GAMES202 Lecture 04 - Real-Time Shadows 2

GAMES202_Lecture_04 (ucsb.edu)

I. More on PCF and PCSS

The Principle behind PCF/PCSS

image-20230801180939320

 

In PCSS:

V(x)=qN(p)w(p,q)χ+[DSM(q)Dscene(x)]

For any shading point x which have its corresponding texel p on the shadow map, we consider the neighboring region of p.

 

Thus, we have the following conclusions:

 

Performance Issue in PCSS

Given the PCSS algorithm:

  1. Blocker Search:

    • Get the average blocker depth in a certain region inside the shadow map

  2. Penumbra Estimation:

    • Use the average blocker depth to determine filter size

  3. Percentage Closer Filtering

 

Which steps can be slow in PCSS?

 

II. Variance (Soft) Shadow Mapping (VSM/VSMM)

What is new in VSM/VSMM:

 

Speeding up PCF

Predict the percentage of texels that are in front of the shading point:

 

Key Idea

Using probability theories to approximate the answer.

 

We may now directly compute the CDF, using the error function (assuming normal distribution):

 

We may also apply the following rule:

Chebyshev's Inequality: When t>μ, we have:

P(x>t)σ2σ2+(tμ)2

where σ2 is variance and μ is mean, regardless of the actual distribution.

 

Performance

 

Key Idea

image-20230801195842740

N1Nzunocc+N2Nzocc=zavg

Performance

image-20230801200445538

 

Issues

 

III. MIPMAP and Summed-Area Variance Shadow Maps

Querying μ and σ of an arbitrary rectangular range in O(1):

P(xt)pmax(t)σ2σ2+(tμ)2

MIPMAP for Range Query

Allowing fast, approx., square range queries.

 

Summed-Area Table (SAT) for Range Query

Essentially doing prefix sum.

image-20230801202123077

[Gamboa et al.]

 

IV. Moment Shadow Mapping

Motivation

image-20230801202917705

 

Goal of Moment Shadow Mapping:

 

Moments

Partial Reference: [John A. Rice - Mathematical Statistics and Data Analysis 3ed (Duxbury Advanced) (2006, Duxbury Press)]

Definition: The r-th moment of a random variable is E(Xr), i.e. the expectation of random variable X to r.

 

What can moments do?

Approximating a distribution more accurately.

image-20230801204256755

[Peters et al., Moment Shadow Mapping]

 

Moment Shadow Mapping

image-20230801205000655

Pros

Cons