From 81500ca7575f955b56834281821532c59396e841 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Thu, 13 Nov 2025 13:00:10 +0000 Subject: [PATCH 01/16] [Port] [6000.2] Fix for incorrect buffer size when switching XR On/Off --- .../Runtime/RenderPipeline/HDRenderPipeline.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 125318f9f41..9bb02c732a7 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -670,8 +670,7 @@ public HDRenderPipeline(HDRenderPipelineAsset asset) m_DepthPyramidMipLevelOffsetsBuffer = new ComputeBuffer(15, sizeof(int) * 2); - m_CustomPassColorBuffer = new Lazy(() => RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GetCustomBufferFormat(), enableRandomWrite: true, useDynamicScale: true, name: "CustomPassColorBuffer")); - m_CustomPassDepthBuffer = new Lazy(() => RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GraphicsFormat.None, useDynamicScale: true, name: "CustomPassDepthBuffer", depthBufferBits: CoreUtils.GetDefaultDepthBufferBits())); + AllocateCustomPassBuffers(); // For debugging MousePositionDebug.instance.Build(); @@ -2239,6 +2238,14 @@ protected override void Render(ScriptableRenderContext renderContext, List(() => RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GetCustomBufferFormat(), enableRandomWrite: true, useDynamicScale: true, name: "CustomPassColorBuffer")); + m_CustomPassDepthBuffer = new Lazy(() => RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GraphicsFormat.None, useDynamicScale: true, name: "CustomPassDepthBuffer", depthBufferBits: CoreUtils.GetDefaultDepthBufferBits())); + } } } From 41c22ac4546845c23b942f24bc52e5c9bcac1571 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Thu, 13 Nov 2025 13:00:10 +0000 Subject: [PATCH 02/16] [Port] [6000.2] [APV] Loading a baking set using the Load Baking Set button does not load probes --- .../Editor/Lighting/ProbeVolume/ProbeVolumeLightingTab.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeLightingTab.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeLightingTab.cs index ab94e7d8f23..bb2045301a0 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeLightingTab.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeLightingTab.cs @@ -361,6 +361,7 @@ void BakingGUI() activeSet = newSet; ProbeReferenceVolume.instance.Clear(); + ProbeReferenceVolume.instance.SetActiveBakingSet(newSet); } if (activeSet != null) From 52e6f4f121bca047fa8169e1d889b55dbe9adaea Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Fri, 14 Nov 2025 06:34:05 +0000 Subject: [PATCH 03/16] [Port] [6000.2] Force fixed exposure in the editor while scene view filtering --- .../Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 9cbf08dfde1..8f8759159fa 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1125,6 +1125,7 @@ internal static void SetExposureTextureToEmpty(RTHandle exposureTexture) bool IsExposureFixed(HDCamera camera) => m_Exposure.mode.value == ExposureMode.Fixed || m_Exposure.mode.value == ExposureMode.UsePhysicalCamera #if UNITY_EDITOR || (camera.camera.cameraType == CameraType.SceneView && HDAdditionalSceneViewSettings.sceneExposureOverriden) + || (UnityEditor.SceneView.lastActiveSceneView != null && UnityEditor.SceneView.lastActiveSceneView.isUsingSceneFiltering) #endif ; From f71f112f5e904f42ff63d19cd23bda945b46c95e Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Fri, 14 Nov 2025 06:34:07 +0000 Subject: [PATCH 04/16] [Port] [6000.2] docg-7322: Clarify Keyword node behavior --- .../com.unity.shadergraph/Documentation~/Keyword-Node.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.shadergraph/Documentation~/Keyword-Node.md b/Packages/com.unity.shadergraph/Documentation~/Keyword-Node.md index 765401ff4cb..08ec9031998 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Keyword-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Keyword-Node.md @@ -1,7 +1,12 @@ # Keyword node ## Description -You can use a Keyword node to create a static branch in your Shader Graph that references a [Keyword](Keywords.md) on the [Blackboard](Blackboard.md). The appearance of a Keyword node, including its available ports, changes based on the Keyword it references. + +You can use a Keyword node to create branches or shader variants that reference [Keywords](Keywords.md) on the [Blackboard](Blackboard.md). + +Based on the Keyword's definition, the node either generates shader variants or dynamic branches. For more information, refer to [Declare shader keywords](https://docs.unity3d.com/Manual/SL-MultipleProgramVariants-declare.html). + +The appearance of a Keyword node, including its available ports, changes based on the Keyword it references and its definition. ## Creating new Keyword Nodes Because each Keyword node references a specific Keyword, you must first define at least one Keyword on the Blackboard. Drag a Keyword from the Blackboard to the workspace to make a Keyword node that corresponds to that Keyword. From 23b1ca14fa6a7df3447ea59b8f3e07ad74446e5b Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Sat, 15 Nov 2025 08:27:09 +0000 Subject: [PATCH 05/16] [Port] [6000.2] [VFX] Override unity_SpriteProps with default value --- .../ShaderGraph/Templates/VFXConfig.template.hlsl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.visualeffectgraph/Editor/ShaderGraph/Templates/VFXConfig.template.hlsl b/Packages/com.unity.visualeffectgraph/Editor/ShaderGraph/Templates/VFXConfig.template.hlsl index b4af44d5128..5716da463d5 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/ShaderGraph/Templates/VFXConfig.template.hlsl +++ b/Packages/com.unity.visualeffectgraph/Editor/ShaderGraph/Templates/VFXConfig.template.hlsl @@ -60,6 +60,16 @@ UNITY_INSTANCING_BUFFER_END(PerInstance) #define VFX_GET_INSTANCE_ID(i) input.instanceID #endif +// These are supposed to be passed as a instanced constant property (unity_SpriteFlipArray) for sprites, but it doesn't work for VFX Shadergraph mesh outputs +// because the instancing constant arrays (UNITY_DEFINE_INSTANCED_PROP...) are used for per-effect instancing in VFX, not per-particle instancing. +// In any case, the value passed for VFX is always (1,1) currently, and not user-modifiable, so no need to get it from a constant buffer. +#define unity_SpriteProps float4(1,1,1,1) +#ifdef unity_SpriteColor +#undef unity_SpriteColor +#endif +#define unity_SpriteColor float4(1,1,1,1) + + $splice(VFXPerBlockDefines) $splice(VFXSRPCommonInclude) @@ -218,7 +228,7 @@ void GetElementData(inout AttributesElement element) #if !VFX_HAS_INDIRECT_DRAW && !HAS_STRIPS if (attributes.alive) -#endif +#endif { $splice(VFXProcessBlocks) } From 9e86c585eda80f5d154017e30165a2ec9c62c5d3 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Wed, 19 Nov 2025 00:57:27 +0000 Subject: [PATCH 06/16] [Port] [6000.2] [UUM-90714] Fix for ShadowCaster2D breaks on certain Rotation positions when Casting Source is set to PolygonCollider2D --- .../Runtime/2D/Shadows/ShadowRendering.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowRendering.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowRendering.cs index a7e48f68589..dde2ed05a8b 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowRendering.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowRendering.cs @@ -221,19 +221,15 @@ private static Bounds CalculateWorldSpaceBounds(Camera camera, ILight2DCullResul Vector3 maxCorner = new Vector3(float.MinValue, float.MinValue, float.MinValue); for (int i = 0; i < k_Corners; i++) { - maxCorner = Vector3.Max(maxCorner, nearCorners[i]); - maxCorner = Vector3.Max(maxCorner, farCorners[i]); - minCorner = Vector3.Min(minCorner, nearCorners[i]); - minCorner = Vector3.Min(minCorner, farCorners[i]); + maxCorner = Vector3.Max(maxCorner, camera.transform.TransformPoint(nearCorners[i])); + maxCorner = Vector3.Max(maxCorner, camera.transform.TransformPoint(farCorners[i])); + minCorner = Vector3.Min(minCorner, camera.transform.TransformPoint(nearCorners[i])); + minCorner = Vector3.Min(minCorner, camera.transform.TransformPoint(farCorners[i])); } nearCorners.Dispose(); farCorners.Dispose(); - // Transform the point from camera space to world space - maxCorner = camera.transform.TransformPoint(maxCorner); - minCorner = camera.transform.TransformPoint(minCorner); - // TODO: Iterate through the lights for (int i = 0; i < cullResult.visibleLights.Count; i++) { From ae40f795bf2e762bb01005fd68e6e57b466b3d12 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Thu, 20 Nov 2025 07:56:07 +0000 Subject: [PATCH 07/16] [Port] [6000.2] Clean up the Shader Graph docs landing page --- .../Documentation~/index.md | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/Packages/com.unity.shadergraph/Documentation~/index.md b/Packages/com.unity.shadergraph/Documentation~/index.md index 44e968d904d..4ca6632ad80 100644 --- a/Packages/com.unity.shadergraph/Documentation~/index.md +++ b/Packages/com.unity.shadergraph/Documentation~/index.md @@ -1,23 +1,11 @@ -# About Shader Graph - -## Description +# Shader Graph Shader Graph enables you to build shaders visually. Instead of writing code, you create and connect nodes in a graph framework. Shader Graph gives instant feedback that reflects your changes, and it’s simple enough for users who are new to shader creation. -For an introduction to Shader Graph, see [Getting Started](Getting-Started.md). - -Shader Graph is available through the Package Manager window in supported versions of the Unity Editor. If you install a Scriptable Render Pipeline (SRP) such as the [Universal Render Pipeline (URP)](https://docs.unity3d.com/Manual/urp/urp-introduction.html) or the [High Definition Render Pipeline (HDRP)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest), Unity automatically installs Shader Graph in your project. - -Shader Graph package versions on Unity Engine 2018.x are *Preview* versions, which do not receive bug fixes and feature maintenance. To work with an actively supported version of Shader Graph, use Unity Engine 2019.1 or higher. - -### SRP packages are part of the core - -With the release of Unity 2021.1, graphics packages are relocating to the core of Unity. This move simplifies the experience of working with new Unity graphics features, as well as ensuring that your projects are always running on the latest verified graphics code. - -For each release of Unity (alpha / beta / patch release) graphics packages are embedded within the main Unity installer. When you install the latest release of Unity, you also get the latest [Universal Render Pipeline (URP)](https://docs.unity3d.com/Manual/urp/urp-introduction.html), [High Definition Render Pipeline (HDRP)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest), Shader Graph, [Visual Effect (VFX) Graph](https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@latest) packages, among others. - -Tying graphics packages to the main Unity release allows better testing to ensure that the graphics packages you use have been tested extensively with the version of Unity you have downloaded. +Shader Graph is automatically available in your project as soon as you install the [Universal Render Pipeline (URP)](https://docs.unity3d.com/Manual/urp/urp-introduction.html) or the [High Definition Render Pipeline (HDRP)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest). Refer to [Shader Graph installation details](install-shader-graph.md). -You can also use a local copy or a custom version of the graphics packages with an override in the manifest file. +* [Get Started with Shader Graph](Getting-Started.md) +* [Shader Graph Node Library reference](Node-Library.md) +* [Shader Graph samples](ShaderGraph-Samples.md) -For more information, see the following post on the forum: [SRP v11 beta is available now](https://forum.unity.com/threads/srp-v11-beta-is-available-now.1046539/). +![Graph examples in the Shader Graph window](images/NodeReferenceSamples.png) From b88edf4204537feb397199e0141eee5a9633b7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Slysz?= Date: Fri, 21 Nov 2025 06:44:05 +0000 Subject: [PATCH 08/16] [6000.2] [UUM-125463] Fix warning thrown by worker thread from URP indexer for project upgrader --- .../Editor/Converter/ConversionIndexers.cs | 45 ---------- .../Converter/ConversionIndexers.cs.meta | 11 --- .../Converter/MaterialReferenceBuilder.cs | 3 +- .../Converter/ReadonlyMaterialConverter.cs | 87 ++++++++++++++++--- .../RenderPipelineConvertersEditor.cs | 63 +------------- .../Editor/Converter/converter_editor.uxml | 5 +- 6 files changed, 78 insertions(+), 136 deletions(-) delete mode 100644 Packages/com.unity.render-pipelines.universal/Editor/Converter/ConversionIndexers.cs delete mode 100644 Packages/com.unity.render-pipelines.universal/Editor/Converter/ConversionIndexers.cs.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Converter/ConversionIndexers.cs b/Packages/com.unity.render-pipelines.universal/Editor/Converter/ConversionIndexers.cs deleted file mode 100644 index 533d2bd743e..00000000000 --- a/Packages/com.unity.render-pipelines.universal/Editor/Converter/ConversionIndexers.cs +++ /dev/null @@ -1,45 +0,0 @@ -using UnityEditor.Search; -using UnityEngine; -using Object = UnityEngine.Object; - -namespace UnityEditor.Rendering.Universal -{ - static class ConversionIndexers - { - private const int k_Version = 8; - - [CustomObjectIndexer(typeof(Object), version = k_Version)] - internal static void ConversionIndexer(CustomObjectIndexerTarget context, ObjectIndexer indexer) - { - //Custom finding of all default Material properties on every single object type including custom types - if (MaterialReferenceBuilder.MaterialReferenceLookup.TryGetValue(context.targetType, out var methods)) - { - foreach (var method in methods) - { - if (method == null) continue; - - var result = method.GetMaterialFromMethod(context.target, (methodName, objectName) => - $"The method {methodName} was not found on {objectName}. This property will not be indexed."); - - if (result is Material materialResult) - { - if (materialResult != null && MaterialReferenceBuilder.GetIsReadonlyMaterial(materialResult)) - { - indexer.AddProperty("urp", "convert-readonly", context.documentIndex); - } - } - else if (result is Material[] materialArrayResult) - { - foreach (var material in materialArrayResult) - { - if (material != null && MaterialReferenceBuilder.GetIsReadonlyMaterial(material)) - { - indexer.AddProperty("urp", "convert-readonly", context.documentIndex); - } - } - } - } - } - } - } -} diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Converter/ConversionIndexers.cs.meta b/Packages/com.unity.render-pipelines.universal/Editor/Converter/ConversionIndexers.cs.meta deleted file mode 100644 index c1cdbb66abe..00000000000 --- a/Packages/com.unity.render-pipelines.universal/Editor/Converter/ConversionIndexers.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 192e94d6ebdfb96438e2d027c77f9519 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Converter/MaterialReferenceBuilder.cs b/Packages/com.unity.render-pipelines.universal/Editor/Converter/MaterialReferenceBuilder.cs index fbd49bd9b4e..344c0972e31 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/Converter/MaterialReferenceBuilder.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/Converter/MaterialReferenceBuilder.cs @@ -130,7 +130,8 @@ public static object GetMaterialFromMethod(this MethodInfo method, // and we've already checked for other possible null exceptions here if ((e.InnerException is NullReferenceException)) { - Debug.LogWarning(generateErrorString(method.Name, obj.name)); + if (generateErrorString != null) + Debug.LogWarning(generateErrorString(method.Name, obj.name)); } else { diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Converter/ReadonlyMaterialConverter.cs b/Packages/com.unity.render-pipelines.universal/Editor/Converter/ReadonlyMaterialConverter.cs index 6711b944ac1..a0834799650 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/Converter/ReadonlyMaterialConverter.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/Converter/ReadonlyMaterialConverter.cs @@ -45,35 +45,94 @@ internal class ReadonlyMaterialConverter : RenderPipelineConverter List guids = new List(); + public Material[] GetBuiltInMaterials() + { + using (UnityEngine.Pool.ListPool.Get(out var tmp)) + { + foreach (var materialName in ReadonlyMaterialMap.Map.Keys) + { + var name = materialName + ".mat"; + + Material mat = null; + foreach (var material in AssetDatabaseHelper.FindAssets()) + { + if (material.name == materialName) + { + mat = material; + break; + } + } + + if (mat == null) + { + mat = AssetDatabase.GetBuiltinExtraResource(name); + if (mat == null) + { + mat = Resources.GetBuiltinResource(name); + if (mat == null) + { + mat = Resources.Load(name); + } + } + } + + if (mat == null) + { + Debug.LogError($"Material '{materialName}' not found in built-in resources or project assets."); + continue; + } + + tmp.Add(mat); + } + return tmp.ToArray(); + } + } + + private string BuildQuery() + { + using (UnityEngine.Pool.ListPool.Get(out var tmp)) + { + var materials = GetBuiltInMaterials(); + foreach (var mat in materials) + { + string formattedId = $"<$object:{GlobalObjectId.GetGlobalObjectIdSlow(mat)},UnityEngine.Object$>"; + tmp.Add($"ref={formattedId}"); + } + + return string.Join(" or ", tmp) + " -t:RenderPipelineGlobalSettings"; + } + } + public override void OnInitialize(InitializeConverterContext ctx, Action callback) { + var query = BuildQuery(); Search.SearchService.Request ( - Search.SearchService.CreateContext("asset", "urp=convert-readonly a=URPConverterIndex"), + Search.SearchService.CreateContext(new[] { "asset", "scene" }, query), (searchContext, items) => { - // we're going to do this step twice in order to get them ordered, but it should be fast - var orderedRequest = items.OrderBy(req => + foreach (var r in items) { - GlobalObjectId.TryParse(req.id, out var gid); - return gid.assetGUID; - }); + if (r == null || r.id == null) + continue; - foreach (var r in orderedRequest) - { - if (string.IsNullOrEmpty(r?.id) || - !GlobalObjectId.TryParse(r.id, out var gid)) - { + // Direct conversion - works for both assets and scene objects + var unityObject = r.ToObject(); + + if (unityObject == null) continue; - } var label = r.provider.fetchLabel(r, r.context); var description = r.provider.fetchDescription(r, r.context); + var gid = GlobalObjectId.GetGlobalObjectIdSlow(unityObject); + int type = gid.identifierType; // 1=Asset, 2=SceneObject + + var go = unityObject as GameObject; var item = new ConverterItemDescriptor() { - name = description.Split('/').Last().Split('.').First(), - info = $"{label}", + name = $"{unityObject.name} ({(type == 1 ? "Prefab" : "SceneObject")})", + info = type == 1 ? AssetDatabase.GetAssetPath(unityObject) : go.scene.path, }; guids.Add(gid.ToString()); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Converter/RenderPipelineConvertersEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/Converter/RenderPipelineConvertersEditor.cs index 61ef2cf5d64..96f44a87011 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/Converter/RenderPipelineConvertersEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/Converter/RenderPipelineConvertersEditor.cs @@ -97,8 +97,6 @@ internal class RenderPipelineConvertersEditor : EditorWindow Button m_InitAnConvertButton; Button m_ContainerHelpButton; - bool m_InitAndConvert; - List m_CoreConvertersList = new List(); List m_VEList = new List(); @@ -269,9 +267,6 @@ public void CreateGUI() m_InitButton = rootVisualElement.Q