Rendering to textures

The render-to-textures technique allows developers to create textures based on a sub-scene's appearance in the rendered scene. These textures are then "baked" into objects of coming scene graphs via texture mapping. They can be used to create nice special effects on the fly, or can be stored for subsequent deferred shading, multi-pass rendering, and other advanced rendering algorithms.

To implement texture baking dynamically, there are generally three steps to follow:

  1. Create the texture for rendering to.
  2. Render the scene to the texture.
  3. Use the texture as you want.

We have to create an empty texture object before putting it into use. OSG can create an empty osg::Texture object by specifying its size. The setTextureSize() method ...

Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.