Archived

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

Draigan

Stencil Shadow Volume prob

Recommended Posts

Perhaps I should post this in the Graphics forum instead but I''m using Direct3D and this place gets 3 times as many hits it seems so.... Anyway, I got a weird problem and here''s a pic... http://www.geocities.com/dpicco2002/ Anyone have any idea what''s going on here?

Share this post


Link to post
Share on other sites
backface culling maybe? it looks like triangles are getting culled somehow, it must be backface culling.

edit: yeah, just for kicks try turning off backface culling when rendering shadow volumes.

[edited by - billybob on October 21, 2002 3:39:11 AM]

Share this post


Link to post
Share on other sites
If I turn the culling to none on my increment pass and one none on my decrement pass, then no shadow volume will be rendered since they cancel each other out (I tried). Any other ideas?

Edit: If I turn off the culling on my increment pass, and then turn it to CW on my decrement pass, then the full shadow volume renders perfectly (not just the silohuete tho, so I guess it's not PERFECT). So I guess it is culling then perhaps?

[edited by - Draigan on October 21, 2002 3:55:01 AM]

Share this post


Link to post
Share on other sites
Perhaps the Shadow Map is getting sliced up by the Z-Buffer?
Can you push the Map out from the face it''s on a little or give the shadow map a higher priority than the world?
Also maybe try messing with the Near and Far planes to improve the acuracy of the Z-Buffer?

Just some thoughts...

-Ximmer

Share this post


Link to post
Share on other sites
How are you calculating your shadow volume? it almost looks to me like a problem arising from strip ordering, where one face has its vertices in one order and the next has it reversed...

Share this post


Link to post
Share on other sites
Okay, I think I have that fixed... the only problem that remains is that I still get a lot of the same artifacts where it self-shadows.... kinda like what was on the ground but now only where there's self-shadowing...

And also, when I stand within the shadow volume, everything is drawn in shadow... any way to easily fix this?

Edit: The ground shadow draws perfectly now though

[edited by - Draigan on October 21, 2002 4:12:54 AM]

Edit: It also looks like there is some remnants of the shadow volume around the player char... like it's an outline of shadow volume around him... I can post another pic if any wants... It's 5:30am here now so I'm gonna head to bed... I'll post a pic and demo tomorrow if no-one has any ideas.

[edited by - Draigan on October 21, 2002 4:16:53 AM]

Edit: Okay, I've uploaded another screenshot to show my current problem... if anyone has any ideas I'd greatly appreciate it again. Thanks guys/gals.

[edited by - Draigan on October 21, 2002 4:25:54 AM]

Share this post


Link to post
Share on other sites
Okay, got that problem fixed... it was a stupid mistake on my part. I was rendering the object, moving it''s frame, generating the shadow volume and then rendering it so it was generating a different shadow volume than the object was rendering.

Now my only problem is correct rendering when the camera is inside the shadow volume. Anyone with any ideas as to how to fix this?

Share this post


Link to post
Share on other sites
Hi Draigan,

Been looking at shadow volumes myself over the last couple of days and I did see several articles about this very problem. I cant remember all the places I visited to get the details but this article seemed to provide the most information for me:

http://www.gamasutra.com/features/20021011/lengyel_01.htm

If I recall any other sites with the relevant details I''ll post them.

Good Luck

Share this post


Link to post
Share on other sites