Soft Shadows

After a whole day of searching i  found a good way to get soft shadows. I followed a tutorial here, link to the shader used from the tutorial here. It’s done in OpenGL tho, so you’ll have to do a little translation to hlsl if you’re using xna or directx

The technique i’m using is stratified poisson sampling. Its relatively cheap seeing that you’d have to do a  16 sampled pcf to get similar results, but its still noisy. Antialiasing should smooth it out a bit.

There’s still a bit of z fighting, i’ll have to work on it a bit more to fix those issues.

download here

It’s the same messy shadow mapping project i modified except that it uses an orthogonal projection for the light.

enjoy 😀

Advertisements

5 responses to “Soft Shadows

  1. Nice, this came soon before I fixed my depth comparison bug in my cascaded shadow mapping. I currently use a combination of 4x PCF with linear interpolation (so it lerps among 4 levels of darkness, not just black to white). I think using just basic Poisson disk sample on top of the linear combo could make noise-free edges without banding.

  2. Pingback: Advanced Shadow Mapping in XNA 4.0 | S.Luebss·

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s