Dynamic Glossy Reflections
For my personal needs I solved the problem of creating fully dynamic diffuse indirect lighting for a high number of dynamic light sources with the help of the Rasterized Voxel-based Dynamic Global Illumination (RVBDGI) technique. However, I still had the problem of generating appropriate glossy reflections. They should be fully dynamic, i.e. not rely on techniques as for example pre-computed environment maps, work efficiently with a large number of dynamic light sources, produce detailed results even for objects behind the viewer and should work with a modest amount of video memory.
Below you can see four screenshots taken in the Crytek Sponza scene with the dwarf model from the Microsoft DirectX SDK used as dynamic mesh. The top left image shows the scene only directly illuminated, the top right image with additional diffuse indirect illumination, the bottom left image glossy reflections at maximum specular intensity and the bottom right image the final combined result.
In the same way as the low resolution voxel grids for the RVBDGI an additional high resolution voxel grid (256x256x256 cells) is created by the graphics hardware rasterizer. This reflection grid has the same world-space dimensions as the first low resolution grid cascade and is moved likewise synchronously with the viewer camera, but only stores one color/ occlusion value per voxel.
After the virtual point lights are propagated across the low resolution grid cascades an ambient term is extracted from the SH coefficients of the first cascade and applied to the voxels of the reflection grid, i.e. ambient lighting is performed. Since the glossy reflections will be created later on according to the Voxel Cone Tracing technique as proposed by Crassin et al., such an illumination will still produce pausible results. Furthermore it has the advantage that in this way efficiently a high number of dynamic light sources can be used and that even surfaces that are not directly but only indirectly illuminated will also create reflections.
After the illumination of the reflection grid a mip-map chain is generated that can be cone traced later on in the same fullscreen pass in which the diffuse indirect lighting is calculated. However, the so generated glossy reflections will only cover the area around the viewer that corresponds to the first cascade of diffuse indirect illumination. Therefore when the voxels of the reflection grid are illuminated, the ambient term is faded out with an increasing distance to the grid center. In combination with fading out the cone traced reflections later on in the same way, a smooth fade out is ensured in all circumstances without introducing any popping artifacts. In addition to this during cone tracing the gathered voxel radiance values are faded out with an increasing distance to the cone start position so that the trace distance is kept synchronous with the propagation distance of the virtual point lights.
The demo application from which the above screenshots were taken uses two grid cascades for the diffuse indirect illumination and contains one directional and twelve medium-sized moving point lights. In contrast to the first version of the demo application I increased the texture format that is used for the reflection grid from RGBA8 to RGBA16F. In this way I could significantly reduce flickering, caused by dynamic objects when using a wide angle for cone tracing, while only slightly decreasing performance and keeping the required video memory amount still at a reasonable level. On a Nvidia Geforce GTX 880 Mobile I achieved following results at a screen resolution of 1280x720:
Since the voxel grids are moved synchronously with the viewer camera even large outdoor scenes can be handled with high interactive frame-rates and a moderate amount of video memory. Since the Glossy Reflections part is added on top of the RVBDGI, they can be easily disabled on devices with less powerful graphics hardware.
You can download the latest demo with full source here: