From 4e76e4d9239d7de4988ac0f00dbf6fb975f5645b Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Sat, 2 Nov 2024 04:22:39 +0000 Subject: [PATCH 01/16] [Port] [2022.3] [UUM-70119] Fix render texture corruption when using HDR UUM-70926 With HDR disabled, the UI is rendered only from the main camera. With HDR enabled, UI rendering occurs from all cameras. RawImage can use a render texture as a source. Each camera that outputs to a render texture references the unprocessed texture when rendering the UI. This causes corrupted rendering. Changed the UI to be rendered only on the main camera. --- .../Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs index 359ddafb3d4..f61a0cb89b0 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs @@ -966,7 +966,8 @@ TextureHandle RenderTransparentUI(RenderGraph renderGraph, HDCamera hdCamera) context.cmd.ClearRenderTarget(false, true, Color.clear); context.renderContext.ExecuteCommandBuffer(context.cmd); context.cmd.Clear(); - context.renderContext.DrawUIOverlay(data.camera); + if (data.camera.targetTexture == null) + context.renderContext.DrawUIOverlay(data.camera); }); } } From 953995b3e0c312a286d71ef234b9b9a2cf922a0a Mon Sep 17 00:00:00 2001 From: Satish Chandra Dhanyamraju Date: Sat, 2 Nov 2024 04:22:46 +0000 Subject: [PATCH 02/16] =?UTF-8?q?2022.3:Fix=20for=20Camera=20view=20is=20n?= =?UTF-8?q?ot=20rendered=20on=20PowerVR=20Rogue=20GE8320=20GPU'S=20if=20?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue : https://jira.unity3d.com/browse/UUM-82949 Camera view is not rendered on PowerVR Rogue GE8320 GPU'S if Shadows are enabled in URP Asset and Camera stack contains Overlay Camera's. This is caused by changes done to fix https://jira.unity3d.com/browse/UUM-59572 These changes are now being reverted. There is a PR in trunk which fixes original bug (UUM-59572) without needing the fix that is now being reverted. --- .../Runtime/Passes/AdditionalLightsShadowCasterPass.cs | 5 +---- .../Runtime/Passes/MainLightShadowCasterPass.cs | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs index 7ff7fd0447a..9ddad06f7f5 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs @@ -860,10 +860,7 @@ bool SetupForEmptyRendering(ref RenderingData renderingData) /// public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) { - // UUM-63146 - glClientWaitSync: Expected application to have kicked everything until job: 96089 (possibly by calling glFlush)" are thrown in the Android Player on some devices with PowerVR Rogue GE8320 - // Resetting of target would clean up the color attachment buffers and depth attachment buffers, which inturn is preventing the leak in the said platform. This is likely a symptomatic fix, but is solving the problem for now. - if (Application.platform == RuntimePlatform.Android && PlatformAutoDetect.isRunningOnPowerVRGPU) - ResetTarget(); + if (m_CreateEmptyShadowmap) { // Reset pass RTs to null diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/MainLightShadowCasterPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/MainLightShadowCasterPass.cs index 49db2e77cab..2a3a5ff21ec 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/MainLightShadowCasterPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/MainLightShadowCasterPass.cs @@ -171,10 +171,7 @@ bool SetupForEmptyRendering(ref RenderingData renderingData) /// public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) { - // UUM-63146 - glClientWaitSync: Expected application to have kicked everything until job: 96089 (possibly by calling glFlush)" are thrown in the Android Player on some devices with PowerVR Rogue GE8320 - // Resetting of target would clean up the color attachment buffers and depth attachment buffers, which inturn is preventing the leak in the said platform. This is likely a symptomatic fix, but is solving the problem for now. - if (Application.platform == RuntimePlatform.Android && PlatformAutoDetect.isRunningOnPowerVRGPU) - ResetTarget(); + if (m_CreateEmptyShadowmap) { // Reset pass RTs to null From fbf15ca7d6beca0639a920b88553c93e47ead502 Mon Sep 17 00:00:00 2001 From: Mark Green Date: Sat, 2 Nov 2024 04:22:59 +0000 Subject: [PATCH 03/16] [Port] [2022.3] Minor docs fixes from feedback tickets Minor docs fixes from the following tickets: **This is an edited backport based on https://github.cds.internal.unity3d.com/unity/unity/pull/56146** - https://jira.unity3d.com/browse/DOCG-6217 - https://jira.unity3d.com/browse/DOCG-6218 - https://jira.unity3d.com/browse/DOCG-6228 - https://jira.unity3d.com/browse/DOCG-6253 - https://jira.unity3d.com/browse/DOCG-6232 --- .../Documentation~/custom-material-inspector.md | 2 +- .../Documentation~/render-graph-writing-a-render-pipeline.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Documentation~/custom-material-inspector.md b/Packages/com.unity.render-pipelines.core/Documentation~/custom-material-inspector.md index 64d6a5bb3d6..69dc9bb9147 100644 --- a/Packages/com.unity.render-pipelines.core/Documentation~/custom-material-inspector.md +++ b/Packages/com.unity.render-pipelines.core/Documentation~/custom-material-inspector.md @@ -6,7 +6,7 @@ Custom Material Inspectors enable you to define how Unity displays properties in The implementation for custom Material Inspectors differs between URP and HDRP. For example, for compatibility purposes, every custom Material Inspector in HDRP must inherit from `HDShaderGUI` which does not exist in URP. For information on how to create custom Material Inspectors for the respective render pipelines, see: -- **HDRP**: [HDRP custom Material Inspectors](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/hdrp-custom-material-inspector.html). +- **HDRP**: [HDRP custom Material Inspectors](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/custom-material-inspectors.html). - **URP**: [Unity Custom Shader GUI](https://docs.unity3d.com/Manual/SL-CustomShaderGUI.html). ## Assigning a custom Material Inspector diff --git a/Packages/com.unity.render-pipelines.core/Documentation~/render-graph-writing-a-render-pipeline.md b/Packages/com.unity.render-pipelines.core/Documentation~/render-graph-writing-a-render-pipeline.md index 32e71759b9b..4d3ede8ac0b 100644 --- a/Packages/com.unity.render-pipelines.core/Documentation~/render-graph-writing-a-render-pipeline.md +++ b/Packages/com.unity.render-pipelines.core/Documentation~/render-graph-writing-a-render-pipeline.md @@ -15,7 +15,7 @@ public class MyRenderPipeline : RenderPipeline void InitializeRenderGraph() { - m_RenderGraph = new RenderGraph(“MyRenderGraph”); + m_RenderGraph = new RenderGraph("MyRenderGraph"); } void CleanupRenderGraph() From 78cd83b0fa352c677fc9c34fb8a38821a2ce4180 Mon Sep 17 00:00:00 2001 From: Adrian Smith Date: Thu, 7 Nov 2024 11:35:39 +0000 Subject: [PATCH 04/16] 2022.3/platform/console/gfx image update To update test images for consoles Fixed the size of the reflection probe texture cache in the test suite to prevent out of memory error --- .../Assets/HDRPSettings/HDRenderPipelineAsset.asset | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Tests/SRPTests/Projects/BatchRendererGroup_HDRP/Assets/HDRPSettings/HDRenderPipelineAsset.asset b/Tests/SRPTests/Projects/BatchRendererGroup_HDRP/Assets/HDRPSettings/HDRenderPipelineAsset.asset index 4f65a8a8ddc..effacbcc6d8 100644 --- a/Tests/SRPTests/Projects/BatchRendererGroup_HDRP/Assets/HDRPSettings/HDRenderPipelineAsset.asset +++ b/Tests/SRPTests/Projects/BatchRendererGroup_HDRP/Assets/HDRPSettings/HDRenderPipelineAsset.asset @@ -51,6 +51,7 @@ MonoBehaviour: decalNormalBufferHP: 0 msaaSampleCount: 1 supportMotionVectors: 1 + supportDataDrivenLensFlare: 1 supportRuntimeAOVAPI: 0 supportDitheringCrossFade: 1 supportTerrainHole: 0 @@ -72,7 +73,7 @@ MonoBehaviour: maxEnvLightsOnScreen: 64 reflectionCacheCompressed: 0 reflectionProbeFormat: 74 - reflectionProbeTexCacheSize: 1073750016 + reflectionProbeTexCacheSize: 2048 reflectionProbeTexLastValidCubeMip: 3 reflectionProbeTexLastValidPlanarMip: 0 reflectionProbeDecreaseResToFit: 1 @@ -151,6 +152,8 @@ MonoBehaviour: forcedPercentage: 100 lowResTransparencyMinimumThreshold: 0 rayTracingHalfResThreshold: 50 + lowResSSGIMinimumThreshold: 0 + lowResVolumetricCloudsMinimumThreshold: 50 lowresTransparentSettings: enabled: 1 checkerboardDepthBuffer: 1 @@ -182,7 +185,7 @@ MonoBehaviour: ChromaticAberrationMaxSamples: 03000000060000000c000000 lightSettings: useContactShadow: - m_Values: + m_Values: 000000 m_SchemaId: m_Id: maximumLODLevel: @@ -293,6 +296,8 @@ MonoBehaviour: diffusionProfileSettings: {fileID: 0} virtualTexturingSettings: streamingCpuCacheSizeInMegaBytes: 256 + streamingMipPreloadTexturesPerFrame: 0 + streamingPreloadMipCount: 1 streamingGpuCacheSettings: - format: 0 sizeInMegaBytes: 128 From a598330610a263fd1c891a1de89a7c44f46e4bd6 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Thu, 21 Nov 2024 23:36:51 +0000 Subject: [PATCH 05/16] [Port] [2022.3] Sg/uum 76254 empty group paste location Jira: https://jira.unity3d.com/browse/UUM-76254 Group position is adjusted as elements are added to it. However, if the group is empty, its position remains unchanged and is pasted at the original location. This has been fixed so that the group's position is adjusted when pasting, even if the group is empty. While fixing this issue, I discovered and resolved a problem where the position of a newly created group was not being set initially Before ![Before](https://media.github.cds.internal.unity3d.com/user/761/files/2a5877b8-75ae-4944-8290-f21ae3dfa098) After ![After](https://media.github.cds.internal.unity3d.com/user/761/files/0dbdf1f9-f095-4c5f-bfb9-c23f406c7576) --- .../Editor/Data/Graphs/GroupData.cs | 13 +- .../Editor/Drawing/Views/MaterialGraphView.cs | 7 +- .../Editor/Drawing/Views/ShaderGroup.cs | 8 + .../Assets/CommonAssets/Editor/GroupTests.cs | 122 +++++ .../CommonAssets/Editor/GroupTests.cs.meta | 2 + .../CommonAssets/Graphs/Group.shadergraph | 480 ++++++++++++++++++ .../Graphs/Group.shadergraph.meta | 10 + 7 files changed, 640 insertions(+), 2 deletions(-) create mode 100644 Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Editor/GroupTests.cs create mode 100644 Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Editor/GroupTests.cs.meta create mode 100644 Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Graphs/Group.shadergraph create mode 100644 Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Graphs/Group.shadergraph.meta diff --git a/Packages/com.unity.shadergraph/Editor/Data/Graphs/GroupData.cs b/Packages/com.unity.shadergraph/Editor/Data/Graphs/GroupData.cs index acab2ec9abb..363ce4000bb 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Graphs/GroupData.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Graphs/GroupData.cs @@ -5,7 +5,7 @@ namespace UnityEditor.ShaderGraph { [Serializable] - public class GroupData : JsonObject + public class GroupData : JsonObject, IRectInterface { [SerializeField] string m_Title; @@ -16,6 +16,7 @@ public string title set { m_Title = value; } } + [SerializeField] Vector2 m_Position; @@ -25,6 +26,16 @@ public Vector2 position set { m_Position = value; } } + Rect IRectInterface.rect + { + get => new Rect(position, Vector2.one); + set + { + position = value.position; + } + } + + public GroupData() : base() { } public GroupData(string title, Vector2 position) diff --git a/Packages/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs b/Packages/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs index 64cbb5f170c..d90b8d682dd 100644 --- a/Packages/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs +++ b/Packages/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs @@ -1482,7 +1482,12 @@ internal static void InsertCopyPasteGraph(this MaterialGraphView graphView, Copy { var nodeList = copyGraph.GetNodes(); - ClampNodesWithinView(graphView, new List().Union(nodeList).Union(copyGraph.stickyNotes)); + ClampNodesWithinView(graphView, + new List() + .Union(nodeList) + .Union(copyGraph.stickyNotes) + .Union(copyGraph.groups) + ); graphView.graph.PasteGraph(copyGraph, remappedNodes, remappedEdges); diff --git a/Packages/com.unity.shadergraph/Editor/Drawing/Views/ShaderGroup.cs b/Packages/com.unity.shadergraph/Editor/Drawing/Views/ShaderGroup.cs index 92c3b46df6b..02b2fda1376 100644 --- a/Packages/com.unity.shadergraph/Editor/Drawing/Views/ShaderGroup.cs +++ b/Packages/com.unity.shadergraph/Editor/Drawing/Views/ShaderGroup.cs @@ -53,5 +53,13 @@ public override bool AcceptsElement(GraphElement element, ref string reasonWhyNo return true; } + + protected override void SetScopePositionOnly(Rect newPos) + { + base.SetScopePositionOnly(newPos); + + userData.position = newPos.position; + } + } } diff --git a/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Editor/GroupTests.cs b/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Editor/GroupTests.cs new file mode 100644 index 00000000000..0226578be08 --- /dev/null +++ b/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Editor/GroupTests.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnityEngine.UIElements; +using NUnit.Framework; +using UnityEngine; +using UnityEngine.TestTools; +using UnityEditor.Graphing; +using UnityEditor.ShaderGraph.Drawing; +using UnityEditor.ShaderGraph.Internal; + + +namespace UnityEditor.ShaderGraph.UnitTests +{ + [TestFixture] + internal class GroupTests + { + static string kGraphName = "Assets/CommonAssets/Graphs/Group.shadergraph"; + GraphData m_Graph; + + GraphEditorView m_GraphEditorView; + MaterialGraphEditWindow m_Window; + + [OneTimeSetUp] + public void LoadGraph() + { + List lti; + var assetCollection = new AssetCollection(); + ShaderGraphImporter.GetShaderText(kGraphName, out lti, assetCollection, out m_Graph); + Assert.NotNull(m_Graph, $"Invalid graph data found for {kGraphName}"); + + m_Graph.ValidateGraph(); + // Open up the window + if (!ShaderGraphImporterEditor.ShowGraphEditWindow(kGraphName)) + { + Assert.Fail("ShaderGraphImporterEditor.ShowGraphEditWindow could not open " + kGraphName); + } + + m_Window = EditorWindow.GetWindow(); + if (m_Window == null) + { + Assert.Fail("Could not open window"); + } + + // EditorWindow.GetWindow will return a new window if one is not found. A new window will have graphObject == null. + if (m_Window.graphObject == null) + { + Assert.Fail("Existing Shader Graph window of " + kGraphName + " not found."); + } + + m_GraphEditorView = m_Window.graphEditorView; + + } + + class TestExecuteCommandEvent : ExecuteCommandEvent + { + public void SetCommandName(string command) + { + commandName = command; + } + } + + [UnityTest] + public IEnumerator TestEmptyGroupPastePosition() + { + var materialGraphView = m_GraphEditorView.graphView; + var materialGraphViewType = typeof(MaterialGraphView); + + var cutMethodInfo = materialGraphViewType.GetMethod("CutSelectionCallback", + BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var pasteMethodInfo = materialGraphViewType.GetMethod("PasteCallback", + BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + + var mousePositionPropertyInfo = materialGraphViewType.GetProperty("cachedMousePosition", + typeof(Vector2)); + + Assert.NotNull(cutMethodInfo, "CutSelectionCallback method not found."); + Assert.NotNull(pasteMethodInfo, "PasteCallback method not found."); + Assert.NotNull(mousePositionPropertyInfo, "cachedMousePosition property not found."); + + var groupList = materialGraphView.Query() + .Where(x => x.userData.title == "Empty Group") + .ToList(); + + Assert.AreEqual(1, groupList.Count()); + + + + materialGraphView.ClearSelection(); + materialGraphView.AddToSelection(groupList[0]); + + cutMethodInfo.Invoke(materialGraphView, null); + yield return null; + + groupList = materialGraphView.Query() + .Where(x => x.userData.title == "Empty Group") + .ToList(); + + Assert.AreEqual(0, groupList.Count()); + + mousePositionPropertyInfo.SetValue(materialGraphView, new Vector2(100,100)); + pasteMethodInfo.Invoke(materialGraphView, null); + yield return null; + + mousePositionPropertyInfo.SetValue(materialGraphView, new Vector2(100,200)); + pasteMethodInfo.Invoke(materialGraphView, null); + yield return null; + + groupList = materialGraphView.Query() + .Where(x => x.userData.title == "Empty Group") + .ToList(); + + Assert.AreEqual(2, groupList.Count()); + + Assert.AreNotEqual(groupList[0].GetPosition().position, groupList[1].GetPosition().position, + "When the cursor position changes, the pasted group's position should be adjusted accordingly"); + } + + } +} diff --git a/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Editor/GroupTests.cs.meta b/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Editor/GroupTests.cs.meta new file mode 100644 index 00000000000..e68bdf11d62 --- /dev/null +++ b/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Editor/GroupTests.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 680b4886bf42f4e469e5be34a62e46df \ No newline at end of file diff --git a/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Graphs/Group.shadergraph b/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Graphs/Group.shadergraph new file mode 100644 index 00000000000..fa1af318b80 --- /dev/null +++ b/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Graphs/Group.shadergraph @@ -0,0 +1,480 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "2e2fb2d41f3140e6bf6c2cd71c34aae7", + "m_Properties": [], + "m_Keywords": [], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "4502e1e5b9644594b2df22af116ad5ea" + } + ], + "m_Nodes": [ + { + "m_Id": "af0264ee1a9b49c18fdf9101cf9ae081" + }, + { + "m_Id": "c12d6a9b6653476ca32727965d4298cb" + }, + { + "m_Id": "97cc969e84a14cb09a9260436cd21d3c" + }, + { + "m_Id": "f855f815da12498382d7f7fa2bd05ee1" + }, + { + "m_Id": "2c226297ac7b4ec4a7776745f36c9d64" + }, + { + "m_Id": "52e4d268f589446bb73efac7dccf48c7" + } + ], + "m_GroupDatas": [ + { + "m_Id": "f694401d3c6c402d97536e786e32ec07" + } + ], + "m_StickyNoteDatas": [], + "m_Edges": [], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [ + { + "m_Id": "af0264ee1a9b49c18fdf9101cf9ae081" + }, + { + "m_Id": "c12d6a9b6653476ca32727965d4298cb" + }, + { + "m_Id": "97cc969e84a14cb09a9260436cd21d3c" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "f855f815da12498382d7f7fa2bd05ee1" + }, + { + "m_Id": "2c226297ac7b4ec4a7776745f36c9d64" + }, + { + "m_Id": "52e4d268f589446bb73efac7dccf48c7" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Shader Graphs", + "m_GraphPrecision": 0, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_SubDatas": [], + "m_ActiveTargets": [ + { + "m_Id": "a9167bc70a5241adb50893132cec17c1" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "1af599a5b6874ae8a4a3c9d3b49e82db", + "m_Id": 0, + "m_DisplayName": "Tangent", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Tangent", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "20a4d9d22d5145b89d5fc43b68551665" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "2c226297ac7b4ec4a7776745f36c9d64", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Alpha", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "e7f99533600e469cb17d6a460403a30a" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "4502e1e5b9644594b2df22af116ad5ea", + "m_Name": "", + "m_ChildObjectList": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "52e4d268f589446bb73efac7dccf48c7", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.AlphaClipThreshold", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "df4ecaa19f1d40b88c55203480c21185" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.AlphaClipThreshold" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "685a41ca509448b0a5afa62b66767f9d", + "m_Id": 0, + "m_DisplayName": "Base Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BaseColor", + "m_StageCapability": 2, + "m_Value": { + "x": 0.7353569269180298, + "y": 0.7353569269180298, + "z": 0.7353569269180298 + }, + "m_DefaultValue": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + }, + "m_Labels": [], + "m_ColorMode": 0, + "m_DefaultColor": { + "r": 0.5, + "g": 0.5, + "b": 0.5, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "97cc969e84a14cb09a9260436cd21d3c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Tangent", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "1af599a5b6874ae8a4a3c9d3b49e82db" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "a9167bc70a5241adb50893132cec17c1", + "m_Datas": [], + "m_ActiveSubTarget": { + "m_Id": "20a4d9d22d5145b89d5fc43b68551665" + }, + "m_AllowMaterialOverride": false, + "m_SurfaceType": 0, + "m_ZTestMode": 4, + "m_ZWriteControl": 0, + "m_AlphaMode": 0, + "m_RenderFace": 2, + "m_AlphaClip": true, + "m_CastShadows": true, + "m_ReceiveShadows": true, + "m_DisableTint": false, + "m_AdditionalMotionVectorMode": 0, + "m_AlembicMotionVectors": false, + "m_SupportsLODCrossFade": false, + "m_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "af0264ee1a9b49c18fdf9101cf9ae081", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "f224ffc6fb50427aaa44ece0fadf34b1" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "b8f3d744ba1c4249a953b9d29df5ea96", + "m_Id": 0, + "m_DisplayName": "Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Normal", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "c12d6a9b6653476ca32727965d4298cb", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Normal", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "b8f3d744ba1c4249a953b9d29df5ea96" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "df4ecaa19f1d40b88c55203480c21185", + "m_Id": 0, + "m_DisplayName": "Alpha Clip Threshold", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "AlphaClipThreshold", + "m_StageCapability": 2, + "m_Value": 0.5, + "m_DefaultValue": 0.5, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e7f99533600e469cb17d6a460403a30a", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Alpha", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "f224ffc6fb50427aaa44ece0fadf34b1", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.GroupData", + "m_ObjectId": "f694401d3c6c402d97536e786e32ec07", + "m_Title": "Empty Group", + "m_Position": { + "x": -433.0, + "y": 112.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "f855f815da12498382d7f7fa2bd05ee1", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BaseColor", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "685a41ca509448b0a5afa62b66767f9d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + diff --git a/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Graphs/Group.shadergraph.meta b/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Graphs/Group.shadergraph.meta new file mode 100644 index 00000000000..5d1a45e9e9e --- /dev/null +++ b/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Graphs/Group.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: dc1e3482bafaf6f4eb9452812d08215e +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} From ac1b56d3c7b0b1d354fb65511de323090504f019 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Fri, 22 Nov 2024 11:57:56 +0000 Subject: [PATCH 06/16] [Port] [2022.3] Add documentation for shadow matte interaction with stencil shadows Add documentation for how shadow matte interacts with stencil and ray traced shadows. The 'regression' happened when Anis added stencil for unlit materials https://github.cds.internal.unity3d.com/unity/unity/pull/16463/files#diff-f8f08e5234e1f79654d09936f18d3a903cdb9eccf0ab92b29d8e377a24c66845. The user can check Shadow Matte on the custom shader graph and it will work again. https://jira.unity3d.com/browse/UUM-72348 --- .../shader-properties/surface-options/shadow-matte.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/shadow-matte.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/shadow-matte.md index d6cb6c832f5..b7e08041c98 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/shadow-matte.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/shadow-matte.md @@ -2,5 +2,8 @@ Shadow Matte -Indicates whether or not the Shader receives shadows. Shadow matte only supports shadow maps. It does not support Screen Space Shadows, Ray-Traced Shadows, or Contact Shadows. +Indicates whether the shader receives shadows. Shadow matte only supports shadow maps. +It doesn't support screen-space shadows, ray-traced Shadows, or contact shadows.
+Enable **Shadow Matte** if you add a custom Node that samples shadow maps, otherwise shadows might not render correctly. + From 4389176b6442b4767083bbf769e1899f068ff612 Mon Sep 17 00:00:00 2001 From: Mark Green Date: Mon, 25 Nov 2024 16:56:02 +0000 Subject: [PATCH 07/16] DOCG-5967 Fix inject render pass script example Update incorrect line in the example code on https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@14.0/manual/renderer-features/scriptable-renderer-features/inject-a-pass-using-a-scriptable-renderer-feature.html Jira ticket: https://jira.unity3d.com/browse/DOCG-5967 --- .../inject-a-pass-using-a-scriptable-renderer-feature.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.universal/Documentation~/renderer-features/scriptable-renderer-features/inject-a-pass-using-a-scriptable-renderer-feature.md b/Packages/com.unity.render-pipelines.universal/Documentation~/renderer-features/scriptable-renderer-features/inject-a-pass-using-a-scriptable-renderer-feature.md index 61aa233ef75..f8b49e12679 100644 --- a/Packages/com.unity.render-pipelines.universal/Documentation~/renderer-features/scriptable-renderer-features/inject-a-pass-using-a-scriptable-renderer-feature.md +++ b/Packages/com.unity.render-pipelines.universal/Documentation~/renderer-features/scriptable-renderer-features/inject-a-pass-using-a-scriptable-renderer-feature.md @@ -99,7 +99,7 @@ This section uses the example `RedTintRenderPass` Scriptable Render Pass from th material = CoreUtils.CreateEngineMaterial(shader); redTintRenderPass = new RedTintRenderPass(material); - renderPassEvent = RenderPassEvent.AfterRenderingSkybox; + redTintRenderPass.renderPassEvent = RenderPassEvent.AfterRenderingSkybox; } ``` From ef967c23ff21952280e57162c979b77bdf281158 Mon Sep 17 00:00:00 2001 From: Mark Green Date: Mon, 25 Nov 2024 16:56:03 +0000 Subject: [PATCH 08/16] DOCG-6084 Add anchor link to rendering layers with decals Add anchor link to rendering layers with decals Jira ticket: https://jira.unity3d.com/browse/DOCG-6084 --- .../Documentation~/renderer-feature-decal.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Packages/com.unity.render-pipelines.universal/Documentation~/renderer-feature-decal.md b/Packages/com.unity.render-pipelines.universal/Documentation~/renderer-feature-decal.md index 025b7dac530..6120830249e 100644 --- a/Packages/com.unity.render-pipelines.universal/Documentation~/renderer-feature-decal.md +++ b/Packages/com.unity.render-pipelines.universal/Documentation~/renderer-feature-decal.md @@ -95,6 +95,8 @@ The maximum distance from the Camera at which Unity renders decals. Select this check box to enable the [Rendering Layers](features/rendering-layers.md) functionality. +For more information, refer to [How to use Rendering Layers with Decals](features/rendering-layers#how-to-rendering-layers-decals). + If you enable **Use Rendering Layers**, URP creates a DepthNormal prepass. This makes decals less efficient on GPUs that implement tile-based rendering. ## Decal Projector component From 4bd8644a9221662fbd455bd32018e25b9352eb75 Mon Sep 17 00:00:00 2001 From: Kenny Tan Date: Tue, 26 Nov 2024 14:31:27 +0000 Subject: [PATCH 09/16] [Backport 2022.3][UUM-51358] Fix incorrect sampling for TextMesh when used with Pixel Perfect Camera Fix UUM-51358 --- .../Runtime/2D/Passes/Render2DLightingPass.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Passes/Render2DLightingPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Passes/Render2DLightingPass.cs index 17cf6253095..0a00ee9e3e2 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Passes/Render2DLightingPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Passes/Render2DLightingPass.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using UnityEngine.Profiling; +using UnityEngine.Experimental.Rendering.Universal; namespace UnityEngine.Rendering.Universal { @@ -368,6 +369,15 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData LayerUtility.InitializeBudget(m_Renderer2DData.lightRenderTextureMemoryBudget); ShadowRendering.InitializeBudget(m_Renderer2DData.shadowRenderTextureMemoryBudget); + // Set screenParams when pixel perfect camera is used with the reference resolution + camera.TryGetComponent(out PixelPerfectCamera pixelPerfectCamera); + if (pixelPerfectCamera != null && pixelPerfectCamera.enabled && pixelPerfectCamera.offscreenRTSize != Vector2Int.zero) + { + var cameraWidth = pixelPerfectCamera.offscreenRTSize.x; + var cameraHeight = pixelPerfectCamera.offscreenRTSize.y; + renderingData.commandBuffer.SetGlobalVector(ShaderPropertyId.screenParams, new Vector4(cameraWidth, cameraHeight, 1.0f + 1.0f / cameraWidth, 1.0f + 1.0f / cameraHeight)); + } + var isSceneLit = m_Renderer2DData.lightCullResult.IsSceneLit(); if (isSceneLit) { From cd71e4279f9d84a6a14b87ab5ce1843cd4b7a7e9 Mon Sep 17 00:00:00 2001 From: Evergreen Date: Tue, 26 Nov 2024 14:31:28 +0000 Subject: [PATCH 10/16] [2022.3] Fix Depth attachment texture for DX11 Fixed the CameraDepthAttachment Texture for Dx11, which was rendering as black earlier. The issue is the Camera Depth Attachment texture is referring to the depth buffer and when the shader is trying to access the texture the texture is black Bug: https://jira.unity3d.com/browse/UUM-64316 Backport: https://jira.unity3d.com/browse/UUM-65831 --- .../Runtime/UniversalRenderer.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs index 449a8ec0e56..f8decb40c48 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs @@ -128,6 +128,7 @@ public override int SupportedCameraStackingTypes() internal RTHandle m_ActiveCameraDepthAttachment; internal RTHandle m_CameraDepthAttachment; RTHandle m_XRTargetHandleAlias; + internal RTHandle m_CameraDepthAttachment_D3d_11; internal RTHandle m_DepthTexture; RTHandle m_NormalsTexture; RTHandle m_DecalLayersTexture; @@ -392,6 +393,7 @@ internal override void ReleaseRenderTargets() m_AdditionalLightsShadowCasterPass?.Dispose(); m_CameraDepthAttachment?.Release(); + m_CameraDepthAttachment_D3d_11?.Release(); m_DepthTexture?.Release(); m_NormalsTexture?.Release(); m_DecalLayersTexture?.Release(); @@ -806,7 +808,11 @@ public override void Setup(ScriptableRenderContext context, ref RenderingData re // Doesn't create texture for Overlay cameras as they are already overlaying on top of created textures. if (intermediateRenderTexture) + { CreateCameraRenderTarget(context, ref cameraTargetDescriptor, useDepthPriming, cmd, ref cameraData); + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11) + cmd.CopyTexture(m_CameraDepthAttachment, m_CameraDepthAttachment_D3d_11); + } m_RenderOpaqueForwardPass.m_IsActiveTargetBackBuffer = !intermediateRenderTexture; m_RenderTransparentForwardPass.m_IsActiveTargetBackBuffer = !intermediateRenderTexture; @@ -1532,7 +1538,14 @@ void CreateCameraRenderTarget(ScriptableRenderContext context, ref RenderTexture depthDescriptor.graphicsFormat = GraphicsFormat.None; depthDescriptor.depthStencilFormat = k_DepthStencilFormat; RenderingUtils.ReAllocateIfNeeded(ref m_CameraDepthAttachment, depthDescriptor, FilterMode.Point, TextureWrapMode.Clamp, name: "_CameraDepthAttachment"); - cmd.SetGlobalTexture(m_CameraDepthAttachment.name, m_CameraDepthAttachment.nameID); + + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11) + { + RenderingUtils.ReAllocateIfNeeded(ref m_CameraDepthAttachment_D3d_11, depthDescriptor, FilterMode.Point, TextureWrapMode.Clamp, name: "_CameraDepthAttachment_Temp"); + cmd.SetGlobalTexture(m_CameraDepthAttachment.name, m_CameraDepthAttachment_D3d_11.nameID); + } + else + cmd.SetGlobalTexture(m_CameraDepthAttachment.name, m_CameraDepthAttachment.nameID); // update the descriptor to match the depth attachment descriptor.depthStencilFormat = depthDescriptor.depthStencilFormat; From 5274cb64b075ad071dffc82106f6a8f085d69c21 Mon Sep 17 00:00:00 2001 From: Oleksandr Kokoshyn Date: Tue, 26 Nov 2024 20:54:02 +0000 Subject: [PATCH 11/16] DOCG-5973 linear gradient, DOCG-4959 VFX snippet "position" capitalization DOCG-5973 updated the linear gradient image (shows the correct linear gradient now), edited the caption. DOCG-4959 VFX code snippet "position" capitalization fix. --- .../com.unity.visualeffectgraph/Documentation~/ComponentAPI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.visualeffectgraph/Documentation~/ComponentAPI.md b/Packages/com.unity.visualeffectgraph/Documentation~/ComponentAPI.md index 5e4d361ae06..4531a6787e9 100644 --- a/Packages/com.unity.visualeffectgraph/Documentation~/ComponentAPI.md +++ b/Packages/com.unity.visualeffectgraph/Documentation~/ComponentAPI.md @@ -179,7 +179,7 @@ If you want to manage multiple Visual Effect instances in the same Scene and wan VisualEffect visualEffect; VFXEventAttribute eventAttribute; -static readonly ExposedProperty positionAttribute = "Position" +static readonly ExposedProperty positionAttribute = "position" static readonly ExposedProperty enteredTriggerEvent = "EnteredTrigger" void Start() From 07901fabab7e7436683ca179134c442e604a5448 Mon Sep 17 00:00:00 2001 From: Oleksandr Kokoshyn Date: Tue, 26 Nov 2024 20:54:04 +0000 Subject: [PATCH 12/16] Fixed the description about post-processing effects affecting a camera (Volume Mask, Layers) Fixed the description about post-processing effects affecting a camera (Volume Mask, Layers) --- .../Documentation~/integration-with-post-processing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.universal/Documentation~/integration-with-post-processing.md b/Packages/com.unity.render-pipelines.universal/Documentation~/integration-with-post-processing.md index 515a6fedb64..522fce12ded 100644 --- a/Packages/com.unity.render-pipelines.universal/Documentation~/integration-with-post-processing.md +++ b/Packages/com.unity.render-pipelines.universal/Documentation~/integration-with-post-processing.md @@ -49,7 +49,7 @@ To configure post-processing in a new Scene: Now you can use the Volume Override to enable and adjust the settings for the post-processing effect. > [!NOTE] -> The GameObject which contains the volume and the camera you wish to apply post-processing to must be on the same Layer. +> Post-processing effects from a volume apply to a camera only if a value in the **Volume Mask** property of the camera contains the layer that the volume belongs to. Refer to [Understand Volumes](Volumes.md) for more information. From d425aa695a30129122b30313209607fbf9dde784 Mon Sep 17 00:00:00 2001 From: Rose Hirigoyen Date: Thu, 28 Nov 2024 23:37:04 +0000 Subject: [PATCH 13/16] [Backport 2022.3] Revert Changes from UUM-29958 I made a fix for https://jira.unity3d.com/browse/UUM-68986 that was too aggressive - clearing the material property block after each blit actually clears properties that are needed between blits, in the case for example of edge detection. This created another bug (https://jira.unity3d.com/browse/UUM-85970) where TexelSize property was cleared between two blits in the same pass. Luckily, in the meantime, a better fix was implemented in Unity 6 and 7 (#51608). This PR backports it to 2022.3 (after talking to the original owner, there's should be no reason not to backport it) This works better because it doesn't clear property blocks after each blit, only when a RenderTargetIdentifier is used, which is less aggressive than the fix I had in the first place --- .../Runtime/Utilities/Blitter.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blitter.cs b/Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blitter.cs index cb6dec82102..16bdb345dbf 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blitter.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blitter.cs @@ -190,7 +190,6 @@ static private void DrawTriangle(CommandBuffer cmd, Material material, int shade cmd.DrawMesh(s_TriangleMesh, Matrix4x4.identity, material, 0, shaderPass, s_PropertyBlock); else cmd.DrawProcedural(Matrix4x4.identity, material, shaderPass, MeshTopology.Triangles, 3, 1, s_PropertyBlock); - s_PropertyBlock.Clear(); } static internal void DrawQuad(CommandBuffer cmd, Material material, int shaderPass) @@ -199,7 +198,6 @@ static internal void DrawQuad(CommandBuffer cmd, Material material, int shaderPa cmd.DrawMesh(s_QuadMesh, Matrix4x4.identity, material, 0, shaderPass, s_PropertyBlock); else cmd.DrawProcedural(Matrix4x4.identity, material, shaderPass, MeshTopology.Quads, 4, 1, s_PropertyBlock); - s_PropertyBlock.Clear(); } /// @@ -274,6 +272,7 @@ public static void BlitTexture(CommandBuffer cmd, RTHandle source, Vector4 scale /// Pass idx within the material to invoke. public static void BlitTexture(CommandBuffer cmd, RenderTargetIdentifier source, Vector4 scaleBias, Material material, int pass) { + s_PropertyBlock.Clear(); s_PropertyBlock.SetVector(BlitShaderIDs._BlitScaleBias, scaleBias); // Unfortunately there is no function bind a RenderTargetIdentifier with a property block so we have to bind it globally. cmd.SetGlobalTexture(BlitShaderIDs._BlitTexture, source); @@ -290,6 +289,8 @@ public static void BlitTexture(CommandBuffer cmd, RenderTargetIdentifier source, /// Pass idx within the material to invoke. public static void BlitTexture(CommandBuffer cmd, RenderTargetIdentifier source, RenderTargetIdentifier destination, Material material, int pass) { + s_PropertyBlock.Clear(); + s_PropertyBlock.SetVector(BlitShaderIDs._BlitScaleBias, Vector2.one); // Unfortunately there is no function bind a RenderTargetIdentifier with a property block so we have to bind it globally. cmd.SetGlobalTexture(BlitShaderIDs._BlitTexture, source); cmd.SetRenderTarget(destination); @@ -308,6 +309,8 @@ public static void BlitTexture(CommandBuffer cmd, RenderTargetIdentifier source, /// Pass idx within the material to invoke. public static void BlitTexture(CommandBuffer cmd, RenderTargetIdentifier source, RenderTargetIdentifier destination, RenderBufferLoadAction loadAction, RenderBufferStoreAction storeAction, Material material, int pass) { + s_PropertyBlock.Clear(); + s_PropertyBlock.SetVector(BlitShaderIDs._BlitScaleBias, Vector2.one); // Unfortunately there is no function bind a RenderTargetIdentifier with a property block so we have to bind it globally. cmd.SetGlobalTexture(BlitShaderIDs._BlitTexture, source); cmd.SetRenderTarget(destination, loadAction, storeAction); From 00d83c2036e3f999c3f06c1ac54cbefbc51159df Mon Sep 17 00:00:00 2001 From: Oleksandr Kokoshyn Date: Thu, 28 Nov 2024 23:37:04 +0000 Subject: [PATCH 14/16] DOCG-5914 added an extra null check, DOCG-5912 protected access for Dispose DOCG-5914 added an extra null check, DOCG-5912 protected access for Dispose --- .../inject-a-pass-using-a-scriptable-renderer-feature.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Documentation~/renderer-features/scriptable-renderer-features/inject-a-pass-using-a-scriptable-renderer-feature.md b/Packages/com.unity.render-pipelines.universal/Documentation~/renderer-features/scriptable-renderer-features/inject-a-pass-using-a-scriptable-renderer-feature.md index f8b49e12679..6ec7e259f6f 100644 --- a/Packages/com.unity.render-pipelines.universal/Documentation~/renderer-features/scriptable-renderer-features/inject-a-pass-using-a-scriptable-renderer-feature.md +++ b/Packages/com.unity.render-pipelines.universal/Documentation~/renderer-features/scriptable-renderer-features/inject-a-pass-using-a-scriptable-renderer-feature.md @@ -136,6 +136,7 @@ public class MyRendererFeature : ScriptableRendererFeature { if (shader == null) { + Debug.LogError("Ensure that you've set a shader in the Scriptable Renderer Feature."); return; } material = CoreUtils.CreateEngineMaterial(shader); @@ -147,12 +148,13 @@ public class MyRendererFeature : ScriptableRendererFeature public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData) { - if (renderingData.cameraData.cameraType == CameraType.Game) + if (redTintRenderPass != null && + renderingData.cameraData.cameraType == CameraType.Game) { renderer.EnqueuePass(redTintRenderPass); } } - public override void Dispose(bool disposing) + protected override void Dispose(bool disposing) { CoreUtils.Destroy(material); } From fc37208baadaab884efea5b7fdac98fdfd141393 Mon Sep 17 00:00:00 2001 From: Mark Green Date: Thu, 28 Nov 2024 23:37:06 +0000 Subject: [PATCH 15/16] Graphics docs feedback fixes November 2024 (part 4 - 2022.3 fixes) Part 4 of minor fixes from feedback tickets - 2022.3 specific fixes. Jira tickets: - https://jira.unity3d.com/browse/DOCG-5757 - https://jira.unity3d.com/browse/DOCG-6016 - https://jira.unity3d.com/browse/DOCG-5966 --- .../Documentation~/Frame-Settings-API.md | 2 +- .../Documentation~/InstallURPIntoAProject.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/Frame-Settings-API.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/Frame-Settings-API.md index 75b6cacd1ae..babd533061c 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/Frame-Settings-API.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/Frame-Settings-API.md @@ -44,7 +44,7 @@ Finally, access the Frame Settings structure itself. This controls the actual va - **Camera**: `HDAdditionalCameraData.renderingPathCustomFrameSettings` - **Reflection Probe**: `HDAdditionalReflectionData.frameSettings` -For information on the API available for `FrameSettings`, including how to edit the value of a Frame Setting, see [FrameSettings Scripting API](framesettings-scripting-api). +For information on the API available for `FrameSettings`, including how to edit the value of a Frame Setting, see [FrameSettings Scripting API](#framesettings-scripting-api). ## Frame Setting enumerations diff --git a/Packages/com.unity.render-pipelines.universal/Documentation~/InstallURPIntoAProject.md b/Packages/com.unity.render-pipelines.universal/Documentation~/InstallURPIntoAProject.md index 85b0f422f3e..d4ccab1f261 100644 --- a/Packages/com.unity.render-pipelines.universal/Documentation~/InstallURPIntoAProject.md +++ b/Packages/com.unity.render-pipelines.universal/Documentation~/InstallURPIntoAProject.md @@ -61,4 +61,5 @@ When you upgrade a project from the Built-in Render Pipeline (BiRP) to the Unive * [Render Pipeline Converter](features/rp-converter.md) * [Upgrade custom shaders for URP compatibility](urp-shaders/birp-urp-custom-shader-upgrade-guide.md) * [Find graphics quality settings in URP](birp-onboarding/quality-settings-location.md) -* [Update graphics quality levels for URP](quality-presets.md) +* [Update graphics quality levels for URP](birp-onboarding/quality-presets.md) + From 22ca795af49643446648165b7a6e92f3dfa90cc6 Mon Sep 17 00:00:00 2001 From: Oleksandr Kokoshyn Date: Thu, 28 Nov 2024 23:37:07 +0000 Subject: [PATCH 16/16] [Backport of pull/57437] DOCG-4814. Clarified the rendering layer count point in performance impact. [Backport of pull/57437] DOCG-4814. Clarified the rendering layer count point in performance impact. --- .../Documentation~/features/rendering-layers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.universal/Documentation~/features/rendering-layers.md b/Packages/com.unity.render-pipelines.universal/Documentation~/features/rendering-layers.md index f6d7a6096dc..c5334054a96 100644 --- a/Packages/com.unity.render-pipelines.universal/Documentation~/features/rendering-layers.md +++ b/Packages/com.unity.render-pipelines.universal/Documentation~/features/rendering-layers.md @@ -140,4 +140,4 @@ This section contains information related to the impact of Rendering Layers on p * When using Rendering Layers only for Lights in the Forward Rendering Path, the performance impact is insignificant. -* Performance impact grows more significantly when the Rendering Layer count exceeds a multiple of 8. For example: increasing the layer count from 8 to 9 layers has a bigger relative impact than increasing the layer count from 9 to 10 layers. \ No newline at end of file +* Performance impact grows more significantly when the Rendering Layer count exceeds a multiple of 8. For example: increasing the layer count from 8 to 9 layers has a bigger relative impact than increasing the layer count from 9 to 10 layers. The same consideration applies to increasing the count from 16 to 17, from 24 to 25 and so on. \ No newline at end of file