> For the complete documentation index, see [llms.txt](https://doc.realvirtual.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.realvirtual.io/components-and-scripts/game4automation/environment-controller.md).

# Environment Controller

Starting from **realvirtual.io Version 6**, the EnvironmentController leverages Unity's **Universal Rendering Pipeline (URP)** to provide enhanced visual fidelity and customization options.

You can find the **EnvironmentController** in **Tools > realvirtual > Environments** as part of the **realvirtual Prefab** in your scene.

***

### Overview

The EnvironmentController provides three preset visual modes:

* **Default**: A balanced environment for general use.
* **Dark**: Suitable for low-light or nighttime scenarios.
* **White**: Ideal for bright, minimalistic environments.

The component allows adjustments to floor size, fade effects, and toggling advanced features with straightforward controls.

<figure><img src="/files/FIputjHA5RNZeu0Um2AT" alt="" width="375"><figcaption><p>Environment - Default Mode</p></figcaption></figure>

<figure><img src="/files/WYwCR7OVV0eBnB2mIVo2" alt="" width="375"><figcaption><p>Environment - Dark Mode</p></figcaption></figure>

<figure><img src="/files/1fuSlg8s7UYO39URswnG" alt="" width="375"><figcaption><p>Environment - White Mode</p></figcaption></figure>

***

### Runtime Lighting (No Baking Required)

{% hint style="info" %}
Improved in realvirtual \*\*6.3.4\*\* (Starter & Professional)
{% endhint %}

The EnvironmentController computes the **skybox ambient light and environment reflection live at runtime** (using `DynamicGI.UpdateEnvironment`). This runs once when the scene starts, in both Edit and Play mode, so your scenes are correctly lit **without baking lighting**. The cost is a one-time calculation at scene start with no per-frame impact.

Because the ambient and reflection are generated from the skybox at runtime, the per-scene **baked lighting folder** Unity otherwise stores next to a scene (with `LightingData.asset`, `ReflectionProbe-*.exr` and lightmaps) is **no longer required** for skybox-lit scenes. Removing it slims down your project and stops these binary files from reappearing as changes in version control after every bake.

#### Removing baked lighting folders

Use **Tools > realvirtual > Settings > Remove Baked Lighting Folders…** to clean up the active scene or your whole project. The tool disables Baked Global Illumination on each scene, clears the scene's Lighting Data reference, and deletes the per-scene baked lighting folder. You choose the scope in the confirmation dialog: **Active scene only** or **All scenes**.

{% hint style="warning" %}
This permanently deletes baked lighting data and cannot be undone except through version control. \*\*Commit or back up your project first.\*\* Scenes that rely on \*\*real baked lightmaps\*\* (baked shadows / ambient occlusion) will look different afterwards — only skybox-lit scenes are visually identical.
{% endhint %}

***

### Properties

**Mode**

* Dropdown to select the desired environment mode: `Default`, `Dark`, or `White`.

When **Advanced Mode** is enabled:

* A hidden Skybox is activated, creating a more immersive environment by enhancing lighting and shadows.
* A sphere is added to hide the skybox and to show a uni-color background.

<figure><img src="/files/0CleGweab9MulCp0ndQF" alt="" width="375"><figcaption><p>Environment - Advanced Mode deactivated</p></figcaption></figure>

<figure><img src="/files/lGPb4D7LB634bJC9Yckq" alt="" width="375"><figcaption><p>Environment - Advanced Mode activated</p></figcaption></figure>

#### Floor

* **Size**:
  * Numeric input to specify the floor size in Meter.
* **Fade**:
  * Checkbox to enable or disable the fading effect on the floor.

***

### Customizing the Environment

The recommended way to customize the Environment Controller is by **overwriting the values of the real irtual prefab** in your scene. This approach ensures that your changes are scene-specific while maintaining compatibility with the RealVirtual framework.

#### Prefab Structure

Each visual setup is organized as a **sub-gameobject** within the prefab. These sub-gameobjects are activated dynamically based on the current **visual mode setting**. The three primary modes included are:

* **Dark Mode**
* **Default Mode**
* **White Mode**

Each mode contains the following key components:

**1. Sun**

* Represents the primary directional light source for the scene.
* Customize the **intensity, color, and angle** of the light for desired effects.

**2. Floor**

* Defines the material and rendering properties for the ground plane.
* Update the floor's texture, material properties, or color to match your scene's aesthetics.

**3. Sky**

* Manages the skybox or atmospheric effects.
* Customize the sky material to change the overall ambiance of the environment.

#### Effects and Post-Processing

Under the **Effects** section of each sub-gameobject, you will find settings related to **post-processing**. These can be tailored to adjust the mood, tone, and visual clarity of the scene. Common properties include:

* **Bloom**: Adjust intensity and threshold for glow effects.
* **Color Grading**: Modify contrast, saturation, and color tones.
* **Ambient Occlusion**: Enhance shadow details for better depth perception.
* **Motion Blur**: Add a sense of motion for dynamic scenes.
* **Vignette**: Focus viewer attention by darkening edges.

<figure><img src="/files/MnZvs00lgYkDmJ5uHrpA" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.realvirtual.io/components-and-scripts/game4automation/environment-controller.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
