![]() If you miss this, you will get the error you're seeing, as specified for the error conditions under "Framebuffer Completeness" in the OpenGL 3.3 spec: This is per framebuffer state, so it needs to be called while the FBO is bound. If you don't want to render to any color buffers, you need a call that specifies that: glDrawBuffer(GL_NONE) All I want to is to render ONLY the depth into a texture. I read the GL glFrameBuffer docs, and I cannot comprehend why the code above wouldn't work. The only way I found to make it work is to specify a COLOR_ATTACHMENT (which would fix the draw buffer error). I always get the error GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER. Now I'm porting this code to OpenGL Desktop (2.1 and up) and it refuses to work. Unsigned int type = glCheckFramebufferStatus( GL_FRAMEBUFFER ) GlBindFramebuffer( GL_FRAMEBUFFER, framebuffer ) GlTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ) GlTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ) GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ) GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ) ![]() GlBindTexture( GL_TEXTURE_2D, depth_texture ) I got the following code working perfectly fine on iOS and Android: unsigned int depth_texture = 0,
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |