scenemanager.jpg SceneManagers FAQ
Overview of the various SceneManagers available for Ogre.


Introduction

A scene is an abstract representation of what is shown in a virtual world. Scenes may consist of static geometry such as terrain or building interiors, models such as trees, chairs or monsters, light sources that illuminate the scene and cameras that view the scene.

Scenes can have quite different types. An interior scene might be made up of hallways and rooms populated by furniture and artwork on the walls. An exterior scene might consist of a terrain of rolling hills, trees, grass waving in the breeze and a blue sky with gently moving clouds.

Ogre provides a set of different scene managers, each of which is customized to best support different kinds of scenes. Ogre experts may even wish to develop their own scene manager, customized to best the type of scene used in their application.

This document lists the various scene managers provided by Ogre and discusses their strengths and weaknesses.

Selecting a Scene Manager

You can select a scene manager via the createSceneManager() method defined in your root node, replacing ST_GENERIC with your scene manager of choice:

mRoot->createSceneManager(ST_GENERIC);

The argument to createSceneManager specifies the type of scene manager to use, based on the following values:

  • ST_GENERIC - Generic scene manager (Octree if you load Plugin_OctreeSceneManager, DotScene if you load Plugin_DotSceneManager)
  • ST_EXTERIOR_CLOSE - old Terrain Scene Manager
  • ST_EXTERIOR_FAR - Nature scene manager (this mode is not present anymore in Ogre 1.0. Use "Terrain", or "Paging Landscape" instead)
  • ST_EXTERIOR_REAL_FAR - Paging Scene Manager
  • ST_INTERIOR - BSP scene manager


Each SceneManager can register any combination of those flags for itself, since they are simple bit masks. So the default manager registers itself as ST_GENERIC, the octree manager and PCZ manager register themselves as all types, the BSP manager registers itself as ST_INTERIOR.

When you request a scene manager by type instead of name, Ogre picks the last manager to register a matching type.
The order depends on the order you load plugins in the plugins.cfg file. If you load the BSP, PCZ and Octree managers in that order, the Octree manager will grab all scene requests (when requested by type).

That's is also the order in the default Ogre plugins.cfg, so most people are probably using the octree manager if they use the type flags (even if they request ST_INTERIOR and have the BSP manager loaded, if the BSP plugin is loaded before the Octree plugin!).

Instead of requesting a scene manager via type, you can also do it via the name. The text names to find the scene managers explicitly are (case sensitive):

  • DefaultSceneManager
  • OctreeSceneManager
  • BspSceneManager
  • PCZSceneManager


Only those above listed four are official Ogre scene managers in the sense of being provided by the Ogre team. However, there are quite some community developed alternatives which are partially listed on this page as well. The Ogre Terrain System is also developed by the Ogre team and is the new standard approach for terrain rending. It is however not technically an own scene manager, but rather a scene manager independent component.

Generic Scene Manager (default)

Kojack wrote:
The default generic manager (the one that's built in) isn't that good. It can do hierarchical frustum culling, but relies on you to build the hierarchy. If you add 1000 nodes with entities to the root scene node, each has to be tested for culling every frame. Raycasting is even worse, it always tests every bounding box for a ray intersect, it doesn't use the hierarchy (if a parent node isn't hit, it still checks all children even though they could never be hit). In other words, never use it.


Octree Scene Manager

Uses an Octree to split the scene and performs well for most scenes, except those which are reliant on heavy occlusion.

Kojack wrote:
The octree manager uses an octree (obviously) to subdivide the world. This means it should be able to quickly cull entire regions of the world (if the parent region isn't visible to the camera, no child needs to be checked). Raycasting used the octree too, so it can quickly find potentially colliding bounding boxes. Unlike some octrees, meshes aren't split. It puts entire meshes into leaf nodes (it's a loose octree). Note: If you use the octree scene manager, you won't be working with SceneNode objects, they are really a hidden class called OctreeNode (this is why you can't inherit from SceneNode and inject them into an existing scene, unless the SM is the default one).


Pros:

  • A simple and generic solution, works well for most scenes
  • Can use the StaticGeometry class to accelerate large chunks of immovable geometry

Cons:

  • No specific acceleration for particular scene structures
  • Heavily occluded scenes will need a more specialised solution


BSP Scene Manager

This scene manager is intended for use in interior scenes. Particularly, it is optimized for the sort of geometry that results from intersecting walls and corridors.

The normal process for creating levels in a format usable by the BSP scene manager is:

  • Use one of the numerous level editing tools to create your level, saving the level in .map format.
  • Compile the .map file to a Quake 3-style .bsp file, which can be read in by the BSP scene manager. You can use id Software BSP compiler (q3map2) for this task, since it's no longer proprietary (released under the GNU GPL).
Kojack wrote:
The BSP manager loads quake3 levels. BSP (Binary Space Partition) is an old technique. It has a some visibility and region division uses, but for rendering it's actually a poor technique. It was good for software rendering because it could order all faces for back to front rendering without needing a z buffer, but it causes bloated tri counts, potential flaws where it cuts geometry, etc. Brute force rendering is quicker these days, and we have a real z buffer. Ogre's bsp is pretty neglected, it's kept compatible with ogre but isn't really much use these days.


Portal Connected Zone Scene Manager (PCZSM)

See the Portal Connected Zone Scene Manager page for information on this scenemanager.

Kojack wrote:
The Portal Connected Zone manager (and the octreezone plugin which goes with it) allow you to define zones in the world and portals which connect them. You can only see the contents of a zone if you are in the zone or can see the portal into a zone. It's harder to set up because this isn't automatic, you need to place zones and portals, but it can occlude things which are within the frustum but behind other objects.


Pros:

  • Optimized for interior scenes.
  • Compatible with numerous level editing tools.

Cons:

  • Quake 3-style .bsp format may not be that efficient with modern GPUs in any case.
  • Some people recommend instead creating levels in a general purpose modeling tool such as Blender, exporting the level in .scene format.

Here is a link to a Blender BSP importer which works great: http://blenderartists.org/forum/showthread?t=41306

Ogre Terrain System


The Ogre Terrain System is the default terrain system since Ogre 1.8.

Pros:

  • SceneManager independent, separate optional component
  • Long term support (because it's no add-on, it's part of the Ogre core)
  • Many improvements in comparison to older/other terrain managers
  • Integrates with (optional) Ogre::Paging component
  • Inherently editable - a lot like ETM
  • In-built support for splatting layers, configurable sampler inputs and pluggable material generators

Cons:

  • Maybe there are still some performance optimizations needed

See also: Ogre Terrain System for a lot of additional information and links regarding the new component.

Terrain Scene Manager

The terrain scene manager (TSM) is intended for relatively small scenes involving static terrain. This scene manager makes it easy to generate terrain from a heightmap. Heightmaps can be created from a variety of tools.
The TSM is an extended version of the OctreeSceneManager (with added terrain chunks).

Note: In Ogre 1.8 the TSM was removed, in favor of the new and more powerful Terrain Component. So it's only available up to Ogre 1.7.

Pros:

  • Fast rendering of high-resolution terrain (due to efficient level of detail and culling algorithms)
  • Easy to generate terrain via heightmaps and terrain textures
  • Vertex program based morphing between LOD levels
  • Customisable material so you can use shaders if you want

Cons:

  • No paging out of the box - the interface hooks are there but you need to add it
  • No splatting out of the box, but can be done with a custom material

Detailed documentation on the terrain scene manager can be found here.

Paging Scene Manager (ogreaddons)

The Paging Scene Manager allows scenes to be split into a set of pages. Only those pages that are being used need be loaded at any given time, allowing arbitrarily large scenes. Each page has its own heightmap, to which several textures can be applied by height. This allows snowy-peaked mountains within a green landscape, for example.

Pros:

  • Handles larger scenes than both the terrain and nature scene managers
  • Allows Real-time Terrain deformation and saves to files.
  • Allows multiple heightmaps and multiple textures per heightmap
Image + detail (fading on distance)
     Texture coloring based on user height (4 colors)
     Splatting.
     Real-time Splatting using Shaders.
     Real-time Texture coloring based on user height (4 colors)
  • Special Video Card Memory Savings that divides at least per 3 Memory consumption:
- Texture Coordinates sharing accross pages (one texture coordinates set for any number of pages.)
 - Displacment Mapping using shaders (use only one float for a vertices instead of 3.)
  • Map Tool (called "Mapsplitter") that split Big Map and Textures in pages, can compute lightmaps, normal maps, splatting maps.
  • Support Raw Heightmap up to 16 bits per height (instead of 8 bits jpg,png files)
  • Real-time Map change, Texturing Change
  • Binary demo here: http://tuan.kuranes.free.fr/Ogre.html
  • Vertex Morphing using shaders
  • Horizon Occlusion Visibility Real-time determination: nothing behind a mountain will be sent to the video card
  • Octree support

Cons:

  • Requires installation of the paging scene manager plug-in
  • Needs use of The Map Tool to generate pages
  • More options means more complexity


DotSceneOctree SceneManager (ogreaddons)

The DotSceneOctree SceneManager allows the geometry and meshes of a scene to be stored in a single file.
It's a kind of a hybrid of static geometry and the octree. It has an external tool which merges all geometry into octree nodes based on material type and maximum triangle count. It registers all scene types.

Pros:

  • Contains scene in a single file
  • Allows meshes to be classified as static or dynamic
  • Octree support

Cons:

  • Needs use of a processing tool to build a binary octree (.bin) file.
  • Does not support 32 bit indices, so bigger meshes needs to be split up before being fed to the processing tool.

Myrddins Paging Landscape Plugin

A project with many features and great looking terrains.

The terrain is editable (only by Mogre projects).

For more details look to Myrddin Landscape Plugin.

Pros:

  • It works with Ogre and Mogre
  • ...

Cons:

  • ...

Editable Terrain Manager

A project which offers an API to edit height and texture of a terrain.
For more details look to Editable Terrain Manager.

The powerful landscape/scene editor Artifex Terra uses the API of the Editable Terrain Manager. Created scenes can be loaded to Ogre applications by an additional loader.

Pros:

  • It works with Ogre and Mogre
  • ...

Cons:

  • ...

Overhang Terrain Scene Manager

Can display terrain with overhangs and tunnels.
It's a modified version of the Terrain Scene Manager, which adds modifications/additions to height map based terrain. A modify tool is integrated.

It was created for Ogre 1.4 and is open source.
For details look to page Overhang Terrain Scene Manager.

Planet Rendering Engine

The aim of this terrain manager is to render a planet. So it's possible to fly from far away to the planet, plunge to the atmosphere and move plane to the planet surface. A LOD system is integrated for seamless gradation.

More details are in this forum thread.

Pros:

  • ...

Cons:

  • ...

Tunnel Scene Manager

For Ogre it's not available. But it's listed here for information and inspiration.

Most (high performance) racing games use a "tunnel" scene manager. It's all about he spatial structure of the game: A game like Mario Kart needs to be more than a tunnel in spacial terms but a F1 or WipeOut-like game would benefit from it.
A "tunnel" scene manager would part space in chunks that are following a way.

See also

<HR>
Creative Commons Copyright -- Some rights reserved.


THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.

BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.

1. Definitions

  • "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
  • "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
  • "Licensor" means the individual or entity that offers the Work under the terms of this License.
  • "Original Author" means the individual or entity who created the Work.
  • "Work" means the copyrightable work of authorship offered under the terms of this License.
  • "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
  • "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.

2. Fair Use Rights

Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.

3. License Grant

Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:

  • to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
  • to create and reproduce Derivative Works;
  • to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
  • to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
  • For the avoidance of doubt, where the work is a musical composition:
    • Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
    • Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
    • Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).


The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.

4. Restrictions

The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:

  • You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested.
  • You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
  • If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.

5. Representations, Warranties and Disclaimer

UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.

6. Limitation on Liability.

EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7. Termination

  • This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
  • Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.

8. Miscellaneous

  • Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
  • Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
  • If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
  • No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
  • This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.