[GAMES202 笔记] Lecture 3

[GAMES 202] Lecture Notes 3

Shadow Mapping

A 2-pass algorithm: light pass: recording depth, render-to-texture (in a separate framebuffer);
camera pass: reproject camera-visible fragments to get depth from light.

An image-space algorithm: no need of knowledge of scene geometry. Cons: self-occlusion and aliasing (caused by low precision and resolution)

Implementation details: whether shadow texture comparing real camera-space (i.e. orthographic projecting) or perspective projected is OK, as long as consistent. The orthographic projecting is often used in directional lights.

Shadow mapping difference between orthographic and perspective projection.


Self occlusion

z-fighting (precision problem, for assuming a constant depth within the area in a pixel, which may have a varing depth value in reality.)

Solution #1: adding a bias when comparing depth values ( may adaptive to light incident angle); Cons: detatched shadow (peter panning) happens when is too big.

Solution #2: second-depth shadow mapping using midpoint between first and second depth value (may get with face-culling?) in shadow mapping. Cons: the watertight-object requirement and large overhead. Other solutions: over sampling, …


when projecting shadow of a small object to a far-away surface… Solution: Cascaded Shadow Mapping, CSM, PCF, …

Multiple light sources? shadow maps and computational cost! (optimization methods exists)

Approximations in RTR

An important approximation:

It’s more accurate when: (at least 1 condition is achieved) 1 the integrated area is small (small support) 2 the integrand is smooth

Applications: Decoupling the visibility term (separate process: first shading, then do shadow mapping).

1 When small support: point / directional lights:
2 Smooth integrand: diffuse bsdf / constant radiance area lighting

PCSS: Percentage Closing Soft Shadow

PCF: Percentage Closer Filtering

source from nvidia Anti-aliasing the shadow’s edges: filter the shadow map depth-comparing results, around each point, average the visibility results. Filtering size: small->shaper, lager->softer

Issue: sometimes the softening effect went to far. (especially when the shadow is close to the blocker, which makes the unrealistic visual effect). Notice the noisy shadow nearing 202chan’s hair:


From PCF to PCSS: the adaptive filtering PCF

Guess: very large filter will achieve soft shadows? Key observation: the more distant from blocker, the softer the shadow Conclusion: filter size -> relative average projected blocker depth

截屏2021-03-24 下午11.57.36

1 Blocker Search: average blocker depth from shadow map (note: [1] the shadow map by taking the area light as a point light; [2] the search area can depends on the area light size and receiver’s distance from light. )
2 Penumbra Estimation: use the ave blocker depth to determine filter size 3 do PCF using the adaptive sized filter


  1. 博主
    3 年前
    2021-4-05 20:02:43

    Banner character: ねり by しらたま from 星空鉄道とシロの旅

发送评论 编辑评论

 ̄﹃ ̄
∠( ᐛ 」∠)_
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
( ๑´•ω•) "(ㆆᴗㆆ)
Source: github.com/k4yt3x/flowerhd