From 7294aed1aee66aa727d01fb41bbed0e5076f7296 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Fri, 17 Apr 2026 10:16:43 +0000 Subject: [PATCH 1/6] [Port] [6000.0] Graphics/URP/UUM-134993 - Fix URP Sample - Blit Depth Copy Pass wrongly binding msaa depth with Vulkan --- .../RendererFeatures/DepthBlit/DepthBlitCopyDepthPass.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/RendererFeatures/DepthBlit/DepthBlitCopyDepthPass.cs b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/RendererFeatures/DepthBlit/DepthBlitCopyDepthPass.cs index 1d126cff0bd..eadf2a979db 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/RendererFeatures/DepthBlit/DepthBlitCopyDepthPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/RendererFeatures/DepthBlit/DepthBlitCopyDepthPass.cs @@ -133,8 +133,9 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer builder.SetRenderFunc((PassData data, RasterGraphContext context) => { // Enable an MSAA shader keyword based on the source texture MSAA sample count + // when depth must be resolved manually in the copy shader RTHandle sourceTex = data.source; - int cameraSamples = sourceTex.rt.antiAliasing; + int cameraSamples = sourceTex.rt.bindTextureMS ? sourceTex.rt.antiAliasing : 1; context.cmd.SetKeyword(data.keyword_DepthMsaa2, cameraSamples == 2); context.cmd.SetKeyword(data.keyword_DepthMsaa4, cameraSamples == 4); context.cmd.SetKeyword(data.keyword_DepthMsaa8, cameraSamples == 8); From cedcc264148f92c9581fa39abac6be5292d729ab Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Sun, 19 Apr 2026 09:28:05 +0000 Subject: [PATCH 2/6] [Port] [6000.0] Graphics/HDRP - [UUM-130925] - Fix null limit.xy values in _ColorPyramidUvScaleAndLimitCurrentFrame after color pyramid for distortion --- .../RenderPipeline/HDRenderPipeline.RenderGraph.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 ded68994506..90794cc86f6 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 @@ -293,10 +293,11 @@ void RecordRenderGraph(RenderRequest renderRequest, GenerateColorPyramid(m_RenderGraph, hdCamera, colorBuffer, distortionColorPyramid, FullScreenDebugMode.PreRefractionColorPyramid, distortionRendererList); currentColorPyramid = distortionColorPyramid; - - // The color pyramid for distortion is not an history, so it need to be sampled appropriate RT handle scale. Thus we need to update it - var newScale = new Vector4(RTHandles.rtHandleProperties.rtHandleScale.x, RTHandles.rtHandleProperties.rtHandleScale.y, 0, 0); - m_ShaderVariablesGlobalCB._ColorPyramidUvScaleAndLimitCurrentFrame = newScale; + // The color pyramid for distortion is not an history buffer, so it needs to be sampled using an appropriate RT handle scale. Thus we need to update the scale and the limit. + // It's relatively straightforward to update the scale because we store it in rtHandleScale but we miss the limit values. For now, we approximate them by setting them to the scale value. + // This is imperfect but resetting limit at (0, 0) gives worse results (UUM-130925). + var newScaleLimits = new Vector4(RTHandles.rtHandleProperties.rtHandleScale.x, RTHandles.rtHandleProperties.rtHandleScale.y, RTHandles.rtHandleProperties.rtHandleScale.x, RTHandles.rtHandleProperties.rtHandleScale.y); + m_ShaderVariablesGlobalCB._ColorPyramidUvScaleAndLimitCurrentFrame = newScaleLimits; PushGlobalCameraParams(m_RenderGraph, hdCamera); } From 24a27205a6e2ee97a5e6c75a6aef57cb0a2eebbd Mon Sep 17 00:00:00 2001 From: Kenny Tan Date: Mon, 27 Apr 2026 16:46:06 +0000 Subject: [PATCH 3/6] [Port] [6000.0] [UUM-139229][URP 2D] Fix preview camera missing lighting and shadows --- .../Runtime/2D/Rendergraph/DrawLight2DPass.cs | 14 ++------ .../2D/Rendergraph/DrawRenderer2DPass.cs | 34 ++++++------------- .../2D/Rendergraph/Renderer2DRendergraph.cs | 19 +++++++++++ 3 files changed, 33 insertions(+), 34 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawLight2DPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawLight2DPass.cs index 612f62ee69a..961e14527b2 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawLight2DPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawLight2DPass.cs @@ -178,20 +178,12 @@ internal void Render(RenderGraph graph, ContextContainer frameData, Renderer2DDa Universal2DResourceData universal2DResourceData = frameData.Get(); UniversalCameraData cameraData = frameData.Get(); - DebugHandler debugHandler = ScriptableRenderPass.GetActiveDebugHandler(cameraData); - var isDebugLightingActive = debugHandler?.IsLightingActive ?? true; - -#if UNITY_EDITOR - if (cameraData.isSceneViewCamera && UnityEditor.SceneView.currentDrawingSceneView != null) - isDebugLightingActive &= UnityEditor.SceneView.currentDrawingSceneView.sceneLighting; - - if (cameraData.camera.cameraType == CameraType.Preview) - isDebugLightingActive = false; -#endif + // Check for lighting in scene/prefab/preview camera + var isLightingActive = Renderer2D.s_IsLightingActive; if (!layerBatch.lightStats.useLights || isVolumetric && !layerBatch.lightStats.useVolumetricLights || - !isDebugLightingActive) + !isLightingActive) return; // Render single RTs by for apis that don't support MRTs diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawRenderer2DPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawRenderer2DPass.cs index 132a6ac9828..dc0455681cf 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawRenderer2DPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawRenderer2DPass.cs @@ -37,7 +37,7 @@ private static void Execute(RasterGraphContext context, PassData passData) RendererLighting.SetLightShaderGlobals(cmd, passData.lightBlendStyles, passData.blendStyleIndices); #if UNITY_EDITOR - if (passData.isLitView) + if (passData.isLightingActive) #endif { if (passData.layerUseLights) @@ -85,7 +85,7 @@ class PassData internal bool activeDebugHandler; #if UNITY_EDITOR - internal bool isLitView; // Required for prefab view and preview camera + internal bool isLightingActive; // Required for prefab view and preview camera #endif } @@ -98,35 +98,23 @@ public void Render(RenderGraph graph, ContextContainer frameData, Renderer2DData CommonResourceData commonResourceData = frameData.Get(); var layerBatch = layerBatches[batchIndex]; - bool isLitView = true; -#if UNITY_EDITOR - // Early out for prefabs - if (cameraData.isSceneViewCamera && UnityEditor.SceneView.currentDrawingSceneView != null) - isLitView = UnityEditor.SceneView.currentDrawingSceneView.sceneLighting; - - // Early out for preview camera - if (cameraData.cameraType == CameraType.Preview) - isLitView = false; - - DebugHandler debugHandler = GetActiveDebugHandler(cameraData); - if (debugHandler != null) - isLitView = debugHandler.IsLightingActive; -#endif + // Check for lighting in scene/prefab/preview camera + var isLightingActive = Renderer2D.s_IsLightingActive; // Preset global light textures for first batch if (batchIndex == 0) { using (var builder = graph.AddRasterRenderPass(k_SetLightBlendTexture, out var passData, m_SetLightBlendTextureProfilingSampler)) { - if (layerBatch.lightStats.useLights && isLitView) + if (layerBatch.lightStats.useLights && isLightingActive) { passData.lightTextures = universal2DResourceData.lightTextures[batchIndex]; for (var i = 0; i < passData.lightTextures.Length; i++) builder.UseTexture(passData.lightTextures[i]); } - SetGlobalLightTextures(graph, builder, passData.lightTextures, ref layerBatch, rendererData, isLitView); + SetGlobalLightTextures(graph, builder, passData.lightTextures, ref layerBatch, rendererData, isLightingActive); builder.AllowPassCulling(false); builder.AllowGlobalStateModification(true); @@ -146,7 +134,7 @@ public void Render(RenderGraph graph, ContextContainer frameData, Renderer2DData passData.isSceneLit = rendererData.lightCullResult.IsSceneLit(); passData.layerUseLights = layerBatch.lightStats.useLights; #if UNITY_EDITOR - passData.isLitView = isLitView; + passData.isLightingActive = isLightingActive; #endif var drawSettings = CreateDrawingSettings(k_ShaderTags, renderingData, cameraData, lightData, SortingCriteria.CommonTransparent); @@ -171,7 +159,7 @@ public void Render(RenderGraph graph, ContextContainer frameData, Renderer2DData builder.UseRendererList(passData.rendererList); } - if (passData.layerUseLights && isLitView) + if (passData.layerUseLights && isLightingActive) { passData.lightTextures = universal2DResourceData.lightTextures[batchIndex]; for (var i = 0; i < passData.lightTextures.Length; i++) @@ -192,7 +180,7 @@ public void Render(RenderGraph graph, ContextContainer frameData, Renderer2DData // Post set global light textures for next renderer pass var nextBatch = batchIndex + 1; if (nextBatch < universal2DResourceData.lightTextures.Length) - SetGlobalLightTextures(graph, builder, universal2DResourceData.lightTextures[nextBatch], ref layerBatches[nextBatch], rendererData, isLitView); + SetGlobalLightTextures(graph, builder, universal2DResourceData.lightTextures[nextBatch], ref layerBatches[nextBatch], rendererData, isLightingActive); builder.SetRenderFunc((PassData data, RasterGraphContext context) => { @@ -201,9 +189,9 @@ public void Render(RenderGraph graph, ContextContainer frameData, Renderer2DData } } - void SetGlobalLightTextures(RenderGraph graph, IRasterRenderGraphBuilder builder, TextureHandle[] lightTextures, ref LayerBatch layerBatch, Renderer2DData rendererData, bool isLitView) + void SetGlobalLightTextures(RenderGraph graph, IRasterRenderGraphBuilder builder, TextureHandle[] lightTextures, ref LayerBatch layerBatch, Renderer2DData rendererData, bool isLightingActive) { - if (isLitView) + if (isLightingActive) { if (layerBatch.lightStats.useLights) { diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs index e64f7ca07a6..31f129ddee5 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs @@ -31,6 +31,7 @@ internal sealed partial class Renderer2D : ScriptableRenderer int m_BatchCount; bool ppcUpscaleRT = false; + static internal bool s_IsLightingActive; private struct ImportResourceSummary { @@ -202,8 +203,10 @@ ImportResourceSummary GetImportResourceSummary(RenderGraph renderGraph, Universa void InitializeLayerBatches() { Universal2DResourceData resourceData = frameData.Get(); + UniversalCameraData cameraData = frameData.Get(); m_LayerBatches = LayerUtility.CalculateBatches(m_Renderer2DData, out m_BatchCount); + s_IsLightingActive = IsSceneViewOrPreviewLightingActive(cameraData); // Initialize textures dependent on batch size if (resourceData.normalsTexture.Length != m_BatchCount) @@ -857,5 +860,21 @@ private void CleanupRenderGraphResources() m_CameraSortingLayerHandle?.Release(); Light2DLookupTexture.Release(); } + + static internal bool IsSceneViewOrPreviewLightingActive(UniversalCameraData cameraData) + { + DebugHandler debugHandler = ScriptableRenderPass.GetActiveDebugHandler(cameraData); + var isLightingActive = debugHandler?.IsLightingActive ?? true; + +#if UNITY_EDITOR + if (cameraData.isSceneViewCamera && UnityEditor.SceneView.currentDrawingSceneView != null) + isLightingActive &= UnityEditor.SceneView.currentDrawingSceneView.sceneLighting; + + if (cameraData.isPreviewCamera && cameraData.camera.name == "Preview Scene Camera") + isLightingActive = false; +#endif + + return isLightingActive; + } } } From 934215c611d05628b5a9ce88d04fdf3fcf110dbb Mon Sep 17 00:00:00 2001 From: Pema Malling Date: Mon, 27 Apr 2026 16:46:06 +0000 Subject: [PATCH 4/6] [6000.0] Fix color bleeding near edge of screen with HDRP SSGI --- .../RaytracingIndirectDiffuse.compute | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/IndirectDiffuse/RaytracingIndirectDiffuse.compute b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/IndirectDiffuse/RaytracingIndirectDiffuse.compute index 284dffc4045..4ce006f356c 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/IndirectDiffuse/RaytracingIndirectDiffuse.compute +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/IndirectDiffuse/RaytracingIndirectDiffuse.compute @@ -222,11 +222,8 @@ NeighborTapData GetNeighborTapDataSample_HR(uint2 groupThreadId, int2 offset) return GetNeighborTapDataSample_HR(OffsetToLDSAdress_HR(groupThreadId, offset)); } -NeighborTapData GetNeighborTapDataSample_HR_NOLDS(uint2 fulLResCoord, int2 offset) +NeighborTapData GetNeighborTapDataSample_HR_NOLDS(uint2 tapCoord) { - int2 tapCoord = (fulLResCoord / 2 + offset) * 2; - tapCoord = int2(clamp(tapCoord.x, 0, (int)_ScreenSize.x - 1), clamp(tapCoord.y, 0, (int)_ScreenSize.y - 1)); - NeighborTapData outVal; outVal.lighting = LOAD_TEXTURE2D_X(_IndirectDiffuseTexture, tapCoord / 2).xyz; outVal.linearDepth = Linear01Depth(LOAD_TEXTURE2D_X(_DepthTexture, tapCoord).x, _ZBufferParams); @@ -278,11 +275,15 @@ void IndirectDiffuseIntegrationUpscaleHalfRes(uint3 dispatchThreadId : SV_Dispat { for(int x = -HALF_RES_OUT_REGION_SIZE; x < HALF_RES_OUT_REGION_SIZE; ++x) { + int2 tapCoord = (targetCoord / 2 + int2(x,y)) * 2; + if (any(tapCoord < 0) || any(tapCoord >= _ScreenSize.xy)) + continue; + #ifndef WITHOUT_LDS // Grab the neighbor data NeighborTapData neighborData = GetNeighborTapDataSample_HR(groupThreadId, int2(x,y)); #else - NeighborTapData neighborData = GetNeighborTapDataSample_HR_NOLDS(targetCoord, int2(x,y)); + NeighborTapData neighborData = GetNeighborTapDataSample_HR_NOLDS(tapCoord); #endif // Evaluate the weight of this neighbor float weight = EvaluateNeighborWeight(neighborData, normalData.normalWS, linearDepth); @@ -416,6 +417,10 @@ void IndirectDiffuseIntegrationUpscaleFullRes(uint3 dispatchThreadId : SV_Dispat { for(int x = -FULL_RES_OUT_REGION_SIZE; x < FULL_RES_OUT_REGION_SIZE; ++x) { + int2 tapCoord = targetCoord + int2(x,y); + if (any(tapCoord < 0) || any(tapCoord >= _ScreenSize.xy)) + continue; + #ifndef WITHOUT_LDS // Grab the neighbor data NeighborTapData neighborData = GetNeighborTapDataSample_FR(groupThreadId, int2(x,y)); From 083519026dbc721e9da910d2b255f097db5383e8 Mon Sep 17 00:00:00 2001 From: Louis-Philippe Ledoux Date: Tue, 28 Apr 2026 11:10:08 +0000 Subject: [PATCH 5/6] Fix the doubling of the lens flare effect in XR --- .../Runtime/Passes/PostProcessPass.cs | 2 +- .../Runtime/Passes/PostProcessPassRenderGraph.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs index 8d600c9f0ad..6e461febff0 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs @@ -1106,7 +1106,7 @@ void LensFlareDataDriven(ref UniversalCameraData cameraData, CommandBuffer cmd, Matrix4x4 gpuVPXR = GL.GetGPUProjectionMatrix(cameraData.GetProjectionMatrixNoJitter(xrIdx), true) * cameraData.GetViewMatrix(xrIdx); LensFlareCommonSRP.DoLensFlareDataDrivenCommon( - m_Materials.lensFlareDataDriven, camera, pixelRect, cameraData.xr, cameraData.xr.multipassId, + m_Materials.lensFlareDataDriven, camera, pixelRect, cameraData.xr, xrIdx, (float)m_Descriptor.width, (float)m_Descriptor.height, usePanini, paniniDistance, paniniCropToFit, true, camera.transform.position, diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPassRenderGraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPassRenderGraph.cs index b2d3c21ca00..059d9c06c92 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPassRenderGraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPassRenderGraph.cs @@ -1255,7 +1255,7 @@ public void RenderLensFlareDataDriven(RenderGraph renderGraph, UniversalResource Matrix4x4 nonJitteredViewProjMatrix_k = GL.GetGPUProjectionMatrix(data.cameraData.GetProjectionMatrixNoJitter(xrIdx), true) * data.cameraData.GetViewMatrix(xrIdx); LensFlareCommonSRP.DoLensFlareDataDrivenCommon( - data.material, data.cameraData.camera, data.viewport, xr, data.cameraData.xr.multipassId, + data.material, data.cameraData.camera, data.viewport, xr, xrIdx, data.width, data.height, data.usePanini, data.paniniDistance, data.paniniCropToFit, true, From df6ac0f8a0c42ad101663eeededaa85d9d73e83f Mon Sep 17 00:00:00 2001 From: Evergreen Date: Tue, 28 Apr 2026 11:10:12 +0000 Subject: [PATCH 6/6] [Port] [6000.0] [XR] Fix missing unity_StereoEyeIndex constant in URP Multi-pass, needed for stereoscopic panoramic skyboxes --- .../Runtime/XR/XRBuiltinShaderConstants.cs | 5 +++++ .../Runtime/ScriptableRenderer.cs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/XR/XRBuiltinShaderConstants.cs b/Packages/com.unity.render-pipelines.core/Runtime/XR/XRBuiltinShaderConstants.cs index cbbd2cee2dc..df9f0be4d19 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/XR/XRBuiltinShaderConstants.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/XR/XRBuiltinShaderConstants.cs @@ -52,6 +52,11 @@ public static class XRBuiltinShaderConstants /// static public readonly int unity_StereoWorldSpaceCameraPos = Shader.PropertyToID("unity_StereoWorldSpaceCameraPos"); + /// + /// Cached unique id for unity_StereoEyeIndex + /// + static public readonly int unity_StereoEyeIndex = Shader.PropertyToID("unity_StereoEyeIndex"); + // Pre-allocate arrays to avoid GC static Matrix4x4[] s_cameraProjMatrix = new Matrix4x4[2]; static Matrix4x4[] s_invCameraProjMatrix = new Matrix4x4[2]; diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs index 13f1429eec7..54467bd2467 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs @@ -292,6 +292,10 @@ void SetPerCameraShaderVariables(RasterCommandBuffer cmd, UniversalCameraData ca cameraHeight = (float)cameraTargetSizeCopy.y; useRenderPassEnabled = false; + + // Multi-pass needs to set unity_StereoEyeIndex builtin param for skybox-panoramic.shader to work correctly (UUM-120719) + if (!cameraData.xr.singlePassEnabled) + cmd.SetGlobalVector(XRBuiltinShaderConstants.unity_StereoEyeIndex, new Vector4(cameraData.xr.multipassId, 0, 0, 0)); } if (camera.allowDynamicResolution)