Displace with Noise
eharetea

Brownian Noise vs. Turbulence

VEX noise displacement.

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Tuesday July 29th, 2008 08:58 PM

Displace with Noise - test.3daet.com

Displace with Noise - test.3daet.com


/*
*
* Author: Dan Lynch
*
*/

#pragma hint switcher toggle
#pragma label switcher "Turbulence/Brownian"
#pragma label amp "Amplitude"
#pragma label lacunarity "Lacunarity"
#pragma label recursions "Recursions"
#pragma label freq "Frequency"
#pragma group Displace freq offset recursions lacunarity amp

displace
d_ndisp(
        int switcher 0;
        vector freq 1offset 0;
        int recursions 5;
        float lacunarity 2;
        float amp=1;
        )
{
    vector Pnz wo_space(P+offset)*freq;
    vector Nn normalize(N);
    float Nz 0;
    float mlt 1;
    float iF;
    int i;

    for(i=0;i<recursions;i++){
        iF = i*5.6789;

        if(switcher==0) {
                Nz += abs(noise(iF+Pnz*mlt)-.5)/mlt;
        } else {
                Nz += (noise(iF+Pnz*mlt)-.5)/mlt;
        }

        mlt *= lacunarity;
    }
    += Nn Nz amp;
    computenormal(P);
}




Downloads:
Download: brownian_vs_turbulence.vfl 952 B

Please login or Click Here to register for downloads
Creative Commons License
Displace with Noise by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com