Does OpenGL stencil test happen before or after fragment program runs?

Posted by david on Stack Overflow See other posts from Stack Overflow or by david
Published on 2010-05-03T05:27:34Z Indexed on 2010/05/03 5:38 UTC
Read the original article Hit count: 228

When I set glStencilFunc( GL_NEVER, . . . ) effectively disabling all drawing, and then run my [shader-bound] program I get no performance increase over letting the fragment shader run. I thought the stencil test happened before the fragment program. Is that not the case, or at least not guaranteed? Replacing the fragment shader with one that simply writes a constant to gl_FragColor does result in a higher FPS.

© Stack Overflow or respective owner

Related posts about c++

Related posts about win32