Skip to main content

Module probe

Module probe 

Source
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.
IrradianceCache
A cache of irradiance samples for global-illumination interpolation.
IrradianceCacheEntry
A single cached irradiance sample.
LightProbeGrid
A regular 3D grid of SH3 irradiance probes.
Ray
A ray with an origin and a (unit) direction.
ReflectionProbe
A spherical reflection probe that captures environment radiance at a point.
Sh3
Third-order (L2) spherical harmonics — 9 real coefficients per colour channel. Each Sh3 stores (R, G, B) for all 9 basis functions.

Enums§

CubemapFace
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 dir to 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 normal from 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.