Jump to content

  • Log In with Google      Sign In   
  • Create Account

Differences bwteen depth-pass and depth-fail stencil shadow in shadow volume


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Jeason   Members   -  Reputation: 96

Like
0Likes
Like

Posted 23 February 2012 - 01:47 AM

I find depth-pass tech gives wrong stencil buffer if the camera is in the shadow volume when i learn the sample of ShadowVolume in DXSDK.
But the depth-fail tech works at all circumstances whether the camera is in the shadow or not.

Can you represent your opinion about it ?

Sponsor:

#2 Tsus   Members   -  Reputation: 1034

Like
1Likes
Like

Posted 23 February 2012 - 04:32 AM

Well, yes that‘s true. Posted Image

The classical z-pass technique decrements the stencil value when a front face is rendered. If that’s not visible, well, then shadowed and lit areas are reversed… Everything that should not be in shadow suddenly is (and vice versa).

Carmack’s z-fail shadows can handle this case, but unfortunately they are a slower, since the GPU can’t do hierarchical z-culling anymore (c.f. Persson, "Depth In-depth", page 6). If your shadow casting geometries are not too complex, don’t worry.

Cheers!

#3 Eric Lengyel   Crossbones+   -  Reputation: 2322

Like
1Likes
Like

Posted 23 February 2012 - 06:10 AM

Another reason z-fail is more expensive is because you have to render a lot more triangles for the endcaps. You should you z-pass as much as possible, and use z-fail only when necessary. You can determine when z-fail is necessary as described here:

http://www.gamasutra.com/view/feature/2942/the_mechanics_of_robust_stencil_.php?page=4

#4 Jeason   Members   -  Reputation: 96

Like
0Likes
Like

Posted 24 February 2012 - 03:07 AM

Thank you, guys!Posted Image




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS