Inferred lighting

6,425 views
6,140 views

Published on

Inferred lighting

Published in: Technology

Inferred lighting

  1. 1. inferred lighting : Handling Transparency in Deferred Render system OZ http://ozlael.egloos.com
  2. 2. Deferred Render System result normal depth
  3. 3. Deferred Render System ● Transparency is usually solved by splittin g the Rendering pipeline in two parts - Render opaque - Render transparent objects ● Lighting inconsistency problem ● Split pipelines ● Need same pipeline between opaque an d transparence
  4. 4. Deferred Rendering Transparency in ShaderX7 alpha G-buffer : Transparent only every odd horizontal line is rendered.
  5. 5. Deferred Rendering Transparency in ShaderX7 C0 = CsA + Cd(1-A) or C0 = Cd + (Cs-Cd)A
  6. 6. Inferred lighting ● Extension of Light Pre-pass ● Mixed resolution rendering : G-Buffers and Lighting are done at a lower resolut ion that the final output pass. ● Use DSF filter ● Same lit approach
  7. 7. Inferred lighting N D DSF Geometry Pass: 800x450 Light Pass: 800x450 Material Pass: 1280x720, 8x MSAA
  8. 8. Discontinuity Sensitive Filtering (DSF) Bilinear DSF
  9. 9. DSF Buffer In 16bit -> Object/Instance ID & Normal Group ID
  10. 10. DSF Buffer Object/Instance ID
  11. 11. DSF Buffer Normal Group ID
  12. 12. Up-Sample High Res. Low Res.
  13. 13. Up-Sample High Res. Low Res.
  14. 14. Up-Sample a,b,c : same DSF ID X d: High Res. other DSF ID Low Res.
  15. 15. Handling Alpha Objects in Geometry Pass G-Buffer into 2×2 quads transparency 1 transparent opaque 3 opaques
  16. 16. Handling Alpha Objects in Geometry Pass G-Buffer into 2×2 quads 3 transparents 1 opaque
  17. 17. Handling Alpha Objects in Geometry Pass Write stipple pattern
  18. 18. Handling Alpha Objects in Geometry Pass Alpha samples are lit same as opaque samples
  19. 19. Handling Alpha Objects in Geometry Pass DSF on opaque objects automatically ignores alpha samples : different DSF ID
  20. 20. Handling Alpha Objects in Geometry Pass Alpha object shader knows stipple pattern : Looks up proper sample locations in L-buffer
  21. 21. Inferred lighting is the perfect one? ● Never!!!
  22. 22. Dark side ● Transparents being lit at 1/4 resolution Forward Render Inferred Render
  23. 23. Dark side ● DSF filtering is not cheap ● Incur higher base cost ● Assign stipple patterns for 3 alpha lightin g layers ● Complex G-buffer reading at Post image process ● In the H/W early-Z between G-pass and M-pass is impossible (back buffer size di ffer)
  24. 24. Dark side ● Assign the appropriate normal ID Different normal ID Same normal ID each faces each faces
  25. 25. Question?

×