Sign in to follow this  
maya18222

More Questions on Perlin Noise

Recommended Posts

Just wondered if anyone knew the answer to these few questions. 1. When passing the decimal parts of the position to the gradient functions, as seen below, why does he subtract 1 from each in turn?
      return lerp(w, lerp(v, lerp(u, grad(p[AA  ], x  , y  , z   ),  // AND ADD
                                     grad(p[BA  ], x-1, y  , z   )), // BLENDED
                             lerp(u, grad(p[AB  ], x  , y-1, z   ),  // RESULTS
                                     grad(p[BB  ], x-1, y-1, z   ))),// FROM  8
                     lerp(v, lerp(u, grad(p[AA+1], x  , y  , z-1 ),  // CORNERS
                                     grad(p[BA+1], x-1, y  , z-1 )), // OF CUBE
                             lerp(u, grad(p[AB+1], x  , y-1, z-1 ),
                                     grad(p[BB+1], x-1, y-1, z-1 ))));



2. Ive noticed that this will actually produce values from -2 to 2, when returned from the gradient functions, yet the out come of perlin noise is always -1 to 1, this seems to be due to the lerp functions never returning values out of -1 to 1, when used with the fade decimal value, but why is this? is the fade function designed to do this?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this