VR-Vantage API Documentation
7.4 - Environmental Effects and the Lighting Model

Table of Contents

VR-Vantage implements environmental and lighting effects through SilverLining.

It provides two interfaces to set SilverLining state, the DtDeTimeManager and the DtEnvironment. The DtDeTimeManager controls date and time. The DtEnvironment controls SilverLining's clouds, precipitation, air turbidity, and visibility effects.

7.4.1 Managing Clouds, Visibility, and Precipitation

The DtEnvironment is a member of a DtScene. It provides a serializable interface to SilverLining environmental effects and it maintains records of its state, which can be saved or loaded with the makArchives::DtEnvironmentRecord. A DtEnvironment wraps a DtSkyObject, which is the distributed interface to the SilverLining clouds, precipitation, turbidity, and visibility effects. To set your scene's environmental effects, you might do something like the following:

scene.environment().clear();
scene.environment().setPrecipitationEnabled(true);
scene.environment().setPrecipitationType(DtEnvironment::Rain);
scene.environment().setPrecipitationIntensity(0.5);
DtCloudLayerRecord cloudLayer;
cloudLayer.setType("CumulusCongestus");
cloudLayer.setEnabledFlag(true);
cloudLayer.setAltitude(1000);
cloudLayer.setWidth(20000);
cloudLayer.setLength(20000);
cloudLayer.setThickness(100);
cloudLayer.setDensity(1.0);
scene.environment().addCloudLayer(cloudLayer);

7.4.2 Managing the Time and Date

The DtDeTimeManager maintains the scene's time and date, as well as changing the time each tick according to its time scale setting. The DtDeTimeManager's settings are distributed to all nodes by the DtDeSharedState. This means that you should never modify the DtDeTimeManager directly; instead, use the functions DtDeSharedState::setDateAndTime() and DtDeSharedState::setTimeScale(). The date and time are the main determinants of the lighting model's state.

[<< Terrain Structure] [Home] [Top of Page] [Forests >>]



Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)