Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ XR Studio

Environment setup

  • Last UpdatedDec 04, 2023
  • 2 minute read

The environment state, which includes weather conditions and lighting conditions are useful for creating the illusion of photorealism and immersion.

You can set these elements before starting a session, or modify them at runtime to create a weather deviation. For example, a sandstorm arrives while starting a turbine system.

Elements

There are several elements that can be involved in designing different environment states:

  • HDR settings. Change the illumination characteristics of the rendering to change the day hour, to make rain and snow more realistic, or even to drive fog and sandstorm effects. The HDR Panel of the the Player Debug tool can be useful to create and save a particular HDR setup.

  • Post Process settings. Add some post process effects to enforce the visualization of some extreme conditions. The Post Process Panel of the Player Debug tool can be useful to create and save a particular post process setup.

  • Rain. Use rain nodes to create raining conditions.

  • Snow. Use snow nodes to create snowing conditions.

  • Texture switches. Change the skydome texture or the complete lightmap set to move from day to night or to improve the raining effect. This is a useful instrument; however, you should consider the weight of the textures to be changed.

  • Lens Flare. Add/remove or change the lens flare effect, depending on the lighting conditions.

The developer should learn how to master the elements described above and then try to create the desired effects. The sample project contains a simple implementation (weather.xml) of some effects that can be used as a starting point to develop new ones.

For more information on these environmental effects see XR Graphics Guide.

Code example

This is a code example for weather.xml.

<Multitextureswitch name="light_condition" path="./Gamedata/Textures/user/AlternativeAssets/rain" fileBase="rain_" fileList="textureswitch_rain.cache"/>

<Lensflare name="lens_flare" lensFlare="light_omni|DummyLens"/>

<var name="weatherState" type="sint" value="0" />

<Command name="set_weatherState">

<if condition="%0%==0" >

<!-- normal -->

<setfield field="postProcess.file" value="./GameData/hdr/post_process_simulation.xml"/>

<setfield field="postProcess.load"/>

<setfield field="hdr.file" value="./GameData/hdr/hdr_simulation.xml"/>

<setfield field="hdr.load"/>

<if condition="@light_condition.currentSet@==1" >

<setfield field="light_condition.currentSet" value="0"/>

</if>

<setfield field="lens_flare.show"/>

<setfield field="3DRain.enabled" value="false" />

<setfield field="3DSnow.enabled" value="false" />

<else condition="%0%==1" >

<!-- fog -->

<setfield field="postProcess.file" value="./GameData/hdr/post_process_simulation_fog.xml"/>

<setfield field="postProcess.load"/>

<setfield field="hdr.file" value="./GameData/hdr/hdr_simulation_fog.xml"/>

<setfield field="hdr.load"/>

<if condition="@light_condition.currentSet@==1" >

<setfield field="light_condition.currentSet" value="0"/>

</if>

<execute command="set_fogIntensity" value="@fogIntensity.value@" />

<setfield field="lens_flare.hide"/>

<setfield field="3DRain.enabled" value="false" />

<setfield field="3DSnow.enabled" value="false" />

</else>

<else condition="%0%==2" >

<!-- rain -->

<setfield field="postProcess.file" value="./GameData/hdr/post_process_simulation_rain.xml"/>

<setfield field="postProcess.load"/>

<setfield field="hdr.file" value="./GameData/hdr/hdr_simulation_rain.xml"/>

<setfield field="hdr.load"/>

<if condition="@light_condition.currentSet@==0" >

<setfield field="light_condition.currentSet" value="1"/>

</if>

<execute command="set_rainIntensity" value="@rainIntensity.value@" />

<setfield field="lens_flare.hide"/>

<setfield field="3DSnow.enabled" value="false" />

<setfield field="3DRain.enabled" value="true" />

</else>

<else>

<!-- snow -->

<setfield field="postProcess.file" value="./GameData/hdr/post_process_simulation_snow.xml"/>

<setfield field="postProcess.load"/>

<setfield field="hdr.file" value="./GameData/hdr/hdr_simulation_snow.xml"/>

<setfield field="hdr.load"/>

<if condition="@light_condition.currentSet@==0" >

<setfield field="light_condition.currentSet" value="1"/>

</if>

<execute command="set_snowIntensity" value="@snowIntensity.value@" />

<setfield field="lens_flare.hide"/>

<setfield field="3DRain.enabled" value="false" />

<setfield field="3DSnow.enabled" value="true" />

</else>

</if>

<setfield field="weatherState.value" value="%0%" />

</Command>

<!-- ... -->

In This Topic
TitleResults for “How to create a CRG?”Also Available in