Cone Step Tracing
Now that we have our voxel light data in a 3D texture we can generate mipmaps and perform cone step tracing. The basic idea is to cast a ray out from each side of each voxel and use a lower-resolution mipmap for each ray step. We start with mipmap 1 at a distance that is 1.5 texels away from the position we are testing, and then double the distance with each steo of the ray. Because we are using linear filtering we don't have to make the sample coordinates line up exactly to a texel center, and it will work fine:
Here are the first results when cone step tracing is applied. You can see light bouncing off the floor and reflecting on the ceiling:
This dark hallway is lit with indirect lighting:
There's lots of work left to do, but we can see here the basic idea works.
- 2
- 1
18 Comments
Recommended Comments