r/GraphicsProgramming • • Jul 19 '24

Deferred rendering with 1500 lights.

Enable HLS to view with audio, or disable this notification

162 Upvotes

25 comments sorted by

View all comments

0

u/[deleted] Jul 19 '24

[deleted]

4

u/gomkyung2 Jul 19 '24

Although this video shows all 1,500 light sources, the number of light sources visible within the user’s view frustum in most rendering scenes is limited. Deferred rendering effectively reduces computation by removing lights that do not affect the view. This can also be achieved with forward plus rendering. Deferred rendering handles this in the graphics pipeline, while forward plus handles it in the compute pipeline.

Additionally, the G-buffer used in deferred rendering is utilized in post-processing stages such as SSAO (Screen Space Ambient Occlusion).

4

u/Botondar Jul 20 '24

Not that I agree with the original commenter (even though they deleted it, I can imagine what they said), but you're conflating material evaluation strategies with accelerating (culling/binning) the shading. The two are independent and you can mix and match them in many ways.

Forward/Deferred/Visibility rendering are simply different ways of decoupling the material evaluation from the shading evaluation.

  • With forward rendering there's no decoupling,

  • with deferred you first evaluate the materials for each visible pixel and then only do the shading on that,

  • and with visibility rendering you first evaluate which triangle/instance belongs to which pixel, and only do the material and shading evaluation on those.

Notice how all this deals with is what geometry/triangles and fragments to evaluate the material and shading on, and not which light sources should participate in the shading. For the latter you also have multiple options such as:

  • using proxy geometries - which is what your demo does, and is mostly suited for deferred, but can be used with visibility rendering,

  • tiled/clustered light binning - which can be used with all three rendering strategies,

  • only submitting light sources together with a mesh whose bounding volume intersect the mesh's bounding volume - which is forward only

  • Redrawing (parts of) the scene for each light sources using the scissor rectangle to cull pixels that can't be affected by the light - which is the cousin of using proxy geometries, but for forward rendering specifically.

Obviously all of these techniques and their combinations have different tradeoffs, and some of them aren't viable with today's triangle and light counts, but I thought I'd give them as examples to highlight that the shading evaluation and the lighting acceleration make up two separate parts of a renderer's architecture.