![]() sfail: the test from glStencilFunc failed.mask: a mask applied to both ref and the stencil pixel you can use 0xFF (if you have 8 bitplanes) to disable the mask.ref: a fixed integer used in the comparison.OP: one of GL_NEVER, GL_ALWAYS, GL_EQUAL, GL_NOTEQUAL, GL_LESS, GL_LEQUAL, GL_GEQUAL, GL_GREATER.GlStencilFunc takes 3 parameters, to build the following test (ref & mask) OP (stencil & mask): The stencil buffer can be manipulated using glStencilFunc and glStencilOp: glStencilFunc specifies a test to apply to each pixel of the stencil buffer, then glStencilOp specifies the action to apply depending on the test result. You can inspect the number of bitplanes using glGetIntegerv(GL_STENCIL_BITS, &i). This is mostly a matter of vocabulary: the per-pixel information is a number of bitplanes - that is, of bits.įor instance, it is common to have 8 bitplanes, which means one byte is associated with each pixel on screen, and you can store up to 2 8 = 256 different values. ![]() There are quite a few points to understand to manipulate the stencil buffer correctly, so let's take time to learn them. The stencil buffer is another buffer for your custom use: you can store per-pixel information there and direct OpenGL to act differently depending on that information. 5 Working on color, depth and/or stencil buffers specifically.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |