Expand description
Environment probes and global illumination helpers.
Provides:
- Spherical harmonic (SH3) projection and evaluation
- Cubemap / equirectangular / octahedral map utilities
- Reflection probe parallax correction
- Tetrahedral-interpolated light probe grids
- Screen-space reflection ray generation
- Irradiance cache with validity ageing
Structs§
- BakedAo
- A 3D grid of pre-baked ambient-occlusion values.
- Irradiance
Cache - A cache of irradiance samples for global-illumination interpolation.
- Irradiance
Cache Entry - A single cached irradiance sample.
- Light
Probe Grid - A regular 3D grid of SH3 irradiance probes.
- Ray
- A ray with an origin and a (unit) direction.
- Reflection
Probe - A spherical reflection probe that captures environment radiance at a point.
- Sh3
- Third-order (L2) spherical harmonics — 9 real coefficients per colour
channel. Each
Sh3stores (R, G, B) for all 9 basis functions.
Enums§
- Cubemap
Face - The six faces of a cubemap.
Functions§
- blend_
weight - Compute the blend weight for a reflection probe at
sample_pos. - convolve_
sh_ lambert - Convolve SH3 with the clamped-cosine (Lambertian) kernel.
- dir_
to_ equirect - Convert a unit direction to equirectangular UV
[0,1]². - dir_
to_ face_ uv - Map a world-space direction
dirto a cubemap face and per-face UV in [0, 1]². - equirect_
to_ dir - Convert an equirectangular UV
[0,1]²to a unit direction. - face_
uv_ to_ dir - Map a cubemap face + per-face UV back to a world-space direction.
- irradiance_
from_ sh - Evaluate irradiance for a surface with
normalfrom precomputed SH coefficients (Ramamoorthi & Hanrahan 2001). - octahedral_
map - Encode a unit direction using the octahedral map (Cigolle et al., 2014).
- octahedral_
unmap - Decode an octahedral-mapped UV back to a unit direction.
- parallax_
correct_ dir - Apply parallax correction to a reflection direction.
- project_
to_ sh - Monte Carlo projection of a spherical function onto SH3 basis.
- sh_add
- Add two SH3 sets.
- sh_
basis - Evaluate all 9 SH basis functions at direction
dir. - sh_
rotate - Rotate SH3 by a rotation matrix.
- sh_
scale - Scale SH3 by scalar
s. - ssr_
fade - Compute the SSR fade factor — attenuates hits near screen edges and for high roughness.
- ssr_ray
- Generate an SSR ray in view space.