Skip to content

Commit 7003793

Browse files
committed
Fixed typos.
1 parent 7c7a826 commit 7003793

1 file changed

Lines changed: 32 additions & 22 deletions

File tree

README.md

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Customizable Post-processing Stack for Universal Render Pipeline
22

3-
This package adds the ability to create custom post-processing effects for the universal render pipeline in a manner similar to [PPSv2](https://github.com/Unity-Technologies/PostProcessing) and [HDRP's Custom Post Process](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@8.2/manual/Custom-Post-Process.html). It is supposed to be a replacement for Unity's **PPSv2** till URP internally supports custom post-processing effect.
3+
This package adds the ability to create custom post-processing effects for the universal render pipeline in a manner similar to [PPSv2](https://github.com/Unity-Technologies/PostProcessing) and [HDRP's Custom Post Process](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@8.2/manual/Custom-Post-Process.html). It is supposed to be a replacement for Unity's **PPSv2** till URP internally supports custom post-processing effects.
44

5-
**Note:** You can add you custom effects in URP by inheriting from the `ScriptableRendererFeature` and `ScriptableRenderPass` classes. I personally find this to be hassle and that is why I wrote this package merely for convenience. I also took it as a chance to pick up the features I like from every post-processing solution I used for unity.
5+
**Note:** You can already add you custom effects to URP by inheriting from the `ScriptableRendererFeature` and `ScriptableRenderPass` classes. I personally find this to be a hassle and that is why I wrote this package merely for convenience. I also took it as a chance to pick up the features I like from every post-processing solution I used in Unity.
66

77
## System Requirements
88

@@ -11,18 +11,20 @@ This package adds the ability to create custom post-processing effects for the u
1111

1212
## Features
1313

14-
* Conveniently add custom post processing effects similar to [PPSv2](https://github.com/Unity-Technologies/PostProcessing) (at least more convenient that writing a renderer feature and a render pass).
14+
* Conveniently add custom post processing effects similar to [PPSv2](https://github.com/Unity-Technologies/PostProcessing) (at least more convenient that writing a renderer feature and a render pass for every effect).
1515
* Reorder effects from the editor similar to HDRP's [Custom Post Process Orders Settings](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@8.2/manual/Custom-Post-Process.html#effect-ordering).
16-
* Use legacy image effect shaders and unlit shader graphs if you wish (To be honest I didn't do anything, it worked out of the box so I added it to features list).
17-
* Use `SceneNormals` feature (adapted from [Outline Study](https://github.com/chrisloop/outlinestudy) by [Christopher Sims](https://github.com/chrisloop)) to grab the scene normals on a texture.
16+
* Use legacy image effect shaders and unlit shader graphs if you wish (To be honest I didn't do anything, it worked out of the box so I added it to the features list).
17+
* Use it with Camera Stacking.
18+
* Use the `SceneNormals` feature (adapted from [Outline Study](https://github.com/chrisloop/outlinestudy) by [Christopher Sims](https://github.com/chrisloop)) to grab the scene normals onto a texture.
1819

1920
Features that are almost untested:
20-
* Compatible with MultiPass XR but it is tested with Mock HMD Loader only so I can't guarantee that it works on an actual headset.
21+
* It should be compatible with MultiPass XR but it is tested with Mock HMD Loader only so I can't guarantee that it works on an actual headset.
22+
* 2D renderers don't support renderer features yet. However, you can use camera stacking and stack a camera with a forward renderer on top of the camera with the 2D renderer. The forward renderer will apply the post processing to the result of the 2D renderer. I tried it and it worked but I didn't heavily test it yet.
2123

2224
## Known Issues
2325

24-
* It failed to work with Single-Pass Instanced Stereo Rendering. Actually, URP didn't work for me in this mode so I don't the reason behind this issue.
25-
* The `SceneNormals` renderer feature uses the override material in the draw settings. This means that it doesn't not copy the parameters of the original material such as normal maps and alpha clipping. This should be solved in URP 10.0 with the release of the `DepthNormalsPass` made for the SSAO feature.
26+
* It failed to work with Single-Pass Instanced Stereo Rendering. Actually, all of URP didn't work for me in this mode so I don't the reason behind this issue.
27+
* The `SceneNormals` renderer feature uses the override material in the drawing settings. This means that it does not copy the parameters of the original material such as normal maps and alpha clipping. This should be solved in URP 10.0 with the release of the `DepthNormalsPass` made for the SSAO feature.
2628

2729
## Screenshots
2830

@@ -49,13 +51,13 @@ Other custom effects in samples but not used in screenshots:
4951

5052
## How To Install
5153

52-
Follow the instructions from the Unity manual on [Installing from a Git URL](https://docs.unity3d.com/Manual/upm-ui-giturl.html) and insert the url: https://github.com/yahiaetman/urp-custom-pps.git then wait for the package to be downloaded and installed.
54+
Follow the instructions from the Unity manual on [Installing from a Git URL](https://docs.unity3d.com/Manual/upm-ui-giturl.html) and insert the url: https://github.com/yahiaetman/urp-custom-pps.git then wait for the package to be downloaded and installed into the project.
5355

54-
The package contains 8 example effect which are included as a sample. Samples can be imported from the package page in the package manager.
56+
The package contains 8 example effects which are included as a sample. Samples can be imported from the package page in the package manager.
5557

5658
## Tutorial
5759

58-
First, we need a c# shader and a script for our custom effect. We will create a grayscale effect for the sake of simplicity.
60+
First, we need a shader and a c# script for our custom effect. We will create a grayscale effect for the sake of simplicity.
5961

6062
First, lets create the C# script. We will call it `GrayScaleEffect.cs`. The name of the file must match the volume component class name to comply with Unity Serialization rules. In the file write the following:
6163

@@ -129,15 +131,19 @@ public class GrayscaleEffectRenderer : CustomPostProcessRenderer
129131
}
130132
```
131133

132-
As you can see, the code consists of two classes: the volume component and the renderer. The volume component only holds data and will appear as a volume profile option. The renderer is rensponsible for rendering the effect and read the effect parameters from the volume component. The volume component and renderer is decoupled from each other which opens up many options while implementing your effects. For example:
133-
1. You can have a one-to-one relationship between your volume component and renderer (as we did above).
134-
2. You can have a renderer without any corresponding volume component if it does not need any data from the volumes.
134+
As you can see, the code consists of two classes: **a volume component** and **a renderer**.
135+
* The volume component only holds data and will appear as a volume profile option.
136+
* The renderer is rensponsible for rendering the effect and reads the effect parameters from the volume component.
137+
138+
**Volume components** and **Renderers** are decoupled from each other which presents many possibilities while implementing your effects. For example:
139+
1. You can have a one-to-one relationship between your volume component and your renderer (as we did above).
140+
2. You can have a renderer without any corresponding volume components if it does not need any data from the volumes.
135141
3. You can have a renderer that reads from multiple volume components (see [GrayAndInvertEffect.cs](Samples~/Examples/Scripts/PostProcessing/GrayAndInvertEffect.cs) as an example).
136142
4. You can have multiple renderers read from the same volume component(s).
137143

138-
The option #3 is especially useful for writing uber effect shaders that can do multiple effects in the same blit to enhance performance.
144+
Option #3 is especially useful for writing uber effect shaders that can do multiple effects in the same blit to enhance performance.
139145

140-
Then we create the shader code. Create a shader file with any name you like (I prefer `GrayScale.shader`) and replace its content with the following code:
146+
Now back to coding. We need to write the shader code. Create a shader file with any name you like (I prefer `Grayscale.shader`) and replace its content with the following code:
141147

142148
```glsl
143149
Shader "Hidden/PostProcess/Grayscale"
@@ -179,24 +185,28 @@ Shader "Hidden/PostProcess/Grayscale"
179185
}
180186
```
181187

182-
Since vertex shaders rarely contain any logic specific to the effect, we use a default vertex shader `FullScreenTrianglePostProcessVertexProgram` which is included in `Packages/com.yetman.render-pipelines.universal.postprocess/ShaderLibrary/Core.hlsl`. The fragment shader is the one reponsible for reading the original pixel color, calculating the grayscale color and blending the two colors together.
188+
Since vertex shaders rarely contain any logic specific to the effect, we use a default vertex shader `FullScreenTrianglePostProcessVertexProgram` which is included in:
189+
```
190+
Packages/com.yetman.render-pipelines.universal.postprocess/ShaderLibrary/Core.hlsl
191+
```
192+
The fragment shader is the one reponsible for reading the original pixel color, calculating the grayscale color and blending the two colors together.
183193

184-
Now that we have our custom effect, we need to add a `CustomPostProcess` renderer feature to the foward renderer as seen in the next image. You can also add a `SceneNormals` renderer feature if you want to use scene normals in an effect (such as Edge Detection).
194+
Now that we have our custom effect, we need to add a `CustomPostProcess` renderer feature to the `ForwardRenderer` asset as seen in the next image. You can also add a `SceneNormals` renderer feature if you want to use scene normals in an effect (such as Edge Detection).
185195

186196
![Add Renderer Feature](Documentation~/tut-add-renderer-feature.png)
187197

188198
The `CustomPostProcess` renderer feature contains 3 lists that represent 3 injection points in the `ScriptableRenderer` as seen in the next image. The three injection points are:
189199
* **After Opaque and Sky** where we can apply effects before the transparent geometry is rendered.
190-
* **Before Post Process** which happens after the transparent geometry is rendered and before the builtin post processing is applied.
200+
* **Before Post Process** which happens after the transparent geometry is rendered but before the builtin post processing is applied.
191201
* **After Post Process** which happens at the very end before the result is blit to the camera target.
192202

193-
The ordering of the effects in a list is the same order in which they are executed (from top to bottom). You can re-order the effects as you see fit. **Note** that the effect must be added to the renderer feature to be rendered, otherwise, it will be ignored. So we added `GrayScale` to its list `After Post Process`.
203+
The ordering of the effects in a list is the same order in which they are executed (from top to bottom). You can re-order the effects as you see fit. **Note**: Any effect must be added to the renderer feature to be rendered, otherwise, it will be ignored. So we added `GrayScale` to its list `After Post Process`.
194204

195205
![Add GrayScale to After Post Process](Documentation~/tut-add-grayscale-to-after-pp.png)
196206

197-
Then we will create a volume in the scene (or use an existing volume) and add a `GrayScale Effect` volume component to it as seen in the next image.
207+
Then we will create a volume in the scene (or use an existing volume) and add a `Grayscale Effect` volume component to it as seen in the next image.
198208

199-
![Add GrayScale to Volume](Documentation~/tut-add-grayscale-to-volume.png)
209+
![Add Grayscale to Volume](Documentation~/tut-add-grayscale-to-volume.png)
200210

201211
Now you can override the `Blend` parameter and see the view becoming grayscale.
202212

0 commit comments

Comments
 (0)