Sign in to follow this  
Jo

Shadow volume artifact...

Recommended Posts

Jo    122
This one's thrown me for a loop. http://jabberwaffle.freewebspace.com/shadow_artifact.jpg It looks like part of the stencil buffer is retaining some of its values from the last frame, although I'm pretty sure that isn't happening. This only occurs at some angles, which at first made me think it might have to do with the specular component (I'm using Blinn-Phong per-pixel shading using shaders), but there is no component here. Shadow volumes are fine and all D3D commands complete without errors or warnings on the highest level of debugging output. Has anyone else already tangled with this beast? Any ideas would be apreciated. Edited by Coder: Using html links is good. See GDNet Forums FAQ [Edited by - Coder on August 3, 2004 4:00:20 PM]

Share this post


Link to post
Share on other sites
Jo    122
Made some progress, so I'm happier if not any better educated.

I do a stencil buffer clear in between each light pass, so I didn't see the need to clear the stencil buffer at the beginning of the frame. It shouldn't make a difference, but clearing the buffer that extra time gets rid of that bit of overdraw. I'm still not quite sure what was causing the problem. Anybody have an idea?

Share this post


Link to post
Share on other sites
Jo    122
After implementing scissoring and a limited clear rectangle the artifact is back with a vengence. Clearly the problem is related to clearing the stencil buffer, but exactly what the problem is I still can't figure out. The modified portion of the stencil buffer is always cleared in between passes, but for some reason parts of it look like they're leaking through.

Too much for 3:45 in the morning. Any help here would be apreciated.

Share this post


Link to post
Share on other sites
Jo    122
Who knows why, but changing the order I do my shadow volume passes seems to fix the problem. I've checked and re-checked it, and the order is supposed to be 1) Front Faces Increment, 2) Back Faces Decrement, but when I do back faces first the artifact goes away.

Let me reach into a well worn bag and pull out an old classic...

WTF?

Well, if it aint broke don't fix it I guess.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this