Documentation
¶
Overview ¶
Render-to-texture via an offscreen framebuffer object (FBO).
Demonstrates:
- Creating a texture to serve as a color attachment
- Creating an FBO and attaching the texture with FramebufferTexture2D
- Checking framebuffer completeness with CheckFramebufferStatus
- Rendering a triangle into the FBO (offscreen)
- Reading back pixels from the FBO with ReadPixels
- Binding the FBO texture and sampling it in a second pass
The program performs two render passes:
- Render a green triangle into a 32x32 FBO texture.
- Bind that texture and draw a fullscreen quad onto the default framebuffer (64x64 pbuffer), effectively displaying the FBO contents.
Both passes are verified by reading back pixels.
Click to show internal directories.
Click to hide internal directories.