Real-time rendering
Problems
- Order-independent transparency
Composite the transparent fragments of each pixel as if they were blended in depth order with the over operator, when the rasterizer delivers them in an arbitrary order.
core - Tone mapping
Map the high dynamic range luminances of a rendered or captured image to the small range of a display, with a global curve or a local operator, while keeping contrast and detail visible.
core
Algorithms
- Cascaded shadow maps
Split the view frustum into depth ranges and render one shadow map per range, so that shadow resolution follows the distance to the eye.
1 languagescore - Percentage-closer filtering
Soften shadow map edges by comparing several depth samples near the lookup point with the receiver depth and averaging the binary results.
1 languagescore - Perlin noise
A smooth pseudorandom function made by interpolating random gradients at the points of an integer lattice with a quintic fade curve.
1 languagescore - Reinhard tone mapping operator
Scale luminance so that the log average maps to a key such as 0.18, then compress it with L/(1+L) or a white point curve. An optional local step adds dodging and burning.
1 languagescore - S3 texture compression
Code each 4x4 block of texels in 64 bits, as two 16-bit endpoint colors and a 2-bit index per texel into the line between them, for 4 bits per texel and random access on the GPU.
1 languagescore - Screen-space ambient occlusion
Estimate ambient occlusion per pixel by testing sample points around it against the depth buffer, then blur the noisy result.
1 languagescore - Worley noise
A procedural texture basis whose value is the distance to the nearest, or the k-th nearest, of random feature points scattered in cells.
1 languagescore - Adaptive scalable texture compression
A block texture format with 128 bits per block for footprints from 4x4 to 12x12 texels, whose color endpoints and weights are packed with trits, quints and bits by integer sequence coding.
1 languagesadvanced - Clustered shading
Group pixels into clusters by screen tile and exponential depth slice, keep a light list for each occupied cluster, and shade each pixel with the lights of its cluster.
1 languagesadvanced - Horizon-based ambient occlusion
March the depth buffer in several screen directions to find the horizon angle in each, and integrate the visible part of the hemisphere.
1 languagesadvanced - Parallax occlusion mapping
March the view ray through a height field in texture space to find the first intersection, giving parallax and self-occlusion per pixel.
1 languagesadvanced - Per-pixel linked list transparency
Append every transparent fragment to a linked list per pixel on the GPU with an atomic counter, then sort and blend each list in a resolve pass.
1 languagesadvanced - Percentage-closer soft shadows
Estimate the penumbra width from the average blocker depth found in the shadow map and use it as the kernel size of percentage-closer filtering.
1 languagesadvanced - Precomputed atmospheric scattering
Precompute transmittance and single and multiple Rayleigh and Mie scattering into 2D and 4D tables, so that sky and aerial perspective render from any altitude with a few lookups.
1 languagesadvanced - ROAM
Keep a terrain triangulation as a binary triangle tree and split and merge triangles with two priority queues to meet an error bound each frame.
1 languagesadvanced - Screen-space reflections
March the reflected ray through the depth buffer in screen space, perspective correct, and reuse the shaded color at the hit. Off-screen and hidden surfaces fall back to an environment map.
1 languagesadvanced - Simplex noise
Gradient noise summed over the n + 1 corners of the simplex that holds the point, which costs O(n^2) instead of O(n 2^n) in n dimensions.
1 languagesadvanced - Spherical harmonic irradiance environment map
Nine spherical harmonic coefficients give the diffuse irradiance of a distant environment as E(n) = n^T M n. The error is at most 3/32 (about 9%) of the total light, and under 3% on average.
1 languagesadvanced - Tiled shading
Cut the screen into tiles, keep for each tile the lights whose volume can reach its frustum between the nearest and farthest depth, and shade each pixel with the lights of its tile only.
1 languagesadvanced - Variance shadow maps
Store depth and squared depth, filter them like a texture, and bound the fraction of light by Chebyshev's inequality on the local depth distribution.
1 languagesadvanced - View-dependent refinement of progressive meshes
Refine or coarsen a progressive mesh locally by legal vertex splits and edge collapses, driven by the view frustum, the surface orientation and screen-space error.
1 languagesadvanced - Weighted blended order-independent transparency
Approximate the over operator by a weighted average of the transparent colors with depth-based weights, computed in one pass with additive blending.
1 languagesadvanced - Ground-truth ambient occlusion
A horizon-based screen-space method that integrates cosine-weighted visibility in closed form per slice. Its match with ray traced AO is a measurement, for one depth layer only.
1 languagesresearch - Moment shadow mapping
Store four power moments of depth and compute the sharp lower bound on the occluded fraction, an upper bound on the lit fraction with less light leaking than variance shadow maps.
1 languagesresearch
Data structures
- Cube map
Six square textures on the faces of a cube that store a function of direction. A lookup picks the face of the largest component of the direction and divides the other two by it.
1 languagesintro - G-buffer
A set of screen-sized images that stores, per pixel, the depth and the surface attributes of the nearest surface, such as the normal, the base color and the roughness, for a later shading pass.
1 languagescore - Geometry clipmaps
Render terrain as nested regular grids centered on the viewer. Each coarser level has half the resolution of the level inside it, and the levels update incrementally as the viewer moves.
1 languagesadvanced - Irradiance volume
A 3D grid of light probes that store the incoming irradiance by direction, interpolated to light moving objects with baked global illumination.
1 languagesadvanced - Texture clipmap
A mipmap whose finer levels are clipped to a fixed-size window around the viewer, so that very large textures fit in a bounded memory.
1 languagesadvanced
Techniques
- Billboard
Draw a textured quad that is rotated each frame to face the camera, used for particles, foliage and distant objects.
intro - Bump mapping
Perturb the shading normal by the gradient of a height texture, so that a flat surface looks wrinkled without changing its geometry.
intro - Environment mapping
Approximate reflections by looking up the reflected direction in a texture that stores the distant surroundings as a function of direction.
intro - Light mapping
Precompute the lighting of static surfaces into a second texture with a unique parameterization and modulate the surface texture by it at run time.
intro - Normal mapping
Store surface normals in a texture, usually in tangent space, and use them in place of the interpolated normal when shading.
intro - Toon shading
Quantize the diffuse term to a few flat bands through a one-dimensional ramp texture and draw dark silhouettes, to look like hand-drawn cartoons.
intro - Deferred shading
Draw the scene once to store the surface attributes of the visible surface at each pixel, then compute the lighting per pixel from these stored values, so each light is applied once per visible pixel.
core - Displacement mapping
Move the vertices of a finely tessellated surface along their normals by a height texture, so that the relief changes the geometry and silhouette.
core - Fractal Brownian motion noise
Sum octaves of a noise function, each with doubled frequency and reduced amplitude, to get a self-similar texture for terrain, clouds and marble.
1 languagescore - Image-based lighting
Light a scene with a captured high dynamic range image of the real surroundings, treating each texel as a distant light source.
core - Impostor
Replace a distant complex object by an image of it rendered to a texture and drawn on a quad, refreshed when the view changes enough.
core - Parallax mapping
Shift the texture coordinates along the view direction by the height read from a height map, to fake the parallax of surface relief.
core - Schlick's Fresnel approximation
Approximate the Fresnel reflectance by F0 + (1 - F0)(1 - cos theta)^5, where F0 is the reflectance at normal incidence. It is exact at 0 and 90 degrees and off by a few hundredths between.
1 languagescore - Geomorphing
Interpolate the vertex positions between two levels of detail over several frames so that switching levels causes no visible pop.
1 languagesadvanced - Spherical harmonic lighting
Project lighting and transfer functions onto low-order spherical harmonics, so that integrals over the sphere become dot products of coefficients.
advanced - Split sum approximation
Split the specular image-based lighting integral into a prefiltered environment map and a precomputed two-dimensional BRDF table.
advanced - Virtual texturing
Page fixed-size tiles of a huge texture into a physical cache on demand, using a feedback pass and an indirection table, like virtual memory.
advanced - Linearly transformed cosines
Shade with polygonal area lights in real time by fitting each BRDF lobe as a clamped cosine distribution under a 3x3 linear transform.
research - Precomputed radiance transfer
Precompute how each point of a static object transfers low-frequency incident light, including shadows and interreflection, in a spherical harmonic basis.
research - Visibility buffer
A deferred method that stores only the triangle and instance id of the visible surface per pixel, and computes the attributes and their derivatives again from the vertex data when it shades.
research
Concepts
- Level of detail
Draw an object with a simpler representation when it covers few pixels, choosing among versions by distance, screen size or error.
intro - Physically based shading
Shading with reflectance models that aim to obey reciprocity and energy conservation, such as microfacet BRDFs, so that one set of material parameters works under all lights.
core
Models
- Blinn-Phong reflection model
An empirical reflection model that adds ambient, diffuse and a specular lobe built on the half vector between the light and view directions.
1 languagesintro - GGX microfacet distribution
The density of microfacet normals D(h) = alpha^2 / (pi ((n.h)^2 (alpha^2 - 1) + 1)^2), normalized over projected area. It has a sharp peak and a long tail, and is the usual D of microfacet BRDFs.
1 languagescore - Gooch shading
A non-photorealistic shading model for technical illustration that varies hue from cool to warm with the surface orientation instead of brightness.
core - Disney principled BRDF
A BRDF with a few intuitive parameters such as base color, metallic and roughness that blends diffuse, specular, sheen and clearcoat lobes.
1 languagesadvanced - Oren-Nayar reflectance model
A diffuse model for rough surfaces made of Lambertian V-cavity facets. Compared with Lambert, it scatters more light back toward the light source and gives rough objects a flatter look.
1 languagesadvanced - Preetham sky model
An analytic model of daylight sky radiance as a function of sun position, view direction and turbidity, fitted to simulated scattering.
advanced - Smith masking-shadowing function
The G factor of a microfacet BRDF. It assumes facet heights and normals are uncorrelated and gives G1 = 1/(1+Lambda), with a closed form for GGX and a separable and a height-correlated G2.
1 languagesadvanced