Shadows

Shadow Map

Percentage Closer Filtering (PCF)
  • .

Soft-Shadows

Raytracing
  • It's the proper way to solve it, but it's costly; the other techniques are approximations.

  • Send rays from the point to the light source.

  • .

  • Approximate the percentage of the area that is visible to the light source, via the ratio of rays that hit the light vs rays that didn't hit the light.

Percentage Closer Soft Shadows (PCSS)
  • Presented at Siggraph in 2005.

  • .

  • The PCF sample varies through out the shadow, so the shadows closer to the object look sharp and far away from the object look smooth.

  • Based on the distance to the object from the floor, you decide what filter you should use.

    • How far the occluder is vs how far the point I want to compute is.

    • It also uses the occluder size.

    • .

  • Requires a 'Occluder Search' so a situation like below correctly indicates that should  be shadow in that point.

    • The shadow in that points comes from the fact that the left side of the light source blocks the object.

    • .

  • As PCSS requires Occluder Search and a PCF with large radius, depending on the situation, this method of soft shadows is not cheap.

    • Is cheaper than tracing rays, tho.

  • .

~Other Techiniques
  • Doesn't work with Shadow Maps, as Shadow Maps just gives you a blunt occlusion information.

  • Tries to approximate the PCF / PCSS, for soft-shadows instead of computing it.

  • Variance Shadow Maps (VSM) .

  • Convolution Shadow Maps (CSM) .

  • Exponential Shadow Maps (ESM) .

  • .

  • There are improvements to these methods, trying to solve the problems of these approximations.

Radiance Cascades
  • I saw a video demonstrating the usage of radiance cascades for soft-shadows.