View Full Version : multiple stencils ?
03-10-2009, 03:45 AM
how far is it possible to have or simulate multiple stencil buffers ?
03-10-2009, 09:12 AM
...Not possible to have, there is one (hardware accelerated)stencil attachment to framebuffers. Simulate if you can write to a buffer and read simultaneously you can discard fragments based on buffer values. Not sure if this is allowed however.
03-10-2009, 09:57 AM
What I want to do is to do some stencil stuff during a rendering and to combine the rendering with the stencil buffer with a second pass, so something like this:
So, this is impossible ?
03-10-2009, 10:37 AM
you can combine values with f.e. INCR/DECR for as long as possible (2^8 times) as long as you don't clear the stencil buffer.
03-10-2009, 01:33 PM
What I want to do is to do some stencil stuff during a rendering and to combine the rendering with the stencil buffer with a second pass
This is exactly the purpose of the stencil buffer, why would you want multiple stencil buffers attached to your framebuffer?
03-10-2009, 02:03 PM
Well, I forgot to tell that I need to clear the stencil buffer between the 2 passes.
03-10-2009, 02:22 PM
There is no problem with that, you can do it, call glClear.
03-11-2009, 05:16 AM
So, it's okay as long as I clear between the 2 passes. But if, for some reasons, I also need to clear between the 2 drawings (so clearing in between the 2 passes) there aren't any solution ?
03-11-2009, 05:50 AM
glClear gets a bitmask. You can choose to clear only color and/or depth and keep your stencil buffer intact as long as you want.
03-14-2009, 05:17 PM
also Check this out http://www.opengl.org/registry/specs/EXT/stencil_clear_tag.txt
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.