[GAMES202]Lecture Note 4
Deeper look into PCF
Convolutional Weighted Filtering in PCF:
Optimization Bottleneck: Averaging every texel inside the filter region (ave. blocker depth and visibility, step 1 and 3 in PCSS) Solution: sampling, cons: noisy (temporal effect: flickering)
Variance Soft Shadow Mapping, VSM
Faster, and more rough version of PCSS?
Motivation: the slow performance of PCSS at step 3 Idea: use CDF of Normal Distribution to approximate depth distribution Key: Fast computation of mean and variance
Solution:
Mean: Hardware MIPMAPing / Summed Area Tables, SAT Variance: (get through render-to-texture: multi-output, while generating )
CDF of Gaussian PDF: Error Function, ERF (numerical, not analytical solution)
One more step: Chebyshev’s Inequality, instead of Gaussian CDF
The Remaining Issue: PCSS Step 1 Averaging the blocker depth in filtering region Avaliable: through MIPMAP, through Chebyshev Assumption: all (assumes surface parallel to light?) Anormalies caused by this assumption: light leaking
Mean Calculation for arbitrary rectangular: Range Query
MIPMAP Only for square, needs interpolation
SAT Preprocess: prefix sum (with Inclusion-Exclusion Principle in 2D) Parallelization: 2-pass, first row then column (multiple 1-D prefix-sum each row/column)
Moment Shadow Mapping
Motivation: more accurate distribution for VSSM using higher moments
Moments and orders: first orders of moments represents a function (CDF here!) with steps. is fine, optimize time cost with packing&unpacking (SIMD?)