This repository contains the implementation for the thesis "Radial Volumetric Shadow Mapping".
This thesis presents a novel radial approach to volumetric shadow mapping that reduces computational redundancy in conventional ray marching methods. Traditional volumetric shadow maps repeatedly evaluate identical depth samples for rays that coincide in shadow map space, resulting in significant computational overhead.
The proposed method leverages epipolar geometry to reparametrize the shadow map into radial coordinates, where isoparametric points lie along spokes radiating from the light source. The algorithm pre-processes shadow maps by determining relevant angular and radial ranges, then computes discrete shadow segments using run-length encoding along each spoke. These segments preserve the shadow-casting properties of the original geometry while enabling efficient occlusion testing during rendering.
Comparative experiments demonstrate significant performance improvements over traditional methods while maintaining high visual fidelity. The computational complexity scales with the scene’s depth complexity rather than the number of ray marching samples. However, geometric configurations with high depth complexity can exceed segment buffer capacity, leading to visual artifacts.
- Novel Radial Approach: Reparametrizes shadow maps using epipolar geometry to reduce redundancy.
- Run-Length Encoded Shadow Segments: Efficient storage and occlusion testing using discrete segments.
- Compute Shader pipeline: Heavy leverage of compute shaders for determining angular ranges and generating segments.
- Modern Graphics Backend: Built on Rust and wgpu (WebGPU) for cross-platform high performance.
- Interactive Inspection: Real-time adjustment of volumetric parameters and visualization of intermediate passes via ImGui.
To build and run this project, you need to have the Rust toolchain installed.
- Rust (latest stable recommended)
-
Clone the repository:
git clone https://github.com/your-username/shadow.git cd shadow -
Run the application: You can run the engine directly using Cargo. It is recommended to run in release mode for optimal performance.
cargo run --release
Load a custom model: You can specify a custom GLTF model path using the
--model(or-m) argument:cargo run --release -- --model models/sponza/sponza.glb
The build script will automatically handle copying
modelsandshadersassets to the target directory.
The engine uses a standard fly-camera control scheme:
- W / S: Move Forward / Backward
- A / D: Move Left / Right
- Space: Move Up
- Left Ctrl: Move Down
- Left Mouse Button + Drag: Rotate Camera / Look around
Relevant files for the radial volumetric implementation:
src/passes/:pass_radial.rs: Core logic for the radial reparametrization.pass_volumetric.rs: Volumetric rendering pass using the generated data.pass_segment.rs: Generation of shadow segments.
src/structs/: Core data structures.shaders/:radial.wgsl: Shader logic for radial coordinate handling.volumetric.wgsl: Volumetric accumulation shader.segment.wgsl: Run-length encoding and segment generation.
models/: 3D assets (GLTF/GLB) for the scenes.
This project is licensed under the MIT License - see the LICENSE file for details.