Friday, January 18, 2013

Soft Shadows and Glossy Specular Reflection

It has been a while since I posted my last update. I have made some major changes since then. I am still working on optimizations of the ray traversal algorithms and data structures. I have implemented soft shadows and glossy specular reflection by using a technique that loosely follows what Cyril Crassin pioneered and what Epic's Unreal Engine 4 is using for dynamic lighting (Sparse Voxel Octree Cone Tracing). 

Models courtesy of Dmitriy Parkin (Imrod), Happy Buddha and Dragon (Stanford 3D Scanning Repository)
Thanks to Jon Olick for optimization tips.

800x600 @ 25-60 fps (2x GTX 680)

Surprisingly, the performance on an Nvidia Geforce GTX 580 is not much slower than a single GTX 680. I suppose there are some ways I could better take advantage of the Kepler architecture of the 680 over the 580's Fermi.


  1. Hi Daniel,

    Amazing work.

    How many bounces are you using? What specular cone ratio are you using and what's your voxel resolution? Are you using octrees?

    The demo from this site: created by Alex Nakervis

    runs at about 10fps using 1024x768 on my GTX485m if I use 128x128x128 voxels, turn the specular coneratio to 0.1 and turn out 2nd bounce gi (I modified the source code he provided). I still havent' figured out how to get soft shadows using a directional light for the Sponza scene.

    With regards to your soft shadows, are you using a point light?

    1. 1 primary cone cast from camera for each screen pixel
      1 secondary cone cast toward 1 point light
      1 reflection cone

      Both secondary cones are traversals through a 'scene' octree with samples accumulated from a 3D texture.

      The soft shadows are determined by opacity accumulation through the scene octree traversal's 3D texture samples. The 3D texture is made up of 'bricks' of voxels with boundaries.

      This is not a very flexible setup at the moment, but I intend to vastly improve things in the coming weeks.

    2. All models are themselves octrees of subdivision 10.