Reflection Probes
For specular reflections, EntropyPortal uses Reflection Probes. These capture the surrounding environment into high-resolution cubemaps.
Probe Types
Section titled “Probe Types”Local Probes
Section titled “Local Probes”- Used for specific areas (e.g., a room, a shiny object).
- Use Box Projection (Parallax Correction) to align reflections with room geometry.
- Stored in a
TextureCubeArray.
Global Probe (Skybox)
Section titled “Global Probe (Skybox)”- A fallback probe that captures the sky and distant geometry.
- Always available if no local probe overlaps the object.
Implementation
Section titled “Implementation”The ProbeVolumeService manages reflection probes alongside light probes.
Capture Pipeline
Section titled “Capture Pipeline”- Scheduling: The service prioritizes probes based on visibility and update frequency settings.
- Rendering: The scene is rendered 6 times (once per face) into a cubemap target.
- Prefiltering: The cubemap is convolved with the BRDF to generate mipmaps for different roughness levels (radiance).
graph TD
Sync[Sync with Scene] --> Check{Dirty?}
Check -->|Yes| Queue[Queue for Capture]
Queue --> Render[Render High-Res Cubemap]
Render --> Mips[Generate Mipmaps]
Mips --> Filter["Compute Shader:<br/>Prefilter Radiance"]
Filter --> Array[Write to TextureCubeArray]
- Storage: The final result is copied into the
TextureCubeArraybin corresponding to its resolution (128, 256, 512, or 1024).
Shading
Section titled “Shading”During the base pass:
- The shader finds the
ReflectionProbeIndexfor the current cluster. Reflection probes are treated as lights in the clustering system. - It samples the reflection probe at the appropriate mip level based on surface roughness.
- It applies Box Projection if enabled to correct for perspective.