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/master #8100

Merged
merged 92 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
22164a0
[VFX] Position Circle Feedback
PaulDemeulenaere Aug 20, 2024
2d92d9a
[SpeedTree] Fix UUM-77419: (.st9) asset incorrectly using leaf-facing…
volkan-unity Aug 21, 2024
d96b8ac
[UUM-76115] Fix display of Shader Graph shortcuts in context menus
dhsavell Aug 21, 2024
7f3174c
[UUM-70329] Set the 'Maximum Shadows on Screen' limit to 65536.
mseonkim-unity Aug 21, 2024
6ed7b6c
[Fix] UUM-76816 - RenderGraph Error's when resizing the sceneview
LagueKristin Aug 21, 2024
416fb36
[UUM-73033] Fix Color Lookup causing GC.Alloc every frame
seungwon-oh Aug 22, 2024
fb9a646
2d/staging/tilemap/gpuskinningsrpbatcher
ChuanXin-Unity Aug 22, 2024
ee11760
Fix a bug that Disable Color Tint setting in a shader graph has no ef…
MinseokLee-Unity Aug 22, 2024
56a6407
Sg/uum 76198 remove context block delete option
JangkyuSeo Aug 22, 2024
155dee7
SG integration: Read unexposed global properties from cbuffer
gabrieldelacruz Aug 22, 2024
ee713e7
[ShaderGraph] Fix for identifier name conflicts with underscore prefix.
Aug 22, 2024
31afd64
[Unity 6][URP] Fixing light leak when using point lights (UUM-78494)
ellioman Aug 22, 2024
4ff6edb
fix camera offset in the UI editor for the RenderObject feature UUM-7…
UnityAljosha Aug 22, 2024
12b6a5f
[6000] Add depth of field graphics test for Renderer2D
kennytann Aug 23, 2024
3d4b05d
[ShaderGraph] [UUM-76021] Fix node previews toggle shortcut
mseonkim-unity Aug 23, 2024
c0a4a5a
[ShaderGraph] [UUM-75921] Add sticky note checks to the group shortcuts
mseonkim-unity Aug 23, 2024
593c5c9
[Unity 6][URP] Fixing an issue where Prefiltering data wasn't updated…
ellioman Aug 24, 2024
0b2d5d0
[VFX] Some Strip attributes don't behave correctly
gabrieldelacruz Aug 26, 2024
6666577
[UUM-68514] fixed nondeterministic PathTracing tests
katana7755 Aug 26, 2024
20736ce
Fix DefaultVolumeProfile UI errors
arttu-peltonen Aug 26, 2024
7218c88
[Unity 6][URP] Fixing a Invalid Depth format error when clicking CTRL…
ellioman Aug 26, 2024
64ae343
Prevent URP creation from UniversalCameraAdditionalData.OnDestroy
RSlysz Aug 26, 2024
7a76336
Add TAA with CAS and no upscale case.
eh-unity Aug 27, 2024
a50b0bc
RenderGraph - Fix failing test on non-compatible Compute Shaders plat…
YohannVaastUnity Aug 27, 2024
10fc0c9
Fix issues with EndCameraRendering
acohade-U Aug 27, 2024
ecefa77
Disable the LOD_FADE_CROSSFADE keyword in the URP material upgrader
ApoorvaJ Aug 27, 2024
725e272
Fix EndLayoutGroup UI Error on Mac when baking APV
laylaarab Aug 28, 2024
552c298
[UUM-75935] Prevent excessively large numeric errors when calculating…
seungchan-jeong Aug 28, 2024
2576dc7
[URP] UniversalRenderer: Disable depth-priming for wireframe rendering.
amsXYZ Aug 28, 2024
b00a28a
Restore parity between URP and HDRP in the Rendering Layers Debug View
MaximeGrangeUnity Aug 29, 2024
2966136
[HDRP] - Fix Dynamic Scaling Issues in CopyDepth Function
gmitrano-unity Aug 29, 2024
dac7778
[SRPF] Incorrect usage of GetLastDefinedRenderingLayerIndex as a size…
kirill-titov-u Aug 29, 2024
481980f
[VFX] Fix Convert to SG Triangle
PaulDemeulenaere Aug 29, 2024
d3fec77
Graphics/SRP/RPF - [UUM-78657] Updated HDRenderUtilities documentatio…
axoloto Aug 30, 2024
8476c0f
Fix NRP Compiler Store Action Data Corruption & Misc RG/NRP Improvements
gmitrano-unity Aug 30, 2024
747e7e5
[HDRP] HDAdditionalLightData.RequestSubShadowMapRendering on directio…
SuminCho1 Aug 30, 2024
e0f1c49
Fix shader warnings
ApoorvaJ Aug 30, 2024
44b41d2
[VFX] Fixed node search expand/collapse button can be blurry
julienamsellem Aug 30, 2024
069e47e
[VFX] Avoid blocking exception on missing type
PaulDemeulenaere Aug 30, 2024
cba70e0
Fix light unit lux conversion
Aug 30, 2024
be09ecb
[2d] Fix (Case UUM-77050) ShaderGraph sprite is replaced by a blue bo…
venkify Sep 2, 2024
f49575c
[6000][UUM-78999] Add depth write/test options to sprite targets shad…
kennytann Sep 2, 2024
cd0cdcc
Fix some issues related to physical DoF
alelievr Sep 3, 2024
1f8484d
[VFX][Samples] Strips learning samples
OrsonFavrel Sep 4, 2024
124cc71
[UUM-64808] Add alpha clamping to BloomPrefilter.compute
mseonkim-unity Sep 4, 2024
ef54ee4
[UUM-78448][UUM-75824] Fix post processing when camera stacking + Giz…
kennytann Sep 4, 2024
a6248a7
Fix APV scenario blending not interacting properly with streaming
pema99 Sep 4, 2024
347481f
Sg/uum 76242 restore selection after undo
JangkyuSeo Sep 4, 2024
d386071
[SRPF] Updated Mathematics to 1.3.2 for U6
kirill-titov-u Sep 4, 2024
ec90f43
UUM-79124: Fix APV compatability with asset bundles and addressables.
pema99 Sep 5, 2024
aecaf4d
Fix UUM-78116 Reflection Proxy Volume gizmo handles cannot be interac…
YvainRaeymaekers Sep 5, 2024
692134a
Fix missing distance to depth conversion
alelievr Sep 5, 2024
5ca7d0c
LineRendering: Fixed segment-culling for single-pass stereo rendering.
amsXYZ Sep 5, 2024
979d703
Fixed Foveated Rendering Shader Graph error on Mac
thomas-zeng Sep 6, 2024
7f968ef
Fix a bug that Normal From Height node generates incorrect shader cod…
MinseokLee-Unity Sep 6, 2024
1d22912
Fix GPUResidentDrawer exception: NewLength 8 is out of range of '7' C…
vincent-breysse Sep 6, 2024
97e9cf1
[WebGPU] Fallback for rendering layers 16 bit mask
christing12 Sep 6, 2024
d7493d7
UUM-74682: Fix LightBaking not working properly on AMD
pigselated Sep 6, 2024
6786dc8
Fix 'Objects are trying to be loaded during a domain backup' errors o…
MinseokLee-Unity Sep 7, 2024
81b8048
Fix a APV cannot be enabled when scene and game view are not shown
nanho-lee Sep 9, 2024
9df1705
Sg/uum 76254 empty group paste location
JangkyuSeo Sep 9, 2024
1fc2d32
Fixed the BlockNode to display the name using DisplayName.
JangkyuSeo Sep 9, 2024
063aa8b
Added documentation for [Scene Color Sampling fails when using a cust…
nanho-lee Sep 9, 2024
e60a9db
[URP]UniversalAdditionalCameraData uses default asset renderer if cam…
Sep 9, 2024
3e67204
Additional error checking when Importing textures into RenderGraph
UnityAljosha Sep 10, 2024
bae252e
Change 'Graph Inspector' and 'Open Shader Graph User Manual' icons to…
geunheepark-unity Sep 10, 2024
3331917
[VFX][Doc] VFX Graph doc improvements 2nd pass
julienf-unity Sep 10, 2024
d93961c
[Shader Graph] Simplified the code for Camera Direction
bencloward Sep 11, 2024
e676c97
Migrate URP documentation and restructure all graphics documentation
markg-unity Sep 11, 2024
67a7ae5
DOCG-5949 Move custom render pipeline docs from main manual into SRP …
markg-unity Sep 11, 2024
88ef561
Move a copy of main manual SRP Batcher and BRG pages to HDRP
markg-unity Sep 11, 2024
92188bc
[UUM-73849] Make native render pass option follows universal renderer…
seungchan-jeong Sep 12, 2024
2b65312
[UUM-78038] Fix cascade shadows and distance shadowmask not blending
seungwon-oh Sep 12, 2024
2271e5d
[UUM-64059] made ForwardLit and GBuffer passes of URP's speed tree sh…
katana7755 Sep 12, 2024
61d00cb
Add padding to Shader graph preferences settings
geunheepark-unity Sep 12, 2024
152ce20
[UUM-70628] Fix sun flicker where the sun is close to cloud boundaries.
mseonkim-unity Sep 12, 2024
93c3d34
Fixed Render Graph Blit utils error when using multiple times in succ…
Nzollner Sep 13, 2024
2d044e9
[UUM-79452][6000] Fix rendergraph2d light look up resource usage
kennytann Sep 13, 2024
c2db13a
Edited the TableOfContents.md and the index.md files to tell users th…
oleks-k Sep 13, 2024
af3d6e5
[WebGPU] URP Foundation Yamato Tests
christing12 Sep 14, 2024
b9a666f
Fix RPCore RenderGraphPerformanceTests after additional error checkin…
raquelpeces Sep 16, 2024
52609de
[VFX] Fixed sticky notes resizing was broken in some cases
julienamsellem Sep 17, 2024
ce0c351
Additional URP Render Graph Fixes & Improvements
gmitrano-unity Sep 18, 2024
8a59caa
Lighting/fix freeze during apv bake in terrain demo scene
YvainRaeymaekers Sep 18, 2024
00778c6
[SRP][ANT-2307] Remove unused projects
theopnv Sep 18, 2024
6eb9523
[HDRP] Fix an expensive call to FindObjectsOfTypeAll causing inspecto…
remi-chapelain Sep 18, 2024
8ef2ead
Graphics/SRP/RPF - [UUM-76816] - Fix RenderGraph Error when resizing …
axoloto Sep 18, 2024
37729a3
Fix depth stencil format for cameraDepthAttachment and cameraDepthTex…
UnityAljosha Sep 18, 2024
f9439a5
[Unity 6][URP] Fixing an issue where RG had two extra shadow textures
ellioman Sep 18, 2024
a806f0b
[VFX] Custom hlsl parsing issues
julienamsellem Sep 19, 2024
b516dcf
Graphics/urp/bugfix/uum 77906
eh-unity Sep 19, 2024
28c0840
[VFX] Strip tangent not properly computed when using Shader Graph output
gabrieldelacruz Sep 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 0 additions & 32 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -337,38 +337,6 @@ Editor/Resources/unity[[:space:]]editor[[:space:]]resources filter=lfs diff=lfs
**/SRP_SmokeTest/**/*.tiff filter=lfs diff=lfs merge=lfs -text
**/SRP_SmokeTest/**/*.ttf filter=lfs diff=lfs merge=lfs -text
**/SRP_SmokeTest/**/*.vfx filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.bytes filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.cube filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.dds filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.exp filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.FBX filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.fbx filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.hdr filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.jpeg filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.jpg filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.png filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.psd filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.tga filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.tif filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.tiff filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.ttf filter=lfs diff=lfs merge=lfs -text
**/UniversalGfxTestStereo/**/*.vfx filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.bytes filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.cube filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.dds filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.exp filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.FBX filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.fbx filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.hdr filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.jpeg filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.jpg filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.png filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.psd filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.tga filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.tif filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.tiff filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.ttf filter=lfs diff=lfs merge=lfs -text
**/UniversalUpgradeTest/**/*.vfx filter=lfs diff=lfs merge=lfs -text

**/com.unity.template-hd/Assets/Scenes/SampleScene/LightingData.asset filter=lfs diff=lfs merge=lfs -text
**/HDRP_PerformanceTests/Assets/Scenes/Lighting/Cloud.asset filter=lfs diff=lfs merge=lfs -text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
* [What's new](whats-new.md)
* [12](whats-new-12.md)
* [13](whats-new-13.md)
* [Creating a custom render pipeline](srp-custom.md)
* [Create a custom Scriptable Render Pipeline](srp-custom-getting-started.md)
* [Create a Render Pipeline Asset and Render Pipeline Instance in a custom render pipeline](srp-creating-render-pipeline-asset-and-render-pipeline-instance.md)
* [Create a simple render loop in a custom render pipeline](srp-creating-simple-render-loop.md)
* [Execute rendering commands in a custom render pipeline](srp-using-scriptable-render-context.md)
* [Scriptable Render Pipeline callbacks reference](srp-callbacks-reference.md)
* Camera components
* [Free Camera](Free-Camera.md)
* [Camera Switcher](Camera-Switcher.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# SRP Core

![](https://blogs.unity3d.com/wp-content/uploads/2018/01/image5_rs.png)

The Scriptable Render Pipeline (SRP) is a Unity feature that allows you to write C# scripts to control the way Unity renders each frame. SRP Core is a package that makes it easier to create or customize an SRP.

SRP Core contains reusable code, including boilerplate code for working with platform-specific graphics APIs, utility functions for common rendering operations, and the shader libraries used in the High Definition Render Pipeline (HDRP) and Universal Render Pipeline (URP).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Scriptable Render Pipeline callbacks reference

When working with SRP, use these to make Unity call your C# code at specific times.

* [RenderPipeline.Render](xref:UnityEngine.Rendering.RenderPipeline.Render(UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Camera[])) is the main entry point to the SRP. Unity calls this method automatically. If you are writing a custom render pipeline, this is where you begin to write your code.
* The [RenderPipelineManager](xref:UnityEngine.Rendering.RenderPipelineManager) class has the following events that you can subscribe to, so that you can execute custom code at specific points in the render loop:
* [beginFrameRendering](xref:UnityEngine.Rendering.RenderPipeline.BeginFrameRendering(UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Camera[])) - **Note:** This can generate garbage. Use `beginContextRendering` instead.
* [endFrameRendering](xref:UnityEngine.Rendering.RenderPipeline.EndFrameRendering(UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Camera[])) - **Note:** This can generate garbage. Use `endContextRendering` instead.
* [beginContextRendering](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Rendering.RenderPipelineManager-beginContextRendering.html)
* [endContextRendering](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Rendering.RenderPipelineManager-endContextRendering.html)
* [beginCameraRendering](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Rendering.RenderPipelineManager-beginCameraRendering.html)
* [endCameraRendering](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Rendering.RenderPipelineManager-endCameraRendering.html)
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
uid: um-srp-creating-render-pipeline-asset-and-render-pipeline-instance
---

# Create a Render Pipeline Asset and Render Pipeline Instance in a custom render pipeline

If you are creating your own render pipeline based on the Scriptable Render Pipeline (SRP), your Project must contain:

* A script that inherits from [RenderPipelineAsset](xref:UnityEngine.Rendering.RenderPipelineAsset) and overrides its `CreatePipeline()` method. This script defines your Render Pipeline Asset.
* A script that inherits from [RenderPipeline](xref:UnityEngine.Rendering.RenderPipeline), and overrides its `Render()` method. This script defines your Render Pipeline Instance, and is where you write your custom rendering code.
* A Render Pipeline Asset that you have created from your [RenderPipelineAsset](xref:UnityEngine.Rendering.RenderPipelineAsset) script. This asset acts as a factory class for your Render Pipeline Instance.

Because these elements are so closely related, you should create them at the same time.

## Creating a basic Render Pipeline Asset and Render Pipeline Instance

The following example shows how to create a script for a basic custom Render Pipeline Asset that instantiates the Render Pipeline Instance, a script that defines the Render Pipeline Instance, and the Render Pipeline Asset itself.

1. Create a C# script called _ExampleRenderPipelineAsset.cs_.

2. Copy and paste the following code into the new script:

```lang-csharp
using UnityEngine;
using UnityEngine.Rendering;

// The CreateAssetMenu attribute lets you create instances of this class in the Unity Editor.
[CreateAssetMenu(menuName = "Rendering/ExampleRenderPipelineAsset")]
public class ExampleRenderPipelineAsset : RenderPipelineAsset
{
// Unity calls this method before rendering the first frame.
// If a setting on the Render Pipeline Asset changes, Unity destroys the current Render Pipeline Instance and calls this method again before rendering the next frame.
protected override RenderPipeline CreatePipeline() {
// Instantiate the Render Pipeline that this custom SRP uses for rendering.
return new ExampleRenderPipelineInstance();
}
}
```

3. Create a C# script called _ExampleRenderPipelineInstance.cs_.

4. Copy and paste the following code into the new script:


```lang-csharp
using UnityEngine;
using UnityEngine.Rendering;

public class ExampleRenderPipelineInstance : RenderPipeline
{
public ExampleRenderPipelineInstance() {
}

protected override void Render (ScriptableRenderContext context, Camera[] cameras) {
// This is where you can write custom rendering code. Customize this method to customize your SRP.
}
}
```

5. In the Project view, either click the add (+) button, or open the context menu and navigate to **Create**, and then choose **Rendering** > **Example Render Pipeline Asset**. Unity creates a new Render Pipeline Asset in the Project view.

## Creating a configurable Render Pipeline Asset and Render Pipeline Instance

By default, a Render Pipeline Asset stores information about which Render Pipeline Instance to use for rendering, and the default Materials and Shaders to use in the Editor. In your `RenderPipelineAsset` script, you can extend your Render Pipeline Asset so that it stores additional data, and you can have multiple different Render Pipeline Assets with different configurations in your Project. For example, you might use a Render Pipeline Asset to hold configuration data for each different tier of hardware. The High Definition Render Pipeline (HDRP) and the Universal Render Pipeline (URP) include examples of this.

The following example shows how to create a `RenderPipelineAsset` script that defines a Render Pipeline Asset with public data that you can set for each instance using the Inspector, and a Render Pipeline Instance that receives a Render Pipeline Asset in its constructor and uses data from that Render Pipeline Asset.

1. Create a C# script called _ExampleRenderPipelineAsset.cs_.

2. Copy and paste the following code into the new script:

```lang-csharp
using UnityEngine;
using UnityEngine.Rendering;

// The CreateAssetMenu attribute lets you create instances of this class in the Unity Editor.
[CreateAssetMenu(menuName = "Rendering/ExampleRenderPipelineAsset")]
public class ExampleRenderPipelineAsset : RenderPipelineAsset
{
// This data can be defined in the Inspector for each Render Pipeline Asset
public Color exampleColor;
public string exampleString;

// Unity calls this method before rendering the first frame.
// If a setting on the Render Pipeline Asset changes, Unity destroys the current Render Pipeline Instance and calls this method again before rendering the next frame.
protected override RenderPipeline CreatePipeline() {
// Instantiate the Render Pipeline that this custom SRP uses for rendering, and pass a reference to this Render Pipeline Asset.
// The Render Pipeline Instance can then access the configuration data defined above.
return new ExampleRenderPipelineInstance(this);
}
}
```

3. Create a C# script called _ExampleRenderPipelineInstance.cs_.

4. Copy and paste the following code into the new script:

```lang-csharp
using UnityEngine;
using UnityEngine.Rendering;

public class ExampleRenderPipelineInstance : RenderPipeline
{
// Use this variable to a reference to the Render Pipeline Asset that was passed to the constructor
private ExampleRenderPipelineAsset renderPipelineAsset;

// The constructor has an instance of the ExampleRenderPipelineAsset class as its parameter.
public ExampleRenderPipelineInstance(ExampleRenderPipelineAsset asset) {
renderPipelineAsset = asset;
}

protected override void Render(ScriptableRenderContext context, Camera[] cameras) {
// This is an example of using the data from the Render Pipeline Asset.
Debug.Log(renderPipelineAsset.exampleString);

// This is where you can write custom rendering code. Customize this method to customize your SRP.
}
}

```

5. In the Project view, either click the add (+) button, or open the context menu and navigate to **Create**, and then choose **Rendering** > **Example Render Pipeline Asset**. Unity creates a new Render Pipeline Asset in the Project view.
Loading
Loading