Perlin noise: Difference between revisions

no edit summary
No edit summary
No edit summary
 
Line 3: Line 3:
# Generate a grid of random unit-length vectors
# Generate a grid of random unit-length vectors
#* In improved perlin noise, vectors which only contain +=1 and 0 such as (1, 1, 0) are used
#* In improved perlin noise, vectors which only contain +=1 and 0 such as (1, 1, 0) are used
# For each point, find the closest corners in the grid and compute the dot product between the vector from the corner and the corner's random vector.
# For each point, find the closest corners in the grid and compute the dot product between the vector from the corner and the corner's random vector. This results in 4 values for each pixel, one for each corner.
# Interpolate between these using smoothstep.
# Interpolate between these using smoothstep.
#* In improved perlin noise, use smootherstep which has zero first and second derivatives at the boundaries:
#* In improved perlin noise, use smootherstep which has zero first and second derivatives at the boundaries: