Thursday, November 3, 2011

Rendering to a texture

    Sometimes it is required to render to something else than the screen. This can be useful if we want to generate our own textures, save a screenshot or create shadows using shadow maps. After we render the image we can then use it as any other regular texture in our shaders. In this application we will replace the texture of the bottom-right corner of the image from the crate texture to a scene of the same cube on the main part of the screen only on a different color background.