SHARE
TWEET

Untitled

a guest Jun 26th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             float noise( float3 x )
  2.             {
  3.                 // The noise function returns a value in the range -1.0f -> 1.0f
  4.  
  5.                 float3 p = floor(x);
  6.                 float3 f = frac(x);
  7.  
  8.                 f       = f*f*(3.0-2.0*f);
  9.                 float n = p.x + p.y*57.0 + 113.0*p.z;
  10.  
  11.                 return lerp(lerp(lerp( hash(n+0.0), hash(n+1.0),f.x),
  12.                                lerp( hash(n+57.0), hash(n+58.0),f.x),f.y),
  13.                            lerp(lerp( hash(n+113.0), hash(n+114.0),f.x),
  14.                                lerp( hash(n+170.0), hash(n+171.0),f.x),f.y),f.z);
  15.             }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top