Simple Shadow Mapping

Started by
10 comments, last by Endemoniada 10 years, 8 months ago
Looks like self-shadowing (though weird you don't get the same effect on the floor). Use a higher bias for the depth comparison (SHADOW_EPSILON in Luna's code) or only render the backfaces to your shadow map by flipping the cull mode.

To high an epsilon will result in so-called peter-panning (objects look like they hover above ground). It's hard to get straight forward shadow mapping right - if possible at all.

Edit:

Notice the color is 0, I don't see how that can possibly work, shouldn't it be 0xffffffff ? In fact, that's why my original setup wasn't working, I was clearing it to zero and not one.


You're right, it should be. Depends, though. The SDK sample e.g. is "indoors" so I guess every pixel gets drawn anyway (you wouldn't even need a target clear).
Advertisement

Thanks a lot unbird. I realized SSM has lots of inherent problems so I think it's time to switch over to variance or more probably exponential shadow mapping. Exponential seems like the way to go but it's hard to find much about it. I'll probabky start a new post once I get something up and running. I'm learning a lot and that's a good thing :)

Thanks again.

This topic is closed to new replies.

Advertisement