Skip to content
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

Internal/2022.3/staging #8123

Merged
merged 30 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f1b0fde
[Port] [2022.3] [UUM-83862] Fix sorting the Reflection Probe by resol…
svc-reach-platform-support Nov 29, 2024
846f4cf
DOCG-5984 Improved the Custom post-processing section, migrated the F…
oleks-k Dec 2, 2024
cb9517f
Graphics docs feedback fixes November 2024 (part 7 - 2022.3 fixes)
markg-unity Dec 3, 2024
df6e673
DOCG-5291 Fix anchor link to light limit
markg-unity Dec 3, 2024
6e3d7c2
[Port] [2022.3] Fix for avoid warnings when using the NormalFromTextu…
svc-reach-platform-support Dec 4, 2024
304092b
[Port] [2022.3] [UUM-78038] Fix cascade shadows and distance shadowma…
seungwon-oh Dec 4, 2024
d7716f5
[Port] [2022.3] Add clamp to HairAngleWorld to prevent nan from FastASin
svc-reach-platform-support Dec 4, 2024
250b2d0
[Port] [2022.3] [UUM-73947] Added SS Shadow coord transform to Transf…
svc-reach-platform-support Dec 4, 2024
f94dc0a
[Port] [2022.3] [VFX/Particle] DrawMeshNow artifact on M1
svc-reach-platform-support Dec 5, 2024
daa3226
[2022][ShaderGraph] Fix for identifier name conflicts with underscore…
Dec 9, 2024
baa4498
[Backport 2022.3][UUM-83351] Fix clear flags when post processing is …
kennytann Dec 9, 2024
490bf09
[Port] [2022.3] Prevent URP creation from UniversalCameraAdditionalDa…
RSlysz Dec 18, 2024
e679f66
Backport 55248
alelievr Dec 19, 2024
0f630de
[Backport] [2022.3] Backport Nov 2024 graphics feedback fixes to 2022.3
markg-unity Dec 19, 2024
eb7b2a6
[Port] [VFX/SG] Fix FogNode usage in URP
PaulDemeulenaere Dec 19, 2024
af0a3d6
[Port] [2022.3] [UUM-84980] Fix wrong SSR when using a shader graph w…
svc-reach-platform-support Dec 20, 2024
8417723
[Port] [2022.3] Prevent scene spherical harmonics lighting from leaki…
svc-reach-platform-support Jan 6, 2025
6b2b462
[Port] [2022.3] Fixes from graphics docs feedback tickets Dec 2024
markg-unity Jan 6, 2025
706d28e
[VFX][Backport][2022.3] In some specific circumstances, an exception …
julienamsellem Jan 7, 2025
e1e2772
[Port] [2022.3] DOCG-5341 Add note about SRP Blitter API and Shader G…
markg-unity Jan 12, 2025
83c8319
[Port] [2022.3] Docs feedback fixes January 2025
markg-unity Jan 12, 2025
bc2ffc8
[Port] [2022.3] DOCG-5432 Add note about converting read-only materia…
markg-unity Jan 12, 2025
4e58b99
[Port] [2022.3] Fix downsampled SSAO not using the correct resolution…
svc-reach-platform-support Jan 15, 2025
e4e624a
[Port] [2022.3][URP] Make sure ScriptableStripper doesn't strip any v…
svc-reach-platform-support Jan 15, 2025
8c027e1
[Port] [2022.3] Docs feedback fixes January 2025 part 2
svc-reach-platform-support Jan 17, 2025
a59444a
2022.3 Backport PR #49299 (Reduce Banding on FSR Upscaled Render Target)
Jan 19, 2025
9d4a304
[Port] [2022.3] Fix HDRP sky rendering when Camera Relative Rendering…
svc-reach-platform-support Jan 20, 2025
ee10cbb
[Port] [2022.3] DOCG-6464 Add steps to 2D sprite lit shader graph URP…
markg-unity Jan 20, 2025
41c9c02
[Port] [2022.3] Fixed two parameters being the wrong type leading to …
lpledouxUnity Jan 20, 2025
2338c99
[Backport] [2022.3] Improve URP blitting docs (from DOCG-6282)
markg-unity Jan 22, 2025
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 @@ -7,6 +7,7 @@ This page covers the process of how to use the RenderGraph API to write a render
To begin, your render pipeline needs to maintain at least one instance of [RenderGraph](../api/UnityEngine.Experimental.Rendering.RenderGraphModule.RenderGraph.html). This is the main entry point for the API. You can use more than one instance of a render graph, but be aware that Unity does not share resources across `RenderGraph` instances so for optimal memory usage, only use one instance.

```c#
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering.RenderGraphModule;

public class MyRenderPipeline : RenderPipeline
Expand All @@ -21,8 +22,11 @@ public class MyRenderPipeline : RenderPipeline
void CleanupRenderGraph()
{
m_RenderGraph.Cleanup();
m_RenderGraph = null;
m_RenderGraph = null;
}

...

}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ public HierarchicalSphere(Color baseColor, HierarchicalSphere parent = null)
/// <param name="filled">If true, also draw the surface of the hull's sphere</param>
public void DrawHull(bool filled)
{
if (Event.current.type != EventType.Repaint)
return;

Color wireframeColor = m_HandleColor;
wireframeColor.a = 0.8f;
using (new Handles.DrawingScope(m_WireframeColor, Matrix4x4.TRS((Vector3)Handles.matrix.GetColumn(3) + center, Quaternion.identity, Vector3.one)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ You can use AOVs to output the contribution from a selected list of [Lights](Lig
## Custom Pass AOVs
Finally, you can use AOVs to output the results of [custom passes](Custom-Pass.md). In particular, you can output the cumulative results of all custom passes that are active on every custom pass injection point. This can be useful to output arbitrary information that custom passes compute, such as the Object ID of the Scene GameObjects.

## Rendering Precission
## Rendering precision
By default AOVs are rendering at the precision and format selected in the HDRP asset. If the AOVRequest is configured with *SetOverrideRenderFormat* option set to true, then rendering will use the same precision as the user allocated AOV output buffer.

## Scripting API example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can use the **Volume Profiles** section to assign and edit a [Volume Profile

The **Default Volume Profile Asset** (A) references a Volume Profile in the HDRP package folder called `DefaultSettingsVolumeProfile` by default. Below it, you can add [Volume overrides](Volume-Components.md), and edit their properties. You can assign your own Volume Profile to this property field. Be aware that this property must always reference a Volume Profile. If you assign your own Volume Profile and then delete it, HDRP automatically re-assigns the `DefaultSettingsVolumeProfile` from the HDRP package folder.

The **LookDev Volume Profile Asset** (B) references the Volume Profile HDRP uses in the [LookDev window](Look-Dev.md). This Asset works in almost the same way as the Default Volume Profile Asset, except that it overrides [Visual Environment Components](Override-Visual-Environment.md) and sky components.![](Images/HDRPgs_Volume_Profiles.png)
The **LookDev Volume Profile Asset** (B) references the Volume Profile HDRP uses in the [LookDev window](Look-Dev.md). This Asset works in almost the same way as the Default Volume Profile Asset, except it overrides [Visual Environment Components](Override-Visual-Environment.md) and sky components.

## Frame Settings (Default Values)

Expand All @@ -36,8 +36,6 @@ Use this section to select which custom post processing effect HDRP uses in the

HDRP provides one list for each post processing injection point. See the [Custom Post Process](Custom-Post-Process.md) documentation for more details.

![](Images/HDRPgs_Custom_PP.png)

## Miscellaneous

| **Property** | **Description** |
Expand All @@ -54,7 +52,7 @@ HDRP provides one list for each post processing injection point. See the [Custom
| **Property** | **Description** |
| --------------------------| ------------------------------------------------------------ |
| Shader Variant Log Level | Use the drop-down to select what information HDRP logs about Shader variants when you build your Unity Project. • Disabled: HDRP doesn’t log any Shader variant information.• Only SRP Shaders: Only log Shader variant information for HDRP Shaders.• All Shaders: Log Shader variant information for every Shader type. |
| Export Shader Variants | Controls whether to output shader variant information to a file. |
| Export Shader Variants | Controls whether to output shader variant information to a file. Unity saves the information to the folder with your project files, in `Temp/graphics-settings-stripping.json` and `Temp/shader-stripping.json`. |

## Resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Forward and Deferred rendering both implement the same features, but the quality

## Differences between Forward and Deferred rendering in HDRP

| **Feature** | **Forward Rendering** | **Defferred** |
| **Feature** | **Forward Rendering** | **Deferred** |
|---|---|---|
| **Normal shadow bias** | HDRP uses the geometric normal (the vertex normal) of the Material for shadow bias, so Forward Rendering produces fewer shadow artifacts. | HDRP uses the pixel normal of the Material for shadow bias, so Deferred Rendering produces more shadow artifacts. |
| **Emissive Color** | Ambient Occlusion doesn't affect Emissive Color. | Ambient Occlusion affects Emissive Color due to technical constraints. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

Frame Settings are settings HDRP uses to render Cameras, real-time, baked, and custom reflections. You can set the default values for Frame Settings for each of these three individually from within the [HDRP Global Settings](Default-Settings-Window.md) tab (menu: **Edit** > **Project Settings** > **Graphics** > **HDRP Global Settings**).

![](Images/FrameSettings1.png)

To make Cameras and Reflection Probes use their respective default values for Frame Settings, disable the **Custom Frame Settings** checkbox under the **General** settings of Cameras or under **Capture Settings** of Reflection Probes.

You can override the default value of a Frame Setting on a per component basis. Enable the **Custom Frame Settings** checkbox to set specific Frame Settings for individual Cameras and Reflection Probes. This exposes the Frame Settings Override which gives you access to the same settings as within the HDRP Global Settings. Edit the settings within the Frame Settings Override to create a Frame Settings profile for an individual component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ This section includes all the menu items under the **Edit > Rendering > Decal La

This section includes all the menu items under the **Edit > Rendering > Materials** menu fold-out.

For more information, refer to [Convert materials and shaders](convert-from-built-in-convert-materials-and-shaders).

| **Item** | **Description** |
| ----------------------------------------------- | ------------------------------------------------------------ |
| **Upgrade HDRP Materials to Latest Version** | Upgrades all HDRP Materials in the project to the latest version. This is useful if HDRP's automatic Material upgrade process fails to upgrade a Material. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ The property to enable in your Frame Settings is: **Lighting > Contact Shadows**

You can enable Contact Shadows on a per Light basis for Directional, Point, and Spot Lights. Tick the **Enable** checkbox under the **Contact Shadows** drop-down in the **Shadows** section of each Light to indicate that HDRP should calculate Contact Shadows for that Light.

Only one Light can cast Contact Shadows at a time. This means that, if you have more than one Light that casts Contact Shadows visible on the screen, only the dominant Light renders Contact Shadows. HDRP chooses the dominant Light using the screen space size of the Light’s bounding box. A Directional Light that casts Contact Shadows is always the dominant Light.

**Note**: A Light casts Contact Shadows for every Mesh Renderer that uses a Material that writes to the depth buffer. This is regardless of whether you enable or disable the **Cast Shadows** property on the Mesh Renderer. This means that you can disable **Cast Shadows** on small GameObjects/props and still have them cast Contact Shadows. This is good if you do not want HDRP to render these GameObjects in shadow maps. If you do not want this behavior, use Shader Graph to author a Material that does not write to the depth buffer.

[!include[](snippets/volume-override-api.md)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Micro Shadows

Micro shadows are shadows that the High Definition Render Pipeline (HDRP) simulates for small details embedded in the Material of a GameObject, but not in its Mesh geometry. HDRP uses the details from the normal map and the ambient occlusion map to estimate the shadows those maps would cast if they were Meshes.
Micro shadows are shadows that the High Definition Render Pipeline (HDRP) simulates for small details embedded in the Material of a GameObject, but not in its Mesh geometry.

HDRP uses the details from the normal map, the ambient occlusion map, and specular occlusion to estimate the shadows those details would cast if they were meshes.

In this image, the different layers of details in the Material shadow each other.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Using these three things, HDRP generates volumetric clouds in a two-step process

[!include[](snippets/Volume-Override-Enable-Override.md)]

* In your [HDRP Asset](HDRP Asset) go to **Lighting > Volumetrics > Volumetric Clouds**.
* In your [HDRP Asset](HDRP-Asset.md) go to **Lighting > Volumetrics > Volumetric Clouds**.

* In your [Frame Settings](Frame-Settings.md) go to **Lighting > Volumetric Clouds**.

Expand Down Expand Up @@ -126,6 +126,7 @@ When importing these two map Textures, disable **sRGB**. For best results, do no
| -------------------------------- | ------------------------------------------------------------ |
| **Temporal Accumulation Factor** | The amount of temporal accumulation to apply to the clouds. Temporal accumulation increases the visual quality of clouds by decreasing the noise. A higher value produces better quality clouds, but can create [ghosting](Glossary.md#ghosting). |
| **Ghosting Reduction** | When you enable this property, HDRP removes the ghosting caused by temporal accumulation. This effect might cause a flickering effect when the **Temporal Accumulation Factor** value is low. |
| **Perceptual Blending** | Blend the clouds with the environment. This might cause artifacts if the sky is overexposed. This setting only has an effect when you disable multi-sample antialiasing (MSAA). |
| **Num Primary Steps** | The number of steps to use to evaluate the clouds' transmittance. Higher values linearly increase the resource intensity of the effect. |
| **Num Light Steps** | The number of steps to use to evaluate the clouds' lighting. Higher values exponent increase the resource intensity of the effect. |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ For more information, see [System requirements for Unity](https://docs.unity3d.c
HRDP is only compatible with the following platforms:

- Windows and Windows Store, with DirectX 11 or DirectX 12 and Shader Model 5.0
- Google
- Stadia
- Sony
- PlayStation 4
- PlayStation 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ To upgrade the Materials in your Scene to HDRP-compatible Materials:
The automatic upgrade options described above can't upgrade all Materials to HDRP correctly:

* You can't automatically upgrade custom Materials or Shaders to HDRP. You must [convert custom Materials and Shaders manually](#ManualConversion).
* HDRP can only convert materials from the **Assets** folder of your project. HDRP uses the [error shader](xref:shader-error) for GameObjects that use the default read-only material from the Built-In Render Pipeline, for example [primitives](xref:um-primitive-objects).
* Height mapped Materials might look incorrect. This is because HDRP supports more height map displacement techniques and decompression options than the Built-in Render Pipeline. To upgrade a Material that uses a heightmap, modify the Material's **Amplitude** and **Base** properties until the result more closely matches the Built-in Render Pipeline version.
* You can't upgrade particle shaders. HDRP doesn't support particle shaders, but it does provide Shader Graphs that are compatible with the [Built-in Particle System](https://docs.unity3d.com/Manual/Built-inParticleSystem.html). These Shader Graphs work in a similar way to the built-in particle shaders. To use these Shader Graphs, import the **Particle System Shader Samples** sample:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ You can also watch the presentation from Unite Copenhagen (October 2019) to lear
* **PC with DX11**:
* Oculus Rift & Rift S (Oculus XR Plugin, Windows 10, DirectX 11)
* Windows Mixed Reality (Windows XR Plugin, Windows 10, DirectX 11)
* Open VR
* **PS4**:
* PlayStationVR
* Open VR*

**Note**: Valve is currently developing their OpenVR Unity XR plugin for 2019.3 and beyond.
For more information, see [Unity XR platform updates](https://blogs.unity3d.com/2020/01/24/unity-xr-platform-updates/) on the Unity blog, and [XR Plugin Architecture](https://docs.unity3d.com/Manual/XRPluginArchitecture.html) in the Unity Manual.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# Underwater view

To view non-infinite water surfaces from underwater, you have to specify a [collider](https://docs.unity3d.com/Manual/Glossary.html#Collider). You can either use the box collider HDRP automatically provides or select a box collider in the scene to use for this purpose.
To change the area where the camera displays an underwater view for a non-infinite water surface, use the **Volume Bounds** setting. Follow these steps:

To view infinite water surfaces from underwater, you have to specify a **Volume Depth**.
1. Create a GameObject with a collider component, for example a cube with a **Box Collider** component.
2. Place the GameObject where you want the underwater view to be visible.
3. In the collider component, select **Edit Collider** to set the size of the visible underwater area.
4. Select the water GameObject.
5. In the **Inspector** window, under **Appearance**, under **Underwater**, set **Volume Bounds** to the GameObject you created.

To set the area of the underwater view for an ocean, follow these steps:

1. Select the ocean GameObject.
2. In the **Inspector** window, under **Appearance**, enable **Underwater**.
3. Adjust **Volume Depth**.

If you look directly upward at the water surface from below, you may see a square border around the scene view. This is normal. It is because HDRP can only use screenspace data underwater.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ This is especially important when you upgrade your project from an earlier versi
1. Select a global Volume in your scene, such as the **Sky and Fog Volume**.
2. Click **Add Override**.
3. Select **Lighting** > **Water Rendering**.
4. Set the Water **Enable** property to True.

![](Images/WaterSystem-EnableTrue.png)

4. In the **Water Rendering** component, set **State** to **Enabled**.

This is especially important when you upgrade your project from an earlier version of Unity, because water is inactive by default. If your project originates in HDRP 14 (Unity 2022.2) or later, the water implementation may work even if you only enable it in the **Quality** settings.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ To set a source material for the `Blit()` command to use in shader graph:
5. In **Node Settings**, enable the **Exposed** toggle so `Blit()`can bind the texture.
4. Drag the **MainTex** node into your shader graph.
5. Press the Spacebar to open the **Create Node** window
6. In the **Create Node** window, search for the **Texture 2D Array** node and select it to create it in your scene.
6. In the **Create Node** window, search for the **Sample Texture 2D Array** node and select it to create it in your scene.
7. Connect the **MainTex** node to the **Texture Array** port of the **Sample Texture 2D Array** node.
8. Connect the **RBGA** output port of the **Sample Texture 2D Array** to the **Base Color** block in the **Fragment** context.
9. `Blit()` automatically binds the source texture inside the `_MainTex` property.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ To make sure Reflection Probes also capture lighting data from Probe Volumes, yo

### Adjust your Light and Mesh Renderer settings

1. To include a Light in a Probe Volume's baked lighting data, open the Inspector for the Light then set the **Light Mode** to **Mixed** or **Baked**.
2. To include an object in a Probe Volume's baked lighting data, open the Inspector for the object and enable **Contribute Global Illumination**.
3. To make an object receive baked lighting, open the Inspector for the object and set **Receive Global Illumination** to **Light Probes**.
1. To include a Light in an Adaptive Probe Volume's baked lighting data, open the Inspector for the Light then set the **Light Mode** to **Mixed** or **Baked**.
2. To include a GameObject in an Adaptive Probe Volume's baked lighting data, open the Inspector for the GameObject and enable **Contribute Global Illumination**.
3. To make a GameObject receive baked lighting, open the Inspector for the GameObject, then in the **Mesh Renderer** component set **Receive Global Illumination** to **Light Probes**.

### Bake your lighting

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,17 +269,19 @@ SHADOW_TYPE EvaluateShadow_Directional( LightLoopContext lightLoopContext, Posit
shadow = lightLoopContext.shadowValue;

#ifdef SHADOWS_SHADOWMASK
float3 camToPixel = posInput.positionWS - GetPrimaryCameraPosition();
float distanceCamToPixel2 = dot(camToPixel, camToPixel);

int shadowSplitIndex = lightLoopContext.shadowContext.shadowSplitIndex;
if (shadowSplitIndex < 0)
{
shadow = shadowMask;
}
else if (shadowSplitIndex == int(_CascadeShadowCount) - 1)
{
float fade = lightLoopContext.shadowContext.fade;
// float fade = lightLoopContext.shadowContext.fade;
float3 camToPixel = posInput.positionWS - GetPrimaryCameraPosition();
float distanceCamToPixel2 = dot(camToPixel, camToPixel);

HDDirectionalShadowData dsd = lightLoopContext.shadowContext.directionalShadowData;
float fade = saturate(distanceCamToPixel2 * dsd.fadeScale + dsd.fadeBias);
// In the transition code (both dithering and blend) we use shadow = lerp( shadow, 1.0, fade ) for last transition
// mean if we expend the code we have (shadow * (1 - fade) + fade). Here to make transition with shadow mask
// we will remove fade and add fade * shadowMask which mean we do a lerp with shadow mask
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ RenderAOParameters PrepareRenderAOParameters(HDCamera camera, Vector2 historySiz
}
else
{
parameters.runningRes = new Vector2(Mathf.RoundToInt(camera.actualWidth * 0.5f), Mathf.RoundToInt(camera.actualHeight * 0.5f));
// Ceil is needed because we upsample the AO too, round would loose a pixel is the resolution is odd
parameters.runningRes = new Vector2(Mathf.CeilToInt(camera.actualWidth * 0.5f), Mathf.CeilToInt(camera.actualHeight * 0.5f));
cb._AOBufferSize = new Vector4(parameters.runningRes.x, parameters.runningRes.y, 1.0f / parameters.runningRes.x, 1.0f / parameters.runningRes.y);
}

Expand Down
Loading
Loading