SPACE // EUCLIDEAN ℝ³
TERRITORY 04 · OPTICS & SHADING

Material Library & Shaders

The physics of optical reflectance, microfacet scattering, and procedural synthesis—from Lambertian diffuse and Cook-Torrance BRDFs to the Disney Principled BSDF, subsurface scattering, and Perlin noise.

MICROFACET SPECULAR REFLECTANCE
Microfacet Optical Workbench

Cook-Torrance & GGX Reflectance Dial

Fresnel F₀ · Smith G₂ · GGX D
Roughness (α):0.35
Metallic vs Dielectric:Dielectric (Plastic)
Incident Light Angle:45°

Optical & Shading Models (12)

Energy-Conserving Microfacet Mathematics
Diffuse ReflectionVery Low (Analytic)

Lambertian Ideal Diffuse Reflection

The fundamental baseline of diffuse shading. Assumes light entering a matte surface is scattered equally in all directions, regardless of the camera view angle.

GOVERNING OPTICAL EQUATION:f_{\text{Lambert}}(\mathbf{l}, \mathbf{v}) = \frac{\rho}{\pi} \max(0, \mathbf{n} \cdot \mathbf{l})
Parameters & Physical Meaning:
ρ:Diffuse albedo reflectance color [0, 1]³
n:Surface unit normal vector
l:Incident light direction unit vector
PHYSICAL PHENOMENON:Uniform isotropic scattering of incident photons across the entire hemisphere due to subsurface refraction and multiple internal reflections.
GLSL / HLSL Shader Recipe:
vec3 diffuse = (albedo / 3.14159265) * max(dot(N, L), 0.0) * lightColor;
Microfacet SpecularLow (Per-Pixel)

Cook-Torrance Microfacet Specular BRDF

The cornerstone of Physically Based Rendering (PBR). Breaks specular reflection into three distinct physical phenomena: facet alignment (D), reflection strength (F), and micro-shadowing (G).

GOVERNING OPTICAL EQUATION:f_{\text{spec}}(\mathbf{l}, \mathbf{v}) = \frac{D(\mathbf{h}) \cdot F(\mathbf{v}, \mathbf{h}) \cdot G(\mathbf{l}, \mathbf{v}, \mathbf{h})}{4 (\mathbf{n} \cdot \mathbf{l}) (\mathbf{n} \cdot \mathbf{v})}
Parameters & Physical Meaning:
D(h):Microfacet Normal Distribution Function (NDF)
F(v, h):Fresnel reflectance term
G(l, v, h):Geometric shadowing and masking attenuation function
h:Half-vector: h = normalize(l + v)
PHYSICAL PHENOMENON:Statistical modeling of rough surfaces as millions of microscopic mirror facets that reflect light according to Snell's law and Fresnel equations.
GLSL / HLSL Shader Recipe:
vec3 specular = (D * F * G) / (4.0 * max(dot(N, L), 0.001) * max(dot(N, V), 0.001));
Distribution FunctionLow (Per-Pixel)

GGX / Trowbridge-Reitz Normal Distribution (D)

The industry standard microfacet distribution. Unlike Gaussian or Beckmann models, GGX exhibits extended highlight tails that perfectly match real metals, plastics, and coated surfaces.

GOVERNING OPTICAL EQUATION:D_{\text{GGX}}(\mathbf{h}) = \frac{\alpha^2}{\pi \left( (\mathbf{n} \cdot \mathbf{h})^2 (\alpha^2 - 1) + 1 \right)^2}
Parameters & Physical Meaning:
α:Roughness parameter squared: α = roughness²
n:Macroscopic surface normal
h:Half-way vector between light and view rays
PHYSICAL PHENOMENON:Long-tailed distribution of microfacet orientations, accurately modeling the soft optical glow and wide specular highlights observed on real-world materials.
GLSL / HLSL Shader Recipe:
float NdotH = max(dot(N, H), 0.0);
float a2 = alpha * alpha;
float denom = (NdotH * NdotH * (a2 - 1.0) + 1.0);
float D = a2 / (3.14159265 * denom * denom);
Fresnel TermVery Low (Analytic)

Schlick's Fresnel Approximation (F)

A fast, hyper-accurate polynomial approximation of the complex dielectric Fresnel equations. Explains why water, glass, car paint, and wood gleam brilliantly at grazing view angles.

GOVERNING OPTICAL EQUATION:F_{\text{Schlick}}(\mathbf{v}, \mathbf{h}) = F_0 + (1 - F_0)(1 - (\mathbf{v} \cdot \mathbf{h}))^5
Parameters & Physical Meaning:
F_0:Reflectance at normal incidence (0° angle of incidence)
v:Camera viewing direction vector
h:Microfacet normal (half-vector)
PHYSICAL PHENOMENON:All materials become 100% reflective mirrors (F = 1.0) at extreme grazing angles (90° incidence), governed by electromagnetic boundary conditions.
GLSL / HLSL Shader Recipe:
vec3 F = F0 + (1.0 - F0) * pow(clamp(1.0 - max(dot(V, H), 0.0), 0.0, 1.0), 5.0);
Geometric MaskingLow (Per-Pixel)

Smith Height-Correlated Masking & Shadowing (G)

Prevents unrealistically bright specular highlights at grazing angles by mathematically accounting for self-shadowing among microscopic surface peaks.

GOVERNING OPTICAL EQUATION:G_2(\mathbf{l}, \mathbf{v}) = \frac{2(\mathbf{n} \cdot \mathbf{l})(\mathbf{n} \cdot \mathbf{v})}{(\mathbf{n} \cdot \mathbf{v})\sqrt{\alpha^2 + (1-\alpha^2)(\mathbf{n} \cdot \mathbf{l})^2} + (\mathbf{n} \cdot \mathbf{l})\sqrt{\alpha^2 + (1-\alpha^2)(\mathbf{n} \cdot \mathbf{v})^2}}
Parameters & Physical Meaning:
α:Roughness parameter (alpha)
n · l:Cosine of the light angle
n · v:Cosine of the view angle
PHYSICAL PHENOMENON:Microscopic facet peaks cast shadows on adjacent valleys, preventing incident light from reaching deep crevices and blocking reflected rays from reaching the camera.
GLSL / HLSL Shader Recipe:
float NdotL = max(dot(N, L), 0.0);
float NdotV = max(dot(N, V), 0.0);
float ggxV = NdotL * sqrt(NdotV * NdotV * (1.0 - a2) + a2);
float ggxL = NdotV * sqrt(NdotL * NdotL * (1.0 - a2) + a2);
float G = 0.5 / max(ggxV + ggxL, 0.0001);
Principled Uber-ShaderModerate (LUT / Vector)

Disney Principled BSDF (Burley 2012)

The shader model that unified the 3D industry. Introduced by Brent Burley at Pixar/Disney in 2012 (*Wreck-It Ralph*), it is now the universal standard in Blender, Unreal, Maya, and glTF.

GOVERNING OPTICAL EQUATION:f(\mathbf{l}, \mathbf{v}) = (1 - \text{metallic}) f_{\text{diffuse}} + f_{\text{specular}} + f_{\text{clearcoat}} + f_{\text{sheen}} + f_{\text{glass}}
Parameters & Physical Meaning:
Subsurface:Controls blend between diffuse and subsurface scattering
Metallic:0 = Dielectric (wood, plastic), 1 = Pure Conductor (gold, iron)
Roughness:Microfacet smoothness controlling highlight spread
Clearcoat:Secondary specular top layer for automotive lacquers
PHYSICAL PHENOMENON:Unified phenomenological framework mapping artist-friendly intuitive sliders directly to physically plausible energy-conserving optical equations.
GLSL / HLSL Shader Recipe:
vec3 finalBSDF = mix(diffuseEnergy * baseColor, specularLobe, metallic) + clearcoatLobe;
Subsurface ScatteringExtreme (Monte Carlo SSS)

Subsurface Scattering (BSSRDF & Random Walk)

The optical secret to living, organic materials. Without SSS, human skin looks like dry, chalky painted plastic. Subsurface scattering softens harsh shadow terminators with warm organic glow.

GOVERNING OPTICAL EQUATION:S(\mathbf{x}_i, \vec{\omega}_i, \mathbf{x}_o, \vec{\omega}_o) = \frac{1}{\pi} F_t(\mathbf{x}_i, \vec{\omega}_i) R(\|\mathbf{x}_i - \mathbf{x}_o\|) F_t(\mathbf{x}_o, \vec{\omega}_o)
Parameters & Physical Meaning:
x_i, x_o:Incident entrance point and outgoing exit point on surface
R(r):Radial diffuse reflectance profile across distance r
F_t:Fresnel transmission factor entering/leaving the boundary
PHYSICAL PHENOMENON:Light penetrates translucent materials (human skin, wax, marble, jade, milk), bounces millions of times off internal cellular particles, and exits at different surface points.
GLSL / HLSL Shader Recipe:
// Random Walk path tracer step in participating volume
float stepSize = -log(rand()) / extinctionCoeff;
currentPos += rayDir * stepSize;
Volumetric OpticsHigh (Raymarching)

Volumetric Absorption & Scattering (Beer-Lambert)

Governs light traveling through particulate space. Computes how much light is absorbed by colored glass or scattered into god-rays across atmospheric fog.

GOVERNING OPTICAL EQUATION:I(s) = I_0 \exp\left( -\int_0^s \sigma_t(x) dx \right) + \int_0^s L_s(x) \sigma_s(x) \exp\left( -\int_x^s \sigma_t(t') dt' \right) dx
Parameters & Physical Meaning:
σ_a:Absorption coefficient (light converted to thermal energy)
σ_s:Scattering coefficient (light redirected by particulates)
σ_t:Extinction coefficient: σ_t = σ_a + σ_s
p(θ):Henyey-Greenstein phase function for forward/backward scattering
PHYSICAL PHENOMENON:Radiative transfer within participating media such as fog, smoke, atmospheric haze, murky ocean water, and stained glass.
GLSL / HLSL Shader Recipe:
float transmittance = exp(-extinction * stepLength);
accumulatedLight += inScattering * transmittance * stepLength;
Wave InterferenceLow (Per-Pixel)

Thin-Film Wave Interference & Iridescence

The mesmerizing spectral shimmer seen on soap bubbles, oil slicks on water, beetle carapaces, and tempered heat-treated titanium.

GOVERNING OPTICAL EQUATION:\Delta \phi = \frac{4\pi d}{\lambda} \sqrt{n_2^2 - n_1^2 \sin^2 \theta} + \delta_r
Parameters & Physical Meaning:
d:Nanometer thickness of the thin film coating (e.g. 200–800 nm)
λ:Optical wavelength of light (Red ~650nm, Green ~530nm, Blue ~440nm)
n₁, n₂:Refractive indices of ambient medium and thin film layer
PHYSICAL PHENOMENON:Constructive and destructive wave interference when light reflections from the top and bottom interfaces of a microscopic film layer interfere with one another.
GLSL / HLSL Shader Recipe:
// Spectral phase interference evaluation for RGB wavelengths
vec3 phase = (4.0 * 3.14159265 * filmThickness / vec3(650.0, 532.0, 450.0)) * sqrt(n2*n2 - sinTheta*sinTheta);
vec3 iridColor = 0.5 + 0.5 * cos(phase);
Diffuse ReflectionLow (Per-Pixel)

Oren-Nayar Rough Diffuse Shading

Generalizes Lambertian reflection for porous, powdery surfaces. Explains why the full moon appears as a flat, uniformly illuminated disk rather than a smoothly shaded sphere.

GOVERNING OPTICAL EQUATION:f_{\text{ON}}(\mathbf{l}, \mathbf{v}) = \frac{\rho}{\pi} \left( A + B \max\left(0, \cos(\phi_i - \phi_r)\right) \sin \alpha \tan \beta \right) (\mathbf{n} \cdot \mathbf{l})
Parameters & Physical Meaning:
σ:Surface roughness standard deviation (in radians)
A, B:A = 1 - 0.5σ²/(σ² + 0.33), B = 0.45σ²/(σ² + 0.09)
α, β:α = max(θ_i, θ_r), β = min(θ_i, θ_r)
PHYSICAL PHENOMENON:Micro-cavity diffuse interreflection on extremely rough, porous surfaces (lunar dust, concrete, dry sand, plaster, terracotta).
GLSL / HLSL Shader Recipe:
float A = 1.0 - 0.5 * (sigma2 / (sigma2 + 0.33));
float B = 0.45 * (sigma2 / (sigma2 + 0.09));
float diffuseON = (albedo / 3.14159) * NdotL * (A + B * max(0.0, cosPhi) * sinAlpha * tanBeta);
Procedural SynthesisLow (Per-Pixel)

Perlin & Simplex Procedural Gradient Noise

The mathematical brush of procedural materials. Ken Perlin's gradient noise (1985 Academy Award) allows infinite procedural texture generation with zero image files.

GOVERNING OPTICAL EQUATION:N(\mathbf{x}) = \sum_{i} K(\mathbf{x} - \mathbf{p}_i) \cdot (\mathbf{g}_i \cdot (\mathbf{x} - \mathbf{p}_i)), \quad \text{fBm}(\mathbf{x}) = \sum_{k=0}^{M} \gamma^k N(2^k \mathbf{x})
Parameters & Physical Meaning:
p_i:Hyper-cubic or simplicial grid lattice vertices surrounding point x
g_i:Pseudo-random gradient unit vectors at lattice vertices
fBm:Fractal Brownian Motion summing multiple octaves of noise
PHYSICAL PHENOMENON:Continuous, differentiable pseudo-random mathematical noise fields providing natural turbulence for clouds, marble, rust, and planetary terrain.
GLSL / HLSL Shader Recipe:
float fbm(vec3 p) {
  float v = 0.0; float a = 0.5;
  for(int i=0; i<5; i++) { v += a * simplexNoise(p); p *= 2.0; a *= 0.5; }
  return v;
}
Procedural SynthesisLow (Per-Pixel)

Worley / Voronoi Cellular Distance Noise

Introduced by Steven Worley in 1996. Evaluates distance metrics across 3D cell domains, perfectly generating organic skin pores, reptile scales, dried mud cracks, and foam bubbles.

GOVERNING OPTICAL EQUATION:F_k(\mathbf{x}) = k\text{-th smallest } \|\mathbf{x} - \mathbf{p}_i\| \quad \forall \mathbf{p}_i \in \mathcal{S}_{\text{feature points}}
Parameters & Physical Meaning:
F₁:Distance to closest feature point (creates cell cores)
F₂:Distance to second closest feature point
F₂ - F₁:Cellular border boundary isolines (cracks, scales, leather)
PHYSICAL PHENOMENON:Spatial partitioning based on Euclidean distance to randomly distributed feature points, mimicking biological cell tissue, cracked mud, reptilian scales, and cobblestones.
GLSL / HLSL Shader Recipe:
// 3x3x3 cell neighborhood distance query
float d1 = minDistanceToFeaturePoint(p);
float d2 = secondMinDistanceToFeaturePoint(p);
float edge = d2 - d1; // sharp organic cell boundary
2026 AEO KNOWLEDGE GRAPH & INQUIRY TREE

Frequently Explored Structural Questions

1 Verified Semantic Answers