AREA LIGHT!?? — Percentage-Closer Soft Shadows (PCSS)

Game Graphics Simplified
2 min readFeb 19, 2021

There ‘s no point light

Previously we was able to handle shadow casted by a distant/directional light or point light. But in real life, we don’t actually have perfect directional light or point light. All lights have an area and not all shadows are razor sharp.

This looks really hard to achieve 😫

For a realistic shadow, the further it goes away from light, the softer the shadow is. The larger the light source, the softer the shadow is.

Sample two rounds!

The smart engineers came up with a solution! We sample two rounds -

The first round we sample an average blocker distance using the shadow map.

Then we use the average blocker distance to calculate the radius of penumbra (area that is partially shaded) using similar triangles.

The second round we use the penumbra radius to sample the shadow map again.

In this way, we are able to to achieve more physically accurate shadow penumbra 😀

--

--

Game Graphics Simplified
0 Followers

I'm a game graphics engineer. I over-simplify game rendering techniques to make them overly simple and fun!