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/2021.3/staging #8079

Merged
merged 12 commits into from
Jun 28, 2024
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 @@ -676,11 +676,7 @@ void OnEnable()
foreach (var graph in registeredGraph)
m_RegisteredGraphs.Add(graph, new HashSet<string>());

RenderGraph.requireDebugData = true;
RenderGraph.onGraphRegistered += OnGraphRegistered;
RenderGraph.onGraphUnregistered += OnGraphUnregistered;
RenderGraph.onExecutionRegistered += OnExecutionRegistered;
RenderGraph.onExecutionUnregistered += OnExecutionUnregistered;
SubscribeToRenderGraphEvents();
}

private void CreateGUI()
Expand All @@ -690,10 +686,36 @@ private void CreateGUI()

void OnDisable()
{
UnsubscribeToRenderGraphEvents();
}

void SubscribeToRenderGraphEvents()
{
if (RenderGraph.requireDebugData)
return;

RenderGraph.requireDebugData = true;
RenderGraph.onGraphRegistered += OnGraphRegistered;
RenderGraph.onGraphUnregistered += OnGraphUnregistered;
RenderGraph.onExecutionRegistered += OnExecutionRegistered;
RenderGraph.onExecutionUnregistered += OnExecutionUnregistered;
}

void UnsubscribeToRenderGraphEvents()
{
if (!RenderGraph.requireDebugData)
return;

RenderGraph.requireDebugData = false;
RenderGraph.onGraphRegistered -= OnGraphRegistered;
RenderGraph.onGraphUnregistered -= OnGraphUnregistered;
RenderGraph.onExecutionRegistered -= OnExecutionRegistered;
RenderGraph.onExecutionUnregistered -= OnExecutionUnregistered;
}

void Update()
{
// UUM-70378: In case the OnDisable Unsubscribes to Render Graph events when coming back from a Maximized state
SubscribeToRenderGraphEvents();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,49 @@ The **Rendering Debugger** is a specific window for the Scriptable Render Pipeli
![](Images/RenderPipelineDebug1.png)
The Rendering Debugger

## Using the Rendering Debugger
## How to access the Rendering Debugger

The Rendering Debugger window is available in the following modes:

* The Editor.
* The Play mode.
* At runtime in the standalone Unity Player, on any device. The window is only available in **Development Builds**.
| Mode | Platform | Availability | How to Open the Rendering Debugger |
|-----------|----------------|----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Editor | All | Yes (window in the Editor) | Select **Window > Analysis > Rendering Debugger** |
| Play mode | All | Yes (overlay in the Game view) | On a desktop or laptop computer, press **LeftCtrl+Backspace** (**LeftCtrl+Delete** on macOS)<br>On a console controller, press L3 and R3 (Left Stick and Right Stick) |
| Runtime | Desktop/Laptop | Yes (only in Development builds) | Press **LeftCtrl+Backspace** (**LeftCtrl+Delete** on macOS) |
| Runtime | Console | Yes (only in Development builds) | Press L3 and R3 (Left Stick and Right Stick) |
| Runtime | Mobile | Yes (only in Development builds) | Use a three-finger double tap |

To open the Rendering Debugger in the Editor:
To enable all the sections of the **Rendering Debugger** in your built application, disable **Strip Debug Variants** in **Project Settings > Graphics > HDRP Global Settings**. Otherwise, you can only use the [Display Stats](#display-stats) section.

* Enable **Runtime Debug Shaders** in **HDRP Global Settings** (in the menu: **Edit** > **Project Settings** > **Graphics** > **HDRP Settings**).

* Select **Window** > **Analysis** > **Rendering Debugger**.

To open the window in the Play mode, or at runtime in a Development Build, use the keyboard shortcut Ctrl+Backspace (Ctrl+Delete on macOS) or press L3 and R3 (Left Stick and Right Stick) on a controller.
To disable the runtime UI, use the [enableRuntimeUI](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.Rendering.DebugManager.html#UnityEngine_Rendering_DebugManager_enableRuntimeUI) property.

You can display read-only items, such as the FPS counter, independently of the **Rendering Debugger** window. When you disable the **Rendering Debugger** window, they're still visible in the top right corner of the screen. Use this functionality to track particular values without cluttering the screen.

You can disable the runtime UI entirely by using the [`enableRuntimeUI`](https://docs.unity3d.com/Packages/com.unity.render-pipelines.core@latest/api/UnityEngine.Rendering.DebugManager.html#UnityEngine_Rendering_DebugManager_enableRuntimeUI) property.

### Navigation at runtime
## Navigation at runtime

To change the current active item:
### Keyboard

* **Keyboard**: Use the arrow keys.
* **Xbox controller**: Use the Directional pad (D-Pad).
* **PlayStation controller**: Use the Directional buttons.
| Action | Control |
|----------------------------------------------------|-------------------------------------------------------------------------------------------|
| **Change the current active item** | Use the arrow keys |
| **Change the current tab** | Use the Page up and Page down keys (Fn + Up and Fn + Down keys respectively for MacOS) |
| **Display the current active item independently of the debug window** | Press the right Shift key |

To change the current tab:
### Xbox Controller

* **Keyboard**: Use the Page up and Page down keys (Fn + Up and Fn + Down keys respectively for MacOS).
* **Xbox controller**: Use the Left Bumper and Right Bumper.
* **PlayStation controller**: Use the L1 button and R1 button.
| Action | Control |
|----------------------------------------------------|-------------------------------------------------------------------------------------------|
| **Change the current active item** | Use the Directional pad (D-Pad) |
| **Change the current tab** | Use the Left Bumper and Right Bumper |
| **Display the current active item independently of the debug window** | Press the X button |

To display the current active item independently of the debug window:
### PlayStation Controller

* **Keyboard**: Press the right Shift key.
* **Xbox controller**: Press the X button.
* **PlayStation controller**: Press the Square button.
| Action | Control |
|----------------------------------------------------|-------------------------------------------------------------------------------------------|
| **Change the current active item** | Use the Directional buttons |
| **Change the current tab** | Use the L1 button and R1 button |
| **Display the current active item independently of the debug window** | Press the Square button |

<a name="DecalsPanel"></a>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,24 @@ static public void SetupCommonDecalMaterialKeywordsAndPass(Material material)
material.SetInt(HDShaderIDs._DecalColorMask2, (int)mask2);
material.SetInt(HDShaderIDs._DecalColorMask3, (int)mask3);

// First reset the pass (in case new shader graph add or remove a pass)
bool enableDBufferMeshPass = true;
bool enableDBufferProjectorPass = true;
bool enableDecalMeshForwardEmissivePass = true;
bool enableDecalProjectorForwardEmissivePass = true;
bool enableDBufferPass = ((int)mask0 + (int)mask1 + (int)mask2 + (int)mask3) != 0;
bool enableForwardEmissivePass = material.HasProperty(kAffectEmission) && material.GetFloat(kAffectEmission) == 1.0f;

// Disable the passes that aren't needed
// We have to check that the passes can be found on the material before touching them
// This is important because in some cases, HDRP validation code may be run before HDRP initialization
// This happens when importing with clean Library a project that needs to run the material upgrader
// Consequence is that Shader.globalRenderPipeline is not set so FindPadd will ignore passes marked with HDRP tag
// So in this code, we have to assume that even if we don't find a pass, it may still exist

// Then disable pass is they aren't needed
if (material.FindPass(HDShaderPassNames.s_DBufferMeshStr) != -1)
enableDBufferMeshPass = ((int)mask0 + (int)mask1 + (int)mask2 + (int)mask3) != 0;
material.SetShaderPassEnabled(HDShaderPassNames.s_DBufferMeshStr, enableDBufferPass);
if (material.FindPass(HDShaderPassNames.s_DBufferProjectorStr) != -1)
enableDBufferProjectorPass = ((int)mask0 + (int)mask1 + (int)mask2 + (int)mask3) != 0;
material.SetShaderPassEnabled(HDShaderPassNames.s_DBufferProjectorStr, enableDBufferPass);
if (material.FindPass(HDShaderPassNames.s_DecalMeshForwardEmissiveStr) != -1)
enableDecalMeshForwardEmissivePass = material.HasProperty(kAffectEmission) && material.GetFloat(kAffectEmission) == 1.0f;
material.SetShaderPassEnabled(HDShaderPassNames.s_DecalMeshForwardEmissiveStr, enableForwardEmissivePass);
if (material.FindPass(HDShaderPassNames.s_DecalProjectorForwardEmissiveStr) != -1)
enableDecalProjectorForwardEmissivePass = material.HasProperty(kAffectEmission) && material.GetFloat(kAffectEmission) == 1.0f;

// Apply once
material.SetShaderPassEnabled(HDShaderPassNames.s_DBufferMeshStr, enableDBufferMeshPass);
material.SetShaderPassEnabled(HDShaderPassNames.s_DBufferProjectorStr, enableDBufferProjectorPass);
material.SetShaderPassEnabled(HDShaderPassNames.s_DecalMeshForwardEmissiveStr, enableDecalMeshForwardEmissivePass);
material.SetShaderPassEnabled(HDShaderPassNames.s_DecalProjectorForwardEmissiveStr, enableDecalProjectorForwardEmissivePass);
material.SetShaderPassEnabled(HDShaderPassNames.s_DecalProjectorForwardEmissiveStr, enableForwardEmissivePass);

// Set stencil state
material.SetInt(kDecalStencilWriteMask, (int)StencilUsage.Decals);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#endif
#ifdef SCENESELECTIONPASS
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl"
#elif SHADERPASS == SHADERPASS_LIGHT_TRANSPORT
// Use Unity's built-in matrices for meta pass rendering
#define SCENEPICKINGPASS
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl"
#endif
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ However, it is not infinitely flexible and may not be able to meet the needs for
You can now make your own 2D Lighting model.

## Sprite Custom Lit Shader Graph
The new Shader Graph target "Custom Lit Shader Graph" provides a great starting point to create a custom lithing model shader. It does not sample the Light Textures but it does have a Normal pass and a fallback Forward pass for use in non 2D Renderer.

The new Shader Graph target "Custom Lit Shader Graph" provides a great starting point to create a custom lighting model shader. It does not sample the Light Textures but it does have a Normal pass and a fallback Forward pass for use in non 2D Renderer.

## 2D Light Texture
2D Light Textures are Render Textures created by the 2D Renderer that contain the visible lights in the scene. There are up to 4 textures each representing a blend style in the [2D Renderer Data](2DRendererData_overview.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Building your Project for Closed platforms

If you have a license to develop games for Closed platforms that require you to meet the confidentiality and legal agreements of the platform provider, then see the relevant developer forums for a link to the console specific render pipeline package.
If you have a license to develop games for Closed platforms that require you to meet the confidentiality and legal agreements of the platform provider, then refer to the relevant developer forums for a link to the console specific render pipeline package.

## Platform package installation

Expand All @@ -9,4 +9,4 @@ Closed platform packages are not available in the package registry or the Packag
To install a Closed platform package:

1. Download the package from the relevant developer forum.
2. Use the Package Manager to install the package locally. For information on how to install packages locally, see [Installing a local package](https://docs.unity3d.com/Manual/upm-ui-local.html).
2. Use the Package Manager to install the package locally. For information on how to install packages locally, refer to [Installing a local package](https://docs.unity3d.com/Manual/upm-ui-local.html).
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installing the Universal Render Pipeline into an existing Project

You can download and install the latest version of the Universal Render Pipeline (URP) to your existing Project via the [Package Manager system](https://docs.unity3d.com/Packages/com.unity.package-manager-ui@latest/index.html), and then install it into your Project. If you don’t have an existing Project, see documentation on [how to start a new URP Project from a Template](creating-a-new-project-with-urp.md).
You can download and install the latest version of the Universal Render Pipeline (URP) to your existing Project via the [Package Manager system](https://docs.unity3d.com/Packages/com.unity.package-manager-ui@latest/index.html), and then install it into your Project. If you don’t have an existing Project, refer to [how to start a new URP Project from a Template](creating-a-new-project-with-urp.md).

## Before you begin

Expand All @@ -27,7 +27,7 @@ The [Universal Render Pipeline Asset](universalrp-asset.md) (URP Asset) contains
To create a Universal Render Pipeline Asset:

1. In the Editor, go to the Project window.
2. Right-click in the Project window, and select __Create > Rendering > URP Asset__. Alternatively, navigate to the menu bar at the top, and select __Assets > Create > Rendering > Universal Render Pipeline > Pipeline Asset__.
2. Right-click in the Project window, and select **Create** > **Rendering** > **URP Asset (with Universal Renderer)**. Alternatively, navigate to the menu bar at the top, and select **Assets** > **Create** > **Rendering** > **URP Asset (with Universal Renderer)**.

You can either leave the default name for the new Universal Render Pipeline Asset, or type a new one.

Expand All @@ -51,4 +51,4 @@ Set an override URP Assets for different quality levels:

## Upgrading your shaders

If your project uses the prebuilt [Standard Shader](https://docs.unity3d.com/Manual/shader-StandardShader.html), or custom Unity shaders made for the Built-in Render Pipeline, you must convert them to URP-compatible Unity shaders. For more information on this topic, see [Upgrading your Shaders](upgrading-your-shaders.md).
If your project uses the prebuilt [Standard Shader](https://docs.unity3d.com/Manual/shader-StandardShader.html), or custom Unity shaders made for the Built-in Render Pipeline, you must convert them to URP-compatible Unity shaders. For more information on this topic, refer to [Upgrading your Shaders](upgrading-your-shaders.md).
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ To use the Universal Render Pipeline (URP), you can start a new Project or upgra

**Note:** URP does not currently support custom post-processing effects. If your Project uses custom post-processing effects, these cannot currently be recreated in URP. Custom post-processing effects will be supported in a forthcoming release of URP.

**Note:** Projects made using URP are not compatible with the High Definition Render Pipeline (HDRP) or the Built-in Render Pipeline. Before you start development, you must decide which render pipeline to use in your Project. For information on choosing a render pipeline, see [the Render Pipelines section of the Unity Manual](https://docs.unity3d.com/2019.3/Documentation/Manual/render-pipelines.html).
**Note:** Projects made using URP are not compatible with the High Definition Render Pipeline (HDRP) or the Built-in Render Pipeline. Before you start development, you must decide which render pipeline to use in your Project. For information on choosing a render pipeline, refer to [the Render Pipelines section of the Unity Manual](https://docs.unity3d.com/2019.3/Documentation/Manual/render-pipelines.html).
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This effect helps you to render perspective views in Scenes with a very large field of view. Panini projection is a cylindrical projection, which means that it keeps vertical straight lines straight and vertical. Unlike other cylindrical projections, panini projection keeps radial lines through the center of the image straight too.

For more information about panini projection, see PanoTools’ wiki documentation on [General Panini Projection](https://wiki.panotools.org/The_General_Panini_Projection).
For more information about panini projection, refer to PanoTools’ wiki documentation on [General Panini Projection](https://wiki.panotools.org/The_General_Panini_Projection).

## Using Panini Projection

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ The White Balance component applies a white balance effect that removes unrealis

| **Property** | **Description** |
| --------------- | ------------------------------------------------------------ |
| **Temperature** | Use the slider to set the white balance to a custom color temperature. Higher values result in a warmer color temperature and lower values result in a colder color temperature. See [Wikipedia: Color balance](https://en.wikipedia.org/wiki/Color_balance) for more information about color temperature. |
| **Temperature** | Use the slider to set the white balance to a custom color temperature. Higher values result in a warmer color temperature and lower values result in a colder color temperature. Refer to [Wikipedia: Color balance](https://en.wikipedia.org/wiki/Color_balance) for more information about color temperature. |
| **Tint** | Use the slider to compensate for a green or magenta tint. |
Loading