Skip to content

First round of auto-exposure docs updates #858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ The HDRP Camera shares many properties with the [Standard Unity Camera](https://
| **Background Color** | Use the HDR color picker to select the color that the Camera uses to clear the screen before it renders a frame. The Camera uses this color if:You select **Color** from the **Background Type** drop-down.You select **Sky** from the **Background Type** drop-down and there is no valid sky for the Camera to use. |
| **Culling Mask** | Use the drop-down to set the Layer Mask that the Camera uses to exclude GameObjects from the rendering process. The Camera only renders Layers that you include in the Layer Mask. |
| **Volume Layer Mask** | Use the drop-down to set the Layer Mask that defines which Volumes affect this Camera. |
| **Volume Anchor Override** | Assign a Transform that the [Volume](Volumes.html) system uses to handle the position of this Camera. For example, if your application uses a third person view of a character, set this property to the character's Transform. The Camera then uses the post-processing and Scene settings for Volumes that the character enters.If you do not assign a Transform, the Camera uses its own Transform instead. |
| **Volume Anchor Override** | Assign a Transform that the [Volume](Volumes.html) system uses to handle the position of this Camera. For example, if your application uses a third person view of a character, set this property to the character's Transform. The Camera then uses the post-processing and Scene settings for Volumes that the character enters. If you do not assign a Transform, the Camera uses its own Transform instead. |
| **Probe Layer Mask** | Use the drop-down to set the Layer Mask that the Camera uses to exclude environment lights (light from Planar Reflection Probes and Reflection Probes). The Camera only uses Reflection Probes on Layers that you include in this Layer Mask. |
| **Occlusion Culling** | Enable the checkbox to make this Camera not render GameObjects that are not currently visible. For more information, see the [Occlusion Culling documentation](<https://docs.unity3d.com/Manual/OcclusionCulling.html>). |
| **Exposure Target** | The GameObject to center the [Auto Exposure](Override-Exposure.md) procedural mask around. |
| **Projection** | Use the drop-down to select the projection mode for the Camera.<br />&#8226; **Perspective**: The Camera simulates perspective when it renders GameObjects. This means that GameObjects further from the Camera appear smaller than GameObjects that are closer.<br />&#8226; **Orthographic**: The Camera renders GameObjects uniformly with no perspective. This means that GameObjects further from the Camera appear to be the same size as GameObjects that are closer. Currently, HDRP does not support this projection mode. If you select this projection mode, any HDRP feature that requires lighting does not work consistently. However, this projection mode does work consistently with [Unlit](Unlit-Shader.md) Materials. |
| **FOV Axis** | Use the drop-down to select the axis that you want the field of view to relate to.<br />&#8226; **Vertical**: Allows you to set the **Field of View** using the vertical axis.<br />&#8226; **Horizontal**: Allows you to set the **Field of View** using the horizontal axis.This property only appears when you select **Perspective** from the **Projection** drop-down. |
| **Field of View** | Use the slider to set the viewing angle for the Camera, in degrees.<br />This property only appears when you select **Perspective** from the **Projection** drop-down. |
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To work with physically-based lighting and Materials, you need to set up the Sce

| **Property** | **Description** |
| ------------ | ------------------------------------------------------------ |
| **Mode** | Use the drop-down to select the method that HDRP uses to process exposure: <br/>&#8226; [**Fixed**](#FixedProperties): Allows you to manually sets the Scene exposure.<br/>&#8226; [**Automatic**](#AutomaticProperties): Automatically sets the exposure depending on what is on screen.<br/>&#8226; [**Curve Mapping**](#CurveMappingProperties): Maps the current Scene exposure to a custom curve.<br/>&#8226; [**Use Physical Camera**](#UsePhysicalCameraProperties): Uses the current physical Camera settings to set the Scene exposure. |
| **Mode** | Use the drop-down to select the method that HDRP uses to process exposure: <br/>&#8226; [**Fixed**](#FixedProperties): Allows you to manually sets the Scene exposure.<br/>&#8226; [**Automatic**](#AutomaticProperties): Automatically sets the exposure depending on what is on screen.<br/>&#8226; [**Automatic Histogram**](#AutomaticHistogram): Extends Automatic exposure with histogram control.<br/>&#8226; [**Curve Mapping**](#CurveMappingProperties): Maps the current Scene exposure to a custom curve.<br/>&#8226; [**Use Physical Camera**](#UsePhysicalCameraProperties): Uses the current physical Camera settings to set the Scene exposure. |

<a name="FixedProperties"></a>

Expand Down Expand Up @@ -49,6 +49,22 @@ The human eye can function in both very dark and very bright areas. However, at
| **Mode** | Use the drop-down to select the method that HDRP uses to change the exposure when the Camera moves from dark to light and vice versa:<br />&#8226; **Progressive**: The exposure changes over the period of time defined by the **Speed Dark to Light** and **Speed Light to Dark** property fields.<br />&#8226; **Fixed**: The exposure changes instantly. Note: The Scene view uses **Fixed**. |
| **Speed Dark to Light** | Set the speed at which the exposure changes when the Camera moves from a dark area to a bright area.<br />This property only appears when you set the **Mode** to **Progressive**. |
| **Speed Light to Dark** | Set the speed at which the exposure changes when the Camera moves from a bright area to a dark area.<br />This property only appears when you set the **Mode** to **Progressive**. |
| **Target Mid Gray** | Sets the desired Mid gray level used by the auto exposure (i.e. to what grey value the auto exposure system maps the average scene luminance).<br/>Note that the lens model used in HDRP is not of a perfect lens, hence it will not map precisely to the selected value. |

<a name="AutomaticHistogram"></a>

### Automatic Histogram

The automatic histogram is an extension of the [**Automatic**](#AutomaticProperties) mode. In order to achieve a more stable exposure result, this mode calculates a histogram of the image which makes it possible exclude parts of the image from the exposure calculation. This is useful to discard very bright or very dark areas of the screen.

To control this process, in addition to the properties for **Automatic** mode, this mode includes the following properties:

#### Properties

| **Property** | **Description** |
| ------------------------- | ------------------------------------------------------------ |
| **Histogram Percentages** | Use this field to select the range of the histogram to consider for auto exposure calculations. The values for this field are percentiles. This means that, for example, if you set the low percentile to *X*, if a pixel has a lower intensity than (100-*X*)% of all the pixels on screen, HDRP discards it from the exposure calculation. Similarly, if you set the higher percentile to *Y*, it means that if a pixel has a higher intensity than *Y*%, HDRP discards it from the exposure calculation.<br />This allows the exposure calculation to discard unwanted outlying values in the shadows and highlight regions. |
| **Use Curve Remapping** | Specifies whether to apply curve mapping on top of this exposure mode or not. For information on curve mapping properties, see the [Curve Mapping section](#Curve Mapping). |

<a name="UsingAutomatic"></a>

Expand All @@ -67,6 +83,19 @@ To configure **Automatic Mode**, select the **Metering Mode**. This tells the Ca

- **Mask Weighted**: The Camera applies a weight to every pixel in the buffer then uses the weights to measure the exposure. To specify the weighting, this technique uses the Texture set in the **Weight Texture Mask** field. Note that, if you do not provide a Texture, this metering mode is equivalent to **Average**.

- **Procedural Mask**: The Camera applies applies a weight to every pixel in the buffer then uses the weights to measure the exposure. The weights are generated using a mask that is procedurally generated with the following parameters:

| **Property** | **Description** |
| --------------------------------- | ------------------------------------------------------------ |
| **Center Around Exposure target** | Whether the procedural mask will be centered around the GameObject set as Exposure Target in the [Camera](HDRP-Camera.html). |
| **Center** | Sets the center of the procedural metering mask ([0,0] being bottom left of the screen and [1,1] top right of the screen). Available only when **Center Around Exposure target** is disabled. |
| **Offset** | Sets an offset to where mask is centered . Available only when **Center Around Exposure target** is enabled. |
| **Radii** | Sets the radii (horizontal and vertical) of the procedural mask, in terms of fraction of the screen (i.e. 0.5 means a radius that stretches half of the screen). |
| **Softness** | Sets the softness of the mask, the higher the value the less influence is given to pixels at the edge of the mask. |
| **Mask Min Intensity** | All pixels below this threshold (in EV100 units) will be assigned a weight of 0 in the metering mask. |
| **Mask Max Intensity** | All pixels above this threshold (in EV100 units) will be assigned a weight of 0 in the metering mask. |



Next, set the **Limit Min** and **Limit Max** to define the minimum and maximum exposure values respectively. Move between light and dark areas of your Scene and alter each property until you find the perfect values for your Scene.

Expand Down Expand Up @@ -98,4 +127,45 @@ This mode mainly relies on the [Camera’s](https://docs.unity3d.com/Manual/clas

| **Property** | **Description** |
| ---------------- | ------------------------------------------------------------ |
| **Compensation** | Set the value that the Camera uses to compensate the automatically computed exposure value. This is useful if you want to over or under expose the Scene. This works similarly to how exposure compensation works on most cameras. |
| **Compensation** | Set the value that the Camera uses to compensate the automatically computed exposure value. This is useful if you want to over or under expose the Scene. This works similarly to how exposure compensation works on most cameras. |

<a name="DebugModes"></a>

### Exposure Debug Modes

HDRP offers several debug modes to help you to set the correct exposure for your scene. You can activate these in the [Debug window](Render-Pipeline-Debug-Window.md).

#### Scene EV<sup>100</sup> Values

This debug mode shows a heat map of the scene luminance converted to [EV<sup>100</sup>](Physical-Light-Units.md#EV) units across the screen. This is useful to determine the distribution of intensity across the screen which can help you to identify whether you have set the right exposure limits. It is also an informative view on how the brightness is distributed in your scene.

Furthermore, this debug view shows the numerical value of the pixel at the center of the screen. It also displays this value in the heatmap indicator at the bottom of the screen to show where it is relative to the full range.


![](Images/Override-Exposure4.png)



#### Histogram View

In **Automatic Histogram** mode, if may be difficult to set the upper and lower brightness percentages without a references. To help with this, HDRP includes the Histogram debug view which shows an overview of what the scene brightness distribution looks like.

![](Images/Override-Exposure5.png)

There are two places this debug mode displays information. On the screen and on a histogram at the bottom of the screen. Both of these methods show whether the exposure algorithm accepts or excludes a particular brightness value. To do this on the screen, the debug mode overlays excluded pixels with a particular color. The histogram draws bars that use the same colors to show the range of brightness values and their validity. The colors correspond to:

* **Blue**: The brightness value is below the lower percentile and is excluded.
* **Red**: The brightness value is above the higher percentile and is excluded.
* **White**: The brightness value is between the upper and lower percentiles and is accepted.

At the bottom of the histogram, a yellow arrow points to the target exposure, while a grey arrow points at the current exposure.

If you enable the **Show Tonemap Curve** option, the debug view overlays the curve used to tonemap to the histogram view.

By default, the values on the x-axis are fixed, however, you can also make the histogram fix around the current exposure. To do this, enable the **Center Around Exposure** option. This can be useful to fix the tonemap curve overlay and have a clearer view on how the scene distributes under that curve.

#### Metering Weighted

The Metering Weighted debug view displays the scene alongside a picture of what the scene looks like after HDRP weights it with the metering mask. This is particularly useful to set up the procedural metering masks or determine the right texture mask.

![](Images/Override-Exposure6.png)
Loading