Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Inferred rendering




http://ozlael.egloos.com/
Forward Rendering


●   Traditional Render
●   Single Pass Lighting
●   Multipass Lighting
Forward Rendering
          :Single Pass Lighting

●   For each object:
    Render mesh, applying all lights in one shader...
Forward Rendering
                 :Multipass Lighting

●   For each light:
    –   For each object affected by the light:...
Forward Rendering
               :Multipass Lighting

●   Wasted shader cycles
    –   Invisible surfaces / overdraw
    –...
Deferred Rendering


●   For each object:
    –   Render to multiple targets
    –   Render surface properties into the G-...
Deferred Rendering


●   Worst case complexity is num_objects +
    num_lights
●   Simpler shaders
Deferred Rendering
      G-buffer
Deferred Rendering
      G-buffer
Deferred Rendering
      G-buffer
Deferred Rendering
       Result
MRT
Determine Lit Pixels
Determine Lit Pixels
Early-Z Pass


●   Similar to Early-Z Pass
    –   1st Pass: Visibility tests
    –   2nd Pass: Shading
●   Different than...
Deferred Rendering
                 Weak point

●   Does not handle transparent objects
    –   Forward Rendering Pass
●  ...
Pre-light Pass


●   Geometry pass:
    –   fill up normal and depth buffer
●   Lighting pass:
    –   store light propert...
Pre-light Pass


●   Geometry pass:
    –   fill up normal and depth buffer
●   Lighting pass:
    –   store light propert...
Pre-light Pass

Render opaque Geometry sorted front-to-back


   Normals
                           Depth                 ...
Pre-light Pass




Resistance 2TM in-game screenshot; first row on the left is the depth buffer, on the right is the norma...
Pre-light Pass


●   Flexible Materials
●   H/W MSAA
●   Not Lighting/Shadowing Alpha Geometry
Upcoming SlideShare
Loading in …5
×

Deferred lighting

4,821 views

Published on

Deferred lighting

Published in: Technology
  • Be the first to comment

Deferred lighting

  1. 1. Inferred rendering http://ozlael.egloos.com/
  2. 2. Forward Rendering ● Traditional Render ● Single Pass Lighting ● Multipass Lighting
  3. 3. Forward Rendering :Single Pass Lighting ● For each object: Render mesh, applying all lights in one shader ● Good for scenes with small numbers of li ghts (eg.outdoor sunlight) ● Difficult to organize if there are many light s ● Shader combinations explosion
  4. 4. Forward Rendering :Multipass Lighting ● For each light: – For each object affected by the light: ● framebuffer += object * light ● Worst case complexity is num_objects * n um_lights ● Shader for each material and light type
  5. 5. Forward Rendering :Multipass Lighting ● Wasted shader cycles – Invisible surfaces / overdraw – Triangles outside light influence ● Ideally the scene should be split exactly a long lightboundaries, but getting this right for dynamic lightscan be a lot of CPU wor k
  6. 6. Deferred Rendering ● For each object: – Render to multiple targets – Render surface properties into the G-Buffer ● For each light: – Apply light as a 2D postprocess – Use G-Buffer to compute lighting – Add result to frame buffer
  7. 7. Deferred Rendering ● Worst case complexity is num_objects + num_lights ● Simpler shaders
  8. 8. Deferred Rendering G-buffer
  9. 9. Deferred Rendering G-buffer
  10. 10. Deferred Rendering G-buffer
  11. 11. Deferred Rendering Result
  12. 12. MRT
  13. 13. Determine Lit Pixels
  14. 14. Determine Lit Pixels
  15. 15. Early-Z Pass ● Similar to Early-Z Pass – 1st Pass: Visibility tests – 2nd Pass: Shading ● Different than Early-Z Pass – Geometry is only transformed once
  16. 16. Deferred Rendering Weak point ● Does not handle transparent objects – Forward Rendering Pass ● H/W Anti-aliasing difficult ● Material limited ● Many memory bandwidth
  17. 17. Pre-light Pass ● Geometry pass: – fill up normal and depth buffer ● Lighting pass: – store light properties in light buffer ● 2. Geometry pass: – fetch light buffer and apply different material terms per surface by re-constructing the lighting equation
  18. 18. Pre-light Pass ● Geometry pass: – fill up normal and depth buffer ● Lighting pass: – store light properties in light buffer ● 2. Geometry pass: – fetch light buffer and apply different material terms per surface by re-constructing the lighting equation
  19. 19. Pre-light Pass Render opaque Geometry sorted front-to-back Normals Depth Color Specular Power Blit Lights into Light Buffer (sorted front-to-back) Light Buffer Render opaque Geometry sorted front-to-back or Blit ambient term and other lighting terms into final image Frame Buffer
  20. 20. Pre-light Pass Resistance 2TM in-game screenshot; first row on the left is the depth buffer, on the right is the normal buffer; in the second row is the diffuse light buffer and on the right is the specular light buffer; in the last row is the final result.
  21. 21. Pre-light Pass ● Flexible Materials ● H/W MSAA ● Not Lighting/Shadowing Alpha Geometry

×