![]() ![]() The only case where you write to the framebuffer without applying the stencil test is with glClear(). The stencil test is applied to all fragments, no matter of the primitive type rendered. Secondly I was not using the proper stencil test. I did not know that it was required when rendering to a texture. My problem, as pointed out by the selected answer, was primarily that I did not attach the stencil to the stencil attachment of the FBO: glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, Are there any apparent mistakes with my code?.Does the stencil texture have to have any special properties (solid colour, internal format.etc)?.Is is possible to use a stencil buffer when rendering to a texture?.Is is possible to use a stencil buffer with GL_POINTS?.I had a few questions regarding this issue: The result I am getting is just my texture being drawn without any masking applied from the stencil. GlStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP) GlColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE) GlDrawArrays(GL_POINTS, 0, (int)vertexCount) GlStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE) GlColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE ) Here is my code for rendering to texture: //Initialize buffers, initialize texture, bind frameBuffer I am rendering the results to another texture and then presenting the texture to screen. The stencil buffer should come from a texture. I am trying to draw a texture in OpenGL ES 2.0 using GL_POINTS by applying a stencil buffer. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |