Skip to content

Commit 2d7d2b6

Browse files
markg-unityEvergreen
authored andcommitted
DOCG-5303 Add HDRP 2023.3 APV features
- Add HDRP-only APV features to the Unity 6 Preview manual - Migrate the work done in the URP manual in https://github.cds.internal.unity3d.com/unity/unity/pull/46008/files, to improve the structure and documentation for sky occlusion Jira ticket: https://jira.unity3d.com/browse/DOCG-5303
1 parent b360ee9 commit 2d7d2b6

12 files changed

+131
-63
lines changed

Packages/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@
8282
* [Display Adaptive Probe Volumes](probevolumes-showandadjust.md)
8383
* [Configure the size and density of Adaptive Probe Volumes](probevolumes-changedensity.md)
8484
* [Bake multiple scenes together with Baking Sets](probevolumes-usebakingsets.md)
85-
* [Bake different lighting setups with Lighting Scenarios](probevolumes-bakedifferentlightingsetups)
85+
* [Changing lighting at runtime](change-lighting-at-runtime.md)
86+
* [Choose how to change lighting at runtime](probevolumes-understand-changing-lighting-at-runtime.md)
87+
* [Bake different lighting setups with Lighting Scenarios](probevolumes-bakedifferentlightingsetups.md)
88+
* [Update light from the sky at runtime with sky occlusion](probevolumes-skyocclusion.md)
8689
* [Streaming](probevolumes-streaming.md)
8790
* [Fix issues with Adaptive Probe Volumes](probevolumes-fixissues.md)
88-
* [Sky Occlusion](probevolumes-skyocclusion.md)
8991
* [Adaptive Probe Volume Inspector window reference](probevolumes-inspector-reference.md)
9092
* [Adaptive Probe Volumes panel reference](probevolumes-lighting-panel-reference.md)
9193
* [Adaptive Probe Volumes Options Override reference](probevolumes-options-override-reference.md)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changing lighting at runtime
2+
3+
You can change how objects use the baked data in Adaptive Probe Volumes, to create lighting that changes at runtime. For example, you can turn the lights on and off in a scene, or change the time of day.
4+
5+
| Page | Description |
6+
|-|-|
7+
| [Choose how to change lighting at runtime](probevolumes-understand-changing-lighting-at-runtime.md) | Choose whether to use Lighting Scenarios or sky occlusion. |
8+
| [Bake different lighting setups with Lighting Scenarios](probevolumes-bakedifferentlightingsetups.md) | Use multiple Lighting Scenarios to store baking results for different scene setups, and switch or blend between them at runtime. |
9+
| [Update light from the sky at runtime with sky occlusion](probevolumes-skyocclusion.md) | Sky occlusion means that when a GameObject samples a color from the sky, Unity dims the color if the light can't reach the GameObject. |

Packages/com.unity.render-pipelines.high-definition/Documentation~/probevolumes-adjustment-volume-component-reference.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ Refer to the following for more information about using the Probe Adjustment Vol
3939
<li><strong>Apply Virtual Offset:</strong> Change the position Light Probes use when sampling the lighting in the scene during baking. Refer to <a href="probevolumes-fixissues.md#adjust-virtual-offset">Adjust Virtual Offset</a> for more information.</li>
4040
<li><strong>Override Virtual Offset Settings:</strong> Override the biases HDRP uses during baking to determine when Light Probes use Virtual Offset, and calculate sampling positions. Refer to <a href="probevolumes-fixissues.md#adjust-virtual-offset">Adjust Virtual Offset</a> for more information</li>
4141
<li><strong>Intensity Scale:</strong> Override the intensity of probes to brighten or darken affected areas.</li>
42-
<li><strong>Override Sky Direction:</strong> Override the direction used for sampling the ambient probe when using Sky Occlusion.</li>
43-
<li><strong>Override Sample Count:</strong> Override the sample count used to compute Lighting and Sky Occlusion.</li>
42+
<li><strong>Override Sky Direction</strong> Override the directions Unity uses to sample the ambient probe, if you enable <a href="probevolumes-skyocclusion.md">sky occlusion</a>.</li>
43+
<li><strong>Override Sample Count:</strong> Override the number of samples Unity uses for Adaptive Probe Volumes.</li>
4444
</ul>
4545
</td>
4646
</tr>
@@ -79,5 +79,39 @@ Refer to the following for more information about using the Probe Adjustment Vol
7979
<p>Change the brightness of all probes covered by the Probe Volumes Adjustment Volume component. Use this sparingly, because changing the intensity of probe data can lead to inconsistencies in the lighting. This option only appears if you set <strong>Mode</strong> to <strong>Intensity Scale</strong>.</p>
8080
</td>
8181
</tr>
82+
<tr>
83+
<td><strong>Preview Probe Adjustments</strong></td>
84+
<td colspan="2">
85+
<p>Preview the effect of the adjustments in the Scene view and the <a href="rendering-debugger-window-reference.md">Rendering Debugger</a>.</p>
86+
</td>
87+
</tr>
88+
<tr>
89+
<td><strong>Bake Probe Volumes</strong></td>
90+
<td colspan="2">
91+
<p>Bake the Adaptive Probe Volumes with the adjustments.</p>
92+
</td>
93+
</tr>
8294
</tbody>
8395
</table>
96+
97+
## Override Sample Count properties
98+
99+
These properties are visible only when you set **Mode** to **Override Sample Count**.
100+
101+
### Probes
102+
103+
| Property | Description |
104+
|-|-|
105+
| **Direct Sample Count** | Set the number of samples Unity uses to calculate direct lighting. |
106+
| **Indirect Sample Count** | Set the number of samples Unity uses to calculate indirect lighting. |
107+
| **Sample Count Multiplier** | Set a value to multiply **Direct Sample Count** and **Indirect Sample Count** by. |
108+
| **Max Bounces** | Set the maximum number of times Unity bounces light off objects when it calculates indirect lighting. |
109+
110+
### Sky Occlusion
111+
112+
These properties only have an effect if you enable sky occlusion. Refer to [Update light from the sky at runtime with sky occlusion](probevolumes-skyocclusion.md) for more information.
113+
114+
| Property | Description |
115+
|-|-|
116+
| **Sample Count** | Set the number of samples Unity uses to calculate a sky occlusion value for each probe. |
117+
| **Max Bounces** | Set the maximum number of times Unity bounces light off objects when it calculates a sky occlusion value. |

Packages/com.unity.render-pipelines.high-definition/Documentation~/probevolumes-concept.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Adaptive Probe Volumes have the following advantages:
2121
- Because Adaptive Probe Volumes can cover a whole scene, screen space effects can fall back to Light Probes to get lighting data from GameObjects that are off-screen or occluded. Refer to [Screen Space Global Illumination](Override-Screen-Space-GI.md) for more information.
2222
- Unity can use the data in Adaptive Probe Volumes to adjust lighting from Reflection Probes so it more closely matches the local environment, which reduces the number of Reflection Probes you need. Refer to [Frame Settings properties](frame-settings-reference.md).
2323
- Adaptive Probe Volumes include [streaming](probevolumes-streaming.md) functionality to support large open worlds.
24-
- Adaptive Probe Volumes support [Sky Occlusion](probevolumes-skyocclusion.md) for dynamic sky relighting at runtime.
24+
- You can use Adaptive Probe Volumes to [update light from the sky at runtime with sky occlusion](probevolumes-skyocclusion.md).
2525

2626
![](Images/probevolumes-per-pixel.png)<br/>
2727
The car model is made up of separate GameObjects. The left scene uses Light Probe Groups, which use per-object lighting, so each part of the car samples a single blended probe value. The right scene uses Adaptive Probe Volumes, which use per-pixel lighting, so each part of the car samples its nearest probes. This image uses the ArchVizPRO Photostudio HDRP asset from the Unity Asset Store.

Packages/com.unity.render-pipelines.high-definition/Documentation~/probevolumes-lighting-panel-reference.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ This section appears only if you enable **Lighting Scenarios** under **Light Pro
9494
||| **Not Baked** | An information icon appears if you haven't baked any lighting data for the active Lighting Scenario.|
9595
||| **Not Loaded** | An information icon appears if scenes in the Baking Set aren't currently loaded in the Hierarchy window, so HDRP can't determine the Lighting Scenario status. |
9696

97+
## Sky Occlusion Settings
98+
99+
| **Property** | **Description** |
100+
|-|-|
101+
| **Sky Occlusion** | Enable [sky occlusion](probevolumes-skyocclusion.md). |
102+
| **Samples** | Set the number of samples Unity uses to calculate the light each probe receives from the sky. Higher values increase the accuracy of the sky occlusion data, but increasing baking time. The default value is 2048. |
103+
| **Bounces** | Set the number of times Unity bounces light from the sky off objects when calculating the sky occlusion data. Higher values increase the accuracy of the sky occlusion data, but increase baking time. Use higher values if objects block the direct view from probes to the sky. The default value is 2. |
104+
| **Albedo Override** | Set the brightness of the single color Unity uses to represent objects the sky light bounces off, instead of the actual color of the objects. Higher values brighten the baked sky occlusion lighting. The default value is 0.6. |
105+
| **Sky Direction** | Enable Unity storing and using more accurate data about the directions from probes towards the sky. Refer to [Enable more accurate sky direction data](probevolumes-skyocclusion.md#enable-more-accurate-sky-direction-data) for more information. |
106+
97107
## Probe Invalidity Settings
98108

99109
<table>

Packages/com.unity.render-pipelines.high-definition/Documentation~/probevolumes-options-override-reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ Refer to [Fix issues with Adaptive Probe Volumes](probevolumes-fixissues.md) for
1717
| **Leak Reduction Mode** | Enable to choose the method Unity uses to reduce leaks. Refer to [Fix light leaks](probevolumes-fixissues.md#fix-light-leaks).<br/>Options:<br/>&#8226; **None**: No leak reduction.<br/>&#8226; **Validity Based**: Prevent invalid Light Probes from contributing to the lighting result.<br/>&#8226; **Validity and Normal Based**: Prevent invalid Light Probes from contributing to the lighting result, and give Light Probes more weight than others based on the GameObject pixel's sampling position.
1818
| **Min Valid Dot Product Value** | Enable to make HDRP reduce a Light Probe's influence on a GameObject if the direction towards the Light Probe is too different to the GameObject's surface normal direction. The value is the minimum [dot product](https://docs.unity3d.com/ScriptReference/Vector3.Dot.html) between the two directions where HDRP will reduce the Light Probe's influence. |
1919
| **Occlusion Only Reflection Normalization** | Enable to limit Reflection Probe Normalization so it only decreases the intensity of reflections. Keep this enabled to reduce light leaks. Refer to [Frame Settings](frame-settings-reference.md#lighting). |
20+
| **Intensity Multiplier** | Set the strength of the light contribution from Adaptive Probe Volumes. A value of 0 means Unity doesn't use the Adaptive Probe Volume data. |
21+
| **Sky Occlusion Intensity Multiplier** | Set the strength of the light contribution from sky occlusion data in Adaptive Probe Volumes, if you enable [sky occlusion](probevolumes-skyocclusion.md). |
Lines changed: 41 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,61 @@
1-
# Sky Occlusion
1+
# Update light from the sky at runtime with sky occlusion
22

3-
Sky Occlusion stores the amount of lighting from the Sky affecting probes in an Adaptive Probe Volume. During run-time, this data can be combined with lighting from the Scene’s Ambient Probe to dynamically relight the Scene based on changes to the Sky. See [Visual Environment Volume override](Override-Visual-Environment.md).
3+
You can enable sky occlusion when you use Adaptive Probe Volumes. Sky occlusion means that when a GameObject samples a color from the sky, Unity dims the color if the light can't reach the GameObject.
44

5-
When Sky Occlusion is enabled for Adaptive Probe Volumes, an additional directional visibility factor is calculated for each probe during bake time. This gray value - stored as a spherical harmonic - is used during shading to attenuate the lighting contribution from the Sky. As multiple bounces can be used, the Sky’s effect upon probes with indirect paths to the Sky can also be calculated.
5+
Sky occlusion in Unity uses the sky color from the [ambient probe](https://docs.unity3d.com/2023.3/Documentation/ScriptReference/RenderSettings-ambientProbe.html), which updates at runtime. This means you can dynamically light GameObjects as the sky color changes. For example, you can change the sky color from light to dark, to simulate the effect of a day-night cycle.
66

7-
Static and dynamic objects can both receive lighting with Sky Occlusion. However, only static objects can affect the baked result. Enabling Sky Occlusion can lengthen the time required to bake lighting and uses additional memory at run-time.
7+
If you enable sky occlusion, Adaptive Probe Volumes might take longer to bake, and Unity might use more memory at runtime.
88

9-
## Enable Sky Occlusion
9+
## How sky occlusion works
1010

11-
Sky Occlusion is enabled from the **Sky Occlusion** section of the **Adaptive Probe Volumes** tab within the **Lighting Window**.
11+
When you enable sky occlusion, Unity bakes an additional static sky occlusion value into each probe in an Adaptive Probe Volume. The sky occlusion value is the amount of indirect light the probe receives from the sky, including light that bounced off static GamesObjects.
1212

13-
Note that lighting data must be recalculated if Sky Occlusion is enabled for the first time, or is disabled following a bake.
13+
At runtime, when a static or dynamic GameObject samples an Adaptive Probe Volume probe, Unity approximates the light from the sky using two values:
1414

15-
## Modifying Sky Occlusion properties
15+
- A sky color from the ambient probe, which updates when the sky color changes.
16+
- The sky occlusion value, which is static.
1617

17-
It is possible to affect the visual quality and appearance of Sky Occlusion using these properties:
18+
## Enable sky occlusion
1819

19-
<table>
20-
<thead>
21-
<tr>
22-
<th><strong>Property</strong></th>
23-
<th colspan="2"><strong>Description</strong></th>
24-
</tr>
25-
</thead>
26-
<tbody>
27-
<tr>
28-
<td><strong>Samples</strong></td>
29-
<td>Determines the number of samples used when calculating the sky contribution for each probe. Increasing this value improves the accuracy of lighting data at the cost of the time required to bake Adaptive Probe Volumes.</td>
30-
</tr>
31-
<tr>
32-
<td><b>Bounces</b></td>
33-
<td>The number of bounces used when calculating the sky’s contribution on probes. Increasing the number of bounces can be useful in Scenes where probes may have very indirect routes to the Sky. This will also affect the time required to bake Adaptive Probe Volumes.</td>
34-
</tr>
35-
<tr>
36-
<td><strong>Albedo Override</strong></td>
37-
<td>Sky Occlusion does not consider the albedo (color) of Materials used throughout the Scene when calculating bounced lighting. Instead a single color is a used throughout the Scene. Albedo Override allows this color to be modified. Lower values darken and higher values will brighten the intensity of this value.</td>
38-
</tr>
39-
<tr>
40-
<td><b>Sky Direction</b></td>
41-
<td>Whether probes should store the dominant direction of incoming light from the Sky. Sky Direction increases memory usage but produces more accurate lighting. Without Sky Direction, the surface normals of objects are used instead and in some Scenes this can produce visual inaccuracies.</td>
42-
</tr>
43-
</tbody>
44-
</table>
20+
First, enable the GPU lightmapper. Unity doesn't support sky occlusion if you use **Progressive CPU** instead.
4521

46-
## Sky Direction
22+
1. Go to **Window** &gt; **Rendering** &gt; **Lighting**.
23+
2. Go to the **Scene** panel.
24+
3. Set **Lightmapper** to **Progressive GPU**.
4725

48-
By default, Sky Direction is disabled and the surface normals of objects lit by probes are used to sample the Ambient Probe generated from the Sky.
49-
When Sky Direction is enabled, Unity calculates - for each probe - the most appropriate incoming sky lighting direction. Where desirable, this can be locally overridden in specific areas of the Scene using a [Probe Adjustment Volume](probevolumes-concept.md#volume).
26+
To enable sky occlusion, follow these steps:
5027

51-
Enabling Sky Direction can improve visual results, especially in cave-like scenarios where the sky lighting needs to bounce several times on surfaces before reaching a surface. However the additional data required increases the time needed to bakelighting data. It also increases memory usage during run-time.
28+
1. Go to the **Adaptive Probe Volumes** panel.
29+
2. Enable **Sky Occlusion**.
5230

53-
## Debugging Sky Occlusion
31+
To update the lighting data, you must also [bake the Adaptive Probe Volume](probevolumes-use.md#add-and-bake-an-adaptive-probe-volume) after you enable or disable sky occlusion.
5432

55-
You can inspect the Sky Occlusion value using the **Display Probes** option in the [Rendering Debugger](rendering-debugger-window-reference.md#probe-volume-panel). Two views are provided in the **Probe Shading Mode** dropdown:
56-
1. **Sky Occlusion SH**: Display the gray value (scalar) used to attenuate Sky lighting.
57-
2. **Sky Direction**: Displays a green dot corresponding to the direction used to sample the Ambient Probe. If **Sky Direction** was not enabled or could not be computed this displays a red probe.
33+
## Update light at runtime
5834

59-
## Limitations
35+
To update the light from the sky at runtime, follow these steps to make sure the ambient probe updates when the sky updates.
6036

61-
1. Currently Sky Occlusion does not work if the **Progressive CPU Lightmapper** is selected.
62-
2. If Sky Occlusion is enabled or disabled, the Scene must be rebaked to update lighting data.
63-
3. Sky Direction is not interpolated between probes. This may result in harsh lighting transitions where neighboring probes are storing very different results.
37+
1. In the **Hierarchy** window, select the volume that affects the current camera.
38+
2. In the **Inspector** window, double-click the Volume Profile Asset to open the asset.
39+
3. In the **Visual Environment** &gt; **Sky** section, set **Ambient Mode** to **Dynamic**.
6440

65-
# Additional resources
41+
Refer to [Environment lighting](environment-lighting.md) for more information.
6642

43+
## Enable more accurate sky direction data
6744

45+
When an object samples the ambient probe, by default Unity uses the surface normal of the object as the direction to the sky. This direction might not match the direction the light comes from, for example if the object is inside and the sky light bounces off other objects to reach it.
6846

69-
* [Understand Adaptive Probe Volumes](probevolumes-concept.md)
70-
* [Visual Environment Volume override](Override-Visual-Environment.md)
47+
Unity can instead calculate, store, and use an accurate direction from each Adaptive Probe Volume probe, and take bounce lighting into account. This makes sky occlusion more accurate, especially in areas like caves where probes don't have a direct line of sight to the sky, or when the sky has contrasting colors and the light comes from a specific direction such as through a window.
48+
49+
To enable this feature, in the **Adaptive Probe Volumes** of the Lighting window, enable **Sky Direction**.
50+
51+
If you enable **Sky Direction**, the following applies:
52+
53+
- Baking takes longer and Unity uses more memory at runtime.
54+
- There might be visible seams, because Unity doesn't interpolate sky direction data between probes.
55+
56+
To override the directions Unity uses, use a [Probe Adjustment Volume component](probevolumes-adjustment-volume-component-reference.md).
57+
58+
## Additional resources
59+
60+
- [Adaptive Probe Volumes panel properties](probevolumes-lighting-panel-reference.md#sky-occlusion-settings) for more information about sky occlusion settings
61+
- [Rendering Debugger](rendering-debugger-window-reference.md#probe-volume-panel) for information about displaying baked sky occlusion data

0 commit comments

Comments
 (0)