Graphics‎ > ‎3D‎ > ‎

Deferred Rendering

It's like normal rendering but a little later

With the fixed function pipeline on GPU's the three vertices would be turned into a triangle, textures would be sampled and then lighting was calculated. With shaders there is no longer necessary to follow the strict order of the old fixed function pipelines. Lighting can be done later (deferred) relative to rasterization.

Pass: A pass is rendering of all the triangles in the scene.

Stages: Each step in rendering is called a stage. One or more of them can be a render pass that draw all the surfaces and update some information in the G-Buffer.

G-Buffer: The geometry buffer contains the data needed for the deferred rendering stages. It often need more then one render target to fit all data and it can get big.
L-Buffer: A buffer that accumulate the light of each pixel.

Forward Rendering - 19XY
The classic pipeline style is called forward rendering and i have no clue why. When drawing the pixel shader texture and light the fragment and then it is written to the color buffer. So each triangle drawn need to have access to the lights that will affect it. On the CPU the geometry is grouped by what set of light affect them and each group is then drawn seperatly. This is easy for static light and geometry and harder when things start to move around. If a group is affected by more lights then can be used in single draw call blending need to be used and draw the geometry more then once.

for each object
    for each light that can affect object
        lighting += computeLighting(object, light)

Deferred shading - 2006
Deferred shading has three stages and need a G-Buffer and light accumulation buffer.

Geometry stage
The first stage is a pass that fills in the G-buffer with all the material data and the things needed lighting. This makes the G-Buffer a bit large to fit in all the things needed.

Lightning stage
A bounding volume is rendered for each light and the pixel shader use the G-Buffer data to calculate the lightning for the light source. The light output of all lights is gathered into a the L-Buffer.

Shading stage
The final stage is the shading stage. It takes the G-Buffer and L-Buffer as input and merge them to the final color buffer. This can be done with a single full screen quad.
Deferred lighting (light pre-pass rendering) - 2007

Deferred lighting do an extra pass to lower the size and bandwith off the G-Buffer.

Geometry stage
This pass fills in the G-Buffer with the data needed for lighting only. It makes the G-Buffer smaller.

Lightning stage
The same as in deferred shading.

Shading stage
A pass that renders all geometry again but this time it can use the L-Buffer to light each pixel.
Light Indexed Deferred Rendering - 2007
The first stage is a early-z pass used to fill in the depth values. The next stage renders the lights and write down the index of each light into a light buffer. The size of the buffer per fragments limits how many lights can be on a single fragment and also the whole screen. All the lights information then need to be put into a texture or constant where the last stage, a render pass can read it and use it to light the fragment.
Tiled deferred shading  - 2011
Create a G-Buffer like in normal deferred shading. Split the screen into tiles and the sort lights into the tiles they touch in screen space. As a final step, for each fragment sample the gbuffer and the use the lights in the tile the fragment is in to light and shade the pixel.

Clustered deferred shading - 2012
Create a G-Buffer like in normal deferred shading. Sort the fragments into clusters and then sort lights into the clusters they touch in 3D. As a final step, for each fragment sample the gbuffer and the use the lights in the clusters the fragment is in to light and shade the pixel.

Tiled Forward / Forward+ - 2012
Bin lights into 2D tiles on the screen. Then a forward renderer use these bins in the pixel shaders to apply the lights.

Deferred Texturing - 2013
Only a material Id and the data for lighting is written down to the G-Buffer. Then a full screen shader is used to read the id and texture the screen. The upside is that only areas that are really visible need to access the data for textures.

Tiled Light Trees - 2017
Cull that cone! - 2017
Improved Culling for Tiled and Clustered Rendering - 2017
Lighting transparent surfaces with deferred shading. - 2012 Part I , Part II
Deferred rendering Part 1 and Part 2. -  2008
Rich Geldreich - Deferred rendering history - 2004