[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ] [ Search: ] Using the Volumetric Shadows Render Manager

Considerations when using Volumetric Shadows

Although the volumetric shadows render manger can cope with opaque objects as well, it is important to take into account the following, before choosing to use this render manager for your current scene:

The three render passes

Selecting the Volumetric Shadows Render Manager

The simplest method to select the volumetric shadows render manager is to use the following configuration option:

Engine.RenderManager.Default = crystalspace.rendermanager.osm

Alternately, the volumetric shadows render manager can also be loaded manually as follows:

csRef<iRenderManager> rm = csLoadPlugin<iRenderManager> (objectRegistry,

Note: When loading the volumetric shadows render manager manually the 'CS/data/config/engine.cfg' configuration file will not, by default, be present in the configuration manager. This file specifies configuration options used by the volumetric shadows render manager. Be sure to define these configurations option prior to loading the volumetric shadows render manager. This ca be done by:

csRef<iConfigManager> cfg = 
  csQueryRegistry<iConfigManager> (GetObjectRegistry());
  ("/config/engine.cfg", vfs, iConfigManager::ConfigPriorityPlugin);

After being loaded, the engine must be instructed to use the volumetric shadows render manager as follows:

engine->SetRenderManager (rm);

Configuration options

The configuration options available for the volumetric shadow render manager via the 'CS/data/config/engine.cfg' file are:


Choosing the texture resolution (defaults to 512). This value is used for both the opacity maps and the shadow maps needed by the 3 render passes.


Choosing the desired number of textures for opacity maps, with values from 1 to 8 (defaults to 2). The number of textures actually used could be smaller than the desired one, because it is chosen as the minimum of the number of available MRTs (multiple render targets) on the current GPU and the desired number of textures. A bigger value for this variable produces better renderings, but at a higher computational cost, so a compromise between performance and visuals has to be done for the current scene by choosing a value for this variable.


Setting the default Render Layers file. This should always be equal to ‘/data/renderlayers/lighting_default_osm.xml’.

Recomputing the splitting ratio

The volumetric shadow render manager uses the Bounding Opacity Maps algorithm (see section About Volumetric Shadows) in order to achieve accurate volumetric shadows at real-time performance. The advantage of this method is that it distributes the opacity maps so that they follow the light’s distribution from the real-world. In order to do this it uses a hybrid split function that sets a ratio between logarithmic and linear splitting. Determining the splitting ratio represents the current bottleneck of this render manager, because it involves using the CPU to do image processing on textures readback from the GPU. Fortunately the splitting ratio only needs to be recomputed when the objects’ density changes or new objects are brought into the light’s perspective. For more information regarding how to recompute the splitting ratio see the next section.

Debug Commands

The volumetric shadows render manager implements the iDebugHelper interface and responds to the following debug commands:


Begins recomputing the splitting ratio. This causes the application to have only interactive and not real-time performance and should be called only when necessarily. Refer to the above section for more information.


Toggles a display of the textures generated by the 3 render passes at the bottom of the screen. The first two textures correspond to the depth textures, the one that gives information about the furthest geometry is first and the one that gives information about the closest points comes second. The rest of the textures are opacity textures in a number depending on the available MRTs and the desired number of textures.


Makes the volumetric shadow render manager work with opaque objects as well.


Makes the volumetric shadow render manager work only with translucent objects, which have the alpha rendering priority in Crystal Space.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated using texi2html 1.76.