Skip to content

Change parametrization of procedural metering mask #1080

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
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 @@ -90,7 +90,7 @@ To configure **Automatic Mode**, select the **Metering Mode**. This tells the Ca
| **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). |
| **Radii** | Sets the radii (horizontal and vertical) of the procedural mask, in terms of fraction of half the screen (i.e. 0.5 means a mask that stretch half of the screen in both directions). |
| **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. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ public sealed class Exposure : VolumeComponent, IPostProcessComponent
/// </summary>
public NoInterpVector2Parameter proceduralCenter = new NoInterpVector2Parameter(new Vector2(0.5f, 0.5f));
/// <summary>
/// Sets the radii of the procedural mask, in terms of fraction of the screen (i.e. 0.5 means a radius that stretch half of the screen).
/// Sets the radii of the procedural mask, in terms of fraction of half the screen (i.e. 0.5 means a mask that stretch half of the screen in both directions).
/// </summary>
public NoInterpVector2Parameter proceduralRadii = new NoInterpVector2Parameter(new Vector2(0.15f, 0.15f));
public NoInterpVector2Parameter proceduralRadii = new NoInterpVector2Parameter(new Vector2(0.3f, 0.3f));
/// <summary>
/// All pixels below this threshold (in EV100 units) will be assigned a weight of 0 in the metering mask.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,8 @@ internal void ComputeProceduralMeteringParams(HDCamera camera, out Vector4 proce
float screenDiagonal = 0.5f * (camera.actualHeight + camera.actualWidth);

proceduralParams1 = new Vector4(proceduralCenter.x, proceduralCenter.y,
m_Exposure.proceduralRadii.value.x * screenDiagonal,
m_Exposure.proceduralRadii.value.y * screenDiagonal);
m_Exposure.proceduralRadii.value.x * camera.actualWidth,
m_Exposure.proceduralRadii.value.y * camera.actualHeight);

proceduralParams2 = new Vector4(1.0f / m_Exposure.proceduralSoftness.value, LightUtils.ConvertEvToLuminance(m_Exposure.maskMinIntensity.value), LightUtils.ConvertEvToLuminance(m_Exposure.maskMaxIntensity.value), 0.0f);
}
Expand Down