Skip to content

Shadows & Lights

Yaochuang edited this page Jan 11, 2019 · 2 revisions

In this chapter author presents a new technique to handle shadows of lots of point lights. The following questions would be considerated.

  • Is that widely used now ?
  • What is the negative part ?
  • Cub-Map based method for point light consumes much more memory. What is the positive part ? Is it totally out of date ?
  • It states "the shadow maps of all light sources are rendered in a single draw call".
  • It uses "Multi-Draw-Indirect" Method. Execute draw commands in the indirect draw buffer, then shadow map tiles of all relevant light sources are tightly packed together into the tiled shadow map.
    • How to pack into one Render Target, since max viewport number is 16 ?
  • Tetrahedron Shadow Mapping and GPU's programmable clipping unit.

It try to figure out which lights affect the shading point, including its number and type. For example, 2 point light, 1 spot light. We try to calculate such info in one "Light Pass" correctly and efficiently. So that we can use it in ""Final Shading Pass.
So how to generate "Light info" for each tile efficiently ?

  • It comes from this presentation. It requires DX10 HW. So no Compute available.
  • It seems difficult because of projection to 2D. But for BindlessDeferred, it writes on DX12. Why not choose Compute ?
  • How to solve Depth Discontinuities ?
  • Each work group for a tile(16x16). How to choose "Tile Size" ?
  • Calculate Depth bound, frustum plane, each thread does "light volume-frustum" intersection test. So One loop a work group can handle 256 lights. "Passed light" will be written to a buffer to record a index.
  • ONLY point light is supported. It is not so good.
  • It test the idea in UE4 demeo Infiltrator. It is free in UE4 MaketPlace.
  • There is a similar implementation in Forward Rendering on github called Forward-Plus-Renderer
    • I have not read its code and play the demo.
  • How to solve Depth Discontinuities ? It causes false-positive test result and waste bandwidth.

Shadow Technique Compare

  • The blog shadow-maps is a very good article. It gives a good summary about main stream shadow technique.
    • How to optimize Cascade Shadow Map
    • Shadow Map filter
    • Shadow Bias

Clone this wiki locally