> For the complete documentation index, see [llms.txt](https://docs.bestway.com.ua/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bestway.com.ua/editor/environment-editor/basic-knowledge-about-hdr.md).

# Basic knowledge about HDR

{% hint style="info" %}
You can open the Environment Editor by pressing the F6 key
{% endhint %}

## **Key components for HDR lighting**

The following sections must be enabled in the environment preset settings:

* eye\_adaptation - enabled
* tone\_mapping - enabled
* tone\_mapping - aces

The main HDR parameter is `target_exposure` in the `eye_adaptation` section.

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FagUER0vH3TUpSwn7O3Qc%2FEnvironment%20Editor.png?alt=media&amp;token=7858ab00-2665-41da-a87a-6b33511143c0" alt="" width="375"><figcaption><p>Key components for the HDR lighting</p></figcaption></figure>

## **Conditions for correct HDR operation**

For HDR to function properly, there must be light at varying brightness ranges, with screen brightness differing by at least 5-10 times.

The working range is from 0.001 to 10.

## **Lighting components**

<table><thead><tr><th width="326">Component</th><th>Description</th></tr></thead><tbody><tr><td>light.ambient_intensity</td><td>Intensity of ambient lighting that spreads evenly across the scene.</td></tr><tr><td>light.diffuse_intensity</td><td>Intensity of diffuse lighting that determines the brightness of surfaces facing the light source.</td></tr><tr><td>light.envmap_amount</td><td>Amount of light reflected from the environmental map, used for creating reflections.</td></tr><tr><td>light.environment_intensity</td><td>Intensity of lighting from the environment, including natural and reflected light.</td></tr><tr><td>haze.intensity</td><td>Intensity of haze or fog, adding an atmospheric effect and altering scene visibility.</td></tr><tr><td>HDR sky textures</td><td>Use of high dynamic range textures for the sky to achieve realistic light transitions.</td></tr><tr><td>Quadratic attenuation in light sources</td><td>A light attenuation formula that realistically distributes light as distance increases.</td></tr><tr><td>Speculars for all materials</td><td>Adjustment of specular properties for all materials, adding highlights and reflected light</td></tr></tbody></table>

{% hint style="info" %}
The final color for lighting parameters containing intensity (e.g., light.ambient, light.diffuse, haze.color, and others) is calculated using the formula:

`result_color = color * intensity`

The final brightness depends on the brightness of the color itself and the intensity parameter
{% endhint %}

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FRcK9BMAvbG1HxreVqPW5%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202024-05-16%20%D0%B2%2017.10.57.png?alt=media&amp;token=0becb785-3b8a-4b73-9900-6e3e6ce935d7" alt="" width="375"><figcaption><p><strong>Examples of lighting parameter settings, including color and its intensity</strong></p></figcaption></figure>

### **Real-life brightness levels**

<table><thead><tr><th>Parameter</th><th width="160">Light Intensity</th><th>Description</th></tr></thead><tbody><tr><td>candle</td><td>10</td><td>Imitation of candle light, creating a cozy atmosphere</td></tr><tr><td>cloud_at_night</td><td>0.00033</td><td>Dim lighting under a cloudy night sky</td></tr><tr><td>cloud_at_night (lit by moon)</td><td>0.0419</td><td>Cloudy night sky illuminated by the moon</td></tr><tr><td>frosted_bulb_60w</td><td>1200</td><td>Light from a 60-watt frosted bulb</td></tr><tr><td>monitor</td><td>3</td><td>Imitation of light from a monitor</td></tr><tr><td>moon_surface</td><td>30</td><td>Light mimicking the luminosity of the moon's surface</td></tr><tr><td>sky_cloudy</td><td>20</td><td>Light on a cloudy day</td></tr><tr><td>sky_day</td><td>60</td><td>Bright sunlight during the day</td></tr><tr><td>sky_night (lit by moon)</td><td>0.00085</td><td>Night light when illuminated by the moon</td></tr><tr><td>sky_night_dark</td><td>4e-006</td><td>Very dim night lighting</td></tr><tr><td>sky_night_noon</td><td>0.00124</td><td>Night lighting without additional light sources</td></tr><tr><td>sky_rise_skyline</td><td>0.0019</td><td>Dawn or dusk</td></tr><tr><td>star</td><td>0.00196</td><td>Light from a distant star</td></tr></tbody></table>

## Tonemapper settings

{% hint style="info" %}
Tonemapper settings should be the same across the entire project
{% endhint %}

If you need a specific frame appearance - use a LUT.

For understanding the operation of adaptation and HDR, it is very useful to enable the display of curves for HDR parameters using the console command `v_hdrHistogramOn 1`

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FGDtyi9MYAmwiegoJj7Qm%2Fimage.png?alt=media&amp;token=67c02fba-8f36-4338-9b3e-ac00da19d078" alt=""><figcaption><p>Fig 1. Tonemapper curve</p></figcaption></figure>

**Decoding Figure 1:**

* Red line - tonemapping curve (automatically calculated by the tonemapping formula and its parameters)
* Yellow line - brightness value selected by auto exposure
* Green lines - exposure\_min, exposure\_max
* Blue lines - horizontal brightness readings

## **Objects for testing color**

To test colors in game resources, there are 3 test entity located in the **service** folder of the **Entity Editor** \[1]:

* color\_checker\_gradient - for testing the display of monochrome gradients
* color\_checker\_kodak - for testing brightness levels
* color\_checker - for testing the transmission of standard shades

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FyVkoeZdFsfVUHGVGuEas%2Fimage.png?alt=media&amp;token=248793c0-9bbc-4442-9baa-33bf7696d00c" alt=""><figcaption></figcaption></figure>

Learn more about creating and configuring environment presets

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-type="content-ref"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td>Step-by-step guide to developing custom environment presets</td><td><a href="/editor/environment-editor/creating-environment-preset.md">Creating environment preset</a></td><td><a href="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FXqe0ZKqSICsAK0XgCyMC%2Fsplash_editor_3.jpg?alt=media&amp;token=ecb5bb0d-d794-4925-a780-f7d98f315d42">default_cover.jpg</a></td></tr><tr><td>Detailed instructions for fine-tuning environment presets</td><td><a href="/editor/environment-editor/setting-environment-preset-parameters.md">Setting Environment preset parameters</a></td><td><a href="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FXqe0ZKqSICsAK0XgCyMC%2Fsplash_editor_3.jpg?alt=media&amp;token=ecb5bb0d-d794-4925-a780-f7d98f315d42">default_cover.jpg</a></td></tr></tbody></table>
