1 / 50

Real-time lighting via Light Linked List

Real-time lighting via Light Linked List. 8/07/2014 Abdul Bezrati. Old: Deferred Lighting. Old: Deferred Lighting. Old: Deferred Lighting. New: Light Linked List. Deferred Lighting. GBuffer r. Fill Light Buffers. Light GBuffer. Alpha. Diffuse Lighting. Specular Lighting.

Download Presentation

Real-time lighting via Light Linked List

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Real-time lighting via Light Linked List 8/07/2014 Abdul Bezrati

  2. Old: Deferred Lighting

  3. Old: Deferred Lighting

  4. Old: Deferred Lighting

  5. New: Light Linked List

  6. Deferred Lighting GBufferr Fill Light Buffers Light GBuffer Alpha

  7. Diffuse Lighting

  8. Specular Lighting

  9. New approach • Store lights in a per-pixel linked list.

  10. Compressed Fragment

  11. Resolution • Lower resolutions are better: • One quarter, one eighth etc…

  12. Memory Cost • 4 Buffers at one eighth resolution: • 2 RWByteAddressBuffer • 1 RWStructuredBuffer • 1 Depth Buffer (optional) • Pre-allocate average40 Lights per pixel. • Total cost: • 900P: ~7.25 megs • 1080P: ~10.15 megs

  13. Insomniac Engine GBufferr Fill Linked Listr Light GBuffer Custom Materials Alpha

  14. Insomniac Engine GBuffer (fast path) Fill Linked Listr Light GBuffer Custom Materials Alpha

  15. Insomniac Engine GBufferr Fill Linked List Light GBuffer Custom Materials Alpha

  16. Fill LLL Cost 900P

  17. Fill LLL Cost 1080P

  18. LLL Depth Buffer • Generate down-sized depth buffer. • Use conservative depth selection. • Use GatherRed.

  19. Light Shells

  20. LLL Shader Steps • Software depth test. • Acquire min and max depth. • Allocate a LLL fragment.

  21. LLL Depth Test

  22. LLL Depth Test • Software test front faces.

  23. Depth Bounds • Both depths need to come through. • Which depth comes first?

  24. Depth Bounds • Bounds RWByteAddressBuffer

  25. Depth Bounds • Encode Depth + ID • 16 bits ID • 16 bits Depth

  26. Depth Bounds • Use InterlockedExchange New Info Old Info

  27. Light Fragment Links • Use a RWStructuredBuffer for storage:

  28. Allocate LLL Fragment • Increment current count

  29. Track Last Entry • StartOffsetRWByteAddressBuffer: • InterlockedExachange New Index Old Index

  30. Light Fragment Encoding • Fill the linked light fragment and store it.

  31. Insomniac Engine GBufferr Fill Linked Listr Light GBuffer Custom Materials Alpha

  32. Lighting the GBuffer • Draw full-screen quad • Access the LLL • Apply the light

  33. Accessing the SRVs • Fetch the first linked element offset: • The first linked element is encoded in the lower 24 bits.

  34. Light Loop • Start the lighting loop: • An element index equal to 0xFFFFFF is invalid.

  35. Decoding Light Depth • Decode the light min and max depth. • Compare the light depth.

  36. Access Light Info • Fetch the full light information:

  37. Insomniac Engine GBufferr Fill Linked Listr Light GBuffer Custom Materials Alpha

  38. Custom Materials • Render geometry again. • Access the LLL while rendering.

  39. Custom Materials

  40. Shadows?

  41. Questions? abezrati@insomniacgames.com

More Related