7 hours ago
- Noise is a collection of random values produced by a function with N parameters, classified by dimensions (1D, 2D, 3D etc.).
- 2D noise is easiest to visualize, typically through textures, by mapping normalized pixel coordinates to noise values.
- Coherent noise ensures the same input always yields the same output, small input changes cause small output changes, and large input changes give random output changes.
- Perlin noise, developed by Ken Perlin in 1983, is a famous coherent noise algorithm aimed at reducing the 'machine-like' look of CGI.
- The algorithm uses a grid of integer corners, each with a precomputed random unit vector (gradient). For a given point, vectors to the four corners are computed and dot products with corner gradients are taken.
- The four dot products are interpolated (using a smoothing S-curve) to produce the final noise value.
- Implementation involves a permutation table and gradients table of size 256 (extended to 512) for randomization and wrapping.
- The smoothing S-curve applied to interpolation factors improves the visual smoothness of the resulting noise.
- The final Perlin noise texture shows coherent, natural-looking patterns distinct from purely random noise.