Image-Based Lighting (HDRI) Architecture & Baking Pipeline
HDRI is a texture used to compute lighting, unlike uniform lighting. Uniform lighting relies on constant math parameters, while HDRI / IBL uses spherical texture data to represent complex sky and ambient lighting.
In our engine, environment.rs handles the complete generation pipeline and encapsulates all environment assets—the three baked textures (Diffuse Irradiance, Prefiltered Specular, and the BRDF LUT), a sampler, and the camera/environment uniform—into a single wgpu::BindGroup bound at slot 4.
1. Decoding the Equirectangular Source
We begin by decoding the .exr file into an Equirect buffer containing width, height, and raw linear float pixel values.…