[ Tile-Based Light Culling ]
While trying to find a job in the computer graphics industry, during a preliminary interview I was asked a question about tile-based light culling, which I knew nothing about. So I decided to look into the matter and implemented it in my own engine.
The basic idea is to start the rendering pipeline with a compute shader that determines which lights cover which areas of the screen space, divided into a 2D grid. Then, during the shading phase, only those lights likely to cover the current pixel are taken into account. This makes it possible to have many more lights in a scene than with conventional rendering.
Code available on GitHub or download ZIP.
Here's the result I obtained after a few hours of prototyping. This scene would not be at an acceptable frame rate without this method.
[ Tile occupancy visualization ]
The bluer the screen-space tile, the more lights it contains. Interestingly, the geometry edges are very blue because each tile spans a large depth range and can include many lights between its near and far depths.
[ References ]
- Forward vs Deferred vs Forward+ Rendering with DirectX 11 - Jeremiah. 3dgep.com/forward-plus
- Optimizing tile-based light culling - Wicked Engine. turanszkij.wordpress.com/2018/01/10/optimizing-tile-based-light-culling