This video explains how Perlin noise works and improves upon raw white noise. The video describes linear congruential generators, hashing functions and value noise. This leads to the gradient noise, which assigns each point on the lattice grid a random gradient vector and discusses mathematical oversights in the original Perlin noise algorithm, primarily related to non-uniform gradient vector distribution and gradient discontinuities caused by the smooth interpolant. The video concludes by explaining how the improved Perlin noise algorithm addresses these issues using uniformly distributed gradient vectors and a fifth-order interpolant, as detailed in GPU Gems chapter 5 from 2004.
Unlocking Organic Randomness: Understanding and Improving Perlin Noise
0:00 The Problem with White Noise: White noise lacks spatial consistency and self-similarity, making it unsuitable for generating organic-looking structures like terrain.
0:18 Pseudo-Random Numbers: Computers generate pseudo-random numbers using algorithms like linear congruential generators or hashing functions, which are deterministic but appear random.
0:29 PCG Hash: The video utilizes the PCG hash function for generating white noise, where each pixel coordinate serves as an input to produce a random value.
0:34 Value Noise: Value noise is created by hashing integer positions in space and linearly interpolating (lerping) between neighboring random numbers to achieve smoother, spatially consistent results. Points close in space have similar values.
0:47 Smoothstep Interpolation: Applying a smoothstep easing function to the lerp term in value noise creates non-linear interpolation, resulting in a smoother, more wave-like appearance.
0:59 Bilinear Interpolation: In two dimensions, value noise is generated by bilinearly interpolating between the four corners of a lattice square, using the fractional part of the input position.
0:07 Gradient Noise & Perlin Noise: Perlin noise, a type of gradient noise, assigns a random gradient vector to each point on a lattice grid.
0:08 Dot Product & Bilinear Interpolation: To create Perlin noise, the dot product of the gradient vector at each corner of a square and the vector pointing from that corner to the input position is calculated. These dot products are then bilinearly interpolated.
0:09 Non-Uniform Gradient Distribution Problem: Generating gradient vectors naively between -1 and 1 leads to a non-uniform distribution, causing directional artifacts.
0:09 Uniform Gradient Distribution Solution: Distributing gradient vectors uniformly on a sphere mitigates directional artifacts, though they remain a persistent issue.
0:11 Gradient Discontinuities: Smooth interpolants introduce discontinuities in the gradient of the noise, which can be problematic for lighting calculations requiring accurate normal vectors.
0:12 Fifth-Order Interpolant: The improved Perlin noise algorithm uses a fifth-order interpolant to ensure a continuous second-order derivative, addressing gradient discontinuities.
0:13 Improved Perlin Noise: The video concludes with the improved Perlin noise algorithm incorporating uniformly distributed gradient vectors and a fifth-order interpolant to fix directional artifacts and gradient discontinuities.