• Advertisement
Sign in to follow this  

Real bad biasing issue with SM's

This topic is 4710 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

After rendering objects into a SM, I render my terran scene with the SM projected onto it (a single simple, uniform SM for now). On the terrain, the SM comes out very well: Aliasing is low (2048x2048 SM) and the biasing is pretty non existant. But, when i look at the other objects in the world (the objects rendered into the SM, whom now, during the final rendering pass, are having the SM projected onto it) i get insanely horrid artifacts. For example, the entire mesh is covered in the shadowmap (all black). I have seperate depth bias numbers i'm passing into the shader for terrain (0.f) and models (2.3f). When i move the model bias, the 'artifacts' don't seem to get better, but the entire sm no longer appears on it. (so essencially, we get no shadowing, and no self shadowing (along with no objects casting onto other objects, just the terrain)) I know there's something i'm doing wrong, considering how many SM demos are out there that seem to solve this problem just fine. Has anyone ran into this problem before?? thanks FROG!

Share this post


Link to post
Share on other sites
Advertisement
Well, you typically don't use different bias values for different things in the shadow map.

The first question is whether you are biasing when rendering the shadow map, or when testing against the shadow map.

When you bias the models, are you biasing towards the light or away from the light?

It is best to use bias when rendering into the shadow map. This means that you want to bias objects slightly away from the light. One way to do this is to push the near plane forward a bit.
Another is to use polygonoffset or depthslopescale bias.

The two bias approaches ( during shadow rendering and during shadow testing ) are logically equivalent, but not in practice. For instance, biasing your objects with polygonoffset or depthslopescale bias can effectively shut down z-cull hw. So it is best to pay for the lack of z cull on the shadow map, where rendering is cheaper than to the back buffer ( no shaders for instance ).

Share this post


Link to post
Share on other sites
As of your post, I'm Biasing when rendering the shadow map, with depthbias = 0.004, and slopescaledepthbias = 5.f.

I suppose to clairfy the issue i'm seeing more:
I'm only rendering backfaces into the SM itself. What seems to be occuring is that when those backfaces are tested against their frontface counterparts, i'm getting a black pixel. And for some reason, altering the depthbias and slpescaledepthbias has no effect on the final pixel test. is there perhaps some enabler function i need to call?

FROG

[Edited by - ElFrogo on June 2, 2005 11:43:20 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement