# Setting Environment preset parameters

{% hint style="info" %}
The Environment Editor window can be opened by pressing the F6 key
{% endhint %}

## Light

### Parameters of the `light` block

<figure><img src="/files/0nqLl0DqST48FLO9p1t8" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="274">Parameter</th><th width="310">Description</th><th>Note</th></tr></thead><tbody><tr><td><code>direction</code></td><td>Direction from which the Sun shines</td><td></td></tr><tr><td><code>ambient</code></td><td>Color of ambient light</td><td>Parameter for <strong>Phong</strong> only</td></tr><tr><td><code>ambient_intensity</code></td><td>Intensity of ambient light</td><td>Parameter for <strong>Phong</strong> only</td></tr><tr><td><code>diffuse</code></td><td>Color of sunlight</td><td></td></tr><tr><td><code>diffuse_intensity</code></td><td>Intensity of sunlight</td><td></td></tr><tr><td><code>specular_intensity</code></td><td>Intensity of specular highlights</td><td></td></tr><tr><td><code>environment_intensity</code></td><td>Intensity of sky lighting</td><td>Parameter for <strong>PBR</strong> only</td></tr><tr><td><code>lights_intensity</code></td><td>Intensity multiplier for local light sources</td><td></td></tr><tr><td><code>envmap_amount</code></td><td>Sky lighting brightness in some schemes</td><td></td></tr><tr><td><code>night</code></td><td>Day or night for gameplay</td><td></td></tr><tr><td><code>night_vision</code></td><td>Night vision range multiplier for soldiers</td><td></td></tr><tr><td><code>color_saturation</code></td><td>Color saturation with values [0..2]: <br>0 - gray; <br>1 - normal; <br>2 - oversaturated</td><td></td></tr><tr><td><code>fx_additive_intensity</code></td><td>Intensity for <strong>additive</strong> effects</td><td></td></tr><tr><td><code>fx_blend_intensity</code></td><td>Intensity for <strong>blend</strong> effects</td><td></td></tr></tbody></table>

{% hint style="warning" %}
The Sun's position on the sky texture and the light direction must match. \
The Sun's position is adjusted in the `sky` block using the `relative_rotation` parameter.
{% endhint %}

### Parameters for unit highlighting

Used to `highlight` active units on the map (own/allied/enemy) to make them clearly visible.

Unit highlighting works by modifying the main light source settings (Sun) and adding additional lighting.

**Pros**: units are clearly visible on the map\
**Cons**: disrupts normal lighting

#### Highlight option

Highlight units can be toggled in the Options:

1. Open the Game tab.
2. Check the Highlight units box.

Highlight units can be toggled in the Options:

1. Open the Game tab.
2. Check the `Highlight Units` box.

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

#### Highlight parameters in the Environment preset

<figure><img src="/files/7LHjkJ2ce9n95p3IQnY6" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Parameters that do not work for [PBR](/documentation/textures-and-materials/physically-based-rendering/pbr-parameters.md#pbr-lighting-model-components):

* `ambient_bounced`
* `rim_intensity`
* `rim_glossiness`
  {% endhint %}

| Parameter              | Description                                                                                                                                                                                                | Value Range |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| `brightness`           | <p>Used to calculate <code>ambient</code>/<code>diffuse</code> in the new light source for unit highlighting. <br>Base colors are taken from light/<code>ambient</code> and light/<code>diffuse</code></p> | \[0..100]   |
| `ambient_bounced`      | <p>Light comes from below and sides. <br>Base color - light/<code>ambient</code></p>                                                                                                                       | \[0..100]   |
| `rim_intensity`        | Light intensity perpendicular to the camera direction, highlighting object contours                                                                                                                        | \[0..1]     |
| `rim_glossiness`       | How sharp or blurred the highlight spot edges are                                                                                                                                                          | \[0..1]     |
| `highlight_brightness` | <p>New ambient when hovering over a unit. <br>Base color - light/<code>ambient</code></p>                                                                                                                  | \[0..100]   |

**Brightness value ranges for the** `brightness`, `ambient_bounced`, `highlight_brightness` parameters:

<table><thead><tr><th width="182">Value Ranges</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>Black color</td></tr><tr><td>[1..49]</td><td>Midway between black and base color </td></tr><tr><td>50</td><td>Does not change the base color</td></tr><tr><td>[51..99]</td><td>Midway between base color and white</td></tr><tr><td>[100]</td><td>Shift towards white</td></tr></tbody></table>

## Sky

The parameter block for configuring the sky.

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

{% hint style="warning" %}
The position of the Sun on the sky texture and the light direction must match.
{% endhint %}

| Parameter                 | Description                                             | Note                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| enable                    | Enabled/Disabled                                        |                                                                                                                                                                                                                                                                                                                                                           |
| mesh                      | Sky model                                               | <p>Different models can be used, but it is recommended to use the <code>sky\_farspace</code> model.</p><p>In the <code>sky\_farspace</code> model: </p><p>- alpha is used for smooth transition into haze; </p><p>- parameters from the sky material are output to the <code>sky</code> block; </p><p>- the second set of UVs can be used for clouds.</p> |
| color                     | Color for tinting the sky texture                       | Default is white                                                                                                                                                                                                                                                                                                                                          |
| global\_environment       | Main sky texture                                        |                                                                                                                                                                                                                                                                                                                                                           |
| relative\_rotation        | Sky rotation, in radians                                |                                                                                                                                                                                                                                                                                                                                                           |
| textures/clouds\_mask     | Mask for gradually fading clouds to zero visibility     | It is recommended to make the texture in RF16 format to avoid banding. The mask works well, and it is recommended not to change it.                                                                                                                                                                                                                       |
| textures/clouds           | Texture of clouds floating in the sky                   |                                                                                                                                                                                                                                                                                                                                                           |
| clouds\_scale             | Scale of the clouds                                     |                                                                                                                                                                                                                                                                                                                                                           |
| clouds\_pan\_y            | Speed of cloud movement across the sky along the y-axis |                                                                                                                                                                                                                                                                                                                                                           |
| clouds\_pan\_x            | Speed of cloud movement across the sky along the x-axis |                                                                                                                                                                                                                                                                                                                                                           |
| clouds\_opacity           | Cloud density                                           | \[0..1]                                                                                                                                                                                                                                                                                                                                                   |
| clouds\_opacity2          | Cloud density                                           | \[0..1]                                                                                                                                                                                                                                                                                                                                                   |
| clouds\_color             | Tint of the clouds                                      |                                                                                                                                                                                                                                                                                                                                                           |
| clouds\_color\_luminosity | Brightness of the clouds                                |                                                                                                                                                                                                                                                                                                                                                           |
| environment\_luminosity   | Sky brightness multiplier                               |                                                                                                                                                                                                                                                                                                                                                           |
| tone                      | Overall tint of the sky and clouds                      |                                                                                                                                                                                                                                                                                                                                                           |
| tone\_luminosity          | Overall brightness multiplier for the sky and clouds    |                                                                                                                                                                                                                                                                                                                                                           |
| global\_luminosity        | Overall brightness multiplier for the sky and clouds    |                                                                                                                                                                                                                                                                                                                                                           |
| haze\_falloff\_start      | Start of fog application at the lower edge of the sky   |                                                                                                                                                                                                                                                                                                                                                           |
| haze\_falloff\_end        | End of fog application at the lower edge of the sky     |                                                                                                                                                                                                                                                                                                                                                           |
| haze\_falloff\_power      | Fog intensity                                           |                                                                                                                                                                                                                                                                                                                                                           |

{% hint style="info" %}
To prevent the color from degrading into white or gray, its brightness should be in a wide range. For this, HDR textures are used for the sky.
{% endhint %}

{% hint style="info" %}
Sky brightness can be adjusted with the global\_luminosity parameter or by changing the brightness in the texture itself.
{% endhint %}

**Recommended ranges for HDR sky textures**:

* bright areas: \[1.0..2.0]
* dark areas: \[0.001..0.01]

Tool for converting HDRI textures to cubemap versions: [HDRI to CubeMap](https://matheowis.github.io/HDRI-to-CubeMap/).

## Weather settings

<figure><img src="/files/GjmIeaRgL7NsvDSiZICf" alt="" width="563"><figcaption><p>Weather settings</p></figcaption></figure>

### Wind

Creating wind effect in the game.

**Wind parameters:**

<table data-header-hidden><thead><tr><th width="188">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>direction</code></td><td>Wind direction. <br>Affects the direction of visual effects (vfx) and the swaying direction of trees</td></tr><tr><td><code>power</code></td><td><p>Wind strength is measured on the Beaufort scale:</p><ul><li>0: No wind (calm)</li><li>10: Storm-level wind strength</li></ul><p>*Values above 10 are not used in the wind settings.</p></td></tr></tbody></table>

### Haze

Creates a fogging effect at the edges of visibility. \
Used to hide objects beyond the visibility range and at the edges of the map.

**Haze parameters:**

<table data-header-hidden><thead><tr><th width="185">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>enabled</code></td><td>Enabled/Disabled</td></tr><tr><td><code>color</code></td><td>Haze color</td></tr><tr><td><code>intensity</code></td><td>Fog brightness. Also used for HDR sky. <br>To avoid fog glowing, this parameter should be reduced</td></tr><tr><td><code>start</code></td><td>Start of the haze in game units</td></tr><tr><td><code>end</code></td><td>Maximum haze density in game units</td></tr></tbody></table>

### Weather

Includes weather effects such as snow or rain.

**Weather parameters:**

<table data-header-hidden><thead><tr><th width="186">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>enable</code></td><td>Toggles weather effects on/off</td></tr><tr><td><code>density</code></td><td>Density of the weather effects</td></tr><tr><td><code>rain</code></td><td>Indicates whether it is raining</td></tr><tr><td><code>fx</code></td><td>Specifies the visual effect to display</td></tr><tr><td><code>sound</code></td><td>Selects the sound effect (sfx) for weather phenomena like rain or snow</td></tr></tbody></table>

### Thunder

Thunder and lightning effects.

**Thunder parameters:**

<table data-header-hidden><thead><tr><th width="183">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>enable</code></td><td>Enables/disables thunder and lightning</td></tr><tr><td><code>interval</code></td><td>Range for random selection of thunder and lightning intervals, in seconds</td></tr><tr><td><code>color</code></td><td>Color of the lightning</td></tr><tr><td><code>sound</code></td><td>Sound to be played after a lightning strike</td></tr></tbody></table>

## Additional visual effects

### Video Overlay

`Video Overlay` refers to the process of displaying a video on top of the existing visual content. This means that the video appears superimposed on the current game or application visuals. \
It is used for various purposes, such as adding special effects, informational videos, or cinematic sequences without interrupting the main content.

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

<table data-header-hidden><thead><tr><th width="189">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>enable</code></td><td>Enables/disables the video overlay</td></tr><tr><td><code>file</code></td><td>Path to the video file to be overlaid</td></tr><tr><td><code>color</code></td><td>Tint color for the video overlay</td></tr></tbody></table>

### Lens Flare

`Lens Flare` refers to visual artifacts that occur when a bright light source, such as the sun, shines directly into a camera lens, causing light to scatter and create various shapes and patterns. In a game engine, lens flare effects are used to simulate this phenomenon, adding realism and visual appeal to scenes where the sun or other bright light sources are present. This effect can enhance the immersive experience by mimicking how cameras and the human eye perceive intense light sources.

<table data-header-hidden><thead><tr><th width="198">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>enable</td><td>Enables/disables the lens flare effect</td></tr><tr><td>preset</td><td>Name of the configuration file with sprites located in the <code>resource\set\lens_flare</code> folder</td></tr><tr><td>brightness</td><td>Brightness of the lens flare effect</td></tr><tr><td>fade</td><td>Time for the lens flare effect to appear when sunlight is on the screen and disappear when the sun is off the screen</td></tr></tbody></table>

## Post Process

Post-processes in lighting are effects and techniques applied after the main scene rendering to enhance the visual quality of lighting, add realism, and stylize the image.

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

### Eye Adaptation

Automatic brightness adjustment of the image

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

<table><thead><tr><th width="257">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>enabled</code></td><td>Enabled/disabled</td></tr><tr><td><code>target_exposure</code></td><td>Increase/decrease the image brightness before applying the tone mapping curve</td></tr><tr><td><code>exposure_min</code></td><td>Minimum exposure value, below which the image brightness will not decrease. Maintains dark scenes properly dark</td></tr><tr><td><code>exposure_max</code></td><td>Maximum exposure value, above which the image brightness will not increase. Helps prevent overexposure and detail loss in bright scenes. Can be used to create controlled-bright effects.</td></tr><tr><td><code>rate</code></td><td>Brightness adaptation speed</td></tr><tr><td><code>fix_exposure</code></td><td>Ignore image brightness data for exposure calculation</td></tr><tr><td><code>fix_whitepoint</code></td><td>Ignore image brightness data for white point calculation. Does not work with ACES tonemapper</td></tr></tbody></table>

{% hint style="info" %}
The exposure\_min and exposure\_max parameters are used to control the brightness range of the scene during automatic exposure adaptation (eye adaptation). These parameters help maintain the visual integrity of the scene under various lighting conditions.
{% endhint %}

### Tone Mapping

Tone Mapping is the process of converting HDR brightness range to LDR range for proper display on standard screens. HDR images contain a wider range of bright and dark values than standard displays can reproduce. Tone Mapping helps preserve details and contrast in these images when displayed on a screen.

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

<table><thead><tr><th width="154">Parameter</th><th width="401">Description</th><th>Note</th></tr></thead><tbody><tr><td>enabled</td><td>Enables or disables the use of tonemapper. <br>If disabled, colors in the [0..1] range are directly output to the screen</td><td></td></tr><tr><td>aces</td><td>Enables the standard ACES tonemapper, which emulates film shooting. In ACES mode, all curve parameters are ignored.</td><td>Should be enabled in lighting presets for MoWII.</td></tr></tbody></table>

{% hint style="info" %}
Achieving the desired effect is usually possible by adjusting the `target_exposure` parameter in the [eye\_adaptation](#eye-adaptation) block or using [LUT](#lut).
{% endhint %}

When the aces option is disabled, the manual tone mapping parameters become available.

<figure><img src="/files/ayEbkpjowfyywHrJ5YLu" alt=""><figcaption><p>Example of configuring tone mapping parameters in the Environment Editor</p></figcaption></figure>

**Histogram Explanation:**

* **Toe**: The lower bend of the curve
* **Shoulder**: The upper bend of the curve
* **Linear**: The straight part connecting the toe and shoulder

**The tone mapping curve parameters**

<table><thead><tr><th>Parameter</th><th width="297">Description</th><th>Note</th></tr></thead><tbody><tr><td><code>white_point</code></td><td>Intensity of the HDR scene corresponding to white in the resulting LDR image</td><td></td></tr><tr><td><code>linear_angle</code></td><td>Slope of the linear part of the curve</td><td>Contrast in midtones</td></tr><tr><td><code>shoulder_length</code></td><td>Defines the shape of the <code>shoulder</code></td><td>Contrast in highlights</td></tr><tr><td><code>shoulder_strength</code></td><td>Defines the steepness of the <code>shoulder</code></td><td>Contrast in highlights</td></tr><tr><td><code>toe_numerator</code> and <code>toe_denominator</code></td><td>Define the shape of the <code>toe</code></td><td>Contrast in shadows</td></tr><tr><td><code>toe_strength</code></td><td>Defines the steepness of the <code>toe</code></td><td>Regulates contrast in shadows</td></tr></tbody></table>

The influence of each parameter on the output brightness overlaps.\
&#x20;For example, adjusting the `toe` parameter will also affect the midtones, while adjusting the `shoulder_strength` will affect the entire curve to varying degrees. \
Therefore, a sequential adjustment of a series of parameters is necessary (`white_point` -> `linear_angle` -> `shoulder` -> `toe`).

During the adjustment process, there may be situations where intermediate parameter changes result in incorrect image display, making it difficult to evaluate their impact. \
Therefore, the editor includes a histogram feature that displays the range of incoming brightness and the function of converting HDR to LDR. This helps visualize the impact of parameters on the tone mapping process during intermediate adjustment stages. The histogram components in the editor can be enabled via console commands.

#### Console command parameters for histogram

<table><thead><tr><th width="335">Console Command</th><th>Description</th><th>Note</th></tr></thead><tbody><tr><td><code>v_hdrHistogramOn [0 | 1]</code></td><td>Disables/Enables the histogram display</td><td>Default is 0</td></tr><tr><td><code>v_hdrHistogramLinearRange</code></td><td>Sets the scale of incoming brightness</td><td>0 - linear, <br>1 - logarithmic <br>(default is 0)</td></tr><tr><td><code>v_hdrHistogramFixedLumRange</code></td><td>Maximum incoming brightness</td><td>Default is 0, which sets the maximum scale equal to the scene's maximum brightness if adaptation is enabled. Otherwise, the maximum brightness of the scene must be set manually using this command.</td></tr><tr><td><code>v_hdrHistogramScaleBinHeight</code></td><td>Scales the height of the histogram bins</td><td>0 - no scaling</td></tr></tbody></table>

### Glare

Glare around bright areas of the screen

<table><thead><tr><th width="188">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>threshold</code></td><td>Brightness threshold above which glare appears</td></tr><tr><td><code>scale</code></td><td>Glare intensity adjustment</td></tr></tbody></table>

### Blue Shift

The image becomes gray in unlit areas, useful for night maps

<table><thead><tr><th width="197">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>enabled</code></td><td>Enable/Disable</td></tr><tr><td><code>threshold</code></td><td>Brightness threshold at which the transition to gray starts</td></tr></tbody></table>

### Depth of Field

Simulates the work of a camera.

<figure><img src="/files/6w6exDt8ivYzuaY8YZPr" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="166">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>enable</code></td><td>Enable/Disable</td></tr><tr><td><code>focus</code></td><td>Distance from the camera to the center of the focus area</td></tr><tr><td><code>width</code></td><td>Width of the focus area</td></tr><tr><td><code>far</code></td><td>Distance from the far edge of the focus area</td></tr><tr><td><code>near</code></td><td>Distance from the near edge of the focus area</td></tr><tr><td><code>blur</code></td><td>Level of blurriness for areas outside the focus zone</td></tr><tr><td><code>smooth</code></td><td>Smooth transition between sharp and blurry areas</td></tr></tbody></table>

<figure><img src="/files/Q8x6sL4RZUtKVKpT6Ff4" alt="" width="563"><figcaption></figcaption></figure>

### SSAO

SSAO stands for Screen Space Ambient Occlusion. It emulates shadowing at surface intersections.

| Parameter | Description                     |
| --------- | ------------------------------- |
| enable    | Enable/Disable                  |
| standard  | Standard or extended parameters |

### LUT

Instead of brightness, contrast, saturation, and tone modifiers, image adjustment is implemented via texture.

The reference texture that does not alter colors when used is called `lut_default.tga`.

## Local Light sources

The brightness of local light sources is influenced by the global light\_intensity parameter. The brightness parameters are multiplied when calculating the resulting brightness of local light sources.

| Parameter   | Description                                             | Value Range           |
| ----------- | ------------------------------------------------------- | --------------------- |
| intensity   | Sets the brightness of the center of the light          |                       |
| radius      | How far the light reaches                               |                       |
| compression | Compression of the attenuation curve towards the center | 2..100 (default is 2) |

**Examples of attenuation curves**

* X-axis: normalized distance from 0 to 1 to the center
* Y-axis: normalized intensity from 0 to 1

| <p><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXehC_n8xBZaCKE30zmfXK8kxmPUDBwIfWAhen1U_BMwrDPOD1WBAbu8QVZFl2BP7JF5HE1GtpJ0AUjwpAwJzBUyp0eczpr8QfdrobR0ysHhiDKbVmLjf5lkvwEw2E1dp_47Xh4wXmXBE0P447enD7OHWhk?key=AvjlGCEv98DkJLJw2y3z_g" alt=""></p><p>compression = 2</p> | <p><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXffBpD0kLIuE5J0nBoMav6a8tw4rVtgcYPoI2AVC3uC4IP56zDfnwUmiFR2O_y5T6rVP9xpVrx_OgbGacSY_Xc2eUY5yzEC_O89PdZ-gRVE71bS35urtyW9svBBWG_0W49SDaEqIMdGRy25VBLtTlMWSAQk?key=AvjlGCEv98DkJLJw2y3z_g" alt=""></p><p>compression = 16</p> | <p><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcbONkG5-HbKmvJCvQWbtwC6hDT5C0GYxbGg4VmlkgzZ5O3txiJKgpaSaZBpk_90cc7bdYa7N1VeJMmhhs9rv0zNfjIVtlY-irDRRPOQZbqQeBCGH3qu_wfS6fYr-WVpHtcuBJkiz4TQjrltgKI-2c-htE?key=AvjlGCEv98DkJLJw2y3z_g" alt=""></p><p>compression = 100</p> |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |


---

# Agent Instructions: 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:

```
GET https://bestway-1.gitbook.io/documentation/editor/environment-editor/setting-environment-preset-parameters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
