top of page

Voxel Based Global Illumination

For my thesis I picked a topic that is not only complex enough to show mastery in my field but also shows where I stand in my views about new ways of looking at a problem. While challenging, the idea of global illumination in 3D scenes and the surprising amount of physics that goes behind it to make it look as photo-realistic as possible within real-time rendering budgets intrigue me a lot. I strongly believe that voxelization of 3D scenes will massively help take real-time rendering to new levels of realism and fidelity. Hence, my decision to do Voxel Based Global Illumination.

The Process

  • Voxelization.

  • VPL Creation.

  • Light Propagation.

  • Application of Indirect Lighting​.

  • Clearing Voxel Grid.

Voxelization

  • Consists of a 32x32x32 grid of voxels where each voxel contains diffuse and normal information

  • Place grid center so as to have to camera a quarter grid behind the center

  • Use 64x64 Render target and draw scene. 

  • In the geometry shader, bloat each surface triangle to at least the size of one texel so that all  geometry is guaranteed to get processed by the pixel/fragment shader.

  • Encode color and normal information to the voxel grid

  • Up to 4 best normal are chosen in case voxel contains thin geometry. The 4 normal are chosen w.r.t face normal of a regular tetrahedron

  • Color is chosen according to the one which has the highest contrast.

  • Since the process is done on GPU it is highly parallelized and hence we use Interlocked function to prevent bad writes to the voxel grid buffer.

Virtual Point Light Creation

  • Here, we use the grid we filled in the previous stage and with help of shadow maps we determine which voxels get the direct light from the source.

  • We use three 32x32 render target array of size 32 in order to map to our voxel grid, one for each color channel.

  • This means that this phase happens entirely in voxel space
    Early out is possible, hence this stage scales well with geometry being added to the scene.

  • The voxels that have geometry and which are visible to you and the light are then our first virtual point lights which are represented by using second order spherical harmonics.

Light Propagation

  • In this step, the VPLs created in the previous step are used to propagate more VPLs across the voxel grid. This is an iterative process, the VPL propagation is done according to the light propagation volume technique proposed by Kaplanyan and Dachsbacher[0]. 

  • Each grid cell which is a VPL propagates light to it’s neighboring cells along the X,Y and Z axis of the Cartesian coordinate system. Since the entire process does not require any kind of blending or presenting to the screen, this step is done using the compute shader pipeline in DirectX 11

Applying Indirect Lighting

  • Now that we have the final distribution of light we can finally do the final lighting pass so as to present it on the screen. Obviously, output of the previous step is used as input in this step. 
    Since we are to calculate and write the final color of the pixels on the screen, we now switch back to the rasterization pipeline in DirectX 11.

  • For each pixel, we reconstruct the world position using depth information which helps us get offset into the voxel grid. We also get normal for that pixel which is then used to do diffuse SH lighting. This offset is then used to calculate the red, green and blue SH coeffs for that very pixel which are then used to calculate diffuse SH lighting according to clamped cosine lobe SH Coeffs of the surface normal.

Clear Voxel Grid

  • The voxel grid is then reset to be used in the next frame. This is done to prevent any false positives.

Visual Difference and Performance

  • Since indirect lighting literally adds on to direct lighting, the visual difference is massive.

  • Light is brighter now where direct light hits directly.

  • Indirect light now covers area around surfaces directly lit by direct light.

  • Hence, now surfaces that were now visible before are visible now.

  • Performance: - (Release Build)

    • Only direct lighting at 112fps

    • Direct + indirect runs at 80fps.

Download Link -

(610)-714-1741

  • linkedin

©2025 by Dharmik Dave.

bottom of page