PDA

View Full Version : Framebuffer



mike44
01-20-2018, 12:07 AM
Hi
what is needed to initialize a framebuffer? One function it works fine and the other function nothing is visible. I cannot spot any difference.-
Any ideas on what to try?
Thanks

GClements
01-20-2018, 01:13 AM
what is needed to initialize a framebuffer?
Create the framebuffer, attach at least one colour, depth and/or stencil buffer to it. Bind, set viewport, clear, render.

If you're having problems, use glGetError() and glCheckFramebufferStatus(). If you're using textures, ensure that they aren't bound to a texture unit at the same time as being attached to a framebuffer (the actual restrictions are a bit more relaxed than that; it's only an issue if the attached mipmap level is capable of being read from).