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.
It’s the same messy shadow mapping project i modified except that it uses an orthogonal projection for the light.
enjoy 😀


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.
sounds cool, i’ll try that one
Pingback: Advanced Shadow Mapping in XNA 4.0 | S.Luebss·
Nice. I’ve downloaded your code and expanded it a little bit. If you want to see, what I’ve done with your code, just follow this link: https://sluebess.wordpress.com/2015/04/06/advanced-shadow-mapping-in-xna-4-0/
that’s pretty awesome