Archived

This topic is now archived and is closed to further replies.

Thomas Obermaier

[Planar Shadows] Avoiding Z-Buffer Fights

Recommended Posts

Hi there! I''m currently using planar shadows in my application (fits the requirements perfectly). Everything is nice, as long the shadows are black. But when there is transparency, my system fails (of course). I have some Z-Fights (due to overdraw in my projection) One solution is using the stencil buffer, but i think it should be also possible with some depth testing tricks. Can anyone tell me how to do that. All my tests failed up to now. What do you think is faster? Stenciling, or (if it is possible) depth testing tricks? best regards, thomas

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Not quite sure what you''re aiming at, but have you considered polygon-offset?

Share this post


Link to post
Share on other sites
Ok

I render my planar projection shadows with glBlendFunc(GL_DST_COLOR, GL_ZERO); to achieve some nice colors. The problem: if one face is covering another face after the projection, i have darker regions in my shadow. the easiest solution will be using the stencil buffer to avoid that. But why using stencil tests, when it could be solved by some depth test functions... but i dunno whats the best way to set all those states...

maybe someone has an idea?

TIA

Thomas

Share this post


Link to post
Share on other sites