# 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="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-a1172defa53836b7035f0e47a8bc4eff44b8927b%2Fenvironment-defaultmode.png?alt=media" alt="" width="375"><figcaption><p>Environment - Default Mode</p></figcaption></figure>

<figure><img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-2ad4283152a354ae29c608f0285bd5ed33fcfc27%2Fenvironment-darkmode.png?alt=media" alt="" width="375"><figcaption><p>Environment - Dark Mode</p></figcaption></figure>

<figure><img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-04efbda89940bbb03f8caaf145119dbe452afa12%2Fenvironment-whitemode.png?alt=media" alt="" width="375"><figcaption><p>Environment - White Mode</p></figcaption></figure>

***

### 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="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-4e17380a6cdfabfd9ff4c524a56b95a1b9536342%2Fenvironment-nonadvanced.png?alt=media" alt="" width="375"><figcaption><p>Environment - Advanced Mode deactivated</p></figcaption></figure>

<figure><img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-23d0826c3b00cef3fe119bb895302dc27feef10b%2Fenvironment-advanced.png?alt=media" 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="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-a6a0487a705f5cf72768650cca3c2fe03a2dbd9b%2Fenvironmentcontroller-effects.png?alt=media" alt=""><figcaption></figcaption></figure>
