jimmyacres
light_culling_debug
Tile frustum light culling using an OpenCL kernel that divides the screen up into 32x32 pixel tiles. For each tile, the kernel then finds the minimum and maximum Z depth of the pixels in that tile through a reduction.
With this information, a bounding frustum is created for each tile and each point light's position + attenuation (affected area) in view space is then culled against this frustum.
The idea is that you can then get a list of all the lights that are affecting each tile, cutting down on the number of fragments you need to process for shading. In the lighting shader, you figure out which tile the frag coords fall under and then shade using the lights listed in that tile's light index buffer.
This can be used in both deferred rendering as well as forward rendering (and extended in Forward+ rendering). Looking forward to trying out light indexed forward rendering... I'm a little sick of no transparency and material challenges with full deferred ;)
I'm currently using 2 separate kernels for min/max reduction and light culling - need to combine these as a next step for speed.
Debug view of the buffers used for light culling - Final Render, Linear Depth Buffer, Min Z for each tile (Max Z is also calculated, but not displayed in this debug view), Light "heat map" showing number of lights affecting each tile (provides a visual idea of how much processing each tile will need to perform, not actually used for rendering).
light_culling_debug
Tile frustum light culling using an OpenCL kernel that divides the screen up into 32x32 pixel tiles. For each tile, the kernel then finds the minimum and maximum Z depth of the pixels in that tile through a reduction.
With this information, a bounding frustum is created for each tile and each point light's position + attenuation (affected area) in view space is then culled against this frustum.
The idea is that you can then get a list of all the lights that are affecting each tile, cutting down on the number of fragments you need to process for shading. In the lighting shader, you figure out which tile the frag coords fall under and then shade using the lights listed in that tile's light index buffer.
This can be used in both deferred rendering as well as forward rendering (and extended in Forward+ rendering). Looking forward to trying out light indexed forward rendering... I'm a little sick of no transparency and material challenges with full deferred ;)
I'm currently using 2 separate kernels for min/max reduction and light culling - need to combine these as a next step for speed.
Debug view of the buffers used for light culling - Final Render, Linear Depth Buffer, Min Z for each tile (Max Z is also calculated, but not displayed in this debug view), Light "heat map" showing number of lights affecting each tile (provides a visual idea of how much processing each tile will need to perform, not actually used for rendering).