Rendering order of cameras

There is at least one main camera node in any scene graphs. It is created and managed by the osgViewer::Viewer class, and can be read via the getCamera() method. It automatically adds the root node as its child node before starting the simulation. By default, all other cameras, whether directly or indirectly added to the root node, will share the graphics context associated with the main camera, and draw their own sub-scenes successively onto the same rendering window.

The osg::Camera class provides a setRenderOrder() method to precisely control the rendering order of cameras. It has an order enumeration and an optional order number parameter. The first enumeration can be PRE_RENDER or POST_RENDER, which indicates the ...

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.