Menu

1 / 3

Building a Reusable WebGPU & Rust Engine: Part 6 — HDRI Environment Lighting & Dynamic Shadows

DEV Community: rust·J·7 days ago
#UlAIEBsP
#devtorust#devto#dev#shadow#light
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.