Exponential Soft Shadow-Maps

I’ve knocked down the next graphics feature: exponential soft shadow mapping!

blur_8

Blur with width of 8

Prior, I implemented traditional shadow-mapping, and they looked like this if you got close:

shadow_pixelation.jpg

See those pixelated edges? Not very pretty, and it gets worse the closer you get. With these new shadows, they can have varying penumbra, and look much better at close range!

close_shadows.png

How It Works (In a Nutshell)

Overall, the algorithm has 2 parts: The conversion of linear-depth to exponential-depth, and the Gaussian blur. That first step takes your depth and runs it through the exponential function, scaling it up by some arbitrary constant prior to the function (helps with “shadow bleeding” when shadow samples of different objects are close to each other). The second part takes the exponential depth, and applies a Gaussian blur of a specified width. Mine does this through a compute shader, using the techniques specified in this great presentation by AMD. Finally, during shadow calculations, you calculate the exponential depth of the current z-value and multiply that by your exponential depth, and voila! Silky-smooth shadows.

Here’s a quick batch of pictures that show off the range of shadow blurs:

Soon as I finish up my MFBRDF rendering, it’ll be time to tackle SSAO, then the last project for this semester will be depth of field.

One thought on “Exponential Soft Shadow-Maps

  1. Pingback: Depth of Field | Matt Yan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s