
2. Tile-Based Omnidirectional Shadows 325
for ( uint i=gl_LocalInvocationIndex ; i<groupCounter ; i+=←
LOCAL_SIZE_X )
{
lightIndexBuffer . lightIndices [ startLightIndex+i ]=
groupLightIndices [ i ];
}
}
Listing 2.2. Compute shader for generating indirect draw buffer.
For the Crytek Sponza scene with 103 meshes and 128 processed light sources,
the GPU time taken for this computation task was about 0.02 ms on an NVIDIA
GeForce GTX 880 Mobile.
Finally, care must be taken to reset the atomic counters of the indirect draw
and light-index buffers at the beginning of each frame, which can be done by
using the OpenGL command
glClearBufferSubData().
2.3.3 Indirect