Jump to content
  • Advertisement
Sign in to follow this  
kevintlaw

Depth fail vs depth pass shadow volume

This topic is 3623 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
Advertisement
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
Not quite sure but I believe StencilFail means nothing when StencilFunc is set to Always, you have to use StencilZFail instead.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!