Sign in to follow this  

Depth fail vs depth pass shadow volume

This topic is 3310 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

Hello everyone, i seem to have a problem with my depth fail shadow volume render states. But i have no idea what is wrong. i have successfully implemented depth pass shadow volumes but depth fail yields absolutely nothing at all.

i am currently working in XNA. Here is the declaration of my hlsl technique technique DepthPassShadowVolume { pass IncrementPass { CullMode = CW; StencilEnable = true; StencilFunc = Always; StencilPass = Incr; StencilRef = 0; ZWriteEnable = false; AlphaTestEnable = false; VertexShader = compile vs_2_0 ShadowVertexShader(); PixelShader = compile ps_2_0 ShadowPixelShader(); } pass DecrementPass { CullMode = CCW; StencilRef = 0; StencilEnable = true; StencilFunc = Always; StencilPass = Decr; AlphaTestEnable = false; VertexShader = compile vs_2_0 ShadowVertexShader(); PixelShader = compile ps_2_0 ShadowPixelShader(); } } technique DepthFailShadowVolume { pass IncrementPass { CullMode = CW; StencilEnable = true; StencilFunc = Always; StencilFail = Incr; StencilRef = 0; ZWriteEnable = false; AlphaTestEnable = false; VertexShader = compile vs_2_0 ShadowVertexShader(); PixelShader = compile ps_2_0 ShadowPixelShader(); } pass DecrementPass { CullMode = CCW; StencilRef = 0; StencilEnable = true; StencilFunc = Always; StencilFail = Decr; AlphaTestEnable = false; VertexShader = compile vs_2_0 ShadowVertexShader(); PixelShader = compile ps_2_0 ShadowPixelShader(); } } thanks for looking

Share this post


Link to post
Share on other sites
hehe, i have actually. i set it up so that i was changing the stencilref and stencilfunc with different keystrokes in the hopes of happening upon one that worked but that proved to be unsuccessful. is it possible that my hardware just doesn't support it? i have a Quadro 3450

Share this post


Link to post
Share on other sites
Quote:
Original post by kennyb
Not quite sure but I believe StencilFail means nothing when StencilFunc is set to Always, you have to use StencilZFail instead.


Hey it appears you're right! i didn't even know a stencilzfail existed. but now i have other issues where i'm seeing parts of the shadow volume that are behind other objects. right now i'm assuming that it is not doing the front caps correctly. but thanks to your tip, i've at least got it started again. thanks!

Share this post


Link to post
Share on other sites

This topic is 3310 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.

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