Skip to content

Commit

Permalink
DOCG-5984 Improved the Custom post-processing section, migrated the F…
Browse files Browse the repository at this point in the history
…ullscreen Master Stack pages.

Added a reference to the custom renderer feature page.
Added a reference to custom-post-processing.md on the customizing-urp.md page.
Implemented the same structure as in the 6000 version.
Copied Fullscreen Master Stack pages, the feature is implemented in 2022.3 and was not documented in URP.
Converted the formatting from the main manual to URP.
  • Loading branch information
oleks-k authored and Evergreen committed Dec 2, 2024
1 parent f1b0fde commit 846f4cf
Show file tree
Hide file tree
Showing 14 changed files with 281 additions and 27 deletions.
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 @@ -101,9 +101,12 @@
* [Vignette](post-processing-vignette.md)
* [White Balance](Post-Processing-White-Balance.md)
* [Lens Flare](shared/lens-flare/lens-flare-component.md)
* [Custom Post-processing](post-processing/custom-post-processing.md)
* [How to create a custom post-processing effect](post-processing/post-processing-custom-effect-low-code.md)

* [Custom post-processing](post-processing/custom-post-processing.md)
* [Create a custom post-processing effect in URP](post-processing/post-processing-custom-effect-low-code.md)
* [Full Screen Pass Renderer Feature reference for URP](renderer-features/renderer-feature-full-screen-pass.md)
* [Creating a full-screen shader in Shader Graph in URP](urp-shaders/fullscreen-master-stack-urp.md)
* [Fullscreen Master Stack for Shader Graph in URP](urp-shaders/fullscreen-master-stack-shader-graph.md)
* [Fullscreen Master Stack in Shader Graph reference for URP](urp-shaders/fullscreen-master-stack-reference.md)
* [Shaders and Materials](shaders-in-universalrp.md)
* [Shading Models](shading-model.md)
* [Material Variants](materialvariant-URP.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Customize and extend the rendering process in the Universal Render Pipeline (URP
|[Custom render passes](renderer-features/custom-rendering-passes.md)|Create a custom render pass in a C# script and inject it into the URP frame rendering loop.|
|[Injection points reference](customize/custom-pass-injection-points.md)|The injection points you can use to inject render passes into the frame rendering loop.|
|[Scriptable Renderer Feature and Scriptable Render Pass API reference](renderer-features/scriptable-renderer-features/scriptable-renderer-feature-reference.md)|Common methods you can use to write Scriptable Renderer Passes and Scriptable Renderer Features.|
| [Custom post-processing](post-processing/custom-post-processing.md) | Different approaches to creating custom post-processing effects. |

## Additional resources

- [Pre-built effects (Renderer Features)](urp-renderer-feature.md)
- [How to create a custom post-processing effect](post-processing/post-processing-custom-effect-low-code.md)
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Custom post-processing

The Universal Render Pipeline (URP) provides a variety of pre-built [post-processing effects](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@15.0/manual/integration-with-post-processing.html) that you can adjust to create a particular visual effect or style. URP also lets you create custom post-processing effects using the [Full Screen Pass Renderer Feature](../renderer-features/renderer-feature-full-screen-pass.md). For example, you can implement a grayscale effect to indicate when a player has run out of health.
---
uid: urp-custom-post-processing
---

![Scene with no post-processing effects.](../Images/post-proc/custom-effect/no-custom-effect.png)
<br/>*Scene with no post-processing effects.*
# Custom post-processing

![Scene with grayscale custom post-processing effect.](../Images/post-proc/custom-effect/grayscale-custom-effect.png)
<br/>*Scene with grayscale custom post-processing effect.*
The Universal Render Pipeline (URP) provides a variety of pre-built [post-processing effects](../integration-with-post-processing) that you can adjust to create a particular visual effect or style. URP also lets you create custom post-processing effects.

The following page describes how to create a custom post-processing effect using the [Full Screen Pass Renderer Feature](../renderer-features/renderer-feature-full-screen-pass.md).
The following pages describe different approaches to creating custom post-processing effects.

* [How to create a custom post-processing effect](post-processing-custom-effect-low-code.md).
| Page | Description |
|-|-|
| [Create a low-code custom post-processing effect](post-processing-custom-effect-low-code.md) | How to use a Full Screen Render Pass to create a low-code custom post-processing effect. |
| [Full Screen Pass Renderer Feature reference](../renderer-features/renderer-feature-full-screen-pass.md) | Understand the Full Screen Pass Renderer Feature. |
| [Creating a full-screen shader in Shader Graph in URP](../urp-shaders/fullscreen-master-stack-urp.md) | Resources for working with the Fullscreen Master Stack to create full screen shaders in Shader Graph. |
| [Example of a complete Scriptable Renderer Feature](../renderer-features/create-custom-renderer-feature.md) | You can use a custom Renderer Feature with a Volume component support for implementing custom post-processing effects. |
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# How to create a custom post-processing effect
---
uid: urp-post-processing-custom-effect-low-code
---

The example on this page shows how to use a Full Screen Render Pass to create a grayscale custom post-processing effect.
# Create a low-code custom post-processing effect in URP

The example on this page shows how to use the Full Screen Render Pass Renderer Feature to create a grayscale custom post-processing effect.

For more information on the Full Screen Render Pass Renderer Feature, refer to the [Full Screen Pass Renderer Feature reference](../renderer-features/renderer-feature-full-screen-pass.md).

## Prerequisites

This example requires the following:

- A Unity project with the URP package installed.
* A Unity project with the URP package installed.

- The **Scriptable Render Pipeline Settings** property refers to a URP asset (**Project Settings** > **Graphics** > **Scriptable Render Pipeline Settings**).
* The **Scriptable Render Pipeline Settings** property refers to a URP asset (**Project Settings** > **Graphics** > **Scriptable Render Pipeline Settings**).

## Create a Fullscreen Shader Graph

Expand All @@ -19,9 +25,9 @@ You must create a Fullscreen Shader Graph to create a custom post-processing eff
3. In the **URP Sample Buffer** node's **Source Buffer** dropdown menu, select **BlitSource**.
4. Add a **Vector 3** node.
5. Assign the **Vector 3** node the following values:
- **X** = 0.2126
- **Y** = 0.7152
- **Z** = 0.0722
* **X** = 0.2126
* **Y** = 0.7152
* **Z** = 0.0722
6. Add a **Dot Product** node.
7. Connect the nodes as shown below.

Expand All @@ -41,13 +47,15 @@ You must create a Fullscreen Shader Graph to create a custom post-processing eff

Once you've created a compatible Shader Graph and Material, you can use the Material with a Full Screen Pass Renderer Feature to create a custom post-processing effect.

1. In the Project window, select a URP Renderer.
2. In the Inspector, click **Add Renderer Feature** and select **Full Screen Pass Renderer Feature**. For more information on adding Renderer Features refer to [How to add a Renderer Feature to a Renderer](./../urp-renderer-feature-how-to-add.md).
3. Set the **Post Process Material** to the Material you created with the Fullscreen Shader Graph.
1. Select your project's Universal Renderer.

If you created your project using the **Universal 3D** template, you can find the Universal Renderers in the following project folder: **Assets** > **Settings**.

2. In the Inspector, click **Add Renderer Feature** and select **Full Screen Pass Renderer Feature**. For more information on adding Renderer Features refer to [How to add a Renderer Feature to a Renderer](../urp-renderer-feature-how-to-add.md).
3. Set the **Pass Material** field to the Material you created with the Fullscreen Shader Graph.
4. Set **Injection Point** to **After Rendering Post Processing**.
5. Set **Requirements** to **Color**.

You should now see the effect in both Scene view and Game view.
You should now notice the effect in both Scene view and Game view.

![Example scene with a grayscale custom post-processing effect.](../Images/post-proc/custom-effect/grayscale-custom-effect.png)
<br/>*Example scene with a grayscale custom post-processing effect.*
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Full Screen Pass Renderer Feature reference
---
uid: urp-renderer-feature-full-screen-pass
---

Refer to [How to create a custom post-processing effect](../post-processing/post-processing-custom-effect-low-code.md) for information on how to create a full screen effect using the Full Screen Pass Renderer Feature.
# Full Screen Pass Renderer Feature reference for URP

The Full Screen Pass Renderer Feature lets you inject full screen render passes at pre-defined injection points to create full screen effects.

You can use this Renderer Feature to create [custom post-processing effects](../post-processing/custom-post-processing.md).

## How to use the feature

To add the Renderer Feature to your scene:

1. [Add the Full Screen Pass Renderer Feature](../urp-renderer-feature.md) to the URP Renderer.

Refer to the following page for an example of how to use this feature:

* [How to create a custom post-processing effect](../post-processing/post-processing-custom-effect-low-code.md).

## Properties

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<tr>
<td><strong>Alpha</strong></td>
<td>The Material's alpha value. This determines how transparent the material is. The expected range is 0 - 1.</td>
<td>None</td>
<td>1.0</td>
</tr>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<tr>
<td><strong>Base Color</strong></td>
<td>The base color of the material.</td>
<td>None</td>
<td>Color.grey</td>
</tr>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<tr>
<td><strong>Eye Depth</strong></td>
<td>Scales a value to world space to represent the depth from the near plane. This value represents a point in world space, determined by the platform you use. For more information, refer to <a href="https://docs.unity3d.com/Manual/SL-PlatformDifferences.html">The Depth (Z) direction in Shaders</a>.</td>
<td>In <strong>Graph Settings</strong>:<br/>
&#8226; Enable <strong>Depth Write</strong>.<br/>&#8226; Set <strong>Depth Write Mode</strong> to <strong>LinearEye</strong>.</td>
<td>0</td>
</tr>

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<tr>
<td><strong>Linear 01 Depth</strong></td>
<td>Uses a linear depth value between 0 and 1.</td>
<td>In <strong>Graph Settings</strong>:<br/>
&#8226; Enable <strong>Depth Write</strong>.<br/>&#8226; Set <strong>Depth Write Mode</strong> to <strong>Linear01</strong>.</td>
<td>0</td>
</tr>

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<tr>
<td><strong>Raw Depth</strong></td>
<td>Samples the depth value from the depth buffer. You can also use this setting with a nonlinear depth value.</td>
<td>In <strong>Graph Settings</strong>:<br/>
&#8226; Enable <strong>Depth Write</strong>.<br/>&#8226; Set <strong>Depth Write Mode</strong> to <strong>Raw</strong>.</td>
<td>0</td>
</tr>

Loading

0 comments on commit 846f4cf

Please sign in to comment.