4 . 2. deferred shading

29
4.2. DEFERRED SHADING Exploration of deferred shading (rendering)

Upload: ivrit

Post on 24-Feb-2016

52 views

Category:

Documents


1 download

DESCRIPTION

4 . 2. Deferred Shading. Exploration of deferred shading (rendering). Deferred Shading. Exploration of deferred shading (rendering). A problem with forward rendering. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 4 . 2. Deferred Shading

4.2. DEFERRED SHADINGExploration of deferred shading (rendering)

Page 2: 4 . 2. Deferred Shading

DEFERRED SHADINGExploration of deferred shading (rendering)

Page 3: 4 . 2. Deferred Shading

A problem with forward renderingIn traditional ‘forward’ rendering, input geometry is passed through a shader program that suitably manages the geometry and provides an output (lit) colour.

A potential disadvantage of forward rendering is the often high cost associated with the lighting portion of the shader combined with the likelihood of drawing geometry which is later ‘replaced’ by closer geometry.

Page 4: 4 . 2. Deferred Shading

Deferred renderingDeferred rendering operates by separating the geometry rendering stage from the lighting stage.

Once geometry has been rendered, a later lighting shader then uses available geometry information to determine how the visible scene should be lit (i.e. the computation and memory bandwidth required is reduced to those visible portions).

Page 5: 4 . 2. Deferred Shading

Deferred renderingTypically geometric information is output within a ‘geometry buffer’ (typically just handled as a texture within a shader) using multiple render targets (MRT).

Page 6: 4 . 2. Deferred Shading

Deferred renderingAnother advantage of deferred rendering is the ease with which rendering can employ a large number of dynamic lights (which are challenging to handle within forward renderers) – only those pixels effected by the lights need be considered.

Aside: To a certain extent, early Z-buffer tests can be used to limit unnecessary overdraw using forward rendering. That said, deferred rendering is, arguably, a ‘cleaner’, ‘less complex’ approach).

Page 7: 4 . 2. Deferred Shading

Limitations of deferred renderingA key disadvantage of deferred rendering is the difficulty of handling material transparency. Typically, transparency is handled within a subsequent forward pass following deferred rendering.

Additionally, as the lighting stage has been separated from the geomety stage, hardware based anti-aliasing cannot be used. To a certain extent this can be overcome by using suitable post-render processing.

Page 8: 4 . 2. Deferred Shading

Games using deferred rendering:Games which have adopted a deferred rendering approach include:•Killzone•LittleBigPlanet•Stalker•Dead Space•Tabula Rasa •Grand Theft Auto IV

Page 9: 4 . 2. Deferred Shading

EXAMPLESDeferred rendering examples

Page 10: 4 . 2. Deferred Shading

Leadwerks: Albado (diffuse)

Page 11: 4 . 2. Deferred Shading

Leadwerks: Depth

Page 12: 4 . 2. Deferred Shading

Leadwerks: Normal

Page 13: 4 . 2. Deferred Shading

Leadwerks: Specular

Page 14: 4 . 2. Deferred Shading

Diffuse Lighting

Specular Lighting

Page 15: 4 . 2. Deferred Shading

Leadwerks: Final

Page 16: 4 . 2. Deferred Shading

Deferred Rendering in Killzone

Page 17: 4 . 2. Deferred Shading

Guerrilla’s Killzone

Page 18: 4 . 2. Deferred Shading

Guerrilla’s Killzone

Page 19: 4 . 2. Deferred Shading

Guerrilla’s Killzone

Page 20: 4 . 2. Deferred Shading

Guerrilla’s Killzone

Page 21: 4 . 2. Deferred Shading

Guerrilla’s Killzone

Page 22: 4 . 2. Deferred Shading

Guerrilla’s Killzone

Page 23: 4 . 2. Deferred Shading

Guerrilla’s Killzone

Page 24: 4 . 2. Deferred Shading

Guerrilla’s Killzone

Page 25: 4 . 2. Deferred Shading

Deferred particle rendering

View the DirectX SDK Deferred Particles sample

Page 26: 4 . 2. Deferred Shading

DIRECTED READINGDirected reading concerning deferred reading

Directed

reading

Page 27: 4 . 2. Deferred Shading

Directed reading Directed

reading

• Read Deferred Shading Tutorial – an excellent introductory tutorial exploring core aspects of deferred rendering.• Read Deferred Shading –

informative presentation by Shawn Hargreaves• Read GPU Gems 2 – Deferred

Shading in STALKER – exploring how deferred rendering was used within STALKER.• Read GPU Gems 3 – Deferred

Shading in Tabula Rasa – exploring how deferred rendering was used within Tabula Rasa.

Page 28: 4 . 2. Deferred Shading

Directed reading Directed

reading

http://www.gamerendering.com/category/rendering-methods/

• Read Deferred Rendering in Leadwerks Engine – explore use of deferred shading within a game engine• Read Deferred

Rendering in Killzone 2 – explore use of deferred shading within Killzone 2• More generally

explore gamerendering.com on other aspects of deferred shading:

Page 29: 4 . 2. Deferred Shading

Summary

To do:Read the directed

readingThink if you would like

to build a deferred renderer for your project

Today we explored:

Introduction to deferred shading (rendering)

Typical advantages and disadvantages of deferred rendering