Skip to content

Soft Shadows

Vladislav Kantaev edited this page Oct 26, 2023 · 6 revisions

Setup

Soft Shadows can be enabled in the pipeline asset: Shadows/VSM/Soft Shadows.

📝 Note: Soft Shadows are only available when VSM Blur is turned off.

Options

Soft Shadows

Quality

  • Low - 4 samples per-pixel;
  • High - 16 samples per-pixel. Allows Early Bail.

Mode

  • Poisson - samples are taken directly from a Poisson disk. High Spread can introduce banding.
  • Poisson Stratified - each sample's disk value is picked at random. Requires strong anti-aliasing to mask noise.
  • Poisson Rotated - samples from a Poisson disk are randomly rotated. Typically provides best results: no banding and less noise.

📝 Note: samples of Poisson disk are uniformly distributed and form a naturally looking pattern.

image

Example outputs of each mode (Temporal AA is enabled to smooth out visual noise):

Poisson Poisson Stratified Poisson Rotated
Poisson Poisson Stratified Poisson Rotated

Early Bail

Early Bail is based on the assumption that the majority of pixels are either fully lit or shadowed. It takes first 4 samples, and if all of them are either lit or shadowed, we assume that the rest will be the same, and skip the remaining samples.

📝 Note: it can introduce artifacts with high Spread values.

Spread

Controls the penumbra size. Higher values yield softer shadows.

Rotated Poisson Sampling Texture

Stores random values used in the Poisson Rotated mode. Default texture should be sufficient, but if there is a need to get another, one can be generated via the built-in utility under Window/Toon RP/Rotated Poisson Sampling Texture Generator.