Forward and deferred rendering Flashcards
Lecture 7 (14 cards)
What is forward rendering?
Forward rendering is when lighting is computed while rendering geometry. All lights affecting an object are processed during its draw call.
How does forward rendering handle multiple lights?
It renders objects multiple times - once for each light - in additive passes.
What happens during the first pass of forward rendering?
The first pass writes depth and computes indirect lighting without blending.
What happens during additional passes in forward rendering?
Later passes use additive blending (GL_ONE, GL_ONE), don’t write depth, and compute lighting for each light.
What is deferred rendering?
Deferred rendering delays lighting calculations until after all geometry has been rendered. It separates geometry and lighting into two stages.
What is the main advantage of deferred rendering over forward rendering?
It avoids re-rendering all objects for each light - improving performance when many lights are present.
What are the two main passes in deferred rendering?
Geometry pass and lighting pass
What happens during the geometry pass in deferred rendering?
All geometry is rendered into multiple textures (g-buffers), each storing different surface data (like depth, normals, albedo)
What happens during the lighting pass in deferred rendering?
Lighting is computed by reading from the g-buffers. Each light is rendered in its own pass, often with light-shaped geometry.
What is a G-buffer?
A G-buffer is a set of textures storing geometry data like positions, normals and material properties.
What kind of data is typically stored in a G-buffer?
Common data include depth, surface colour (albedo), normals and material properties like reflectance.
What are some examples of specific G-buffers used in Blinn-Phong lighting?
- Depth
- Albedo
- Normals
- Material properties
What are some advantages of deferred rendering?
- Efficient with many lights
- Clean lighting seperation
- Easier to apply post-processing effects
What are the main limitations of deferred rendering?
- High memory usage
- Complex shaders due to all lighting types
- Cannot handle transparency, since each fragment only stores one depth and one colour.