It renders the scene to a texture, and then for each bucket in the histogram renders a quad with the scene texture, using a fragment program that discards pixels outside the range of interest. For a histogram with n entries this method takes n passes. Image Histogram This example implements an image histogram using occlusion queries. This technique yields better results than simply rendering the scene to an off screen render target. The IDirect3DDevice9::StretchRect() function is used to copy the antialiased image to a render-target texture for post-processing. It takes advantage of the nv_image_processing framework, Cg, and GLSL for to implement several video filters, including guassian blur, edge detection overlay, wobble, TV-noise, radial blur, and night vision.Īntialiasing with Post-Processing In this sample, an antialiased backbuffer is read as the source image for a post-processing effect which creates a green glow. GPU Video Effects This sample uses the GPU to render post-processing effects with source images and video. See the GL_EXT_framebuffer_object spec for more details. The code renders a wireframe teapot to an off-screen frame buffer object, binds this as a texture and then displays it to the window on a textured quad.The FBO extension has the advantages that it is window system independent and does not require a separate OpenGL context for each render target.
Simple Framebuffer Object This simple code example shows how to use the framebuffer object (FBO) extension to perform rendering to texture in OpenGL.