Sign in to follow this  
metalcrusader

StencilValueMask vs. StencilWriteMask

Recommended Posts

Hello! Can anybody explain the difference to me? I ask, because I get different shadows for different masks. I use glStencilFunc( GL,ALWAYS, 0,0) for the stencilbuffer-writings and glStencilFunc( GL_NOTEQUAL, 0, 1) before drawing the "shadow-plane" alternativley glStencilFunc( GL_EQUAL, 0, 1) if I use the two-pass-procedure ( drawing the scene again with all lights on). My problem is that i get different results for zpass and zfail if I use the same stencilMask and also different results if I use different mask only for zPass. Sometimes I get a correct shadow, but the light facing side of the occluder is also in shadow or this front is been lit, but there are holes in the shadow where two shadow intersects. Is there a standart way to use these Masks? Another question: If I try to read out the actual GL_STENCIL_VALUE_MASK or GL_STENCIL_WRITEMASK I get an segfault. Does anybody know how to query these values? I am appreciate for every response!

Share this post


Link to post
Share on other sites
see bottom of page
http://www.opengl.org/resources/features/

"read out the actual GL_STENCIL_VALUE_MASK or GL_STENCIL_WRITEMASK I get an segfault"
this shouldnt happen post your code

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