From 02b70222ad2560f5a0798b15438d65f7cf4b7348 Mon Sep 17 00:00:00 2001 From: Adrien Moulin Date: Thu, 26 Feb 2026 09:59:17 +0000 Subject: [PATCH 01/95] 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 18db752b227..66cc7b9f0a2 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 @@ -313,10 +313,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 34696af1e4522ace822143d81bb6d4f5b4e616e9 Mon Sep 17 00:00:00 2001 From: Nicola Cerone Date: Thu, 26 Feb 2026 09:59:23 +0000 Subject: [PATCH 02/95] Correctly support UITKPreview without affecting other preview. --- .../Editor/Generation/Processors/Generator.cs | 9 ++ .../Generation/Targets/PreviewTarget.cs | 7 +- .../Generation/Targets/UITKPreviewTarget.cs | 89 +++++++++++++++++++ .../Targets/UITKPreviewTarget.cs.meta | 2 + 4 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs create mode 100644 Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs.meta diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs b/Packages/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs index fb9d8db6aaf..e797a5c0c94 100644 --- a/Packages/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs +++ b/Packages/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs @@ -12,6 +12,7 @@ using UnityEngine.Assertions; using Pool = UnityEngine.Pool; using Unity.Profiling; +using UnityEditor.Rendering.UITK.ShaderGraph; namespace UnityEditor.ShaderGraph { @@ -192,6 +193,14 @@ Target[] GetTargetImplementations() } else { + var targets = m_GraphData.activeTargets.ToList(); + foreach (var target in targets) + { + if (target.activeSubTarget is IUISubTarget) + { + return new Target[] { new UITKPreviewTarget() }; + } + } return new Target[] { new PreviewTarget() }; } } diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Targets/PreviewTarget.cs b/Packages/com.unity.shadergraph/Editor/Generation/Targets/PreviewTarget.cs index 89efef4d16b..b3738da3d72 100644 --- a/Packages/com.unity.shadergraph/Editor/Generation/Targets/PreviewTarget.cs +++ b/Packages/com.unity.shadergraph/Editor/Generation/Targets/PreviewTarget.cs @@ -6,7 +6,7 @@ namespace UnityEditor.ShaderGraph { - sealed class PreviewTarget : Target + class PreviewTarget : Target { static readonly GUID kSourceCodeGuid = new GUID("7464b9fcde08e5645a16b9b8ae1e573c"); // PreviewTarget.cs @@ -94,7 +94,6 @@ static class Passes { "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariables.hlsl", IncludeLocation.Pregraph }, { "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl", IncludeLocation.Pregraph }, { "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShim.hlsl", IncludeLocation.Pregraph }, // Post-graph { "Packages/com.unity.shadergraph/ShaderGraphLibrary/PreviewVaryings.hlsl", IncludeLocation.Postgraph }, @@ -103,7 +102,7 @@ static class Passes }; } - static class StructDescriptors + protected static class StructDescriptors { public static StructDescriptor PreviewVaryings = new StructDescriptor() { @@ -133,7 +132,7 @@ static class StructDescriptors }; } - static class KeywordDescriptors + protected static class KeywordDescriptors { public static KeywordDescriptor PreviewKeyword = new KeywordDescriptor() { diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs b/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs new file mode 100644 index 00000000000..21ddab3750e --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.UIElements; + +namespace UnityEditor.ShaderGraph +{ + class UITKPreviewTarget : PreviewTarget + { + static readonly GUID kSourceCodeGuid = new GUID("25a52015b0f83494a824ccc98f1854d1"); // UITKPreviewTarget.cs + + public UITKPreviewTarget() + { + displayName = "Preview"; + isHidden = true; + } + + public override void Setup(ref TargetSetupContext context) + { + context.AddAssetDependency(kSourceCodeGuid, AssetCollection.Flags.SourceDependency); + context.AddSubShader(SubShaders.Preview); + } + + static class SubShaders + { + public static SubShaderDescriptor Preview = new SubShaderDescriptor() + { + renderQueue = "Geometry", + renderType = "Opaque", + generatesPreview = true, + passes = new PassCollection { Passes.Preview }, + }; + } + + static class Passes + { + public static PassDescriptor Preview = new PassDescriptor() + { + // Definition + referenceName = "SHADERPASS_PREVIEW", + useInPreview = true, + + // Templates + passTemplatePath = GenerationUtils.GetDefaultTemplatePath("PassMesh.template"), + sharedTemplateDirectories = GenerationUtils.GetDefaultSharedTemplateDirectories(), + + // Collections + structs = new StructCollection + { + { Structs.Attributes }, + { StructDescriptors.PreviewVaryings }, + { Structs.SurfaceDescriptionInputs }, + { Structs.VertexDescriptionInputs }, + }, + fieldDependencies = FieldDependencies.Default, + pragmas = new PragmaCollection + { + { Pragma.Vertex("vert") }, + { Pragma.Fragment("frag") }, + }, + defines = new DefineCollection + { + { KeywordDescriptors.PreviewKeyword, 1 }, + }, + includes = new IncludeCollection + { + // Pre-graph + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl", IncludeLocation.Pregraph }, // TODO: put this on a conditional + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariables.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShim.hlsl", IncludeLocation.Pregraph }, + + // Post-graph + { "Packages/com.unity.shadergraph/ShaderGraphLibrary/PreviewVaryings.hlsl", IncludeLocation.Postgraph }, + { "Packages/com.unity.shadergraph/ShaderGraphLibrary/PreviewPass.hlsl", IncludeLocation.Postgraph }, + } + }; + } + } +} diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs.meta b/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs.meta new file mode 100644 index 00000000000..02e7412621a --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 25a52015b0f83494a824ccc98f1854d1 \ No newline at end of file From 0ad24f1d047958dec87141cad05a406b1487e14a Mon Sep 17 00:00:00 2001 From: Michael Joos Date: Thu, 26 Feb 2026 09:59:29 +0000 Subject: [PATCH 03/95] [UUM-133826] Initialize uv1 for Canvas shaders when not using masking --- .../Runtime/Material/Canvas/HDCanvasPass.hlsl | 2 ++ .../Editor/ShaderGraph/Includes/CanvasPass.hlsl | 2 ++ .../BuiltIn/Editor/ShaderGraph/Includes/BuiltInCanvasPass.hlsl | 2 ++ 3 files changed, 6 insertions(+) diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Canvas/HDCanvasPass.hlsl b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Canvas/HDCanvasPass.hlsl index d688c00468e..ce526019b65 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Canvas/HDCanvasPass.hlsl +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Canvas/HDCanvasPass.hlsl @@ -91,6 +91,8 @@ Varyings BuildVaryings(Attributes input) float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); float2 maskUV = (input.positionOS.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); output.texCoord1 = float4(input.positionOS.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); + #else + output.texCoord1 = input.uv1; #endif #endif diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/CanvasPass.hlsl b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/CanvasPass.hlsl index d3f261d1c6b..82128033643 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/CanvasPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/CanvasPass.hlsl @@ -80,6 +80,8 @@ Varyings BuildVaryings(Attributes input) float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); float2 maskUV = (input.positionOS.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); output.texCoord1 = float4(input.positionOS.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); + #else + output.texCoord1 = input.uv1; #endif #endif diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Includes/BuiltInCanvasPass.hlsl b/Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Includes/BuiltInCanvasPass.hlsl index 7d326cef6d9..1edf07826d8 100644 --- a/Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Includes/BuiltInCanvasPass.hlsl +++ b/Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Includes/BuiltInCanvasPass.hlsl @@ -77,6 +77,8 @@ Varyings BuildVaryings(Attributes input) float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); float2 maskUV = (input.positionOS.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); output.texCoord1 = float4(input.positionOS.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); + #else + output.texCoord1 = input.uv1; #endif #endif From 730702950277a6b717dfc84a1aaff69637da1a79 Mon Sep 17 00:00:00 2001 From: Nicola Cerone Date: Thu, 26 Feb 2026 09:59:38 +0000 Subject: [PATCH 04/95] Fix coverage (arcAA) issue with SVG Gradient. --- .../Editor/Data/Nodes/UI/RenderTypeBranchNode.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeBranchNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeBranchNode.cs index 4d35f17f2fb..44769e90f34 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeBranchNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeBranchNode.cs @@ -95,7 +95,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.AppendLine("{0} = Unity_UIE_RenderTypeSwitchNode_Output.color.a;", outputVarNameAlpha); } } - sb.AppendLine("else [branch] if ((_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && TestType(IN.typeTexSettings.x, k_FragTypeText))"); + sb.AppendLine("else [branch] if (_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY && TestType(IN.typeTexSettings.x, k_FragTypeText))"); using (sb.BlockScope()) { sb.AppendLine("[branch] if (GetTextureInfo(IN.typeTexSettings.y).sdfScale > 0.0)"); From dbb6ef67a1412fe79b85be23ac7f6ad87a197757 Mon Sep 17 00:00:00 2001 From: Ernestas Kupciunas Date: Fri, 27 Feb 2026 00:04:21 +0000 Subject: [PATCH 05/95] Particle surface material upgrader tests --- .../ParticleSurfaceMaterialUpgraderTest.cs | 780 ++++++++++++++++++ ...articleSurfaceMaterialUpgraderTest.cs.meta | 2 + 2 files changed, 782 insertions(+) create mode 100644 Packages/com.unity.render-pipelines.universal/Tests/Editor/Tools/Converters/MaterialUpgrader/ParticleSurfaceMaterialUpgraderTest.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Tests/Editor/Tools/Converters/MaterialUpgrader/ParticleSurfaceMaterialUpgraderTest.cs.meta diff --git a/Packages/com.unity.render-pipelines.universal/Tests/Editor/Tools/Converters/MaterialUpgrader/ParticleSurfaceMaterialUpgraderTest.cs b/Packages/com.unity.render-pipelines.universal/Tests/Editor/Tools/Converters/MaterialUpgrader/ParticleSurfaceMaterialUpgraderTest.cs new file mode 100644 index 00000000000..87b35b47557 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Tests/Editor/Tools/Converters/MaterialUpgrader/ParticleSurfaceMaterialUpgraderTest.cs @@ -0,0 +1,780 @@ +using System; +using System.Collections; +using NUnit.Framework; +using UnityEditor; +using UnityEditor.Rendering; +using UnityEditor.Rendering.Universal; +using UnityEngine; +using UnityEngine.TestTools; +[Category("Graphics Tools")] + +class ParticleSurfaceMaterialUpgraderTest : MaterialUpgraderTestBase +{ + [OneTimeSetUp] + public override void OneTimeSetUp() + { + m_Upgrader = new ParticleUpgrader("Particles/Standard Surface"); + } + + public ParticleSurfaceMaterialUpgraderTest() : base("Particles/Standard Surface", "Universal Render Pipeline/Particles/Lit") + { + } + + [Test] + [TestCaseSource(nameof(MaterialUpgradeCases))] + public void UpgradeParticleStandardUnlitMaterial(MaterialUpgradeTestCase testCase) + { + base.UpgradeMaterial(testCase); + } + + private static IEnumerable MaterialUpgradeCases() + { + yield return new MaterialUpgradeTestCase + { + name = + "Given_OpaqueParticleStandardSurface_WhenUpgrading_Then_TheOpaqueURPParticleLitPreserve", + setup = material => + { + //set the material to opaque + material.SetFloat("_Mode", 0.0f); // Opaque + }, + verify = material => + { + //check the material is still opaque + Assert.AreEqual(0.0f, material.GetFloat("_Surface")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_CutoutParticleStandardSurface_WhenUpgrading_Then_TheCutoutURPParticleLitGoesOpaque", + setup = material => + { + //set the material to cutout mode + material.SetFloat("_Mode", 1.0f); // Cutout + }, + verify = material => + { + //check the material is opaque + Assert.AreEqual(0.0f, material.GetFloat("_Surface")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_FadeParticleStandardSurface_WhenUpgrading_Then_TheFadeURPParticleLitGoesTransparent", + setup = material => + { + //set the material to fade mode + material.SetFloat("_Mode", 2.0f); // Fade + }, + verify = material => + { + //check the material is transparent + Assert.AreEqual(1.0f, material.GetFloat("_Surface")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_TransparentParticleStandardSurface_WhenUpgrading_Then_TheTransparentURPParticleLitPreserve", + setup = material => + { + //set the material to transparent mode + material.SetFloat("_Mode", 3.0f); // Transparent + }, + verify = material => + { + //check the material is still transparent + Assert.AreEqual(1.0f, material.GetFloat("_Surface")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_AdditiveParticleStandardSurface_WhenUpgrading_Then_TheAdditiveURPParticleLitGoesTransparent", + setup = material => + { + //set the material to additive mode + material.SetFloat("_Mode", 4.0f); // Additive + }, + verify = material => + { + //check the material is transparent + Assert.AreEqual(1.0f, material.GetFloat("_Surface")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_SubtractiveParticleStandardSurface_WhenUpgrading_Then_TheSubtractiveURPParticleLitSurfaceIsNotEmpty", + ignore = true, + setup = material => + { + //set the material to subtractive mode + material.SetFloat("_Mode", 5.0f); // Subtractive + }, + verify = material => + { + //check material surface type is not blank + float surfaceType = material.GetFloat("_Surface"); + Assert.IsTrue(surfaceType == 0.0f || surfaceType == 1.0f, "Surface type is blank."); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_ModulateParticleStandardSurface_WhenUpgrading_Then_TheModulateURPParticleLitSurfaceGoesTransparent", + setup = material => + { + //set the material to modulate mode + material.SetFloat("_Mode", 6.0f); // Modulate + }, + verify = material => + { + //check the material is transparent + Assert.AreEqual(1.0f, material.GetFloat("_Surface")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_OpaqueFlipBookFrameBlendingStandardSurface_WhenUpgrading_Then_TheOpaqueFlipBookFrameBlendingURPParticleLitPreserve", + setup = material => + { + //set the material to opaque with flipbook frame blending + material.SetFloat("_Mode", 0.0f); // Opaque + material.SetFloat("_FlipbookMode", 1.0f); // Frame Blending + }, + verify = material => + { + //check the material flipbook mode is still frame blending + Assert.AreEqual(1.0f, material.GetFloat("_FlipbookBlending")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_OpaqueTwoSidedStandardSurface_WhenUpgrading_Then_TheOpaqueTwoSidedURPParticleLitPreserve", + setup = material => + { + //set the material to opaque and two sided + material.SetFloat("_Mode", 0.0f); // Opaque + material.SetFloat("_Cull", 1.0f); // Two Sided + }, + verify = material => + { + //check the material is still two sided + Assert.AreEqual(1.0f, material.GetFloat("_Cull")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_OpaqueMetallicValueStandardSurface_WhenUpgrading_Then_TheOpaqueURPParticleLitPreserveMetallicValue", + setup = material => + { + //set the material to opaque with metallic value + material.SetFloat("_Mode", 0.0f); // Opaque + material.SetFloat("_Metallic", 0.7f); // Metallic Value + }, + verify = material => + { + //check the material metallic value is preserved + Assert.AreEqual(0.7f, material.GetFloat("_Metallic")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_OpaqueSmoothnessValueStandardSurface_WhenUpgrading_Then_TheOpaqueURPParticleLitPreserveSmoothnessValue", + setup = material => + { + //set the material to opaque with smoothness value + material.SetFloat("_Mode", 0.0f); // Opaque + material.SetFloat("_Glossiness", 0.3f); // Smoothness Value + }, + verify = material => + { + //check the material smoothness value is preserved + Assert.AreEqual(0.3f, material.GetFloat("_Smoothness")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_OpaqueEmissionCheckboxEnabledStandardSurface_WhenUpgrading_Then_TheOpaqueURPParticleLitPreserveEmissionCheckbox", + setup = material => + { + //set the material to opaque with emission enabled + material.SetFloat("_Mode", 0.0f); // Opaque + material.SetFloat("_EmissionEnabled", 1.0f); + material.globalIlluminationFlags = MaterialGlobalIlluminationFlags.BakedEmissive; + }, + verify = material => + { + //check the material emission checkbox is preserved + Assert.IsTrue(material.IsKeywordEnabled("_EMISSION")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_OpaqueAlbedoColorRedStandardSurface_WhenUpgrading_Then_TheOpaqueURPParticleLitPreserveAlbedoColorRed", + setup = material => + { + //set the material to opaque with albedo color red + material.SetFloat("_Mode", 0.0f); // Opaque + material.SetColor("_Color", Color.red); + }, + verify = material => + { + //check the material albedo color is preserved as red + Assert.AreEqual(Color.red, material.GetColor("_BaseColor")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_CutoutAlphaCutoffValueStandardSurface_WhenUpgrading_Then_TheCutoutAlphaCutoffValueURPParticleLitPreserve", + setup = material => + { + //set the material to cutout with alpha cutoff value + material.SetFloat("_Mode", 1.0f); // Cutout + material.SetFloat("_Cutoff", 0.2f); // Alpha Cutoff Value + }, + verify = material => + { + //check the material alpha cutoff value is preserved + Assert.AreEqual(0.2f, material.GetFloat("_Cutoff")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_CutoutStandardSurface_WhenUpgrading_Then_TheCutoutAlphaClippingCheckboxURPParticleLitEnabled", + setup = material => + { + //set the material to cutout mode + material.SetFloat("_Mode", 1.0f); // Cutout + }, + verify = material => + { + //check the material alpha Clipping checkbox is enabled + Assert.AreEqual(1f, material.GetFloat("_AlphaClip")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_FadeFlipBookFrameBlendingStandardSurface_WhenUpgrading_Then_TheFadeFlipBookFrameBlendingURPParticleLitPreserve", + setup = material => + { + //set the material to fade with flipbook frame blending + material.SetFloat("_Mode", 2.0f); // Fade + material.SetFloat("_FlipbookMode", 1.0f); // Frame Blending + }, + verify = material => + { + //check the material flipbook mode is still frame blending + Assert.AreEqual(1.0f, material.GetFloat("_FlipbookBlending")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_FadeTwoSidedStandardSurface_WhenUpgrading_Then_TheFadeTwoSidedURPParticleLitPreserve", + setup = material => + { + //set the material to fade and two sided + material.SetFloat("_Mode", 2.0f); // Fade + material.SetFloat("_Cull", 1.0f); // Two Sided + }, + verify = material => + { + //check the material is still two sided + Assert.AreEqual(1.0f, material.GetFloat("_Cull")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_FadeSoftParticlesStandardSurface_WhenUpgrading_Then_TheFadeSoftParticlesURPParticleLitPreserve", + setup = material => + { + //set the material to fade with soft particles + material.SetFloat("_Mode", 2.0f); // Fade + material.SetFloat("_SoftParticlesEnabled", 1.0f); // Soft Particles + }, + verify = material => + { + //check the material soft particles is preserved + Assert.AreEqual(1.0f, material.GetFloat("_SoftParticlesEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_FadeSoftParticleNearValueStandardSurface_WhenUpgrading_Then_TheFadeSoftParticleNearValueURPParticleLitPreserve", + setup = material => + { + //set the material to fade with soft particles and set near value + material.SetFloat("_Mode", 2.0f); // Fade + material.SetFloat("_SoftParticlesEnabled", 1.0f); // Soft Particles + material.SetFloat("_SoftParticlesNearFadeDistance", 0.1f); // Soft Particle Near + }, + verify = material => + { + //check the material soft particle near value is preserved + Assert.AreEqual(0.1f, material.GetFloat("_SoftParticlesNearFadeDistance")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_FadeSoftParticleFarValueStandardSurface_WhenUpgrading_Then_TheFadeSoftParticleFarValueURPParticleLitPreserve", + setup = material => + { + //set the material to fade with soft particles and set far value + material.SetFloat("_Mode", 2.0f); // Fade + material.SetFloat("_SoftParticlesEnabled", 1.0f); // Soft Particles + material.SetFloat("_SoftParticlesFarFadeDistance", 0.7f); // Soft Particle Far + }, + verify = material => + { + //check the material soft particle far value is preserved + Assert.AreEqual(0.7f, material.GetFloat("_SoftParticlesFarFadeDistance")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_FadeCameraFadingStandardSurface_WhenUpgrading_Then_TheFadeCameraFadingURPParticleLitPreserve", + setup = material => + { + //set the material to fade with camera fading + material.SetFloat("_Mode", 2.0f); // Fade + material.SetFloat("_CameraFadingEnabled", 1.0f); // Camera Fading + }, + verify = material => + { + //check the material camera fading is preserved + Assert.AreEqual(1.0f, material.GetFloat("_CameraFadingEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_FadeCameraDistortionStandardSurface_WhenUpgrading_Then_TheFadeCameraDistortionURPParticleLitPreserve", + setup = material => + { + //set the material to fade with camera distortion + material.SetFloat("_Mode", 2.0f); // Fade + material.SetFloat("_DistortionEnabled", 1.0f); // Camera Distortion + }, + verify = material => + { + //check the material camera distortion is preserved + Assert.AreEqual(1.0f, material.GetFloat("_DistortionEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_FadeDistortionStrengthValueStandardSurface_WhenUpgrading_Then_TheFadeDistortionStrengthValueURPParticleLitPreserve", + setup = material => + { + //set the material to fade with camera distortion and set distortion strength value + material.SetFloat("_Mode", 2.0f); // Fade + material.SetFloat("_DistortionEnabled", 1.0f); // Camera Distortion + material.SetFloat("_DistortionStrength", 2f); // Distortion Strength + }, + verify = material => + { + //check the material distortion strength value is preserved + Assert.AreEqual(2f, material.GetFloat("_DistortionStrength")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_FadeDistortionBlendValueStandardSurface_WhenUpgrading_Then_TheFadeDistortionBlendValueURPParticleLitPreserve", + setup = material => + { + //set the material to fade with camera distortion and set distortion blend value + material.SetFloat("_Mode", 2.0f); // Fade + material.SetFloat("_DistortionEnabled", 1.0f); // Camera Distortion + material.SetFloat("_DistortionBlend", 0.1f); // Distortion Blend + }, + verify = material => + { + //check the material distortion blend value is preserved + Assert.AreEqual(0.1f, material.GetFloat("_DistortionBlend")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_TransparentFlipBookFrameBlendingStandardSurface_WhenUpgrading_Then_TheTransparentFlipBookFrameBlendingURPParticleLitPreserve", + setup = material => + { + //set the material to transparent with flipbook frame blending + material.SetFloat("_Mode", 3.0f); // Transparent + material.SetFloat("_FlipbookMode", 1.0f); // Frame Blending + }, + verify = material => + { + //check the material flipbook mode is still frame blending + Assert.AreEqual(1.0f, material.GetFloat("_FlipbookBlending")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_TransparentTwoSidedStandardSurface_WhenUpgrading_Then_TheTransparentTwoSidedURPParticleLitPreserve", + setup = material => + { + //set the material to transparent and two sided + material.SetFloat("_Mode", 3.0f); // Transparent + material.SetFloat("_Cull", 1.0f); // Two Sided + }, + verify = material => + { + //check the material is still two sided + Assert.AreEqual(1.0f, material.GetFloat("_Cull")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_TransparentCameraFadingStandardSurface_WhenUpgrading_Then_TheTransparentCameraFadingURPParticleLitPreserve", + setup = material => + { + //set the material to transparent with camera fading + material.SetFloat("_Mode", 3.0f); // Transparent + material.SetFloat("_CameraFadingEnabled", 1.0f); // Camera Fading + }, + verify = material => + { + //check the material camera fading is preserved + Assert.AreEqual(1.0f, material.GetFloat("_CameraFadingEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_TransparentCameraDistortionStandardSurface_WhenUpgrading_Then_TheTransparentCameraDistortionURPParticleLitPreserve", + setup = material => + { + //set the material to transparent with camera distortion + material.SetFloat("_Mode", 3.0f); // Transparent + material.SetFloat("_DistortionEnabled", 1.0f); // Camera Distortion + }, + verify = material => + { + //check the material camera distortion is preserved + Assert.AreEqual(1.0f, material.GetFloat("_DistortionEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_TransparentEmissionEnabledStandardSurface_WhenUpgrading_Then_TheTransparentEmissionEnabledURPParticleLitPreserve", + setup = material => + { + //set the material to transparent with emission enabled + material.SetFloat("_Mode", 3.0f); // Transparent + material.SetFloat("_EmissionEnabled", 1.0f); + material.globalIlluminationFlags = MaterialGlobalIlluminationFlags.BakedEmissive; + }, + verify = material => + { + //check the material emission enabled is preserved + Assert.IsTrue(material.IsKeywordEnabled("_EMISSION")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_AdditiveFlipBookFrameBlendingStandardSurface_WhenUpgrading_Then_TheAdditiveFlipBookFrameBlendingURPParticleLitPreserve", + setup = material => + { + //set the material to additive with flipbook frame blending + material.SetFloat("_Mode", 4.0f); // Additive + material.SetFloat("_FlipbookMode", 1.0f); // Frame Blending + }, + verify = material => + { + //check the material flipbook mode is still frame blending + Assert.AreEqual(1.0f, material.GetFloat("_FlipbookBlending")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_AdditiveTwoSidedStandardSurface_WhenUpgrading_Then_TheAdditiveTwoSidedURPParticleLitPreserve", + setup = material => + { + //set the material to additive and two sided + material.SetFloat("_Mode", 4.0f); // Additive + material.SetFloat("_Cull", 1.0f); // Two Sided + }, + verify = material => + { + //check the material is still two sided + Assert.AreEqual(1.0f, material.GetFloat("_Cull")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_AdditiveSoftParticlesStandardSurface_WhenUpgrading_Then_TheAdditiveSoftParticlesURPParticleLitPreserve", + setup = material => + { + //set the material to additive with soft particles + material.SetFloat("_Mode", 4.0f); // Additive + material.SetFloat("_SoftParticlesEnabled", 1.0f); // Soft Particles + }, + verify = material => + { + //check the material soft particles is preserved + Assert.AreEqual(1.0f, material.GetFloat("_SoftParticlesEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_AdditiveCameraFadingStandardSurface_WhenUpgrading_Then_TheAdditiveCameraFadingURPParticleLitPreserve", + setup = material => + { + //set the material to additive with camera fading + material.SetFloat("_Mode", 4.0f); // Additive + material.SetFloat("_CameraFadingEnabled", 1.0f); // Camera Fading + }, + verify = material => + { + //check the material camera fading is preserved + Assert.AreEqual(1.0f, material.GetFloat("_CameraFadingEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_AdditiveDistortionEnabledStandardSurface_WhenUpgrading_Then_TheAdditiveDistortionEnabledURPParticleLitPreserve", + setup = material => + { + //set the material to additive with camera distortion + material.SetFloat("_Mode", 4.0f); // Additive + material.SetFloat("_DistortionEnabled", 1.0f); // Camera Distortion + }, + verify = material => + { + //check the material camera distortion is preserved + Assert.AreEqual(1.0f, material.GetFloat("_DistortionEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_SubtractiveFlipBookFrameBlendingStandardSurface_WhenUpgrading_Then_TheSubtractiveFlipBookFrameBlendingURPParticleLitPreserve", + setup = material => + { + //set the material to subtractive with flipbook frame blending + material.SetFloat("_Mode", 5.0f); // Subtractive + material.SetFloat("_FlipbookMode", 1.0f); // Frame Blending + }, + verify = material => + { + //check the material flipbook mode is still frame blending + Assert.AreEqual(1.0f, material.GetFloat("_FlipbookBlending")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_SubtractiveTwoSidedStandardSurface_WhenUpgrading_Then_TheSubtractiveTwoSidedURPParticleLitPreserve", + setup = material => + { + //set the material to subtractive and two sided + material.SetFloat("_Mode", 5.0f); // Subtractive + material.SetFloat("_Cull", 1.0f); // Two Sided + }, + verify = material => + { + //check the material is still two sided + Assert.AreEqual(1.0f, material.GetFloat("_Cull")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_SubtractiveSoftParticlesStandardSurface_WhenUpgrading_Then_TheSubtractiveSoftParticlesURPParticleLitPreserve", + setup = material => + { + //set the material to subtractive with soft particles + material.SetFloat("_Mode", 5.0f); // Subtractive + material.SetFloat("_SoftParticlesEnabled", 1.0f); // Soft Particles + }, + verify = material => + { + //check the material soft particles is preserved + Assert.AreEqual(1.0f, material.GetFloat("_SoftParticlesEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_SubtractiveCameraFadingStandardSurface_WhenUpgrading_Then_TheSubtractiveCameraFadingURPParticleLitPreserve", + setup = material => + { + //set the material to subtractive with camera fading + material.SetFloat("_Mode", 5.0f); // Subtractive + material.SetFloat("_CameraFadingEnabled", 1.0f); // Camera Fading + }, + verify = material => + { + //check the material camera fading is preserved + Assert.AreEqual(1.0f, material.GetFloat("_CameraFadingEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_SubtractiveDistortionEnabledStandardSurface_WhenUpgrading_Then_TheSubtractiveDistortionEnabledURPParticleLitPreserve", + setup = material => + { + //set the material to subtractive with camera distortion + material.SetFloat("_Mode", 5.0f); // Subtractive + material.SetFloat("_DistortionEnabled", 1.0f); // Camera Distortion + }, + verify = material => + { + //check the material camera distortion is preserved + Assert.AreEqual(1.0f, material.GetFloat("_DistortionEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_ModulateFlipBookFrameBlendingStandardSurface_WhenUpgrading_Then_TheModulateFlipBookFrameBlendingURPParticleLitPreserve", + setup = material => + { + //set the material to modulate with flipbook frame blending + material.SetFloat("_Mode", 6.0f); // Modulate + material.SetFloat("_FlipbookMode", 1.0f); // Frame Blending + }, + verify = material => + { + //check the material flipbook mode is still frame blending + Assert.AreEqual(1.0f, material.GetFloat("_FlipbookBlending")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_ModulateTwoSidedStandardSurface_WhenUpgrading_Then_TheModulateTwoSidedURPParticleLitPreserve", + setup = material => + { + //set the material to modulate and two sided + material.SetFloat("_Mode", 6.0f); // Modulate + material.SetFloat("_Cull", 1.0f); // Two Sided + }, + verify = material => + { + //check the material is still two sided + Assert.AreEqual(1.0f, material.GetFloat("_Cull")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_ModulateSoftParticlesStandardSurface_WhenUpgrading_Then_TheModulateSoftParticlesURPParticleLitPreserve", + setup = material => + { + //set the material to modulate with soft particles + material.SetFloat("_Mode", 6.0f); // Modulate + material.SetFloat("_SoftParticlesEnabled", 1.0f); // Soft Particles + }, + verify = material => + { + //check the material soft particles is preserved + Assert.AreEqual(1.0f, material.GetFloat("_SoftParticlesEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_ModulateCameraFadingStandardSurface_WhenUpgrading_Then_TheModulateCameraFadingURPParticleLitPreserve", + setup = material => + { + //set the material to modulate with camera fading + material.SetFloat("_Mode", 6.0f); // Modulate + material.SetFloat("_CameraFadingEnabled", 1.0f); // Camera Fading + }, + verify = material => + { + //check the material camera fading is preserved + Assert.AreEqual(1.0f, material.GetFloat("_CameraFadingEnabled")); + } + }; + + yield return new MaterialUpgradeTestCase + { + name = + "Given_ModulateDistortionEnabledStandardSurface_WhenUpgrading_Then_TheModulateDistortionEnabledURPParticleLitPreserve", + setup = material => + { + //set the material to modulate with camera distortion + material.SetFloat("_Mode", 6.0f); // Modulate + material.SetFloat("_DistortionEnabled", 1.0f); // Camera Distortion + }, + verify = material => + { + //check the material camera distortion is preserved + Assert.AreEqual(1.0f, material.GetFloat("_DistortionEnabled")); + } + }; + } +} diff --git a/Packages/com.unity.render-pipelines.universal/Tests/Editor/Tools/Converters/MaterialUpgrader/ParticleSurfaceMaterialUpgraderTest.cs.meta b/Packages/com.unity.render-pipelines.universal/Tests/Editor/Tools/Converters/MaterialUpgrader/ParticleSurfaceMaterialUpgraderTest.cs.meta new file mode 100644 index 00000000000..f91feaeac3e --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Tests/Editor/Tools/Converters/MaterialUpgrader/ParticleSurfaceMaterialUpgraderTest.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7a8f40bae4efe4be082ea48246a3e6a2 \ No newline at end of file From 932bf9985711f8bf0f43e110754fd2a84e026b6f Mon Sep 17 00:00:00 2001 From: Yvain Raeymaekers Date: Fri, 27 Feb 2026 00:04:33 +0000 Subject: [PATCH 06/95] [GFXLIGHT-1891] Surface Cache: Fixed ray origin offset leading to dark patches near the world origin --- .../Runtime/Lighting/SurfaceCache/Estimation.hlsl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/Estimation.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/Estimation.hlsl index ffe7296f483..3025dc2dc7a 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/Estimation.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/Estimation.hlsl @@ -133,7 +133,12 @@ void SampleEnvironmentAndDirectionalBounceAndMultiBounceRadiance( inout bool gotValidSamples) { UnifiedRT::Ray ray; - ray.origin = OffsetRayOrigin(patchGeo.position, patchGeo.normal); + // Offset ray origin to avoid self-intersections + // This offset is a percentage of the min voxel width (to keep it proportional to the scene scale) and is combined with OffsetRayOrigin + // Note: OffsetRayOrigin is not a perfect fit for a patchGeo.position that comes from the rasterization pipeline, as its heuristic is designed + // for positions computed via triangle vertices interpolation of a previous ray hit. We use it here nonetheless because its scaling with the distance + // to the world origin also helps to counter floating-point precision issues. + ray.origin = OffsetRayOrigin(patchGeo.position, patchGeo.normal, _VolumeVoxelMinSize * 0.001); ray.tMin = 0; ray.tMax = FLT_MAX; From 630dd72a1779805af8e6ee7bbba577f668c3241a Mon Sep 17 00:00:00 2001 From: Venkatesh Subramania Pillai Date: Fri, 27 Feb 2026 00:04:36 +0000 Subject: [PATCH 07/95] [2d] Fix case where URP-2D shaders are used with Vfx Shadergraph. --- .../Shaders/2D/Include/Core2D.hlsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl index 3b888875bd5..06b21292140 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl @@ -100,7 +100,7 @@ float3 UnitySkinSprite( in float3 inputData, in uint4 blendIndices, in float4 bl void SetUpSpriteInstanceProperties() { -#ifdef UNITY_INSTANCING_ENABLED +#if defined(UNITY_INSTANCING_ENABLED) && !defined(HAVE_VFX_MODIFICATION) unity_SpriteProps.xy = unity_SpriteFlip; #endif } From 679f9fd2310c7f781a3668c1ca66af8b07d42c1d Mon Sep 17 00:00:00 2001 From: Jesper Mortensen Date: Fri, 27 Feb 2026 08:29:25 +0000 Subject: [PATCH 08/95] GFXLIGHT-1993: Select Unity Compute Baker with a Project Setting --- .../ProbeVolume/ProbeGIBaking.LightTransport.cs | 12 +++++++----- .../ProbeVolume/ProbeGIBaking.Serialization.cs | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.LightTransport.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.LightTransport.cs index 2dd1f2683fb..fb91eff0466 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.LightTransport.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.LightTransport.cs @@ -241,11 +241,13 @@ public void Create(ProbeVolumeBakingSet bakingSet, LightingSettings lightingSett skyOcclusionBakingSamples = bakingSet != null ? bakingSet.skyOcclusionBakingSamples : 0; skyOcclusionBakingBounces = bakingSet != null ? bakingSet.skyOcclusionBakingBounces : 0; -#if UNIFIED_BAKER - int indirectSampleCount = lightingSettings.indirectSampleCount; -#else - int indirectSampleCount = Math.Max(lightingSettings.indirectSampleCount, lightingSettings.environmentSampleCount); -#endif + var usingComputeLightBaker = UnityEditor.Rendering.EditorGraphicsSettings.defaultLightBaker == UnityEditor.Rendering.LightBaker.UnityComputeLightBaker; + int indirectSampleCount = 0; + if (usingComputeLightBaker) + indirectSampleCount = lightingSettings.indirectSampleCount; + else + indirectSampleCount = Math.Max(lightingSettings.indirectSampleCount, lightingSettings.environmentSampleCount); + Create(lightingSettings, ignoreEnvironement, lightingSettings.directSampleCount, indirectSampleCount, lightingSettings.environmentSampleCount, (int)lightingSettings.lightProbeSampleCountMultiplier, lightingSettings.maxBounces); } diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Serialization.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Serialization.cs index 150525aeff7..22401c26a6f 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Serialization.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Serialization.cs @@ -1138,7 +1138,7 @@ static unsafe bool WriteBakingCells(BakingCell[] bakingCells) var bakingSetGUID = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(m_BakingSet)); - m_BakingSet.scenarios[ProbeReferenceVolume.instance.lightingScenario] = new ProbeVolumeBakingSet.PerScenarioDataInfo + m_BakingSet.scenarios[m_BakingSet.lightingScenario] = new ProbeVolumeBakingSet.PerScenarioDataInfo { sceneHash = sceneStateHash, cellDataAsset = new ProbeVolumeStreamableAsset(kAPVStreamingAssetsPath, cellL0L1DataDescs, L0L1ChunkSize, bakingSetGUID, AssetDatabase.AssetPathToGUID(cellDataFilename)), @@ -1198,7 +1198,7 @@ unsafe static void WriteDilatedCells(List cells) probeOcclusion.CopyFrom(System.IO.File.ReadAllBytes(cellProbeOcclusionDataFilename)); } - var lightingScenario = ProbeReferenceVolume.instance.lightingScenario; + var lightingScenario = m_BakingSet.lightingScenario; Debug.Assert(m_BakingSet.scenarios.ContainsKey(lightingScenario)); var scenarioDataInfo = m_BakingSet.scenarios[lightingScenario]; From 0ff355f31742e16bcb620a540a1a33eae23f5dee Mon Sep 17 00:00:00 2001 From: Evergreen Date: Fri, 27 Feb 2026 08:29:26 +0000 Subject: [PATCH 09/95] Fix Shader truncation warning in CopyDepthPass --- .../Shaders/Utils/CopyDepthPass.hlsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Utils/CopyDepthPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Utils/CopyDepthPass.hlsl index 731ba1e892b..6698a7f5712 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Utils/CopyDepthPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Utils/CopyDepthPass.hlsl @@ -44,7 +44,7 @@ float SampleDepth(float2 pixelCoords) { int2 coord = int2(pixelCoords); #if MSAA_SAMPLES == 1 - return LOAD(coord); + return LOAD(coord).r; #else float outDepth = DEPTH_DEFAULT_VALUE; From 2c99426713fd013b97f44b8e97dd90ccb7ce09aa Mon Sep 17 00:00:00 2001 From: Thomas Zeng Date: Fri, 27 Feb 2026 08:29:28 +0000 Subject: [PATCH 10/95] Fix On Tile PostProcessing not rendering properly with Gamma Colorspace --- .../RendererFeatures/OnTilePostProcessPass.cs | 2 ++ .../RendererFeatures/OnTileUberPost.shader | 26 ++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs index a7b4c7cba9c..eb15d31af5f 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs @@ -91,6 +91,8 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer SetupGrain(m_OnTileUberMaterial, cameraData, filmgrain, m_PostProcessData); SetupDithering(m_OnTileUberMaterial, cameraData, m_PostProcessData); + CoreUtils.SetKeyword(m_OnTileUberMaterial, ShaderKeywordStrings.LinearToSRGBConversion, cameraData.requireSrgbConversion); + CoreUtils.SetKeyword(m_OnTileUberMaterial, ShaderKeywordStrings.UseFastSRGBLinearConversion, postProcessingData.useFastSRGBLinearConversion); CoreUtils.SetKeyword(m_OnTileUberMaterial, ShaderKeywordStrings._ENABLE_ALPHA_OUTPUT, cameraData.isAlphaOutputEnabled); UberShaderPasses shaderPass = useVisibilityMesh ? UberShaderPasses.NormalVisMesh : UberShaderPasses.Normal; diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTileUberPost.shader b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTileUberPost.shader index 4b3eb37127f..d6917f8f804 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTileUberPost.shader +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTileUberPost.shader @@ -4,6 +4,8 @@ Shader "OnTileUberPost" #pragma multi_compile_local_fragment _ _HDR_GRADING _TONEMAP_ACES _TONEMAP_NEUTRAL #pragma multi_compile_local_fragment _ _FILM_GRAIN #pragma multi_compile_local_fragment _ _DITHERING + #pragma multi_compile_local_fragment _ _GAMMA_20 _LINEAR_TO_SRGB_CONVERSION + #pragma multi_compile_local_fragment _ _USE_FAST_SRGB_LINEAR_CONVERSION #pragma multi_compile_local_fragment _ _ENABLE_ALPHA_OUTPUT #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" @@ -73,6 +75,14 @@ Shader "OnTileUberPost" { half3 color = inputColor.rgb; + // Gamma space... Just do the rest of Uber in linear and convert back to sRGB at the end + #if UNITY_COLORSPACE_GAMMA + { + color = GetSRGBToLinear(color); + inputColor = GetSRGBToLinear(inputColor); + } + #endif + // To save on variants we use an uniform branch for vignette. This may have performance impact on lower end platforms UNITY_BRANCH if (VignetteIntensity > 0) @@ -97,12 +107,26 @@ Shader "OnTileUberPost" } #endif + // When Unity is configured to use gamma color encoding, we ignore the request to convert to gamma 2.0 and instead fall back to sRGB encoding + #if _GAMMA_20 && !UNITY_COLORSPACE_GAMMA + { + color = LinearToGamma20(color); + inputColor = LinearToGamma20(inputColor); + } + // Back to sRGB + #elif UNITY_COLORSPACE_GAMMA || _LINEAR_TO_SRGB_CONVERSION + { + color = GetLinearToSRGB(color); + inputColor = LinearToSRGB(inputColor); + } + #endif + #if _DITHERING { color = ApplyDithering(color, uv, TEXTURE2D_ARGS(_BlueNoise_Texture, sampler_PointRepeat), DitheringScale, DitheringOffset, PaperWhite, OneOverPaperWhite); } #endif - + #if _ENABLE_ALPHA_OUTPUT // Saturate is necessary to avoid issues when additive blending pushes the alpha over 1. return half4(color, saturate(inputColor.a)); From c777237bac83714447356126f66d0f57cc824cac Mon Sep 17 00:00:00 2001 From: Aljosha Demeulemeester Date: Fri, 27 Feb 2026 16:58:14 +0000 Subject: [PATCH 11/95] The Extensible On-Tile Renderer and Post Processing for all platforms --- .../OnTilePostProcessFeatureEditor.cs | 33 +- .../Editor/UniversalRendererDataEditor.cs | 2 +- .../2D/Rendergraph/Renderer2DRendergraph.cs | 3 +- .../Runtime/AssemblyInfo.cs | 1 + .../Runtime/Passes/DrawScreenSpaceUIPass.cs | 18 +- .../OnTilePostProcessFeature.cs | 109 ++-- .../RendererFeatures/OnTilePostProcessPass.cs | 186 +++---- .../RendererFeatures/OnTileUberPost.shader | 66 +-- .../Runtime/RenderingUtils.cs | 44 ++ .../Runtime/ScriptableRenderer.cs | 30 +- .../Runtime/ScriptableRendererFeature.cs | 3 +- .../Runtime/UniversalRenderPipeline.cs | 61 +-- .../UniversalRenderPipelineRenderGraph.cs | 8 +- .../Runtime/UniversalRenderer.cs | 130 +++-- .../Runtime/UniversalRendererRenderGraph.cs | 133 +++-- .../Runtime/ValidationHandler.cs | 8 +- .../Runtime/RenderGraphConstraintsTests.cs | 28 +- .../Scripts/Editor/UniversalProjectAssert.cs | 7 +- .../030_InjectionRenderPass2D.asset | 21 +- .../URPAssets/DefaultURPAsset.asset | 2 + .../Scenes/381_OnTilePostProcessing.meta | 8 + .../Scenes/381_OnTilePostProcessing.unity | 476 ++++++++++++++++++ .../381_OnTilePostProcessing.unity.meta | 7 + .../FallbackPPRenderer.asset | 73 +++ .../FallbackPPRenderer.asset.meta | 8 + .../OnTileRenderer.asset | 73 +++ .../OnTileRenderer.asset.meta | 8 + .../Post Processing Profile.asset | 176 +++++++ .../Post Processing Profile.asset.meta | 8 + .../381_OnTilePostProcessing/README.txt | 7 + .../381_OnTilePostProcessing/README.txt.meta | 7 + .../382_OnTilePostProcessingFallback.unity | 475 +++++++++++++++++ ...82_OnTilePostProcessingFallback.unity.meta | 7 + 33 files changed, 1784 insertions(+), 442 deletions(-) create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing.unity.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/FallbackPPRenderer.asset create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/FallbackPPRenderer.asset.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/OnTileRenderer.asset create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/OnTileRenderer.asset.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/Post Processing Profile.asset create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/Post Processing Profile.asset.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/README.txt create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/README.txt.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/382_OnTilePostProcessingFallback.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/382_OnTilePostProcessingFallback.unity.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/OnTilePostProcessFeatureEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/OnTilePostProcessFeatureEditor.cs index 2525894cf73..34a81fb8963 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/OnTilePostProcessFeatureEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/OnTilePostProcessFeatureEditor.cs @@ -1,9 +1,3 @@ -using UnityEngine; -using UnityEngine.Rendering.Universal; -#if XR_MANAGEMENT_4_0_1_OR_NEWER -using UnityEditor.XR.Management; -#endif - namespace UnityEditor.Rendering.Universal { [CustomEditor(typeof(OnTilePostProcessFeature))] @@ -15,38 +9,17 @@ internal class OnTilePostProcessFeatureEditor : Editor static class Styles { - public static readonly string k_NoSettingsHelpBox = L10n.Tr("This feature performs post-processing operation on tiled memory for Android based untethered XR platforms. There are currently no available settings, they might be added later."); - public static readonly string k_NonUntetheredXRBuildTarget = L10n.Tr("On Tile PostProcessing feature is not fully supported on the current build target. Please switch to an untethered XR platform as the build target, and enable XR provider through XR Plug-in management. The render feature would fallback to texture read mode(slow off-tile rendering)"); + public static readonly string k_NoSettingsHelpBox = L10n.Tr("This feature performs post-processing operation in tile memory. There are currently no available settings, they might be added later."); + public static readonly string k_NeedsOnTileValidation = L10n.Tr("On Tile PostProcessing feature needs the 'On Tile Validation' set on the Renderer. Otherwise, this render feature will fallback to texture sampling mode (slow off-tile rendering)"); } private void OnEnable() { } - bool IsBuildTargetUntetheredXR() - { - bool isBuildTargetUntetheredXR = false; -#if XR_MANAGEMENT_4_0_1_OR_NEWER - var buildTargetGroup = BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget); - var buildTargetSettings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(buildTargetGroup); - if (buildTargetSettings != null && buildTargetSettings.AssignedSettings != null && buildTargetSettings.AssignedSettings.activeLoaders.Count > 0) - { - isBuildTargetUntetheredXR = buildTargetGroup == BuildTargetGroup.Android; - } -#endif - return isBuildTargetUntetheredXR; - } - public override void OnInspectorGUI() { - if (!IsBuildTargetUntetheredXR()) - { - EditorGUILayout.HelpBox( - Styles.k_NonUntetheredXRBuildTarget, - MessageType.Error - ); - } - + EditorGUILayout.HelpBox(Styles.k_NeedsOnTileValidation, MessageType.Info); EditorGUILayout.HelpBox(Styles.k_NoSettingsHelpBox, MessageType.Info); } } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/UniversalRendererDataEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/UniversalRendererDataEditor.cs index 9ddadfb8cc7..efff3a63dd5 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/UniversalRendererDataEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/UniversalRendererDataEditor.cs @@ -46,7 +46,7 @@ private static class Styles public static readonly GUIContent warningIntermediateTextureMode = EditorGUIUtility.TrTextContent("'Always' is Obsolete. Change it to Auto. This can improve performance. The setting will disappear once it is corrected to 'Auto'."); public static readonly GUIContent deferredPlusIncompatibleWarning = EditorGUIUtility.TrTextContent("Deferred+ is only available with Render Graph. In compatibility mode, Deferred+ falls back to Forward+."); public static readonly GUIContent onTileValidation = EditorGUIUtility.TrTextContent("On-Tile Validation", "Enables the feature validation to prevent going off tile. This is mainly useful for tile based architectures."); - public static readonly string onTileValidationWarning = L10n.Tr("On-Tile validation is enabled. All ScriptableRendererFeatures and other features requiring a full-screen pass will be skipped to preserve the On-Tile optimization."); + public static readonly string onTileValidationWarning = L10n.Tr("On-Tile validation is enabled. ScriptableRendererFeatures and ScriptableRenderPasses that would trigger a GPU memory store/load action of the main render targets are not allowed."); public static readonly string deferredOnTileValidationWarning = L10n.Tr("Deferred rendering path is incompatible with the enabled 'On-Tile Validation' and will fallback to Forward."); public static readonly string deferredPlusOnTileValidationWarning = L10n.Tr("Deferred+ rendering path is incompatible with the enabled 'On-Tile Validation' and will fallback to Forward+."); public static readonly string postProcessingOnTileValidationWarning = L10n.Tr("'Post-processing' will be skipped because it is incompatible with the enabled 'On-Tile Validation'."); 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 7046e32494b..f5261a6876d 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 @@ -251,8 +251,7 @@ ImportResourceSummary GetImportResourceSummary(RenderGraph renderGraph, Universa bool isBuiltInTexture = cameraData.targetTexture == null; - bool useActualBackbufferOrienation = !cameraData.isSceneViewCamera && !cameraData.isPreviewCamera && cameraData.targetTexture == null; - TextureUVOrigin backbufferTextureUVOrigin = useActualBackbufferOrienation ? (SystemInfo.graphicsUVStartsAtTop ? TextureUVOrigin.TopLeft : TextureUVOrigin.BottomLeft) : TextureUVOrigin.BottomLeft; + TextureUVOrigin backbufferTextureUVOrigin = RenderingUtils.GetBackBufferUVOrientation(cameraData); output.backBufferColorParams.textureUVOrigin = backbufferTextureUVOrigin; output.backBufferDepthParams.textureUVOrigin = backbufferTextureUVOrigin; diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/AssemblyInfo.cs b/Packages/com.unity.render-pipelines.universal/Runtime/AssemblyInfo.cs index 45b528a0ea8..696ca4679f7 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/AssemblyInfo.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/AssemblyInfo.cs @@ -10,3 +10,4 @@ [assembly: InternalsVisibleTo("Unity.GraphicTests.Performance.Universal.Runtime")] [assembly: InternalsVisibleTo("Unity.RenderPipelines.Multiple_SRP.RuntimeTests")] [assembly: InternalsVisibleTo("Unity.RenderPipelines.Multiple_SRP.EditorTests")] +[assembly: InternalsVisibleTo("UniversalEditorTests")] diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawScreenSpaceUIPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawScreenSpaceUIPass.cs index 863e6ccaf23..43487c5792b 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawScreenSpaceUIPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawScreenSpaceUIPass.cs @@ -126,9 +126,15 @@ internal void RenderOffscreen(RenderGraph renderGraph, ContextContainer frameDat internal void RenderOverlay(RenderGraph renderGraph, ContextContainer frameData, in TextureHandle colorBuffer, in TextureHandle depthBuffer) { - UniversalCameraData cameraData = frameData.Get(); - UniversalResourceData resourceData = frameData.Get(); - UniversalRenderer renderer = cameraData.renderer as UniversalRenderer; + RenderOverlayUIToolkitAndUGUI(renderGraph, frameData, in colorBuffer, in depthBuffer); + RenderOverlayIMGUI(renderGraph, frameData, in colorBuffer, in depthBuffer); + } + + internal void RenderOverlayUIToolkitAndUGUI(RenderGraph renderGraph, ContextContainer frameData, in TextureHandle colorBuffer, in TextureHandle depthBuffer) + { + var cameraData = frameData.Get(); + var resourceData = frameData.Get(); + var renderer = cameraData.renderer as UniversalRenderer; // Render uGUI and UIToolkit overlays using (var builder = renderGraph.AddRasterRenderPass("Draw UIToolkit/uGUI Overlay", out var passData, profilingSampler)) @@ -147,6 +153,12 @@ internal void RenderOverlay(RenderGraph renderGraph, ContextContainer frameData, ExecutePass(context.cmd, data, data.rendererList); }); } + } + + internal void RenderOverlayIMGUI(RenderGraph renderGraph, ContextContainer frameData, in TextureHandle colorBuffer, in TextureHandle depthBuffer) + { + var cameraData = frameData.Get(); + // Render IMGUI overlay and software cursor in a UnsafePass // Doing so allow us to safely cover cases when graphics commands called through onGUI() in user scripts are not supported by RenderPass API // Besides, Vulkan backend doesn't support SetSRGWrite() in RenderPass API and we have some of them at IMGUI levels diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessFeature.cs index a9353ca6a54..6d53065509d 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessFeature.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessFeature.cs @@ -1,24 +1,18 @@ -using System.IO; -using UnityEditor; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; -using UnityEngine.Experimental.Rendering; -using UnityEngine.Rendering.RenderGraphModule; using UnityEngine.Rendering.Universal.Internal; /// /// The class for the On-Tile Post Processing renderer feature. This renderer feature provides a reduced scope alternative to the built-in URP post-processing features but that can run more optimally on tile-based graphics hardware (most untethered-XR devices) /// The renderer feature could only be added once. Adding multiple post processing passes is currently not supported. /// -[DisallowMultipleRendererFeature("On Tile Post Processing (Untethered XR)")] +[DisallowMultipleRendererFeature("On Tile Post Processing")] public partial class OnTilePostProcessFeature : ScriptableRendererFeature { [SerializeField, HideInInspector] PostProcessData m_PostProcessData; - Shader m_UberPostShader; - /// /// Specifies at which injection point the pass will be rendered. /// @@ -30,7 +24,7 @@ public partial class OnTilePostProcessFeature : ScriptableRendererFeature bool TryLoadResources() { - if (m_UberPostShader == null || m_OnTilePostProcessMaterial == null) + if (m_OnTilePostProcessMaterial == null) { if (!GraphicsSettings.TryGetRenderPipelineSettings(out var resources)) { @@ -39,10 +33,18 @@ bool TryLoadResources() return false; } - m_UberPostShader = resources.uberPostShader; - m_OnTilePostProcessMaterial = new Material(m_UberPostShader); - } + var uberPostShader = resources.uberPostShader; + + if (uberPostShader == null || !uberPostShader.isSupported) + { + Debug.LogErrorFormat( + $"Couldn't not create a supported shader for {nameof(OnTilePostProcessFeature)} render feature."); + return false; + } + m_OnTilePostProcessMaterial = new Material(uberPostShader); + } + return true; } @@ -56,60 +58,32 @@ public override void Create() #endif } - if (m_PostProcessData != null) - { - m_ColorGradingLutPass = new ColorGradingLutPass(RenderPassEvent.BeforeRenderingPrePasses, m_PostProcessData); - m_OnTilePostProcessPass = new OnTilePostProcessPass(m_PostProcessData); - // On-tile PP requries memoryless intermediate texture to work. In case intermediate texture is not memoryless, on-tile PP will falls back to offtile rendering. - m_OnTilePostProcessPass.requiresIntermediateTexture = true; - } - } - -#if ENABLE_VR && ENABLE_XR_MODULE - bool IsRuntimePlatformUntetheredXR() - { - // Return true if the current runtime platform is Android(untethered XR platform) - return Application.platform == RuntimePlatform.Android; - } - -#if UNITY_EDITOR - bool IsBuildTargetUntetheredXR() - { - // Return true if the current build target is Android(untethered XR platform). - return EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android; + if (m_PostProcessData == null) + { + Debug.LogError($"{nameof(OnTilePostProcessFeature)} does not have a valid postProcessData instance."); + return; + } + + m_ColorGradingLutPass = new ColorGradingLutPass(RenderPassEvent.BeforeRenderingPrePasses, m_PostProcessData); + m_OnTilePostProcessPass = new OnTilePostProcessPass(m_PostProcessData); + // On-tile PP requires memoryless intermediate texture to work. In case intermediate texture is not memoryless, on-tile PP will falls back to off-tile rendering. + m_OnTilePostProcessPass.requiresIntermediateTexture = true; + + supportedRenderingFeatures.supportsHDR = true; + supportedRenderingFeatures.postProcessing = true; } -#endif -#endif /// public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData) { - bool useFallback = true; - -#if ENABLE_VR && ENABLE_XR_MODULE - // Enable on-tile post processing when running untethered XR - if (renderingData.cameraData.xr.enabled && IsRuntimePlatformUntetheredXR()) - { - useFallback = false; - } - -#if UNITY_EDITOR - // Enable on-tile post processing when running XR Editor Playmode (build target needs to be Android) - if (renderingData.cameraData.xr.enabled && IsBuildTargetUntetheredXR()) - { - useFallback = false; - } -#endif -#endif - - // Post processing needs to be enabled on the camera + // Post processing needs to be enabled on the camera. if (!renderingData.cameraData.postProcessEnabled) return; // NOTE: Ideally, we check here if the Post Processing is enabled on the UniversalRenderer asset through a public API. In that case, the built in post processing will be enabled. - // We currently do not have a public API for that, so we use internal API for now + // We currently do not have a public API for that, so we use internal API for now. var universalRenderer = renderer as UniversalRenderer; - if (universalRenderer.isPostProcessActive) + if (universalRenderer.postProcessEnabled) { Debug.LogError("URP renderer(Universal Renderer Data) has post processing enabled, which conflicts with the On-Tile post processing feature. Only one of the post processing should be enabled. On-Tile post processing feature will not be added."); return; @@ -121,32 +95,11 @@ public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingD if (!TryLoadResources()) return; - var graphicsDeviceType = SystemInfo.graphicsDeviceType; - var deviceSupportsFbf = graphicsDeviceType == GraphicsDeviceType.Vulkan || graphicsDeviceType == GraphicsDeviceType.Metal || graphicsDeviceType == GraphicsDeviceType.Direct3D12; - if (!deviceSupportsFbf) - { - Debug.LogError("The On-Tile post processing feature is not supported on the graphics devices that don't support frame buffer fetch."); - return; - } - - // Internally force the correct mode we require while this is not a public setting. - UniversalRenderPipeline.renderTextureUVOriginStrategy = RenderTextureUVOriginStrategy.PropagateAttachmentOrientation; - m_ColorGradingLutPass.renderPassEvent = RenderPassEvent.BeforeRenderingPrePasses; m_OnTilePostProcessPass.Setup(ref m_OnTilePostProcessMaterial); m_OnTilePostProcessPass.renderPassEvent = postProcessingEvent; - - if (useFallback) - { - // Perform fallback logic to 1. use texture read(off-tile rendering) and 2. disable the UV origin propagation mode. - m_OnTilePostProcessPass.m_UseTextureReadFallback = true; - UniversalRenderPipeline.renderTextureUVOriginStrategy = RenderTextureUVOriginStrategy.BottomLeft; - } - else - { - m_OnTilePostProcessPass.m_UseTextureReadFallback = false; - } + m_OnTilePostProcessPass.m_UseTextureReadFallback = !universalRenderer.onTileValidation; renderer.EnqueuePass(m_ColorGradingLutPass); renderer.EnqueuePass(m_OnTilePostProcessPass); @@ -155,7 +108,7 @@ public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingD /// protected override void Dispose(bool disposing) { - // always dispose unmanaged resources + // Always dispose unmanaged resources. m_ColorGradingLutPass?.Cleanup(); } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs index eb15d31af5f..4be6c781413 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs @@ -1,10 +1,8 @@ using UnityEngine; using UnityEngine.Rendering.RenderGraphModule; -using UnityEngine.Rendering.RenderGraphModule.Util; using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; using UnityEngine.Experimental.Rendering; -using UnityEngine.Rendering.Universal.Internal; /// /// Renders the on-tile post-processing stack. @@ -14,7 +12,7 @@ public class OnTilePostProcessPass : ScriptableRenderPass /// /// The override shader to use. /// - internal bool m_UseMultisampleShaderResolve = false; + internal readonly bool k_SupportsMultisampleShaderResolve = false; internal bool m_UseTextureReadFallback = false; RTHandle m_UserLut; @@ -27,17 +25,35 @@ public class OnTilePostProcessPass : ScriptableRenderPass const string m_PassName = "On Tile Post Processing"; const string m_FallbackPassName = "On Tile Post Processing (sampling fallback) "; + int m_PassOnTile, m_PassOnTileMsaa, m_PassTextureSample, m_PassOnTileVis, m_PassOnTileMsaaVis, m_PassTexureSampleVis; + internal OnTilePostProcessPass(PostProcessData postProcessData) { m_PostProcessData = postProcessData; -#if ENABLE_VR && ENABLE_XR_MODULE - m_UseMultisampleShaderResolve = SystemInfo.supportsMultisampledShaderResolve; + +#if ENABLE_VR && ENABLE_XR_MODULE + k_SupportsMultisampleShaderResolve = SystemInfo.supportsMultisampledShaderResolve; #endif } internal void Setup(ref Material onTileUberMaterial) { - m_OnTileUberMaterial = onTileUberMaterial; + Debug.Assert(onTileUberMaterial != null, "The material set in OnTilePostProcessPass can't be null."); + + if (m_OnTileUberMaterial == null) + { + m_OnTileUberMaterial = onTileUberMaterial; + + // We just do this once, assuming the shader never changes. + m_PassOnTile = onTileUberMaterial.FindPass("OnTileUberPost"); + m_PassOnTileMsaa = onTileUberMaterial.FindPass("OnTileUberPostMSSoftware"); + m_PassTextureSample = onTileUberMaterial.FindPass("OnTileUberPostTextureSample"); + m_PassOnTileVis = onTileUberMaterial.FindPass("OnTileUberPostVisMesh"); + m_PassOnTileMsaaVis = onTileUberMaterial.FindPass("OnTileUberPostMSSoftwareVisMesh"); + m_PassTexureSampleVis = onTileUberMaterial.FindPass("OnTileUberPostTextureSampleVisMesh"); + } + + m_OnTileUberMaterial = onTileUberMaterial; } /// @@ -52,7 +68,7 @@ public void Dispose() /// public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData) { - if (m_OnTileUberMaterial == null) return; + Debug.Assert(m_OnTileUberMaterial != null, "The material set in OnTilePostProcessPass can't be null."); var resourceData = frameData.Get(); var renderingData = frameData.Get(); @@ -81,9 +97,15 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer #endif TextureHandle source = resourceData.activeColorTexture; - TextureDesc srcDesc = renderGraph.GetTextureDesc(source); ; - + TextureDesc srcDesc = renderGraph.GetTextureDesc(source); + + TextureHandle destination = resourceData.backBufferColor; + var destInfo = renderGraph.GetRenderTargetInfo(destination); + + // This signals to URP (or the next pass) that rendering has switched to the backbuffer. URP will therefore not add the final blit pass. + // The code below can then also use resourceData.isActiveTargetBackBuffer correctly for robustness. + resourceData.SwitchActiveTexturesToBackbuffer(); SetupVignette(m_OnTileUberMaterial, cameraData.xr, srcDesc.width, srcDesc.height, vignette); SetupLut(m_OnTileUberMaterial, colorLookup, colorAdjustments, lutSize); @@ -95,93 +117,42 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer CoreUtils.SetKeyword(m_OnTileUberMaterial, ShaderKeywordStrings.UseFastSRGBLinearConversion, postProcessingData.useFastSRGBLinearConversion); CoreUtils.SetKeyword(m_OnTileUberMaterial, ShaderKeywordStrings._ENABLE_ALPHA_OUTPUT, cameraData.isAlphaOutputEnabled); - UberShaderPasses shaderPass = useVisibilityMesh ? UberShaderPasses.NormalVisMesh : UberShaderPasses.Normal; -#if ENABLE_VR && ENABLE_XR_MODULE - bool setMultisamplesShaderResolveFeatureFlag = false; -#endif - if (srcDesc.msaaSamples != MSAASamples.None) - { - if (srcDesc.msaaSamples == MSAASamples.MSAA8x) - { - Debug.LogError("MSAA8x is enabled in Universal Render Pipeline Asset but it is not supported by the on-tile post-processing feature yet. Please use MSAA4x or MSAA2x instead."); - return; - } - - var destInfo = renderGraph.GetRenderTargetInfo(destination); - -#if ENABLE_VR && ENABLE_XR_MODULE - if (m_UseMultisampleShaderResolve) - { - // If we have support for msaa shader resolve we can do MSAA -> non MSAA in our render pass. - shaderPass = useVisibilityMesh ? UberShaderPasses.MSAASoftwareResolveVisMesh : UberShaderPasses.MSAASoftwareResolve; - - // When rendering into the backbuffer, we could enable the shader resolve extension to resolve into the msaa1x surface directly on platforms that support auto resolve. - // For platforms that don't support auto resolve, the backbuffer is a multisampled surface and we don't need to enable the extension. This is to maximize the pass merging because shader resolve enabled pass has to be the last subpass. - if (SystemInfo.supportsMultisampleAutoResolve) - { - - setMultisamplesShaderResolveFeatureFlag = true; - } - } - else -#endif - { - if (destInfo.msaaSamples == (int)srcDesc.msaaSamples) - { - // If we have MSAA -> MSAA we can still resolve in the shader running at fragmnet rate - // and the hardware resolve will sometimes be optimized as a result. - shaderPass = useVisibilityMesh ? UberShaderPasses.MSAASoftwareResolveVisMesh : UberShaderPasses.MSAASoftwareResolve; - } - else - { - // We are going MSAA -> Non MSAA without shader resolve support which is not a valid render pass - // configuration. So we need to force a resolve before running our shader which will cause us not - // to be on tile anymore. - shaderPass = useVisibilityMesh ? UberShaderPasses.TextureReadVisMesh : UberShaderPasses.TextureRead; - } - } - } + int shaderPass; - // Fallback to texture read mode when requested. if (m_UseTextureReadFallback) { - shaderPass = useVisibilityMesh ? UberShaderPasses.TextureReadVisMesh : UberShaderPasses.TextureRead; -#if ENABLE_VR && ENABLE_XR_MODULE - setMultisamplesShaderResolveFeatureFlag = false; -#endif + shaderPass = useVisibilityMesh ? m_PassTexureSampleVis : m_PassTextureSample; } - - // Fallback logic to handle the case where Frame Buffer Fetch is not compatible with the pass setup. - TextureDesc destDesc; - var info = renderGraph.GetRenderTargetInfo(destination); - destDesc = new TextureDesc(info.width, info.height); - destDesc.format = info.format; - destDesc.msaaSamples = (MSAASamples)info.msaaSamples; - destDesc.bindTextureMS = info.bindMS; - destDesc.slices = info.volumeDepth; - destDesc.dimension = info.volumeDepth > 1 ? TextureDimension.Tex2DArray : TextureDimension.Tex2D; - - // Falls back to texture read mode if texture dimension does not match between source and destination (invalid frame buffer fetch setup). - if (srcDesc.width != destDesc.width || srcDesc.height != destDesc.height || srcDesc.slices != destDesc.slices) + else { - shaderPass = useVisibilityMesh ? UberShaderPasses.TextureReadVisMesh : UberShaderPasses.TextureRead; -#if ENABLE_VR && ENABLE_XR_MODULE - setMultisamplesShaderResolveFeatureFlag = false; -#endif + Debug.Assert(srcDesc.width == destInfo.width && srcDesc.height == destInfo.height && srcDesc.slices == destInfo.volumeDepth + , "On Tile Post Processing expects the source and destination to have the same dimensions."); + + switch (srcDesc.msaaSamples) + { + case MSAASamples.None: + shaderPass = useVisibilityMesh ? m_PassOnTileVis : m_PassOnTile; + break; + case MSAASamples.MSAA8x: + Debug.LogError("MSAA8x is enabled in Universal Render Pipeline Asset but it is not supported by the on-tile post-processing feature yet. Please use MSAA4x or MSAA2x instead."); + return; + default: + shaderPass = useVisibilityMesh ? m_PassOnTileMsaaVis: m_PassOnTileMsaa; + break; + } } var lutTexture = resourceData.internalColorLut; var passName = m_UseTextureReadFallback ? m_FallbackPassName : m_PassName; using (var builder = renderGraph.AddRasterRenderPass(passName, out var passData)) - { - passData.source = source; - passData.destination = destination; + { passData.material = m_OnTileUberMaterial; passData.shaderPass = shaderPass; + passData.useTextureReadFallback = m_UseTextureReadFallback; - if (shaderPass == UberShaderPasses.TextureRead || shaderPass == UberShaderPasses.TextureReadVisMesh) + if (m_UseTextureReadFallback) { - builder.UseTexture(source, AccessFlags.Read); + builder.UseTexture(passData.source = source, AccessFlags.Read); } else { @@ -200,48 +171,41 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer builder.UseTexture(userLutTexture, AccessFlags.Read); } - builder.SetRenderAttachment(destination, 0, AccessFlags.WriteAll); + builder.SetRenderAttachment(passData.destination = destination, 0, AccessFlags.WriteAll); builder.SetRenderFunc(static (PassData data, RasterGraphContext context) => ExecuteFBFetchPass(data, context)); - passData.useXRVisibilityMesh = false; + passData.useXRVisibilityMesh = useVisibilityMesh; passData.msaaSamples = (int)srcDesc.msaaSamples; + // When rendering into the backbuffer, we could enable the shader resolve extension to resolve into the msaa1x surface directly on platforms that support auto resolve. + // For platforms that don't support auto resolve, the backbuffer is a multisampled surface and we don't need to enable the extension. This is to maximize the pass merging because shader resolve enabled pass has to be the last subpass. + bool useMultisampledShaderResolve = (int)srcDesc.msaaSamples > destInfo.msaaSamples && k_SupportsMultisampleShaderResolve; + + ExtendedFeatureFlags featureFlags = ExtendedFeatureFlags.None; + + if (useMultisampledShaderResolve) + { + featureFlags |= ExtendedFeatureFlags.MultisampledShaderResolve; + } + #if ENABLE_VR && ENABLE_XR_MODULE if (cameraData.xr.enabled) { - ExtendedFeatureFlags xrFeatureFlag = ExtendedFeatureFlags.MultiviewRenderRegionsCompatible; - if (setMultisamplesShaderResolveFeatureFlag) - { - xrFeatureFlag |= ExtendedFeatureFlags.MultisampledShaderResolve; - } - builder.SetExtendedFeatureFlags(xrFeatureFlag); + featureFlags |= ExtendedFeatureFlags.MultiviewRenderRegionsCompatible; // We want our foveation logic to match other geometry passes(eg. Opaque, Transparent, Skybox) because we want to merge with previous passes. bool passSupportsFoveation = cameraData.xrUniversal.canFoveateIntermediatePasses || resourceData.isActiveTargetBackBuffer; builder.EnableFoveatedRasterization( cameraData.xr.supportsFoveatedRendering && passSupportsFoveation); - passData.useXRVisibilityMesh = useVisibilityMesh; passData.xr = cameraData.xr; // Need to pass this down for the method call RenderVisibleMeshCustomMaterial() } #endif - } + builder.SetExtendedFeatureFlags(featureFlags); - //This will prevent the final blit pass from being added/needed (still internal API in trunk) - resourceData.activeColorID = UniversalResourceData.ActiveID.BackBuffer; - resourceData.activeDepthID = UniversalResourceData.ActiveID.BackBuffer; + } } - enum UberShaderPasses - { - Normal, - MSAASoftwareResolve, - TextureRead, - NormalVisMesh, - MSAASoftwareResolveVisMesh, - TextureReadVisMesh, - }; - // This static method is used to execute the pass and passed as the RenderFunc delegate to the RenderGraph render pass static void ExecuteFBFetchPass(PassData data, RasterGraphContext context) { @@ -251,15 +215,16 @@ static void ExecuteFBFetchPass(PassData data, RasterGraphContext context) if (data.userLutTexture.IsValid()) data.material.SetTexture(ShaderConstants._UserLut, data.userLutTexture); - bool IsHandleYFlipped = RenderingUtils.IsHandleYFlipped(context, in data.destination); + bool flip = context.GetTextureUVOrigin(data.source) != context.GetTextureUVOrigin(data.destination); + // We need to set the "_BlitScaleBias" uniform for user materials with shaders relying on core Blit.hlsl to work - data.material.SetVector(s_BlitScaleBias, !IsHandleYFlipped ? new Vector4(1, -1, 0, 1) : new Vector4(1, 1, 0, 0)); + data.material.SetVector(s_BlitScaleBias, flip ? new Vector4(1, -1, 0, 1) : new Vector4(1, 1, 0, 0)); - if (data.shaderPass == UberShaderPasses.TextureRead || data.shaderPass == UberShaderPasses.TextureReadVisMesh) + if (data.useTextureReadFallback) { data.material.SetTexture(s_BlitTexture, data.source); } - else if (data.shaderPass == UberShaderPasses.MSAASoftwareResolve || data.shaderPass == UberShaderPasses.MSAASoftwareResolveVisMesh) + else { // Setup MSAA samples switch (data.msaaSamples) @@ -303,11 +268,12 @@ private class PassData internal TextureHandle lutTexture; internal TextureHandle userLutTexture; internal Material material; - internal UberShaderPasses shaderPass; + internal int shaderPass; internal Vector4 scaleBias; internal bool useXRVisibilityMesh; internal XRPass xr; internal int msaaSamples; + internal bool useTextureReadFallback; } TextureHandle TryGetCachedUserLutTextureHandle(ColorLookup colorLookup, RenderGraph renderGraph) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTileUberPost.shader b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTileUberPost.shader index d6917f8f804..3d4e8497585 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTileUberPost.shader +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTileUberPost.shader @@ -134,6 +134,20 @@ Shader "OnTileUberPost" return half4(color, 1); #endif } + + // Fallback shader to use when we can't keep things on tile, so usually in the editor when dealing with + // MSAA source targets to a non MSAA destination we can't perform a software resolve in the shader and + // so have to fall back to resolving the color target and reading it in as a texture. + // Where we have a MSAA destination we can avoid this. + half4 FragUberPostTextureSample(Varyings input) : SV_Target0 + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + float2 uv = SCREEN_COORD_APPLY_SCALEBIAS(UnityStereoTransformScreenSpaceTex(input.texcoord)); + half4 inputColor = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv); + return UberPost(inputColor, uv); + } + ENDHLSL SubShader @@ -223,29 +237,13 @@ Shader "OnTileUberPost" Pass { - Name "OnTileUberPostTextureReadVersion" + Name "OnTileUberPostTextureSample" LOD 100 ZTest Always ZWrite Off Cull Off HLSLPROGRAM #pragma vertex Vert - #pragma fragment FragUberPostTextureReadVersion - #pragma target 5.0 - #pragma enable_debug_symbols - #pragma debug - - // Fallback shader to use when we can't keep things on tile, so usually in the editor when dealing with - // MSAA source targets to a non MSAA destination we can't perform a software resolve in the shader and - // so have to fall back to resolving the color target and reading it in as a texture. - // Where we have a MSAA destination we can avoid this. - half4 FragUberPostTextureReadVersion(Varyings input) : SV_Target0 - { - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); - - float2 uv = SCREEN_COORD_APPLY_SCALEBIAS(UnityStereoTransformScreenSpaceTex(input.texcoord)); - half4 inputColor = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv); - return UberPost(inputColor, uv); - } + #pragma fragment FragUberPostTextureSample ENDHLSL } @@ -335,29 +333,33 @@ Shader "OnTileUberPost" Pass { - Name "OnTileUberPostTextureReadVersionVisMesh" + Name "OnTileUberPostTextureSampleVisMesh" LOD 100 ZTest Always ZWrite Off Cull Off HLSLPROGRAM #include "Packages/com.unity.render-pipelines.universal/Shaders/XR/XRVisibilityMeshHelper.hlsl" #pragma vertex VertVisibilityMeshXR - #pragma fragment FragUberPostTextureReadVersion + #pragma fragment FragUberPostTextureSample #pragma target 5.0 - #pragma debug + ENDHLSL + } + } - // Fallback shader to use when we can't keep things on tile, so usually in the editor when dealing with - // MSAA source targets to a non MSAA destination we can't perform a software resolve in the shader and - // so have to fall back to resolving the color target and reading it in as a texture. - // Where we have a MSAA destination we can avoid this. - half4 FragUberPostTextureReadVersion(Varyings input) : SV_Target0 - { - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + //Supported subshader for WebGL + SubShader + { + Tags { "RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline"} - float2 uv = SCREEN_COORD_APPLY_SCALEBIAS(UnityStereoTransformScreenSpaceTex(input.texcoord)); - half4 inputColor = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv); - return UberPost(inputColor, uv); - } + Pass + { + Name "OnTileUberPostTextureSample" + LOD 100 + ZTest Always ZWrite Off Cull Off + + HLSLPROGRAM + #pragma vertex Vert + #pragma fragment FragUberPostTextureSample ENDHLSL } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs index e1e5e6953f2..66cbf0ec0d3 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs @@ -815,6 +815,50 @@ internal static Vector4 GetFinalBlitScaleBias(in RasterGraphContext renderGraphC return scaleBias; } + /// + /// Returns the TextureUVOrigin of the real backbuffer for the current graphics API. In modern graphics APIs like + /// Vulkan or Metal, this will return TopLeft. For OpenGL, WebGL, GLES, this will return BottomLeft. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static TextureUVOrigin GetRealBackBufferUVOrientation() + { + return SystemInfo.graphicsUVStartsAtTop ? TextureUVOrigin.TopLeft : TextureUVOrigin.BottomLeft; + } + + /// + /// Returns the TextureUVOrigin of the UniversalResourceData.backBuffer. This resource is not always the real backbuffer. + /// To get the TextureUVOrigin of the real backbuffer, use GetRealBackBufferUVOrientation(). + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static TextureUVOrigin GetBackBufferUVOrientation(UniversalCameraData cameraData) + { + // Backbuffer orientation is used for either the actual backbuffer (not a texture), or in XR for the eye texture. + bool useRealBackbufferOrientation = !cameraData.isSceneViewCamera && !cameraData.isPreviewCamera && cameraData.targetTexture == null; + return useRealBackbufferOrientation ? RenderingUtils.GetRealBackBufferUVOrientation() : TextureUVOrigin.BottomLeft; + } + /// + /// Returns the TextureUVOrigin of the camera targets. These include the intermediate textures (UniversalResourceData.cameraColor, cameraDepth), + /// the Gbuffers (UniversalResourceData.gbuffer) and any copy of those. Since these are all textures, they normally are all using the + /// Unity texture convention of BottomLeft. However, in the On-Tile Renderer, these can adopt the backbuffer UV orientation. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static TextureUVOrigin GetCameraTargetsUVOrientation(UniversalCameraData cameraData) + { + var universalRenderer = cameraData.renderer as UniversalRenderer; + bool onTileRenderer = (universalRenderer == null) ? false : universalRenderer.onTileValidation; + + if (onTileRenderer) + { + // The On-Tile renderer guarantees that the backbuffer orientation is propagated to + // the camera targets. + return GetBackBufferUVOrientation(cameraData); + } + else + { + return TextureUVOrigin.BottomLeft; + } + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static RTHandleAllocInfo CreateRTHandleAllocInfo(in RenderTextureDescriptor descriptor, FilterMode filterMode, TextureWrapMode wrapMode, int anisoLevel, float mipMapBias, string name) { diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs index afbb82f563b..fd2e6695f6e 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs @@ -132,12 +132,23 @@ public class RenderingFeatures /// /// [Obsolete("cameraStacking has been deprecated use SupportedCameraRenderTypes() in ScriptableRenderer instead. #from(2022.2) #breakingFrom(2023.1)", true)] - public bool cameraStacking { get; set; } = false; + public bool cameraStacking { get; set; } = false; /// /// This setting controls if the Universal Render Pipeline asset should expose the MSAA option. /// public bool msaa { get; set; } = true; + + // Keeping these internal for now to validate the API. Once these would become public, carefully decide which setters should remain internal (with public getter). + internal bool overlayCamera { get; set; } = false; + internal bool supportsHDR { get; set; } = false; + internal bool postProcessing { get; set; } = false; + internal bool upscaling { get; set; } = false; + internal bool gpuOcclusionCulling { get; set; } = false; + internal bool antiAliasing { get; set; } = false; + internal bool cameraOpaqueTexture { get; set; } = false; + internal bool cameraDepthTexture { get; set; } = false; + internal bool deferredLighting { get; set; } = false; } /// @@ -430,6 +441,8 @@ protected List activeRenderPassQueue /// public RenderingFeatures supportedRenderingFeatures { get; set; } = new RenderingFeatures(); + internal virtual void UpdateSupportedRenderingFeatures() { } + /// /// List of unsupported Graphics APIs for this renderer.The scriptable renderer framework will use the returned information /// to adjust things like inspectors, etc. @@ -1171,22 +1184,31 @@ void InternalFinishRenderingCommon(CommandBuffer cmd, bool resolveFinalTarget) } } - private protected int AdjustAndGetScreenMSAASamples(RenderGraph renderGraph, bool useIntermediateColorTarget) + private protected int AdjustAndGetScreenMSAASamples(RenderGraph renderGraph, bool intermediateTexturesAreSampledAsTextures) { // In the editor (ConfigureTargetTexture in PlayModeView.cs) and many platforms, the system render target is always allocated without MSAA if (!SystemInfo.supportsMultisampledBackBuffer) return 1; + // For mobile platforms, when URP main rendering is done to an intermediate target and NRP enabled // we disable multisampling for the system render target as a bandwidth optimization // doing so, we avoid storing costly MSAA samples back to system memory for nothing bool canOptimizeScreenMSAASamples = UniversalRenderPipeline.canOptimizeScreenMSAASamples - && useIntermediateColorTarget + && intermediateTexturesAreSampledAsTextures && Screen.msaaSamples > 1; + // We need to fix an issue where the MSAA samples are never set back to the Quality setting. + // The MSAA samples only seem to be set when the URP asset is changed. The optimization + // in this function seems fragile, because different renderers can be used, even + // in a single frame. If we change a renderer from rendering to the backbuffer (or on-tile), + // to a renderer that renders to the intermediate textures then they render without MSAA, + // without the user knowing. This is a functional/visual bug. + // https://jira.unity3d.com/browse/UUM-134600 + if (canOptimizeScreenMSAASamples) { Screen.SetMSAASamples(1); - } + } // iOS and macOS corner case bool screenAPIHasOneFrameDelay = (Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.IPhonePlayer); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRendererFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRendererFeature.cs index 4897d1dbdfb..e0f5d7b5f34 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRendererFeature.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRendererFeature.cs @@ -1,5 +1,4 @@ using System; -using UnityEngine.Scripting.APIUpdating; namespace UnityEngine.Rendering.Universal { @@ -123,5 +122,7 @@ public void Dispose() protected virtual void Dispose(bool disposing) { } + + internal ScriptableRenderer.RenderingFeatures supportedRenderingFeatures { get; set; } = new ScriptableRenderer.RenderingFeatures(); } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs index ee093bd8e1d..74d013532d9 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs @@ -237,16 +237,11 @@ internal static bool UseDynamicBranchFogKeyword() internal UniversalRenderPipelineRuntimeTextures runtimeTextures { get; private set; } - internal static RenderTextureUVOriginStrategy renderTextureUVOriginStrategy { private get; set; } - /// /// The default Render Pipeline Global Settings. /// public override RenderPipelineGlobalSettings defaultSettings => m_GlobalSettings; - // flag to keep track of depth buffer requirements by any of the overlay cameras in the stack - internal static bool stackedOverlayCamerasRequireDepthForPostProcessing = false; - internal static RenderGraph s_RenderGraph; internal static RTHandleResourcePool s_RTHandlePool; @@ -987,14 +982,12 @@ static void RenderSingleCamera(ScriptableRenderContext context, UniversalCameraD if (asset?.useAdaptivePerformance == true) ApplyAdaptivePerformance(frameData); #endif - UniversalRenderPipeline.renderTextureUVOriginStrategy = RenderTextureUVOriginStrategy.BottomLeft; CreateShadowAtlasAndCullShadowCasters(lightData, shadowData, cameraData, ref data.cullResults, ref context); renderer.AddRenderPasses(ref legacyRenderingData); - RenderTextureUVOriginStrategy uvOriginStrategy = UniversalRenderPipeline.renderTextureUVOriginStrategy; - RecordAndExecuteRenderGraph(s_RenderGraph, context, renderer, cmd, cameraData.camera, uvOriginStrategy); - renderer.FinishRenderGraphRendering(cmd); + RecordAndExecuteRenderGraph(s_RenderGraph, context, renderer, cmd, cameraData.camera); + renderer.FinishRenderGraphRendering(cmd); } // When ProfilingSample goes out of scope, an "EndSample" command is enqueued into CommandBuffer cmd context.ExecuteCommandBuffer(cmd); // Sends to ScriptableRenderContext all the commands enqueued since cmd.Clear, i.e the "EndSample" command @@ -1058,8 +1051,6 @@ static void RenderCameraStack(ScriptableRenderContext context, Camera baseCamera var baseCameraRendererType = renderer.GetType(); bool shouldUpdateCameraStack = false; - stackedOverlayCamerasRequireDepthForPostProcessing = false; - for (int i = 0; i < stackedOverlayCameras.Count; ++i) { Camera overlayCamera = stackedOverlayCameras[i]; @@ -1098,8 +1089,6 @@ static void RenderCameraStack(ScriptableRenderContext context, Camera baseCamera continue; } - stackedOverlayCamerasRequireDepthForPostProcessing |= CheckPostProcessForDepth(); - stackAnyPostProcessingEnabled |= data.renderPostProcessing; lastActiveOverlayCameraIndex = i; } @@ -1111,8 +1100,9 @@ static void RenderCameraStack(ScriptableRenderContext context, Camera baseCamera } bool isStackedRendering = lastActiveOverlayCameraIndex != -1; - if (isStackedRendering && renderer is UniversalRenderer {onTileValidation: true}) - throw new ArgumentException("The active URP Renderer has 'On Tile Validation' on. This currently does not allow Camera Stacking usage. Check your scene and remove all overlay Cameras."); + + // The camera data is set based on the supported features. + renderer.UpdateSupportedRenderingFeatures(); // Prepare XR rendering var xrActive = false; @@ -1177,8 +1167,6 @@ static void RenderCameraStack(ScriptableRenderContext context, Camera baseCamera if (asset?.useAdaptivePerformance == true) ApplyAdaptivePerformance(baseCameraData); #endif - // update the base camera flag so that the scene depth is stored if needed by overlay cameras later in the frame - baseCameraData.postProcessingRequiresDepthTexture |= stackedOverlayCamerasRequireDepthForPostProcessing; // Check whether the camera stack final output is HDR // This is equivalent of UniversalCameraData.isHDROutputActive but without necessiting the base camera to be the last camera in the stack. @@ -1189,12 +1177,11 @@ static void RenderCameraStack(ScriptableRenderContext context, Camera baseCamera hdrDisplayOutputActive = xrPass.isHDRDisplayOutputActive; #endif finalOutputHDR = - asset.supportsHDR && hdrDisplayOutputActive // Check whether any HDR display is active and the render pipeline asset allows HDR rendering && baseCamera.targetTexture == null && (baseCamera.cameraType == CameraType.Game || baseCamera.cameraType == CameraType.VR) // Check whether the stack outputs to a screen - && baseCameraData.allowHDROutput; // Check whether the base camera allows HDR output + && baseCameraData.isHdrEnabled; // Check whether the base camera has HDR enabled (this includes a check if the renderer supports it) // Update stack-related parameters baseCameraData.stackAnyPostProcessingEnabled = stackAnyPostProcessingEnabled; @@ -1462,6 +1449,8 @@ static UniversalCameraData CreateCameraData(ContextContainer frameData, Camera c var renderer = GetRenderer(camera, additionalCameraData); UniversalCameraData cameraData = frameData.Create(); + cameraData.renderer = renderer; + InitializeStackedCameraData(camera, additionalCameraData, cameraData); cameraData.camera = camera; @@ -1497,10 +1486,7 @@ static UniversalCameraData CreateCameraData(ContextContainer frameData, Camera c // Multiple cameras could render into the same XR display and they should share the same MSAA level. // However it should still respect the sample count of the target texture camera is rendering to. if (cameraData.xrRendering && rendererSupportsMSAA && camera.targetTexture == null) - msaaSamples = (int)XRSystem.GetDisplayMSAASamples(); - - if (renderer is UniversalRenderer { onTileValidation: true } && UniversalRenderer.PlatformRequiresExplicitMsaaResolve()) - msaaSamples = 1; + msaaSamples = (int)XRSystem.GetDisplayMSAASamples(); #if ENABLE_MULTI_WINDOWING && PLATFORM_SUPPORTS_PER_WINDOW_TRANSPARENCY && !UNITY_EDITOR bool needsAlphaChannel = GameWindowManager.IsGameWindowTransparent(cameraData.camera.targetDisplay); @@ -1573,11 +1559,16 @@ static void InitializeStackedCameraData(Camera baseCamera, UniversalAdditionalCa cameraData.allowHDROutput = true; } + var supportedRenderingFeatures = cameraData.renderer.supportedRenderingFeatures; + /////////////////////////////////////////////////////////////////// // Settings that control output of the camera / /////////////////////////////////////////////////////////////////// - cameraData.isHdrEnabled = baseCamera.allowHDR && settings.supportsHDR; + if (!supportedRenderingFeatures.antiAliasing) + cameraData.antialiasing = AntialiasingMode.None; + + cameraData.isHdrEnabled = baseCamera.allowHDR && settings.supportsHDR && supportedRenderingFeatures.supportsHDR; cameraData.allowHDROutput &= settings.supportsHDR; Rect cameraRect = baseCamera.rect; @@ -1594,8 +1585,8 @@ static void InitializeStackedCameraData(Camera baseCamera, UniversalAdditionalCa // Discard variations lesser than kRenderScaleThreshold. // Scale is only enabled for gameview. const float kRenderScaleThreshold = 0.05f; - bool disableRenderScale = ((Mathf.Abs(1.0f - settings.renderScale) < kRenderScaleThreshold) || isScenePreviewOrReflectionCamera); - cameraData.renderScale = disableRenderScale ? 1.0f : settings.renderScale; + bool disableRenderScale = (Mathf.Abs(1.0f - settings.renderScale) < kRenderScaleThreshold) || isScenePreviewOrReflectionCamera || !supportedRenderingFeatures.upscaling; + cameraData.renderScale = disableRenderScale? 1.0f : settings.renderScale; #if ENABLE_UPSCALER_FRAMEWORK // ImageUpscalingFilter is deprecated, we now track by upscaler name @@ -1608,8 +1599,10 @@ static void InitializeStackedCameraData(Camera baseCamera, UniversalAdditionalCa bool upscalerSupportsSharpening = activeUpscaler != null && activeUpscaler.supportsSharpening; #else // Convert the upscaling filter selection from the pipeline asset into an image upscaling filter - cameraData.upscalingFilter = ResolveUpscalingFilterSelection(new Vector2(cameraData.pixelWidth, cameraData.pixelHeight), cameraData.renderScale, settings.upscalingFilter); - + cameraData.upscalingFilter = supportedRenderingFeatures.upscaling? + ResolveUpscalingFilterSelection(new Vector2(cameraData.pixelWidth, cameraData.pixelHeight), cameraData.renderScale, settings.upscalingFilter) + : ImageUpscalingFilter.Point; + bool upscalerSupportsTemporalAntiAliasing = cameraData.upscalingFilter == ImageUpscalingFilter.STP; bool upscalerSupportsSharpening = cameraData.upscalingFilter == ImageUpscalingFilter.FSR; #endif @@ -1675,7 +1668,7 @@ static void InitializeAdditionalCameraData(Camera camera, UniversalAdditionalCam using var profScope = new ProfilingScope(Profiling.Pipeline.initializeAdditionalCameraData); var renderer = GetRenderer(camera, additionalCameraData); - var settings = asset; + var settings = asset; bool anyShadowsEnabled = settings.supportsMainLightShadows || settings.supportsAdditionalLightShadows; cameraData.maxShadowDistance = Mathf.Min(settings.shadowDistance, camera.farClipPlane); @@ -1716,6 +1709,14 @@ static void InitializeAdditionalCameraData(Camera camera, UniversalAdditionalCam cameraData.screenSizeOverride = cameraData.pixelRect.size; cameraData.screenCoordScaleBias = Vector2.one; } + + var supportedRenderingFeatures = renderer.supportedRenderingFeatures; + + if (!supportedRenderingFeatures.cameraOpaqueTexture) + cameraData.requiresOpaqueTexture = false; + + if (!supportedRenderingFeatures.cameraDepthTexture) + cameraData.requiresDepthTexture = false; cameraData.renderer = renderer; cameraData.postProcessingRequiresDepthTexture = CheckPostProcessForDepth(cameraData); @@ -1995,7 +1996,7 @@ static UniversalPostProcessingData CreatePostProcessingData(ContextContainer fra UniversalPostProcessingData postProcessingData = frameData.Create(); UniversalCameraData cameraData = frameData.Get(); - postProcessingData.isEnabled = cameraData.stackAnyPostProcessingEnabled; + postProcessingData.isEnabled = cameraData.postProcessEnabled; postProcessingData.gradingMode = settings.supportsHDR ? settings.colorGradingMode diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineRenderGraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineRenderGraph.cs index f75e2329177..352f4e86e15 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineRenderGraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineRenderGraph.cs @@ -5,8 +5,12 @@ namespace UnityEngine.Rendering.Universal { public sealed partial class UniversalRenderPipeline { - static void RecordAndExecuteRenderGraph(RenderGraph renderGraph, ScriptableRenderContext context, ScriptableRenderer renderer, CommandBuffer cmd, Camera camera, RenderTextureUVOriginStrategy uvOriginStrategy) + static void RecordAndExecuteRenderGraph(RenderGraph renderGraph, ScriptableRenderContext context, ScriptableRenderer renderer, CommandBuffer cmd, Camera camera) { + var universalRenderer = renderer as UniversalRenderer; + var renderTextureUVOriginStrategy = (universalRenderer != null && universalRenderer.onTileValidation) ? + RenderTextureUVOriginStrategy.PropagateAttachmentOrientation : RenderTextureUVOriginStrategy.BottomLeft; + RenderGraphParameters rgParams = new RenderGraphParameters { executionId = camera.GetEntityId(), @@ -14,7 +18,7 @@ static void RecordAndExecuteRenderGraph(RenderGraph renderGraph, ScriptableRende commandBuffer = cmd, scriptableRenderContext = context, currentFrameIndex = Time.frameCount, - renderTextureUVOriginStrategy = uvOriginStrategy, + renderTextureUVOriginStrategy = renderTextureUVOriginStrategy, }; try diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs index 3d1cf7ef69a..7ff575ed824 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs @@ -62,17 +62,12 @@ public sealed partial class UniversalRenderer : ScriptableRenderer /// public override int SupportedCameraStackingTypes() { - switch (m_RenderingMode) - { - case RenderingMode.Forward: - case RenderingMode.ForwardPlus: - return 1 << (int)CameraRenderType.Base | 1 << (int)CameraRenderType.Overlay; - case RenderingMode.Deferred: - case RenderingMode.DeferredPlus: - return 1 << (int)CameraRenderType.Base; - default: - return 0; - } + int supported = 1 << (int)CameraRenderType.Base; + + if(supportedRenderingFeatures.overlayCamera) + supported |= 1 << (int)CameraRenderType.Overlay; + + return supported; } /// @@ -85,7 +80,7 @@ protected internal override bool SupportsMotionVectors() /// protected internal override bool SupportsCameraOpaque() { - return true; + return supportedRenderingFeatures.cameraOpaqueTexture; } /// @@ -193,18 +188,29 @@ internal RenderingMode renderingModeActual { Material m_ClusterDeferredMaterial = null; Material m_CameraMotionVecMaterial = null; - internal bool isPostProcessActive { get => m_PostProcess != null; } + // Is the internal post processing of the renderer enabled. + // This does not include post processing in extensions. + // If post processing is enabled on the camera, and on the renderer, then + // the internal post processing passes will be added. + // Validation can still turn this off so it's not a direct view on the + // serialized renderer data. + internal bool postProcessEnabled { get; set; } internal DeferredLights deferredLights { get => m_DeferredLights; } internal LayerMask prepassLayerMask { get; set; } internal LayerMask opaqueLayerMask { get; set; } internal LayerMask transparentLayerMask { get; set; } internal bool shadowTransparentReceive { get; set; } - internal bool onTileValidation { get; set; } + + // A Renderer cannot be switched from On-Tile to not On-Tile. + // We make assumptions in the constructor to create the passes. + internal bool onTileValidation { get; } internal GraphicsFormat cameraDepthTextureFormat { get => (m_CameraDepthTextureFormat != DepthFormat.Default) ? (GraphicsFormat)m_CameraDepthTextureFormat : CoreUtils.GetDefaultDepthStencilFormat(); } internal GraphicsFormat cameraDepthAttachmentFormat { get => (m_CameraDepthAttachmentFormat != DepthFormat.Default) ? (GraphicsFormat)m_CameraDepthAttachmentFormat : CoreUtils.GetDefaultDepthStencilFormat(); } + ValidationHandler m_ValidationHandler; + /// /// Constructor for the Universal Renderer. /// @@ -259,6 +265,14 @@ public UniversalRenderer(UniversalRendererData data) : base(data) onTileValidation = data.onTileValidation; + // The On-Tile Renderer does not support WebGL. + if (onTileValidation && IsWebGL()) + { + onTileValidation = false; + } + + m_ValidationHandler = new ValidationHandler(); + var asset = UniversalRenderPipeline.asset; if (asset != null && asset.supportsLightCookies) { @@ -291,6 +305,17 @@ public UniversalRenderer(UniversalRendererData data) : base(data) this.m_CopyDepthMode = data.copyDepthMode; this.m_CameraDepthAttachmentFormat = data.depthAttachmentFormat; this.m_CameraDepthTextureFormat = data.depthTextureFormat; + this.postProcessEnabled = data.postProcessData != null; + + UpdateSupportedRenderingFeatures(); + + if (onTileValidation) + { + // We don't change the camera setting. Extensions like our own On-Tile Post Processing + // use this as well. We just make sure we disable the internal post processing on the + // renderer because this is not on-tile compatible currently. + postProcessEnabled = false; + } // Note: Since all custom render passes inject first and we have stable sort, // we inject the builtin passes in the before events. @@ -304,7 +329,7 @@ public UniversalRenderer(UniversalRendererData data) : base(data) #endif m_DepthPrepass = new DepthOnlyPass(RenderPassEvent.BeforeRenderingPrePasses, RenderQueueRange.opaque, prepassLayerMask); m_DepthNormalPrepass = new DepthNormalOnlyPass(RenderPassEvent.BeforeRenderingPrePasses, RenderQueueRange.opaque, prepassLayerMask); - if (renderingModeRequested == RenderingMode.Deferred || renderingModeRequested == RenderingMode.DeferredPlus) + if (supportedRenderingFeatures.deferredLighting) { var deferredInitParams = new DeferredLights.InitParams(); deferredInitParams.stencilDeferredMaterial = m_StencilDeferredMaterial; @@ -368,10 +393,10 @@ public UniversalRenderer(UniversalRendererData data) : base(data) m_DrawOffscreenUIPass = new DrawScreenSpaceUIPass(RenderPassEvent.BeforeRenderingPostProcessing); m_DrawOverlayUIPass = new DrawScreenSpaceUIPass(RenderPassEvent.AfterRendering + k_AfterFinalBlitPassQueueOffset); // after m_FinalBlitPass - - //No postProcessData means that post processes are disabled - if (data.postProcessData != null) + + if (postProcessEnabled) { + Debug.Assert(data.postProcessData != null); m_PostProcess = new PostProcess(data.postProcessData); m_ColorGradingLutPassRenderGraph = new ColorGradingLutPass(RenderPassEvent.BeforeRenderingPrePasses, data.postProcessData); } @@ -386,21 +411,60 @@ public UniversalRenderer(UniversalRendererData data) : base(data) m_ProbeVolumeDebugPass = new ProbeVolumeDebugPass(RenderPassEvent.BeforeRenderingTransparents, debugShaders.probeVolumeSamplingDebugComputeShader); #endif - supportedRenderingFeatures = new RenderingFeatures(); - - if (renderingModeRequested is RenderingMode.Deferred or RenderingMode.DeferredPlus) - { - // Deferred rendering does not support MSAA. - // if On-Tile Validation is enabled, Deferred(+) will fallback to Forward(+). Thus we must not fix msaa value in this case. - if (!onTileValidation) - supportedRenderingFeatures.msaa = false; - } - LensFlareCommonSRP.mergeNeeded = 0; LensFlareCommonSRP.maxLensFlareWithOcclusionTemporalSample = 1; LensFlareCommonSRP.Initialize(); } + internal override void UpdateSupportedRenderingFeatures() + { + if (onTileValidation) + { + supportedRenderingFeatures.supportsHDR = false; // We need a blit pass to support hdr. + supportedRenderingFeatures.postProcessing = false; // Internal pp does not support on-tile. + supportedRenderingFeatures.cameraOpaqueTexture = false; + supportedRenderingFeatures.cameraDepthTexture = false; + supportedRenderingFeatures.upscaling = PlatformAutoDetect.isXRMobile; + supportedRenderingFeatures.antiAliasing = false; + supportedRenderingFeatures.gpuOcclusionCulling = false; + supportedRenderingFeatures.deferredLighting = false; + supportedRenderingFeatures.overlayCamera = false; + + // If a device requires explicit msaa resolve, that means that the backbuffer + // can't have msaa. In regular rendering, we can render to msaa intermediate + // textures and blit the resolved textures. However, in on-tile mode, this + // would break the render pass so we need to ensure the intermediate textures + // have the same msaa count as the backbuffer (ie 1). + supportedRenderingFeatures.msaa = !UniversalRenderer.PlatformRequiresExplicitMsaaResolve() && SystemInfo.supportsMultisampledBackBuffer && !supportedRenderingFeatures.deferredLighting; + } + else + { + supportedRenderingFeatures.supportsHDR = true; + supportedRenderingFeatures.postProcessing = postProcessEnabled; + supportedRenderingFeatures.cameraOpaqueTexture = true; + supportedRenderingFeatures.cameraDepthTexture = true; + supportedRenderingFeatures.upscaling = true; + supportedRenderingFeatures.antiAliasing = true; + supportedRenderingFeatures.gpuOcclusionCulling = true; + supportedRenderingFeatures.deferredLighting = renderingModeRequested is RenderingMode.Deferred or RenderingMode.DeferredPlus; + supportedRenderingFeatures.overlayCamera = !supportedRenderingFeatures.deferredLighting; + supportedRenderingFeatures.msaa = !supportedRenderingFeatures.deferredLighting; + } + + foreach (var feature in rendererFeatures) + { + if (feature.isActive) + { + // For example, OnTilePostProcessing adds post processing and hdr support. + supportedRenderingFeatures.supportsHDR |= feature.supportedRenderingFeatures.supportsHDR; + supportedRenderingFeatures.postProcessing |= feature.supportedRenderingFeatures.postProcessing; + } + } + + // Setting the engine wide feature flags here as well. We can likely phase these out. + SupportedRenderingFeatures.active.supportsHDR = supportedRenderingFeatures.supportsHDR; + } + /// protected override void Dispose(bool disposing) { @@ -637,11 +701,7 @@ static RenderPassInputSummary GetRenderPassInputs(List act } void AddRequirementsOfInternalFeatures(ref RenderPassInputSummary inputSummary, UniversalCameraData cameraData, bool postProcessingEnabled, bool renderingLayerProvidesByDepthNormalPass, MotionVectorRenderPass motionVectorPass, CopyDepthMode copyDepthMode) - { - // TAA in postprocess requires it to function. - if (cameraData.IsTemporalAAEnabled() ) - inputSummary.requiresMotionVectors = true; - + { if(cameraData.requiresDepthTexture) { inputSummary.requiresDepthTexture = true; @@ -674,6 +734,10 @@ void AddRequirementsOfInternalFeatures(ref RenderPassInputSummary inputSummary, inputSummary.requiresDepthTextureEarliestEvent = (RenderPassEvent)Mathf.Min( (int)RenderPassEvent.BeforeRenderingPostProcessing, (int)inputSummary.requiresDepthTextureEarliestEvent); } + // TAA in postprocess requires it to function. + if (cameraData.IsTemporalAAEnabled()) + inputSummary.requiresMotionVectors = true; + } // Motion vectors imply depth diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs index 27f4c38a7dc..c083e4b9cb5 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs @@ -589,59 +589,7 @@ public override void OnBeginRenderGraphFrame() { UniversalResourceData resourceData = frameData.Get(); resourceData.InitFrame(); - } - - static void ApplyConstraints(bool onTileValidation, UniversalRenderingData renderingData, UniversalCameraData cameraData, UniversalPostProcessingData postProcessingData, List activeRenderPassQueue, ref RenderingMode renderingMode, ref DepthPrimingMode depthPrimingMode) - { - if (!onTileValidation) - return; - - cameraData.requiresOpaqueTexture = false; - cameraData.requiresDepthTexture = false; - - cameraData.postProcessEnabled = false; - cameraData.stackAnyPostProcessingEnabled = false; - postProcessingData.isEnabled = false; - - cameraData.useGPUOcclusionCulling = false; - cameraData.isHdrEnabled = false; - - if (!PlatformAutoDetect.isXRMobile) - { - cameraData.renderScale = 1.0f; - cameraData.imageScalingMode = ImageScalingMode.None; - } - - if (renderingData.renderingMode == RenderingMode.DeferredPlus) - renderingData.renderingMode = RenderingMode.ForwardPlus; - - if (renderingMode == RenderingMode.DeferredPlus) - renderingMode = RenderingMode.ForwardPlus; - - if (renderingData.renderingMode == RenderingMode.Deferred) - renderingData.renderingMode = RenderingMode.Forward; - - if (renderingMode == RenderingMode.Deferred) - renderingMode = RenderingMode.Forward; - - if (cameraData.baseCamera != null && cameraData.baseCamera != cameraData.camera) - throw new ArgumentException("The active URP Renderer has 'On Tile Validation' on. This currently does not allow Camera Stacking usage. Check your scene and remove all overlay Cameras."); - - if (activeRenderPassQueue.Count > 0) - throw new ArgumentException("The active URP Renderer has 'On Tile Validation' on. This currently does not allow any ScriptableRenderFeature enabled, and it does not allow enqueuing any ScriptableRenderPass. Check your Renderer asset and disable all Renderer Features. Also, ensure that no C# script enqueus any passes on the renderer."); - } - - //Catches mistakes by Unity devs with regards to clearing the settings - [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] - static void ValidateCorrectnessOfConstraints(bool onTileValidation, in RenderPassInputSummary renderPassInputs, bool requireIntermediateTextures) - { - if (!onTileValidation) - return; - - if (renderPassInputs is { requiresColorTexture: false, requiresDepthTexture: false, requiresMotionVectors: false, requiresNormalsTexture: false} && !requireIntermediateTextures) - return; - - throw new ArgumentException("On Tile Validation is on but certain features still added requirements that would validate this."); + m_ValidationHandler.OnBeginRenderGraphFrame(onTileValidation); } internal override void OnRecordRenderGraph(RenderGraph renderGraph, ScriptableRenderContext context) @@ -652,8 +600,6 @@ internal override void OnRecordRenderGraph(RenderGraph renderGraph, ScriptableRe UniversalLightData lightData = frameData.Get(); UniversalPostProcessingData postProcessingData = frameData.Get(); - ApplyConstraints(onTileValidation, renderingData, cameraData, postProcessingData,activeRenderPassQueue, ref m_RenderingMode, ref m_DepthPrimingMode); - MotionVectorRenderPass.SetRenderGraphMotionVectorGlobalMatrices(renderGraph, cameraData); SetupRenderGraphLights(renderGraph, renderingData, cameraData, lightData); @@ -661,7 +607,7 @@ internal override void OnRecordRenderGraph(RenderGraph renderGraph, ScriptableRe SetupRenderingLayers(cameraData.cameraTargetDescriptor.msaaSamples); bool isCameraTargetOffscreenDepth = cameraData.camera.targetTexture != null && cameraData.camera.targetTexture.format == RenderTextureFormat.Depth; - bool applyPostProcessing = cameraData.postProcessEnabled && m_PostProcess != null; + bool applyPostProcessing = cameraData.postProcessEnabled && this.postProcessEnabled; //First get the input requirements for the the ScriptableRenderPasses. These are all user passes plus potentially some that URP adds. RenderPassInputSummary renderPassInputs = GetRenderPassInputs(activeRenderPassQueue); @@ -684,10 +630,11 @@ internal override void OnRecordRenderGraph(RenderGraph renderGraph, ScriptableRe if (cameraData.renderType == CameraRenderType.Base) s_RequiresIntermediateAttachments = RequiresIntermediateAttachments(cameraData, in renderPassInputs, requireCopyFromDepth, applyPostProcessing); - ValidateCorrectnessOfConstraints(onTileValidation, renderPassInputs, s_RequiresIntermediateAttachments); - CreateRenderGraphCameraRenderTargets(renderGraph, isCameraTargetOffscreenDepth, s_RequiresIntermediateAttachments, depthTextureIsDepthFormat); + m_ValidationHandler.active = cameraData.cameraType == CameraType.Game; + m_ValidationHandler.OnBeforeRendering(renderGraph, resourceData); + if (DebugHandler != null) DebugHandler.Setup(renderGraph, cameraData.isPreviewCamera); @@ -743,6 +690,9 @@ public override bool supportsGPUOcclusion { get { + if (!supportedRenderingFeatures.gpuOcclusionCulling) + return false; + // UUM-82677: GRD GPU Occlusion Culling on Vulkan breaks rendering on some mobile GPUs // // We currently disable gpu occlusion culling when running on Qualcomm GPUs due to suspected driver issues. @@ -821,7 +771,7 @@ private void OnBeforeRendering(RenderGraph renderGraph) RecordCustomRenderGraphPasses(renderGraph, RenderPassEvent.AfterRenderingShadows); - bool requiredColorGradingLutPass = cameraData.postProcessEnabled && m_PostProcess != null; + bool requiredColorGradingLutPass = cameraData.postProcessEnabled && this.postProcessEnabled; if (requiredColorGradingLutPass) { m_ColorGradingLutPassRenderGraph.RecordRenderGraph(renderGraph, frameData); @@ -1154,6 +1104,8 @@ private void OnMainRendering(RenderGraph renderGraph, ScriptableRenderContext co // Subtractive mixed lighting requires shadowMask output, which is actually used to store unity_ProbesOcclusion values. m_DeferredLights.CreateGbufferTextures(renderGraph, resourceData, isDepthNormalPrepass); + m_ValidationHandler.OnBeforeGBuffers(renderGraph, resourceData); + RecordCustomRenderGraphPasses(renderGraph, RenderPassEvent.BeforeRenderingGbuffer); bool needsOccluderUpdate = occluderPass == OccluderPass.GBuffer; @@ -1368,7 +1320,7 @@ private void OnAfterRendering(RenderGraph renderGraph, bool applyPostProcessing) RecordCustomRenderGraphPasses(renderGraph, RenderPassEvent.BeforeRenderingPostProcessing); // There's at least a camera in the camera stack that applies post-processing - bool anyPostProcessing = postProcessingData.isEnabled && m_PostProcess != null; + bool anyPostProcessing = postProcessingData.isEnabled && this.postProcessEnabled; #if ENABLE_UPSCALER_FRAMEWORK bool fsr1Enabled = cameraData.resolvedUpscalerHash == UniversalRenderPipeline.k_UpscalerHash_FSR1; @@ -1469,6 +1421,8 @@ private void OnAfterRendering(RenderGraph renderGraph, bool applyPostProcessing) //Checking resourceData.isActiveTargetBackBuffer is a robust way to check if this has happened, by our own code or by the user. if (!resourceData.isActiveTargetBackBuffer && cameraData.resolveFinalTarget) { + Debug.Assert(!onTileValidation, "Adding the final blit pass when On-Tile Validation is on. This is not valid and will throw an exception. Likely, an On-Tile Feature has requested the intermediate textures but did not correctly copy the data to the backbuffer."); + debugHandler?.UpdateShaderGlobalPropertiesForFinalValidationPass(renderGraph, cameraData, !resolveToDebugScreen); //Will swap the active camera targets to backbuffer (resourceData.SwitchActiveTexturesToBackbuffer) @@ -1476,14 +1430,40 @@ private void OnAfterRendering(RenderGraph renderGraph, bool applyPostProcessing) } RecordCustomRenderGraphPasses(renderGraph, RenderPassEvent.AfterRendering); - + // We can explicitely render the overlay UI from URP when HDR output is not enabled. // SupportedRenderingFeatures.active.rendersUIOverlay should also be set to true. bool shouldRenderUI = cameraData.rendersOverlayUI && cameraData.isLastBaseCamera; bool outputToHDR = cameraData.isHDROutputActive; if (shouldRenderUI && !outputToHDR) { - m_DrawOverlayUIPass.RenderOverlay(renderGraph, frameData, resourceData.activeColorTexture, resourceData.activeDepthTexture); + var color = resourceData.activeColorTexture; + var cameraDepth = resourceData.cameraDepth; + + TextureHandle depth; + + if (cameraDepth.IsValid() && SystemInfo.supportsBackbufferInMultipleRenderTargets) + { + var backbufferInfo = renderGraph.GetRenderTargetInfo(resourceData.backBufferDepth); + var cameraDepthDesc = renderGraph.GetTextureDesc(in cameraDepth); + + bool matchingDimensions = backbufferInfo.msaaSamples == (int) cameraDepthDesc.msaaSamples + && backbufferInfo.width == cameraDepthDesc.width && backbufferInfo.height == cameraDepthDesc.height + && backbufferInfo.volumeDepth == cameraDepthDesc.slices; + + // Using the cameraDepth avoids switching the depth target, that would break the native render pass. + depth = (matchingDimensions) ? cameraDepth : resourceData.activeDepthTexture; + } + else + { + depth = resourceData.activeDepthTexture; + } + + m_DrawOverlayUIPass.RenderOverlayUIToolkitAndUGUI(renderGraph, frameData, in color, in depth); + + // IMGUI uses an Unsafe pass and is therefore not supported by the on-tile renderer. + if(!(onTileValidation && cameraData.cameraType == CameraType.Game)) + m_DrawOverlayUIPass.RenderOverlayIMGUI(renderGraph, frameData, in color, in depth); } #if ENABLE_VR && ENABLE_XR_MODULE @@ -1625,13 +1605,16 @@ void ImportBackBuffers(RenderGraph renderGraph, UniversalCameraData cameraData, // We cannot use directly !cameraData.rendersOverlayUI but this is similar logic bool isNativeUIOverlayRenderingAfterURP = !SupportedRenderingFeatures.active.rendersUIOverlay && cameraData.resolveToScreen; bool isNativeRenderingAfterURP = UnityEngine.Rendering.Watermark.IsVisible() || isNativeUIOverlayRenderingAfterURP; - // If MSAA > 1, no extra native rendering after SRP and we target the BB directly (!m_RequiresIntermediateAttachments) - // then we can discard MSAA buffers and only resolve, otherwise we must store and resolve - bool noStoreOnlyResolveBBColor = !s_RequiresIntermediateAttachments && !isNativeRenderingAfterURP && (cameraData.cameraTargetDescriptor.msaaSamples > 1); - //Backbuffer orientation is used for either the actual backbuffer (not a texture), or in XR for the eye texture. - bool useActualBackbufferOrienation = !cameraData.isSceneViewCamera && !cameraData.isPreviewCamera && cameraData.targetTexture == null; - TextureUVOrigin backbufferTextureUVOrigin = useActualBackbufferOrienation ? (SystemInfo.graphicsUVStartsAtTop ? TextureUVOrigin.TopLeft : TextureUVOrigin.BottomLeft) : TextureUVOrigin.BottomLeft; + // If MSAA > 1, no extra native rendering after SRP and we target the BB directly + // then we can discard MSAA buffers and only resolve, otherwise we must store and resolve. + // To target the BB directly, either we don't render to the intermediate textures, or we render with the on-tile renderer. + // The on-tile renderer guarantees a single native render pass for the draw passes to the backbuffer, even though + // it potentially uses the intermediate textures as temporary attachments inside of the NRP. + bool intermediateTexturesAreSampledAsTextures = s_RequiresIntermediateAttachments && !onTileValidation; + bool noStoreOnlyResolveBBColor = !intermediateTexturesAreSampledAsTextures && !isNativeRenderingAfterURP && (cameraData.cameraTargetDescriptor.msaaSamples > 1); + + TextureUVOrigin backbufferTextureUVOrigin = RenderingUtils.GetBackBufferUVOrientation(cameraData); ImportResourceParams importBackbufferColorParams = new ImportResourceParams(); importBackbufferColorParams.clearOnFirstUse = clearBackbufferOnFirstUse; @@ -1682,7 +1665,18 @@ void ImportBackBuffers(RenderGraph renderGraph, UniversalCameraData cameraData, { // Backbuffer is the final render target, we obtain its number of MSAA samples through Screen API // in some cases we disable multisampling for optimization purpose - int numSamples = AdjustAndGetScreenMSAASamples(renderGraph, s_RequiresIntermediateAttachments); + //int numSamples = AdjustAndGetScreenMSAASamples(renderGraph, intermediateTexturesAreSampledAsTextures); + + // We need to fix an issue where the MSAA samples are never set back to the Quality setting. + // The MSAA samples only seem to be set when the URP asset is changed. The optimization + // in this function seems fragile, because different renderers can be used, even + // in a single frame. If we change a renderer from rendering to the backbuffer (or on-tile), + // to a renderer that renders to the intermediate textures then they render without MSAA, + // without the user knowing. This is a functional/visual bug. + // https://jira.unity3d.com/browse/UUM-134600 + // This optimization is temporarely disabled until we fix this functional issue. + int numSamples = (!SystemInfo.supportsMultisampledBackBuffer) ? 1 : Mathf.Max(Screen.msaaSamples, 1); + //BuiltinRenderTextureType.CameraTarget so this is either system render target or camera.targetTexture if non null //NOTE: Careful what you use here as many of the properties bake-in the camera rect so for example @@ -1749,6 +1743,7 @@ void CreateIntermediateCameraColorAttachment(RenderGraph renderGraph, UniversalC desc.autoGenerateMips = false; desc.filterMode = FilterMode.Bilinear; desc.wrapMode = TextureWrapMode.Clamp; + desc.bindTextureMS = onTileValidation && desc.msaaSamples != MSAASamples.None; //Needed for GLES fallback // When there's a single camera setup, there's no need to do the double buffer technique with attachment A/B, in order to save memory allocation // and simplify the workflow by using a RenderGraph texture directly. diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/ValidationHandler.cs b/Packages/com.unity.render-pipelines.universal/Runtime/ValidationHandler.cs index 780b57ffb16..9ef3d2af4b4 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/ValidationHandler.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/ValidationHandler.cs @@ -7,6 +7,7 @@ namespace UnityEngine.Rendering.Universal internal class ValidationHandler { OnTileValidationLayer m_OnTileValidationLayer; + public bool active { get; set; } [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] public void OnBeginRenderGraphFrame(bool onTileValidation) @@ -26,9 +27,10 @@ public void OnBeginRenderGraphFrame(bool onTileValidation) public void OnBeforeRendering(RenderGraph renderGraph, UniversalResourceData resourceData) { // Will be null and therefor remove the validation layer when onTileValidation is off - InternalRenderGraphValidation.SetAdditionalValidationLayer(renderGraph, m_OnTileValidationLayer); + InternalRenderGraphValidation.SetAdditionalValidationLayer(renderGraph, + active? m_OnTileValidationLayer : null); - if (m_OnTileValidationLayer != null) + if (m_OnTileValidationLayer != null && active) { m_OnTileValidationLayer.renderGraph = renderGraph; @@ -41,7 +43,7 @@ public void OnBeforeRendering(RenderGraph renderGraph, UniversalResourceData res [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] public void OnBeforeGBuffers(RenderGraph renderGraph, UniversalResourceData resourceData) { - if (m_OnTileValidationLayer != null) + if (m_OnTileValidationLayer != null && active) { foreach (TextureHandle handle in resourceData.gBuffer) { diff --git a/Packages/com.unity.render-pipelines.universal/Tests/Runtime/RenderGraphConstraintsTests.cs b/Packages/com.unity.render-pipelines.universal/Tests/Runtime/RenderGraphConstraintsTests.cs index dbffc717eb8..b25db4a6ca2 100644 --- a/Packages/com.unity.render-pipelines.universal/Tests/Runtime/RenderGraphConstraintsTests.cs +++ b/Packages/com.unity.render-pipelines.universal/Tests/Runtime/RenderGraphConstraintsTests.cs @@ -235,6 +235,7 @@ public void ApplyToAssetAndRenderer(UniversalRenderPipelineAsset asset, Universa .SetName("Post Processing on Universal Renderer.").Returns(null), }; + [UnityPlatform(exclude = new RuntimePlatform[] { RuntimePlatform.WebGLPlayer })] [UnityTest] [TestCaseSource(nameof(s_OnTileValidationCases))] public IEnumerator URPSettingsShouldNotCauseNonMemorylessTargets(OnTileValidationConfiguration config) @@ -252,26 +253,9 @@ public IEnumerator URPSettingsShouldNotCauseNonMemorylessTargets(OnTileValidatio LogAssert.ignoreFailingMessages = false; } + [UnityPlatform(exclude = new RuntimePlatform[] { RuntimePlatform.WebGLPlayer})] [UnityTest] - public IEnumerator AnyScriptableRendererFeatureProduceAnException() - { - // Arrange - var config = new OnTileValidationConfiguration(); - config.rendererFeatures.Add(ScriptableObject.CreateInstance()); - config.ApplyToAssetAndRenderer(m_UniversalRenderPipelineAsset, m_UniversalRendererData); - - yield return null; - - // Act - LogAssert.Expect(LogType.Error, new Regex("Render Graph Execution error")); - LogAssert.Expect(LogType.Exception, new Regex("ArgumentException")); - - m_UniversalRendererData.onTileValidation = true; - yield return null; - } - - [UnityTest] - public IEnumerator CameraStackingProduceAnException() + public IEnumerator CameraStackingProduceWarning() { // Arrange var gameObject = new GameObject(); @@ -287,15 +271,13 @@ public IEnumerator CameraStackingProduceAnException() yield return null; // Act - LogAssert.Expect(LogType.Exception, new Regex("ArgumentException")); + LogAssert.Expect(LogType.Warning, new Regex("does not support Overlay cameras")); + LogAssert.Expect(LogType.Warning, new Regex("camera overlay no longer exists")); m_UniversalRendererData.onTileValidation = true; yield return null; m_UniversalRendererData.onTileValidation = false; - ((UniversalRenderer)additionalCameraData.scriptableRenderer).onTileValidation = true; - - LogAssert.Expect(LogType.Exception, new Regex("ArgumentException")); yield return null; diff --git a/Tests/SRPTests/Packages/com.unity.testing.urp/Scripts/Editor/UniversalProjectAssert.cs b/Tests/SRPTests/Packages/com.unity.testing.urp/Scripts/Editor/UniversalProjectAssert.cs index a19fe91bf63..5e2223679e3 100644 --- a/Tests/SRPTests/Packages/com.unity.testing.urp/Scripts/Editor/UniversalProjectAssert.cs +++ b/Tests/SRPTests/Packages/com.unity.testing.urp/Scripts/Editor/UniversalProjectAssert.cs @@ -59,10 +59,13 @@ public static void AllRenderersPostProcessing(string projectName, bool expectDis var rendererData = AssetDatabase.LoadAssetAtPath(path); Assert.IsNotNull(rendererData, $"Failed to load renderer at path {path}"); + var renderer = new UniversalRenderer(rendererData); + bool rendererHasPostProcessing = renderer.supportedRenderingFeatures.postProcessing; + if (expectDisabled) - Assert.IsNull(rendererData.postProcessData, $"Universal Renderer at path {path} has post processing enabled. {projectName} project should not have renderers with post processing enabled."); + Assert.False(rendererHasPostProcessing, $"Universal Renderer at path {path} has post processing enabled. {projectName} project should not have renderers with post processing enabled."); else - Assert.IsNotNull(rendererData.postProcessData, $"Universal Renderer at path {path} has post processing disabled. {projectName} project must have post processing enabled."); + Assert.True(rendererHasPostProcessing, $"Universal Renderer at path {path} has post processing disabled. {projectName} project must have post processing enabled."); } } diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/030_RenderPass2D/030_InjectionRenderPass2D.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/030_RenderPass2D/030_InjectionRenderPass2D.asset index 9ee6dd6ba87..27e50be62ed 100644 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/030_RenderPass2D/030_InjectionRenderPass2D.asset +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/030_RenderPass2D/030_InjectionRenderPass2D.asset @@ -1,20 +1,5 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!114 &-4730295787603024334 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ca7c3d2ecbc6d7b4c917e1e525696db0, type: 3} - m_Name: CustomRendererFeature2D - m_EditorClassIdentifier: Universal2DGraphicsTests::UnityEngine.Rendering.Universal.CustomRendererFeature2D - m_Active: 1 - injectionPoint2D: 0 - sortingLayerID: 0 --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 @@ -41,10 +26,8 @@ MonoBehaviour: probeSamplingDebugMesh: {fileID: 0} probeSamplingDebugTexture: {fileID: 0} probeVolumeBlendStatesCS: {fileID: 0} - m_RendererFeatures: - - {fileID: -4730295787603024334} - m_RendererFeatureMap: 322665190b9d5abe - m_UseNativeRenderPass: 0 + m_RendererFeatures: [] + m_RendererFeatureMap: m_LayerMask: serializedVersion: 2 m_Bits: 4294967295 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/CommonAssets/URPAssets/DefaultURPAsset.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/CommonAssets/URPAssets/DefaultURPAsset.asset index b5652987e9a..90534f1b3d4 100644 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/CommonAssets/URPAssets/DefaultURPAsset.asset +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/CommonAssets/URPAssets/DefaultURPAsset.asset @@ -28,6 +28,8 @@ MonoBehaviour: - {fileID: 11400000, guid: b523d3860846cdc4ea49a3ed7350a089, type: 2} - {fileID: 11400000, guid: 7057bd5734ab81a4b94ecd8a281d9594, type: 2} - {fileID: 11400000, guid: 7c7a4f27be43bd847a58021195aeadb0, type: 2} + - {fileID: 11400000, guid: b347de46caf7551439f5930790d3c0f6, type: 2} + - {fileID: 11400000, guid: 2724f69ce5c29884cbddc10513ecb4ab, type: 2} m_DefaultRendererIndex: 0 m_RequireDepthTexture: 1 m_RequireOpaqueTexture: 1 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing.meta new file mode 100644 index 00000000000..101d481f943 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cc6541b33ee3b9e409f22de3e7f27195 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing.unity new file mode 100644 index 00000000000..d6dca4352d4 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing.unity @@ -0,0 +1,476 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &255570693 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 255570695} + - component: {fileID: 255570694} + m_Layer: 0 + m_Name: Post Processing + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &255570694 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 255570693} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: cec4d7e190459584baf14e5061542f70, type: 2} +--- !u!4 &255570695 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 255570693} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &896969948 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 896969951} + - component: {fileID: 896969950} + - component: {fileID: 896969949} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &896969949 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 896969948} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: f94f15321e4f4694ca37e1ec7fdec634, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &896969950 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 896969948} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &896969951 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 896969948} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 2, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &995503095 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 995503097} + - component: {fileID: 995503096} + m_Layer: 0 + m_Name: SelectQualityLevel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &995503096 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 995503095} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f1decc188d2f3146ab93291a5c743e9, type: 3} + m_Name: + m_EditorClassIdentifier: + qualityLevelIndex: 0 + callbacks: [] +--- !u!4 &995503097 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 995503095} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1437903304 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1437903308} + - component: {fileID: 1437903307} + - component: {fileID: 1437903306} + - component: {fileID: 1437903305} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1437903305 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437903304} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73231aa468d81ea49bc3d914080de185, type: 3} + m_Name: + m_EditorClassIdentifier: + ImageComparisonSettings: + TargetWidth: 512 + TargetHeight: 256 + TargetMSAASamples: 1 + PerPixelCorrectnessThreshold: 0.005 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 + RMSEThreshold: 0 + AverageCorrectnessThreshold: 0.001 + IncorrectPixelsThreshold: 0.0000038146973 + UseHDR: 0 + UseBackBuffer: 0 + ImageResolution: 0 + ActiveImageTests: 1 + ActivePixelTests: 7 + WaitFrames: 0 + XRCompatible: 1 + gpuDrivenCompatible: 1 + CheckMemoryAllocation: 1 + renderBackendCompatibility: 2 + SetBackBufferResolution: 0 +--- !u!114 &1437903306 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437903304} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: 11 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 1 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!20 &1437903307 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437903304} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 110 + orthographic: 1 + orthographic size: 0.5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1437903308 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437903304} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 995503097} + - {fileID: 1437903308} + - {fileID: 255570695} + - {fileID: 896969951} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing.unity.meta new file mode 100644 index 00000000000..1ef7a427bdc --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bff692600f71ecc489e86ce510fd6416 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/FallbackPPRenderer.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/FallbackPPRenderer.asset new file mode 100644 index 00000000000..279989e7810 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/FallbackPPRenderer.asset @@ -0,0 +1,73 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-44822978018306977 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e2fb6109d22997344ab15423c6b63b45, type: 3} + m_Name: OnTilePostProcessFeature + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::OnTilePostProcessFeature + m_Active: 1 + m_PostProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} + m_Name: FallbackPPRenderer + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalRendererData + debugShaders: + debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, + type: 3} + hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} + probeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, + type: 3} + probeVolumeResources: + probeVolumeDebugShader: {fileID: 0} + probeVolumeFragmentationDebugShader: {fileID: 0} + probeVolumeOffsetDebugShader: {fileID: 0} + probeVolumeSamplingDebugShader: {fileID: 0} + probeSamplingDebugMesh: {fileID: 0} + probeSamplingDebugTexture: {fileID: 0} + probeVolumeBlendStatesCS: {fileID: 0} + m_RendererFeatures: + - {fileID: -44822978018306977} + m_RendererFeatureMap: 5f94712dbdc160ff + xrSystemData: {fileID: 0} + postProcessData: {fileID: 0} + m_AssetVersion: 3 + m_PrepassLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_OpaqueLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_TransparentLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_DefaultStencilState: + overrideStencilState: 0 + stencilReference: 0 + stencilCompareFunction: 8 + passOperation: 2 + failOperation: 0 + zFailOperation: 0 + m_ShadowTransparentReceive: 1 + m_RenderingMode: 0 + m_DepthPrimingMode: 0 + m_CopyDepthMode: 1 + m_DepthAttachmentFormat: 0 + m_DepthTextureFormat: 0 + m_AccurateGbufferNormals: 0 + m_IntermediateTextureMode: 0 + m_OnTileValidation: 0 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/FallbackPPRenderer.asset.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/FallbackPPRenderer.asset.meta new file mode 100644 index 00000000000..d6674e9afdd --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/FallbackPPRenderer.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2724f69ce5c29884cbddc10513ecb4ab +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/OnTileRenderer.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/OnTileRenderer.asset new file mode 100644 index 00000000000..361c9a56371 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/OnTileRenderer.asset @@ -0,0 +1,73 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-44822978018306977 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e2fb6109d22997344ab15423c6b63b45, type: 3} + m_Name: OnTilePostProcessFeature + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::OnTilePostProcessFeature + m_Active: 1 + m_PostProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} + m_Name: OnTileRenderer + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalRendererData + debugShaders: + debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, + type: 3} + hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} + probeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, + type: 3} + probeVolumeResources: + probeVolumeDebugShader: {fileID: 0} + probeVolumeFragmentationDebugShader: {fileID: 0} + probeVolumeOffsetDebugShader: {fileID: 0} + probeVolumeSamplingDebugShader: {fileID: 0} + probeSamplingDebugMesh: {fileID: 0} + probeSamplingDebugTexture: {fileID: 0} + probeVolumeBlendStatesCS: {fileID: 0} + m_RendererFeatures: + - {fileID: -44822978018306977} + m_RendererFeatureMap: 5f94712dbdc160ff + xrSystemData: {fileID: 0} + postProcessData: {fileID: 0} + m_AssetVersion: 3 + m_PrepassLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_OpaqueLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_TransparentLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_DefaultStencilState: + overrideStencilState: 0 + stencilReference: 0 + stencilCompareFunction: 8 + passOperation: 2 + failOperation: 0 + zFailOperation: 0 + m_ShadowTransparentReceive: 1 + m_RenderingMode: 0 + m_DepthPrimingMode: 0 + m_CopyDepthMode: 1 + m_DepthAttachmentFormat: 0 + m_DepthTextureFormat: 0 + m_AccurateGbufferNormals: 0 + m_IntermediateTextureMode: 0 + m_OnTileValidation: 1 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/OnTileRenderer.asset.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/OnTileRenderer.asset.meta new file mode 100644 index 00000000000..2f064ed60d3 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/OnTileRenderer.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b347de46caf7551439f5930790d3c0f6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/Post Processing Profile.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/Post Processing Profile.asset new file mode 100644 index 00000000000..85f5990f6ff --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/Post Processing Profile.asset @@ -0,0 +1,176 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6062710479559865779 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2c1be1b6c95cd2e41b27903b9270817f, type: 3} + m_Name: Vignette + m_EditorClassIdentifier: + active: 1 + m_AdvancedMode: 0 + mode: + m_OverrideState: 1 + m_Value: 0 + color: + m_OverrideState: 1 + m_Value: {r: 0, g: 0.08608448, b: 0.1509434, a: 1} + hdr: 0 + showAlpha: 0 + showEyeDropper: 1 + center: + m_OverrideState: 1 + m_Value: {x: 0.25, y: 0.4} + intensity: + m_OverrideState: 1 + m_Value: 0.7 + min: 0 + max: 1 + smoothness: + m_OverrideState: 1 + m_Value: 0.5 + min: 0.01 + max: 1 + roundness: + m_OverrideState: 1 + m_Value: 0.3 + min: 0 + max: 1 + rounded: + m_OverrideState: 1 + m_Value: 1 + mask: + m_OverrideState: 1 + m_Value: {fileID: 0} + opacity: + m_OverrideState: 1 + m_Value: 1 + min: 0 + max: 1 +--- !u!114 &-5364752897696196534 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3} + m_Name: Bloom + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.Bloom + active: 1 + skipIterations: + m_OverrideState: 0 + m_Value: 1 + threshold: + m_OverrideState: 1 + m_Value: 0.12 + intensity: + m_OverrideState: 1 + m_Value: 9.26 + scatter: + m_OverrideState: 0 + m_Value: 0.7 + clamp: + m_OverrideState: 0 + m_Value: 65472 + tint: + m_OverrideState: 1 + m_Value: {r: 0.13056093, g: 1, b: 0, a: 1} + highQualityFiltering: + m_OverrideState: 0 + m_Value: 0 + filter: + m_OverrideState: 0 + m_Value: 0 + downscale: + m_OverrideState: 0 + m_Value: 0 + maxIterations: + m_OverrideState: 0 + m_Value: 6 + dirtTexture: + m_OverrideState: 0 + m_Value: {fileID: 0} + dimension: 1 + dirtIntensity: + m_OverrideState: 0 + m_Value: 0 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: Post Processing Profile + m_EditorClassIdentifier: + components: + - {fileID: 4090881633848819103} + - {fileID: 416735121661863312} + - {fileID: -5364752897696196534} +--- !u!114 &416735121661863312 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f335fb1ffd8684294ad653bf1c7564, type: 3} + m_Name: ColorAdjustments + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ColorAdjustments + active: 1 + postExposure: + m_OverrideState: 0 + m_Value: 0 + contrast: + m_OverrideState: 0 + m_Value: 0 + colorFilter: + m_OverrideState: 1 + m_Value: {r: 0.9559748, g: 0.30303732, b: 0, a: 1} + hueShift: + m_OverrideState: 0 + m_Value: 0 + saturation: + m_OverrideState: 0 + m_Value: 0 +--- !u!114 &4090881633848819103 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 899c54efeace73346a0a16faa3afe726, type: 3} + m_Name: Vignette + m_EditorClassIdentifier: + active: 1 + color: + m_OverrideState: 1 + m_Value: {r: 0, g: 0, b: 0, a: 1} + center: + m_OverrideState: 1 + m_Value: {x: 0.65, y: 0.5} + intensity: + m_OverrideState: 1 + m_Value: 0.4 + smoothness: + m_OverrideState: 1 + m_Value: 0.5 + rounded: + m_OverrideState: 1 + m_Value: 1 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/Post Processing Profile.asset.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/Post Processing Profile.asset.meta new file mode 100644 index 00000000000..3ac13cdbe56 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/Post Processing Profile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cec4d7e190459584baf14e5061542f70 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/README.txt b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/README.txt new file mode 100644 index 00000000000..552da0720db --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/README.txt @@ -0,0 +1,7 @@ +The Bloom volume override is explictly added as a safety. +When somehow the wrong renderer would be used, one that +uses the regular post processing, instead of the on-tile +post processing, bloom will show up in the ref image and +fail the test. We assume here bloom has no effect in the +On-Tile PP. Once that would be true, then this might need +to be configured differently. diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/README.txt.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/README.txt.meta new file mode 100644 index 00000000000..1fed78c506c --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/381_OnTilePostProcessing/README.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ad776b47c5a91294bbba1501e68e4705 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/382_OnTilePostProcessingFallback.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/382_OnTilePostProcessingFallback.unity new file mode 100644 index 00000000000..221fd5488df --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/382_OnTilePostProcessingFallback.unity @@ -0,0 +1,475 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &255570693 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 255570695} + - component: {fileID: 255570694} + m_Layer: 0 + m_Name: Post Processing + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &255570694 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 255570693} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: cec4d7e190459584baf14e5061542f70, type: 2} +--- !u!4 &255570695 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 255570693} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &896969948 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 896969951} + - component: {fileID: 896969950} + - component: {fileID: 896969949} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &896969949 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 896969948} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: f94f15321e4f4694ca37e1ec7fdec634, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &896969950 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 896969948} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &896969951 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 896969948} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 2, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &995503095 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 995503097} + - component: {fileID: 995503096} + m_Layer: 0 + m_Name: SelectQualityLevel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &995503096 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 995503095} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f1decc188d2f3146ab93291a5c743e9, type: 3} + m_Name: + m_EditorClassIdentifier: + qualityLevelIndex: 0 + callbacks: [] +--- !u!4 &995503097 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 995503095} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1437903304 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1437903308} + - component: {fileID: 1437903307} + - component: {fileID: 1437903306} + - component: {fileID: 1437903305} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1437903305 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437903304} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73231aa468d81ea49bc3d914080de185, type: 3} + m_Name: + m_EditorClassIdentifier: + ImageComparisonSettings: + TargetWidth: 512 + TargetHeight: 256 + TargetMSAASamples: 1 + PerPixelCorrectnessThreshold: 0.005 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 + RMSEThreshold: 0 + AverageCorrectnessThreshold: 0.001 + IncorrectPixelsThreshold: 0.0000038146973 + UseHDR: 0 + UseBackBuffer: 0 + ActiveImageTests: 1 + ActivePixelTests: 7 + WaitFrames: 0 + XRCompatible: 1 + gpuDrivenCompatible: 1 + CheckMemoryAllocation: 1 + renderBackendCompatibility: 2 + SetBackBufferResolution: 0 +--- !u!114 &1437903306 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437903304} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: 12 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 1 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!20 &1437903307 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437903304} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 110 + orthographic: 1 + orthographic size: 0.5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1437903308 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437903304} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 995503097} + - {fileID: 1437903308} + - {fileID: 255570695} + - {fileID: 896969951} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/382_OnTilePostProcessingFallback.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/382_OnTilePostProcessingFallback.unity.meta new file mode 100644 index 00000000000..c3131655692 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Scenes/382_OnTilePostProcessingFallback.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2120892f9c5a08a489c024856f11fbe7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From 80dcfdf2edebca7a1c45c9ebc05b866cb8916f96 Mon Sep 17 00:00:00 2001 From: Roland Kindermann Date: Fri, 27 Feb 2026 16:58:23 +0000 Subject: [PATCH 12/95] =?UTF-8?q?Disabling=20Render=20Pipeline=20Converter?= =?UTF-8?q?=20menu=20item=20when=20no=20Render=20Pipeline=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Window/RenderPipelineConvertersEditor.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConvertersEditor.cs b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConvertersEditor.cs index d457e54e824..382aec1187a 100644 --- a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConvertersEditor.cs +++ b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConvertersEditor.cs @@ -82,7 +82,16 @@ public static void ShowWindow() [MenuItem("Window/Rendering/Render Pipeline Converter", true, 50)] public static bool CanShowWindow() { - return !EditorApplication.isPlaying; + if (EditorApplication.isPlaying) + return false; + + foreach (var converterType in TypeCache.GetTypesDerivedFrom()) + { + if (!converterType.IsAbstract && !converterType.IsInterface) + return true; + } + + return false; } internal static void DontSaveToLayout(EditorWindow wnd) From e8632a4429968151a0b1b354326bf5b96b957d8d Mon Sep 17 00:00:00 2001 From: Yvain Raeymaekers Date: Fri, 27 Feb 2026 16:58:25 +0000 Subject: [PATCH 13/95] [GFXLIGHT-2048] Surface Cache GI: fix artifacts with transparent objects --- .../ShaderGraph/Includes/PBRForwardPass.hlsl | 2 +- .../ShaderGraph/Includes/PBRGBufferPass.hlsl | 2 +- .../ShaderGraph/Includes/ShaderPassDecal.hlsl | 2 +- .../ShaderLibrary/GlobalIllumination.hlsl | 18 +++++++++++------- .../Shaders/LitForwardPass.hlsl | 2 +- .../Shaders/LitGBufferPass.hlsl | 2 +- .../Shaders/SimpleLitForwardPass.hlsl | 2 +- .../Shaders/SimpleLitGBufferPass.hlsl | 2 +- .../Terrain/TerrainDetailLitPasses.hlsl | 2 +- .../Shaders/Terrain/TerrainLitPasses.hlsl | 2 +- .../Shaders/Terrain/WavingGrassPasses.hlsl | 2 +- 11 files changed, 21 insertions(+), 17 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRForwardPass.hlsl b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRForwardPass.hlsl index 0acd9e96da6..f205c9f2d84 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRForwardPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRForwardPass.hlsl @@ -58,7 +58,7 @@ void InitializeInputData(Varyings input, SurfaceDescription surfaceDescription, void InitializeBakedGIData(Varyings input, inout InputData inputData) { #if defined(_SCREEN_SPACE_IRRADIANCE) - inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy); + inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy, inputData.normalWS); #elif defined(DYNAMICLIGHTMAP_ON) inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.dynamicLightmapUV.xy, input.sh, inputData.normalWS); inputData.shadowMask = SAMPLE_SHADOWMASK(input.staticLightmapUV); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRGBufferPass.hlsl b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRGBufferPass.hlsl index 22247357d87..f0169f4ef20 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRGBufferPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRGBufferPass.hlsl @@ -54,7 +54,7 @@ void InitializeInputData(Varyings input, SurfaceDescription surfaceDescription, void InitializeBakedGIData(Varyings input, inout InputData inputData) { #if defined(_SCREEN_SPACE_IRRADIANCE) - inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy); + inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy, inputData.normalWS); #elif defined(DYNAMICLIGHTMAP_ON) inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.dynamicLightmapUV.xy, input.sh, inputData.normalWS); inputData.shadowMask = SAMPLE_SHADOWMASK(input.staticLightmapUV); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPassDecal.hlsl b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPassDecal.hlsl index c1f3e090c13..73b59f438db 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPassDecal.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPassDecal.hlsl @@ -88,7 +88,7 @@ void InitializeInputData(Varyings input, float3 positionWS, half3 normalWS, half #endif #if defined(_SCREEN_SPACE_IRRADIANCE) - inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy); + inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy, normalWS); #elif defined(VARYINGS_NEED_DYNAMIC_LIGHTMAP_UV) && defined(DYNAMICLIGHTMAP_ON) inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.dynamicLightmapUV.xy, half3(input.sh), normalWS); #if defined(VARYINGS_NEED_STATIC_LIGHTMAP_UV) diff --git a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl index dddcf60e29c..086680f4c94 100644 --- a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl +++ b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl @@ -207,7 +207,11 @@ half3 SampleLightmap(float2 staticLightmapUV, half3 normalWS) } #if defined(_SCREEN_SPACE_IRRADIANCE) -#define SAMPLE_GI(irradianceTex, pos) SampleScreenSpaceGI(pos) + #if !defined(_SURFACE_TYPE_TRANSPARENT) + #define SAMPLE_GI(irradianceTex, pos, normal) SampleScreenSpaceGI(pos) + #else + #define SAMPLE_GI(irradianceTex, pos, normal) EvaluateAmbientProbe(normal) + #endif #elif defined(LIGHTMAP_ON) && defined(DYNAMICLIGHTMAP_ON) #define SAMPLE_GI(staticLmName, dynamicLmName, shName, normalWSName) SampleLightmap(staticLmName, dynamicLmName, normalWSName) #elif defined(DYNAMICLIGHTMAP_ON) @@ -215,11 +219,11 @@ half3 SampleLightmap(float2 staticLightmapUV, half3 normalWS) #elif defined(LIGHTMAP_ON) #define SAMPLE_GI(staticLmName, shName, normalWSName) SampleLightmap(staticLmName, 0, normalWSName) #elif defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2) -#ifdef USE_APV_PROBE_OCCLUSION - #define SAMPLE_GI(shName, absolutePositionWS, normalWS, viewDir, positionSS, vertexProbeOcclusion, probeOcclusion) SampleProbeVolumePixel(shName, absolutePositionWS, normalWS, viewDir, positionSS, vertexProbeOcclusion, probeOcclusion) -#else - #define SAMPLE_GI(shName, absolutePositionWS, normalWS, viewDir, positionSS, vertexProbeOcclusion, probeOcclusion) SampleProbeVolumePixel(shName, absolutePositionWS, normalWS, viewDir, positionSS) -#endif + #ifdef USE_APV_PROBE_OCCLUSION + #define SAMPLE_GI(shName, absolutePositionWS, normalWS, viewDir, positionSS, vertexProbeOcclusion, probeOcclusion) SampleProbeVolumePixel(shName, absolutePositionWS, normalWS, viewDir, positionSS, vertexProbeOcclusion, probeOcclusion) + #else + #define SAMPLE_GI(shName, absolutePositionWS, normalWS, viewDir, positionSS, vertexProbeOcclusion, probeOcclusion) SampleProbeVolumePixel(shName, absolutePositionWS, normalWS, viewDir, positionSS) + #endif #else #define SAMPLE_GI(staticLmName, shName, normalWSName) SampleSHPixel(shName, normalWSName) #endif @@ -372,7 +376,7 @@ half3 CalculateIrradianceFromReflectionProbes(half3 reflectVector, float3 positi if (weightProbe0 > 0.01f) { half3 reflectVector0 = reflectVector; - if (_REFLECTION_PROBE_BOX_PROJECTION) + if (_REFLECTION_PROBE_BOX_PROJECTION) { #if defined(REFLECTION_PROBE_ROTATION) reflectVector0 = BoxProjectedCubemapDirection(unity_SpecCube0_Rotation, reflectVector, rotPosWS0, unity_SpecCube0_ProbePosition, unity_SpecCube0_BoxMin, unity_SpecCube0_BoxMax); diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/LitForwardPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/LitForwardPass.hlsl index b6162a6ea6a..57e17c3f09a 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/LitForwardPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/LitForwardPass.hlsl @@ -145,7 +145,7 @@ void InitializeInputData(Varyings input, half3 normalTS, out InputData inputData void InitializeBakedGIData(Varyings input, inout InputData inputData) { #if defined(_SCREEN_SPACE_IRRADIANCE) - inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy); + inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy, inputData.normalWS); #elif defined(DYNAMICLIGHTMAP_ON) inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.dynamicLightmapUV, input.vertexSH, inputData.normalWS); inputData.shadowMask = SAMPLE_SHADOWMASK(input.staticLightmapUV); diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/LitGBufferPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/LitGBufferPass.hlsl index 9d88a219c3d..707f7836437 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/LitGBufferPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/LitGBufferPass.hlsl @@ -113,7 +113,7 @@ void InitializeInputData(Varyings input, half3 normalTS, out InputData inputData void InitializeBakedGIData(Varyings input, inout InputData inputData) { #if defined(_SCREEN_SPACE_IRRADIANCE) - inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy); + inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy, inputData.normalWS); #elif defined(DYNAMICLIGHTMAP_ON) inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.dynamicLightmapUV, input.vertexSH, inputData.normalWS); inputData.shadowMask = SAMPLE_SHADOWMASK(input.staticLightmapUV); diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitForwardPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitForwardPass.hlsl index 7a5f4dbc516..6890659ef65 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitForwardPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitForwardPass.hlsl @@ -115,7 +115,7 @@ void InitializeInputData(Varyings input, half3 normalTS, out InputData inputData void InitializeBakedGIData(Varyings input, inout InputData inputData) { #if defined(_SCREEN_SPACE_IRRADIANCE) - inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy); + inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy, inputData.normalWS); #elif defined(DYNAMICLIGHTMAP_ON) inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.dynamicLightmapUV, input.vertexSH, inputData.normalWS); inputData.shadowMask = SAMPLE_SHADOWMASK(input.staticLightmapUV); diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitGBufferPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitGBufferPass.hlsl index f689b5dfc0b..bee516caf19 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitGBufferPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitGBufferPass.hlsl @@ -111,7 +111,7 @@ void InitializeInputData(Varyings input, half3 normalTS, out InputData inputData void InitializeBakedGIData(Varyings input, inout InputData inputData) { #if defined(_SCREEN_SPACE_IRRADIANCE) - inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy); + inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, input.positionCS.xy, inputData.normalWS); #elif defined(DYNAMICLIGHTMAP_ON) inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.dynamicLightmapUV, input.vertexSH, inputData.normalWS); inputData.shadowMask = SAMPLE_SHADOWMASK(input.staticLightmapUV); diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainDetailLitPasses.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainDetailLitPasses.hlsl index 06e7fddb117..808623bdc5d 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainDetailLitPasses.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainDetailLitPasses.hlsl @@ -56,7 +56,7 @@ void InitializeInputData(Varyings input, out InputData inputData) inputData.positionWS = input.PositionWS; #if defined(_SCREEN_SPACE_IRRADIANCE) - inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, inputData.positionCS.xy); + inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, inputData.positionCS.xy, input.NormalWS.xyz); #elif !defined(LIGHTMAP_ON) && (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) inputData.bakedGI = SAMPLE_GI(input.vertexSH, GetAbsolutePositionWS(inputData.positionWS), diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitPasses.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitPasses.hlsl index 5f0bd4a1cb4..f0a4cc34558 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitPasses.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitPasses.hlsl @@ -124,7 +124,7 @@ void InitializeBakedGIData(Varyings IN, inout InputData inputData) #endif #if defined(_SCREEN_SPACE_IRRADIANCE) - inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, inputData.positionCS.xy); + inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, inputData.positionCS.xy, inputData.normalWS); #elif defined(DYNAMICLIGHTMAP_ON) inputData.bakedGI = SAMPLE_GI(IN.uvMainAndLM.zw, IN.dynamicLightmapUV, SH, inputData.normalWS); inputData.shadowMask = SAMPLE_SHADOWMASK(IN.uvMainAndLM.zw); diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassPasses.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassPasses.hlsl index faf772d6527..1256d7cb2b1 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassPasses.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassPasses.hlsl @@ -77,7 +77,7 @@ void InitializeInputData(GrassVertexOutput input, out InputData inputData) inputData.vertexLighting = input.fogFactorAndVertexLight.yzw; #if defined(_SCREEN_SPACE_IRRADIANCE) - inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, inputData.positionCS.xy); + inputData.bakedGI = SAMPLE_GI(_ScreenSpaceIrradiance, inputData.positionCS.xy, inputData.normalWS); #elif defined(DYNAMICLIGHTMAP_ON) inputData.bakedGI = SAMPLE_GI(input.lightmapUV, NOT_USED, input.vertexSH, inputData.normalWS); inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUV); From db88be40cdce90533d81cd5685f96651eafe168f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20L=C3=A9t=C3=A9?= Date: Fri, 27 Feb 2026 20:46:53 +0000 Subject: [PATCH 14/95] removing awakefromload sorting --- .../TestRunner/HDRP_GraphicTestRunner.cs | 85 ++++++++++++++----- .../Scenes/009-SG-FullScreenTarget.unity | 4 +- .../Scenes/1x_Materials/1806_BatchCount.unity | 4 +- .../2x_Lighting/2211_Probes_Specular.unity | 2 +- .../3x_DebugView/3003_LightingMode.unity | 2 +- ..._PhysicalCamera-iso-aperture-shutter.unity | 24 +++--- ...1_PhysicalCamera-Aperture-bladeCount.unity | 6 +- ...72_PhysicalCamera-Aperture-curvature.unity | 6 +- ...ysicalCamera-Aperture-barrelClipping.unity | 6 +- ..._PhysicalCamera-Aperture-anamorphism.unity | 8 +- .../4075_PhysicalCamera-gateFit.unity | 10 +-- .../4076_PhysicalCamera-lensShift.unity | 10 +-- .../8207_InstanceIDWithKeywords.unity | 2 +- .../8x_ShaderGraph/8207_Instancing.unity | 2 +- .../8x_ShaderGraph/8207_InstancingAPIs.unity | 2 +- .../8207_InstancingMaterials.unity | 2 +- .../9305_MotionVectors_SpeedTree.unity | 4 + ...9305_MotionVectors_SpeedTree_Terrain.unity | 4 + .../Scenes/9x_Other/9901_AOV_buffers.unity | 2 +- .../Scenes/9x_Other/9902_AOV_buffers2.unity | 10 +-- .../Scenes/9x_Other/9910_GlobalMipBias.unity | 50 +++-------- .../9x_Other/9960-RPCRenderRequest.unity | 2 +- 22 files changed, 134 insertions(+), 113 deletions(-) diff --git a/Tests/SRPTests/Packages/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs b/Tests/SRPTests/Packages/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs index ab1ccdccaaa..efbe1c5f7f9 100644 --- a/Tests/SRPTests/Packages/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs +++ b/Tests/SRPTests/Packages/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs @@ -9,6 +9,7 @@ using UnityEngine.SceneManagement; using System.Linq; using UnityEngine.VFX; +using Object = UnityEngine.Object; public class HDRP_GraphicTestRunner { @@ -31,6 +32,59 @@ private static bool GPUResidentDrawerRequested() return false; } + static Camera FindMainCamera() + { + { + var cameras = GameObject.FindGameObjectsWithTag("MainCamera"); + Assert.LessOrEqual(cameras.Length, 1, "Multiple cameras found with tag 'MainCamera'."); + if (cameras.Length > 0) return cameras[0].GetComponent(); + } + + { + var cameras = Object.FindObjectsByType(); + Assert.LessOrEqual(cameras.Length, 1, "No camera found with tag 'MainCamera', and multiple cameras found without it."); + if (cameras.Length > 0) return cameras[0].GetComponent(); + } + + Assert.Fail("Missing camera for graphic tests."); + return null; + } + + static HDRP_TestSettings FindHDRPTestSettings() + { + var settings = Object.FindObjectsByType(); + Assert.AreEqual(1, settings.Length, "Multiple HDRP_TestSettings found."); + return settings[0]; + } + + static void VERYSLOW_SortByHierarchyPath(T[] objects) where T : Component + { + // This weird little function is used to put the objects in the order they show up + // in the scene hierarchy. Which is something that cannot be inferred from their IDs. + // Unfortunately a lot of tests rely on this. This approach is really slow but the + // test scenes are quite small. + + string GetHierarchySiblingPath(Transform t) + { + if (t.parent == null) + return t.GetSiblingIndex().ToString("D8"); + return GetHierarchySiblingPath(t.parent) + "/" + t.GetSiblingIndex().ToString("D8"); + } + + var objectAndPath = new (T obj, string path)[objects.Length]; + for (int i = 0; i < objects.Length; ++i) + { + objectAndPath[i] = (objects[i], GetHierarchySiblingPath(objects[i].transform)); + } + + Array.Sort(objectAndPath, (a, b) => a.path.CompareTo(b.path)); + + for (int i = 0; i < objects.Length; ++i) + { + objects[i] = objectAndPath[i].obj; + } + } + public static IEnumerator Run(SceneGraphicsTestCase testCase) { HDRP_TestSettings settings = null; @@ -55,13 +109,8 @@ public static IEnumerator Run(SceneGraphicsTestCase testCase) for (int i = 0; i < 5; ++i) yield return new WaitForEndOfFrame(); - settings = GameObject.FindAnyObjectByType(); - camera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent(); - if (camera == null) camera = GameObject.FindAnyObjectByType(); - if (camera == null) - { - Assert.Fail("Missing camera for graphic tests."); - } + settings = FindHDRPTestSettings(); + camera = FindMainCamera(); if (!settings.gpuDrivenCompatible && GPUResidentDrawerRequested()) Assert.Ignore("Test scene is not compatible with GPU Driven and and will be skipped."); @@ -103,21 +152,15 @@ public static IEnumerator Run(SceneGraphicsTestCase testCase) yield return new WaitForEndOfFrame(); // Need to retrieve objects again after scene reload. - settings = GameObject.FindAnyObjectByType(); - camera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent(); - if (camera == null) camera = GameObject.FindAnyObjectByType(); - if (camera == null) - { - Assert.Fail("Missing camera for graphic tests."); - } + settings = FindHDRPTestSettings(); + camera = FindMainCamera(); // Grab the HDCamera HDCamera hdCamera = HDCamera.GetOrCreate(camera); //We need to get all the cameras to set accumulation in all of them for tests that uses multiple cameras -#pragma warning disable CS0618 // Type or member is obsolete - cameras = GameObject.FindObjectsByType(FindObjectsSortMode.InstanceID); -#pragma warning restore CS0618 // Type or member is obsolete + cameras = Object.FindObjectsByType(); + VERYSLOW_SortByHierarchyPath(cameras); //Grab the HDCameras hdCameras = new HDCamera[cameras.Length]; @@ -160,11 +203,9 @@ public static IEnumerator Run(SceneGraphicsTestCase testCase) settings.ImageComparisonSettings.PerPixelCorrectnessThreshold *= settings.xrThresholdMultiplier; // Increase number of volumetric slices to compensate for initial half-resolution due to XR single-pass optimization -#pragma warning disable CS0618 // Type or member is obsolete - foreach (var volume in GameObject.FindObjectsByType(FindObjectsSortMode.InstanceID)) -#pragma warning restore CS0618 // Type or member is obsolete + foreach (var volume in Object.FindObjectsByType()) { - if (volume.profile.TryGet(out Fog fog)) + if (volume.profile.TryGet(out Fog fog)) fog.volumeSliceCount.value *= 2; } } @@ -220,7 +261,7 @@ public static IEnumerator Run(SceneGraphicsTestCase testCase) for (int i = 0; i < waitFrames; ++i) yield return new WaitForEndOfFrame(); - var settingsSG = (GameObject.FindAnyObjectByType() as HDRP_ShaderGraph_TestSettings); + var settingsSG = settings as HDRP_ShaderGraph_TestSettings; if (settingsSG == null || !settingsSG.compareSGtoBI) { // Standard Test diff --git a/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Scenes/009-SG-FullScreenTarget.unity b/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Scenes/009-SG-FullScreenTarget.unity index 5b1b87711a8..6e24b8d6e41 100644 --- a/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Scenes/009-SG-FullScreenTarget.unity +++ b/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Scenes/009-SG-FullScreenTarget.unity @@ -1602,7 +1602,7 @@ GameObject: - component: {fileID: 1297650282} m_Layer: 0 m_Name: Camera_CustomPass_SampleBuffers - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -2827,7 +2827,7 @@ GameObject: - component: {fileID: 2080258769} m_Layer: 0 m_Name: Camera_CustomPostProcess_SampleBuffers - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1806_BatchCount.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1806_BatchCount.unity index df360c6d0b9..c24bd5e74e5 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1806_BatchCount.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1806_BatchCount.unity @@ -4144,7 +4144,7 @@ GameObject: - component: {fileID: 2128869439} m_Layer: 0 m_Name: DeferredCamera - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -4367,7 +4367,7 @@ GameObject: - component: {fileID: 114777191442980008} m_Layer: 0 m_Name: ForwardCamera - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2211_Probes_Specular.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2211_Probes_Specular.unity index 8c8b72be5c4..795be0f36be 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2211_Probes_Specular.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2211_Probes_Specular.unity @@ -354,7 +354,7 @@ GameObject: - component: {fileID: 1395326484} m_Layer: 0 m_Name: Main Camera - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/3x_DebugView/3003_LightingMode.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/3x_DebugView/3003_LightingMode.unity index 5d14801aee0..5aff9212616 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/3x_DebugView/3003_LightingMode.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/3x_DebugView/3003_LightingMode.unity @@ -3342,7 +3342,7 @@ GameObject: - component: {fileID: 1478861849} m_Layer: 0 m_Name: Render Camera - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4070_PhysicalCamera-iso-aperture-shutter.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4070_PhysicalCamera-iso-aperture-shutter.unity index 66966f33fcd..30363961cbf 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4070_PhysicalCamera-iso-aperture-shutter.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4070_PhysicalCamera-iso-aperture-shutter.unity @@ -719,7 +719,7 @@ GameObject: - component: {fileID: 219034148} m_Layer: 0 m_Name: Camera3 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -1090,7 +1090,7 @@ GameObject: - component: {fileID: 298671246} m_Layer: 0 m_Name: Camera4 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -1629,7 +1629,7 @@ GameObject: - component: {fileID: 598190381} m_Layer: 0 m_Name: Camera4 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -1901,7 +1901,7 @@ GameObject: - component: {fileID: 707532090} m_Layer: 0 m_Name: Camera4 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -2090,7 +2090,7 @@ GameObject: - component: {fileID: 727444291} m_Layer: 0 m_Name: Camera2 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -2769,7 +2769,7 @@ GameObject: - component: {fileID: 840047874} m_Layer: 0 m_Name: Camera1 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -3202,7 +3202,7 @@ GameObject: - component: {fileID: 849348813} m_Layer: 0 m_Name: Camera1 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -3785,7 +3785,7 @@ GameObject: - component: {fileID: 1214449688} m_Layer: 0 m_Name: Camera3 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -4207,7 +4207,7 @@ GameObject: - component: {fileID: 1320503530} m_Layer: 0 m_Name: Camera2 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -5073,7 +5073,7 @@ GameObject: - component: {fileID: 1753111754} m_Layer: 0 m_Name: Camera3 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -5262,7 +5262,7 @@ GameObject: - component: {fileID: 1781338326} m_Layer: 0 m_Name: Camera2 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -6679,7 +6679,7 @@ GameObject: - component: {fileID: 2121218950} m_Layer: 0 m_Name: Camera1 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4071_PhysicalCamera-Aperture-bladeCount.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4071_PhysicalCamera-Aperture-bladeCount.unity index 829b5a0844b..f3dec9662b8 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4071_PhysicalCamera-Aperture-bladeCount.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4071_PhysicalCamera-Aperture-bladeCount.unity @@ -1310,7 +1310,7 @@ GameObject: - component: {fileID: 263105405} m_Layer: 0 m_Name: Camera2 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -5118,7 +5118,7 @@ GameObject: - component: {fileID: 1321746300} m_Layer: 0 m_Name: Camera3 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -7780,7 +7780,7 @@ GameObject: - component: {fileID: 2121218950} m_Layer: 0 m_Name: Camera1 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4072_PhysicalCamera-Aperture-curvature.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4072_PhysicalCamera-Aperture-curvature.unity index a547623a09e..14cfb5f6a86 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4072_PhysicalCamera-Aperture-curvature.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4072_PhysicalCamera-Aperture-curvature.unity @@ -1276,7 +1276,7 @@ GameObject: - component: {fileID: 263105405} m_Layer: 0 m_Name: Camera2 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -4894,7 +4894,7 @@ GameObject: - component: {fileID: 1321746300} m_Layer: 0 m_Name: Camera3 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -7780,7 +7780,7 @@ GameObject: - component: {fileID: 2121218950} m_Layer: 0 m_Name: Camera1 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4073_PhysicalCamera-Aperture-barrelClipping.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4073_PhysicalCamera-Aperture-barrelClipping.unity index 9a4a4efb522..ee3e1a1cb29 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4073_PhysicalCamera-Aperture-barrelClipping.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4073_PhysicalCamera-Aperture-barrelClipping.unity @@ -1276,7 +1276,7 @@ GameObject: - component: {fileID: 263105405} m_Layer: 0 m_Name: Camera2 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -4894,7 +4894,7 @@ GameObject: - component: {fileID: 1321746300} m_Layer: 0 m_Name: Camera3 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -7780,7 +7780,7 @@ GameObject: - component: {fileID: 2121218950} m_Layer: 0 m_Name: Camera1 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4074_PhysicalCamera-Aperture-anamorphism.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4074_PhysicalCamera-Aperture-anamorphism.unity index 8e63f8135cd..e264286d9da 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4074_PhysicalCamera-Aperture-anamorphism.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4074_PhysicalCamera-Aperture-anamorphism.unity @@ -1372,7 +1372,7 @@ GameObject: - component: {fileID: 263105405} m_Layer: 0 m_Name: Anamorphism-1 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -4991,7 +4991,7 @@ GameObject: - component: {fileID: 1321746300} m_Layer: 0 m_Name: Anamorphism1 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -6285,7 +6285,7 @@ GameObject: - component: {fileID: 1682211548} m_Layer: 0 m_Name: Anamorphism-0.5 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -8163,7 +8163,7 @@ GameObject: - component: {fileID: 2121218950} m_Layer: 0 m_Name: Anamorphism+0.5 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4075_PhysicalCamera-gateFit.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4075_PhysicalCamera-gateFit.unity index 54b4931ea52..08b5a64f1a2 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4075_PhysicalCamera-gateFit.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4075_PhysicalCamera-gateFit.unity @@ -232,7 +232,7 @@ GameObject: - component: {fileID: 219034148} m_Layer: 0 m_Name: CameraVertical - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -1544,7 +1544,7 @@ GameObject: - component: {fileID: 932603141} m_Layer: 0 m_Name: CameraOverscan - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -1733,7 +1733,7 @@ GameObject: - component: {fileID: 1366777874} m_Layer: 0 m_Name: CameraNone - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -2633,7 +2633,7 @@ GameObject: - component: {fileID: 2005251135} m_Layer: 0 m_Name: CameraHorizontal - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -2853,7 +2853,7 @@ GameObject: - component: {fileID: 2108382484} m_Layer: 0 m_Name: CameraFill - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4076_PhysicalCamera-lensShift.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4076_PhysicalCamera-lensShift.unity index d0d2b036e24..3a4a6595c3c 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4076_PhysicalCamera-lensShift.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4076_PhysicalCamera-lensShift.unity @@ -327,7 +327,7 @@ GameObject: - component: {fileID: 219034148} m_Layer: 0 m_Name: Camera1 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -506,7 +506,7 @@ GameObject: - component: {fileID: 437380980} m_Layer: 0 m_Name: Camera3 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -1506,7 +1506,7 @@ GameObject: - component: {fileID: 1115172523} m_Layer: 0 m_Name: Camera4 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -2197,7 +2197,7 @@ GameObject: - component: {fileID: 1755167540} m_Layer: 0 m_Name: Camera5 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -2694,7 +2694,7 @@ GameObject: - component: {fileID: 2109752274} m_Layer: 0 m_Name: Camera2 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_InstanceIDWithKeywords.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_InstanceIDWithKeywords.unity index 9f668a2f796..a04adf0f6fa 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_InstanceIDWithKeywords.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_InstanceIDWithKeywords.unity @@ -682,7 +682,7 @@ GameObject: - component: {fileID: 693170725} m_Layer: 0 m_Name: Main Camera - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_Instancing.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_Instancing.unity index f4442765c2a..b6a72de8378 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_Instancing.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_Instancing.unity @@ -1844,7 +1844,7 @@ GameObject: - component: {fileID: 693170725} m_Layer: 0 m_Name: Main Camera - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_InstancingAPIs.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_InstancingAPIs.unity index 2da4e7e93d8..24f645c018d 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_InstancingAPIs.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_InstancingAPIs.unity @@ -766,7 +766,7 @@ GameObject: - component: {fileID: 693170725} m_Layer: 0 m_Name: Main Camera - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_InstancingMaterials.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_InstancingMaterials.unity index 404e2b78162..e799958c796 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_InstancingMaterials.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8207_InstancingMaterials.unity @@ -1320,7 +1320,7 @@ GameObject: - component: {fileID: 693170725} m_Layer: 0 m_Name: Main Camera - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9305_MotionVectors_SpeedTree.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9305_MotionVectors_SpeedTree.unity index a0dac30fe67..ef3f3882a0c 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9305_MotionVectors_SpeedTree.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9305_MotionVectors_SpeedTree.unity @@ -1734,6 +1734,10 @@ PrefabInstance: propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} + - target: {fileID: 1132393308280272, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_TagString + value: Untagged + objectReference: {fileID: 0} - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} propertyPath: m_RootOrder value: 6 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9305_MotionVectors_SpeedTree_Terrain.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9305_MotionVectors_SpeedTree_Terrain.unity index 5e6f24a6d99..210767f8721 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9305_MotionVectors_SpeedTree_Terrain.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9305_MotionVectors_SpeedTree_Terrain.unity @@ -434,6 +434,10 @@ PrefabInstance: propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} + - target: {fileID: 1132393308280272, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_TagString + value: Untagged + objectReference: {fileID: 0} - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} propertyPath: m_RootOrder value: 5 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9901_AOV_buffers.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9901_AOV_buffers.unity index 0b057276dc2..df8d90f84e8 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9901_AOV_buffers.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9901_AOV_buffers.unity @@ -2520,7 +2520,7 @@ GameObject: - component: {fileID: 1478861853} m_Layer: 0 m_Name: Render Camera - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9902_AOV_buffers2.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9902_AOV_buffers2.unity index cf4f948923a..75f3dd8608c 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9902_AOV_buffers2.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9902_AOV_buffers2.unity @@ -1655,7 +1655,7 @@ GameObject: - component: {fileID: 881541623} m_Layer: 0 m_Name: Render Fresnel0 - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -2113,7 +2113,7 @@ GameObject: - component: {fileID: 1051300738} m_Layer: 0 m_Name: Render Alpha - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -2815,7 +2815,7 @@ GameObject: - component: {fileID: 1219562933} m_Layer: 0 m_Name: Render WSP - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -3340,7 +3340,7 @@ GameObject: - component: {fileID: 1478861854} m_Layer: 0 m_Name: Render Albedo - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -3782,7 +3782,7 @@ GameObject: - component: {fileID: 1576881642} m_Layer: 0 m_Name: Render CustomPass - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9910_GlobalMipBias.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9910_GlobalMipBias.unity index 94b8b9b54db..787c91e310f 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9910_GlobalMipBias.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9910_GlobalMipBias.unity @@ -841,29 +841,15 @@ PrefabInstance: - target: {fileID: 9156684625621168517, guid: 9dc108d07c97a174aa48fe8f4a6a641d, type: 3} propertyPath: m_Materials.Array.data[0] - value: + value: objectReference: {fileID: 2100000, guid: 82abfb4871a5b8942adf6b029ee89fa3, type: 2} + - target: {fileID: 3565543780733839701, guid: 9dc108d07c97a174aa48fe8f4a6a641d, + type: 3} + propertyPath: MipBias + value: 2.8 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 9dc108d07c97a174aa48fe8f4a6a641d, type: 3} ---- !u!1 &2062117969 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 3855751611528768086, guid: 9dc108d07c97a174aa48fe8f4a6a641d, - type: 3} - m_PrefabInstance: {fileID: 2062117968} - m_PrefabAsset: {fileID: 0} ---- !u!114 &2062117970 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2062117969} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c55790afc56b2e24dadcecb04218a1bf, type: 3} - m_Name: - m_EditorClassIdentifier: - MipBias: 2.8 --- !u!1001 &2084379541 PrefabInstance: m_ObjectHideFlags: 0 @@ -976,24 +962,10 @@ PrefabInstance: propertyPath: m_FontData.m_FontSize value: 10 objectReference: {fileID: 0} + - target: {fileID: 3565543780733839701, guid: 9dc108d07c97a174aa48fe8f4a6a641d, + type: 3} + propertyPath: MipBias + value: 4 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 9dc108d07c97a174aa48fe8f4a6a641d, type: 3} ---- !u!1 &2084379542 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 3855751611528768086, guid: 9dc108d07c97a174aa48fe8f4a6a641d, - type: 3} - m_PrefabInstance: {fileID: 2084379541} - m_PrefabAsset: {fileID: 0} ---- !u!114 &2084379543 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2084379542} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c55790afc56b2e24dadcecb04218a1bf, type: 3} - m_Name: - m_EditorClassIdentifier: - MipBias: 4 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9960-RPCRenderRequest.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9960-RPCRenderRequest.unity index 8fcc0ddf225..b7b650d30b9 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9960-RPCRenderRequest.unity +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9960-RPCRenderRequest.unity @@ -2089,7 +2089,7 @@ GameObject: - component: {fileID: 1609535224} m_Layer: 0 m_Name: RenderRequestCamera - m_TagString: MainCamera + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 From dd5599f8e380c3544ef72f69dc8e34451d2116ea Mon Sep 17 00:00:00 2001 From: Layla Arab Date: Sat, 28 Feb 2026 06:05:12 +0000 Subject: [PATCH 15/95] Lighting Search Column Improvements and Test Improvements --- ...rs.cs => LightingSearchColumnProviders.cs} | 34 +- ... => LightingSearchColumnProviders.cs.meta} | 0 ....uss => LightingSearchColumnProviders.uss} | 0 ...=> LightingSearchColumnProviders.uss.meta} | 0 ...CoreLightingSearchColumnProvidersTests.cs} | 170 ++--- ...ightingSearchColumnProvidersTests.cs.meta} | 0 ....cs => HDLightingSearchColumnProviders.cs} | 95 ++- ...> HDLightingSearchColumnProviders.cs.meta} | 0 ...ss => HDLightingSearchColumnProviders.uss} | 0 ... HDLightingSearchColumnProviders.uss.meta} | 0 .../HDLightingSearchColumnProvidersTests.cs | 598 +++++++++++++++ ...ightingSearchColumnProvidersTests.cs.meta} | 0 .../Editor/HDLightingSearchSelectorsTests.cs | 714 ------------------ 13 files changed, 753 insertions(+), 858 deletions(-) rename Packages/com.unity.render-pipelines.core/Editor/Lighting/{LightingSearchSelectors.cs => LightingSearchColumnProviders.cs} (93%) rename Packages/com.unity.render-pipelines.core/Editor/Lighting/{LightingSearchSelectors.cs.meta => LightingSearchColumnProviders.cs.meta} (100%) rename Packages/com.unity.render-pipelines.core/Editor/StyleSheets/{LightingSearchSelectors.uss => LightingSearchColumnProviders.uss} (100%) rename Packages/com.unity.render-pipelines.core/Editor/StyleSheets/{LightingSearchSelectors.uss.meta => LightingSearchColumnProviders.uss.meta} (100%) rename Packages/com.unity.render-pipelines.core/Tests/Editor/{CoreLightingSearchSelectorsTests.cs => CoreLightingSearchColumnProvidersTests.cs} (56%) rename Packages/com.unity.render-pipelines.core/Tests/Editor/{CoreLightingSearchSelectorsTests.cs.meta => CoreLightingSearchColumnProvidersTests.cs.meta} (100%) rename Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/{HDLightingSearchSelectors.cs => HDLightingSearchColumnProviders.cs} (91%) rename Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/{HDLightingSearchSelectors.cs.meta => HDLightingSearchColumnProviders.cs.meta} (100%) rename Packages/com.unity.render-pipelines.high-definition/Editor/StyleSheets/{HDLightingSearchSelectors.uss => HDLightingSearchColumnProviders.uss} (100%) rename Packages/com.unity.render-pipelines.high-definition/Editor/StyleSheets/{HDLightingSearchSelectors.uss.meta => HDLightingSearchColumnProviders.uss.meta} (100%) create mode 100644 Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDLightingSearchColumnProvidersTests.cs rename Packages/com.unity.render-pipelines.high-definition/Tests/Editor/{HDLightingSearchSelectorsTests.cs.meta => HDLightingSearchColumnProvidersTests.cs.meta} (100%) delete mode 100644 Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDLightingSearchSelectorsTests.cs diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/LightingSearchSelectors.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/LightingSearchColumnProviders.cs similarity index 93% rename from Packages/com.unity.render-pipelines.core/Editor/Lighting/LightingSearchSelectors.cs rename to Packages/com.unity.render-pipelines.core/Editor/Lighting/LightingSearchColumnProviders.cs index bff90e1c5fd..fb5500a16c0 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/LightingSearchSelectors.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/LightingSearchColumnProviders.cs @@ -6,7 +6,7 @@ namespace UnityEditor.Lighting { - static class CoreLightingSearchSelectors + static class CoreLightingSearchColumnProviders { internal const string k_SceneProvider = "scene"; internal const string k_BakingSetPath = "BakingSets/"; @@ -18,8 +18,7 @@ static class CoreLightingSearchSelectors internal const string k_VolumeModePath = k_VolumePath + "Mode"; internal const string k_VolumeProfilePath = k_VolumePath + "Profile"; - const string k_StyleSheetPath = "StyleSheets/LightingSearchSelectors.uss"; - const int k_DefaultSearchSelectorPriority = 99; + const string k_StyleSheetPath = "StyleSheets/LightingSearchColumnProviders.uss"; const int k_MinBakingSamples = 1; const int k_MaxBakingSamples = 8192; static StyleSheet s_StyleSheet; @@ -33,26 +32,6 @@ static StyleSheet LoadStyleSheet() return s_StyleSheet; } - [SearchSelector(k_VolumeModePath, provider: k_SceneProvider, priority: k_DefaultSearchSelectorPriority)] - static object VolumeModeSearchSelector(SearchSelectorArgs args) - { - var go = args.current.ToObject(); - if (go == null) - return null; - - return LightingSearchDataAccessors.GetVolumeMode(go); - } - - [SearchSelector(k_VolumeProfilePath, provider: k_SceneProvider, priority: k_DefaultSearchSelectorPriority)] - static object VolumeProfileSearchSelector(SearchSelectorArgs args) - { - var go = args.current.ToObject(); - if (go == null) - return null; - - return LightingSearchDataAccessors.GetVolumeProfile(go); - } - [SearchColumnProvider(k_BakingModePath)] public static void BakingModeSearchColumnProvider(SearchColumn column) { @@ -396,7 +375,7 @@ internal static void SetLightShape(GameObject go, LightType value) internal static bool IsLightShapeApplicable(LightType lightType) { - return IsAreaLight(lightType); + return lightType is LightType.Rectangle or LightType.Disc; } static bool IsAreaLight(LightType lightType) @@ -407,8 +386,7 @@ static bool IsAreaLight(LightType lightType) enum AreaLightShape { Rectangle = LightType.Rectangle, - Disc = LightType.Disc, - Tube = LightType.Tube + Disc = LightType.Disc } class LightShapeField : EnumField @@ -452,7 +430,9 @@ void UpdateEnumField() { if (IsAreaLight(m_Value)) { - Init((AreaLightShape)m_Value, false); + // Tube is not offered as an option; display as Rectangle + var displayType = m_Value == LightType.Tube ? LightType.Rectangle : m_Value; + Init((AreaLightShape)displayType, false); } } } diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/LightingSearchSelectors.cs.meta b/Packages/com.unity.render-pipelines.core/Editor/Lighting/LightingSearchColumnProviders.cs.meta similarity index 100% rename from Packages/com.unity.render-pipelines.core/Editor/Lighting/LightingSearchSelectors.cs.meta rename to Packages/com.unity.render-pipelines.core/Editor/Lighting/LightingSearchColumnProviders.cs.meta diff --git a/Packages/com.unity.render-pipelines.core/Editor/StyleSheets/LightingSearchSelectors.uss b/Packages/com.unity.render-pipelines.core/Editor/StyleSheets/LightingSearchColumnProviders.uss similarity index 100% rename from Packages/com.unity.render-pipelines.core/Editor/StyleSheets/LightingSearchSelectors.uss rename to Packages/com.unity.render-pipelines.core/Editor/StyleSheets/LightingSearchColumnProviders.uss diff --git a/Packages/com.unity.render-pipelines.core/Editor/StyleSheets/LightingSearchSelectors.uss.meta b/Packages/com.unity.render-pipelines.core/Editor/StyleSheets/LightingSearchColumnProviders.uss.meta similarity index 100% rename from Packages/com.unity.render-pipelines.core/Editor/StyleSheets/LightingSearchSelectors.uss.meta rename to Packages/com.unity.render-pipelines.core/Editor/StyleSheets/LightingSearchColumnProviders.uss.meta diff --git a/Packages/com.unity.render-pipelines.core/Tests/Editor/CoreLightingSearchSelectorsTests.cs b/Packages/com.unity.render-pipelines.core/Tests/Editor/CoreLightingSearchColumnProvidersTests.cs similarity index 56% rename from Packages/com.unity.render-pipelines.core/Tests/Editor/CoreLightingSearchSelectorsTests.cs rename to Packages/com.unity.render-pipelines.core/Tests/Editor/CoreLightingSearchColumnProvidersTests.cs index 3f2879ac27a..7dfc08e14ee 100644 --- a/Packages/com.unity.render-pipelines.core/Tests/Editor/CoreLightingSearchSelectorsTests.cs +++ b/Packages/com.unity.render-pipelines.core/Tests/Editor/CoreLightingSearchColumnProvidersTests.cs @@ -8,11 +8,14 @@ namespace UnityEditor.Rendering.Tests { [TestFixture] - class CoreLightingSearchSelectorsTests + class CoreLightingSearchColumnProvidersTests { GameObject m_TestGameObject; Volume m_Volume; ProbeVolumeBakingSet m_BakingSet; + SearchProvider m_SceneProvider; + SearchContext m_Context; + SearchItem m_SearchItem; [SetUp] public void Setup() @@ -20,6 +23,10 @@ public void Setup() m_TestGameObject = new GameObject("TestCoreLightingObject"); m_Volume = m_TestGameObject.AddComponent(); m_BakingSet = ScriptableObject.CreateInstance(); + + m_SceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); + m_Context = UnityEditor.Search.SearchService.CreateContext("scene"); + m_SearchItem = CreateSearchItem(m_TestGameObject); } [TearDown] @@ -36,13 +43,35 @@ public void TearDown() } } + SearchItem CreateSearchItem(GameObject go) + { + var searchItem = m_SceneProvider.CreateItem(m_Context, $"scene:{go.GetEntityId().ToString()}"); + searchItem.data = go; + return searchItem; + } + + SearchColumn CreateColumn(string path, System.Action columnProvider) + { + var column = new SearchColumn("test", path, "scene"); + columnProvider(column); + return column; + } + + SearchColumnEventArgs CreateColumnEventArgs(SearchItem item, SearchColumn column, object value = null) + { + var args = new SearchColumnEventArgs(item, m_Context, column); + if (value != null) + args.value = value; + return args; + } + #region Baking Set Tests [Test] public void BakingMode_Column_CellCreator_CreatesValidElement() { var column = new SearchColumn("test", "test", "test"); - CoreLightingSearchSelectors.BakingModeSearchColumnProvider(column); + CoreLightingSearchColumnProviders.BakingModeSearchColumnProvider(column); var element = column.cellCreator(column); Assert.IsNotNull(element, "Cell creator should return a valid element"); @@ -58,7 +87,7 @@ public void BakingMode_Column_CellCreator_CreatesValidElement() public void SkyOcclusionBakingSamples_Column_CellCreator_CreatesValidElement() { var column = new SearchColumn("test", "test", "test"); - CoreLightingSearchSelectors.SkyOcclusionBakingSamplesSearchColumnProvider(column); + CoreLightingSearchColumnProviders.SkyOcclusionBakingSamplesSearchColumnProvider(column); var element = column.cellCreator(column); Assert.IsNotNull(element, "Cell creator should return a valid element"); @@ -80,21 +109,14 @@ public void VolumeMode_Column_SetterAndGetter_WorkCorrectly() { m_Volume.isGlobal = true; - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; + var column = CreateColumn("test", CoreLightingSearchColumnProviders.VolumeModeSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); - var column = new SearchColumn("test", "test", "scene"); - CoreLightingSearchSelectors.VolumeModeSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); + var getterResult = column.getter(args); Assert.IsNotNull(getterResult, "Getter should return a value"); Assert.AreEqual("Global", getterResult, "Getter should return 'Global'"); - var setterArgs = new SearchColumnEventArgs(searchItem, context, column); - setterArgs.value = "Local"; + var setterArgs = CreateColumnEventArgs(m_SearchItem, column, "Local"); column.setter(setterArgs); Assert.IsFalse(m_Volume.isGlobal, "Volume should be local after setting"); @@ -107,7 +129,7 @@ public void VolumeMode_Column_SetterAndGetter_WorkCorrectly() public void VolumeMode_Column_CellCreator_CreatesValidElement() { var column = new SearchColumn("test", "test", "test"); - CoreLightingSearchSelectors.VolumeModeSearchColumnProvider(column); + CoreLightingSearchColumnProviders.VolumeModeSearchColumnProvider(column); var element = column.cellCreator(column); Assert.IsNotNull(element, "Cell creator should return a valid element"); @@ -124,21 +146,13 @@ public void VolumeProfile_Column_SetterAndGetter_WorkCorrectly() { var testProfile = ScriptableObject.CreateInstance(); - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - CoreLightingSearchSelectors.VolumeProfileSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); + var column = CreateColumn("test", CoreLightingSearchColumnProviders.VolumeProfileSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); - var setterArgs = new SearchColumnEventArgs(searchItem, context, column); - setterArgs.value = testProfile; + var setterArgs = CreateColumnEventArgs(m_SearchItem, column, testProfile); column.setter(setterArgs); - var getterResult = column.getter(searchColumnEventArgs); + var getterResult = column.getter(args); Assert.IsNotNull(getterResult, "Getter should return a value"); Assert.AreEqual(testProfile, getterResult, "Getter should return the VolumeProfile that was set"); @@ -149,7 +163,7 @@ public void VolumeProfile_Column_SetterAndGetter_WorkCorrectly() public void VolumeProfile_Column_CellCreator_CreatesValidElement() { var column = new SearchColumn("test", "test", "test"); - CoreLightingSearchSelectors.VolumeProfileSearchColumnProvider(column); + CoreLightingSearchColumnProviders.VolumeProfileSearchColumnProvider(column); var element = column.cellCreator(column); Assert.IsNotNull(element, "Cell creator should return a valid element"); @@ -170,15 +184,10 @@ public void LightShape_Column_Getter_ReturnsValue() var light = m_TestGameObject.AddComponent(); light.type = LightType.Rectangle; - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; + var column = CreateColumn(CoreLightingSearchColumnProviders.k_LightShapePath, CoreLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); - var column = new SearchColumn("test", CoreLightingSearchSelectors.k_LightShapePath, "scene"); - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - CoreLightingSearchSelectors.LightShapeSearchColumnProvider(column); - var getterResult = column.getter(searchColumnEventArgs); + var getterResult = column.getter(args); Assert.IsNotNull(getterResult, "Getter should return a value"); Assert.AreEqual(LightType.Rectangle, getterResult, "Getter should return Rectangle"); } @@ -186,15 +195,10 @@ public void LightShape_Column_Getter_ReturnsValue() [Test] public void LightShape_Column_Getter_WithoutLight_ReturnsNull() { - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", CoreLightingSearchSelectors.k_LightShapePath, "scene"); - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - CoreLightingSearchSelectors.LightShapeSearchColumnProvider(column); - var getterResult = column.getter(searchColumnEventArgs); + var column = CreateColumn(CoreLightingSearchColumnProviders.k_LightShapePath, CoreLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); Assert.IsNull(getterResult, "Getter should return null for GameObject without Light component"); } @@ -204,16 +208,9 @@ public void LightShape_Column_Setter_UpdatesAreaLightValue() var light = m_TestGameObject.AddComponent(); light.type = LightType.Point; - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", CoreLightingSearchSelectors.k_LightShapePath, "scene"); - CoreLightingSearchSelectors.LightShapeSearchColumnProvider(column); + var column = CreateColumn(CoreLightingSearchColumnProviders.k_LightShapePath, CoreLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var setterArgs = CreateColumnEventArgs(m_SearchItem, column, LightType.Rectangle); - var setterArgs = new SearchColumnEventArgs(searchItem, context, column); - setterArgs.value = LightType.Rectangle; column.setter(setterArgs); Assert.AreEqual(LightType.Rectangle, light.type, "Light should have type Rectangle after setting"); } @@ -224,16 +221,9 @@ public void LightShape_Column_Setter_RejectsNonApplicableLightTypes() var light = m_TestGameObject.AddComponent(); light.type = LightType.Rectangle; - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; + var column = CreateColumn(CoreLightingSearchColumnProviders.k_LightShapePath, CoreLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var setterArgs = CreateColumnEventArgs(m_SearchItem, column, LightType.Spot); - var column = new SearchColumn("test", CoreLightingSearchSelectors.k_LightShapePath, "scene"); - CoreLightingSearchSelectors.LightShapeSearchColumnProvider(column); - - var setterArgs = new SearchColumnEventArgs(searchItem, context, column); - setterArgs.value = LightType.Spot; column.setter(setterArgs); Assert.AreEqual(LightType.Rectangle, light.type, "Light type should not change when setting non-applicable type"); } @@ -241,8 +231,8 @@ public void LightShape_Column_Setter_RejectsNonApplicableLightTypes() [Test] public void LightShape_Column_CellCreator_CreatesValidElement() { - var column = new SearchColumn("test", CoreLightingSearchSelectors.k_LightShapePath, "test"); - CoreLightingSearchSelectors.LightShapeSearchColumnProvider(column); + var column = new SearchColumn("test", CoreLightingSearchColumnProviders.k_LightShapePath, "test"); + CoreLightingSearchColumnProviders.LightShapeSearchColumnProvider(column); var element = column.cellCreator(column); Assert.IsNotNull(element, "Cell creator should return a valid element"); @@ -255,19 +245,12 @@ public void LightShape_Column_Binder_HandlesApplicableLightTypes() var light = m_TestGameObject.AddComponent(); light.type = LightType.Rectangle; - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", CoreLightingSearchSelectors.k_LightShapePath, "scene"); - CoreLightingSearchSelectors.LightShapeSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); + var column = CreateColumn(CoreLightingSearchColumnProviders.k_LightShapePath, CoreLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + var getterResult = column.getter(args); var element = column.cellCreator(column); - var binderArgs = new SearchColumnEventArgs(searchItem, context, column) { value = getterResult }; + var binderArgs = CreateColumnEventArgs(m_SearchItem, column, getterResult); Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for applicable light types"); } @@ -277,19 +260,12 @@ public void LightShape_Column_Binder_HidesNonApplicableLightTypes() var light = m_TestGameObject.AddComponent(); light.type = LightType.Spot; - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", CoreLightingSearchSelectors.k_LightShapePath, "scene"); - CoreLightingSearchSelectors.LightShapeSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); + var column = CreateColumn(CoreLightingSearchColumnProviders.k_LightShapePath, CoreLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + var getterResult = column.getter(args); var element = column.cellCreator(column); - var binderArgs = new SearchColumnEventArgs(searchItem, context, column) { value = getterResult }; + var binderArgs = CreateColumnEventArgs(m_SearchItem, column, getterResult); column.binder(binderArgs, element); Assert.IsFalse(element.visible, "Element should be hidden for non-applicable light types (Spot)"); @@ -304,11 +280,11 @@ public void AllCoreColumns_HaveValidConfiguration() { var columnTypes = new[] { - CoreLightingSearchSelectors.k_BakingModePath, - CoreLightingSearchSelectors.k_SkyOcclusionBakingSamplesPath, - CoreLightingSearchSelectors.k_VolumeModePath, - CoreLightingSearchSelectors.k_VolumeProfilePath, - CoreLightingSearchSelectors.k_LightShapePath + CoreLightingSearchColumnProviders.k_BakingModePath, + CoreLightingSearchColumnProviders.k_SkyOcclusionBakingSamplesPath, + CoreLightingSearchColumnProviders.k_VolumeModePath, + CoreLightingSearchColumnProviders.k_VolumeProfilePath, + CoreLightingSearchColumnProviders.k_LightShapePath }; foreach (var columnType in columnTypes) @@ -320,19 +296,19 @@ public void AllCoreColumns_HaveValidConfiguration() switch (columnType) { case "BakingSets/BakingMode": - CoreLightingSearchSelectors.BakingModeSearchColumnProvider(column); + CoreLightingSearchColumnProviders.BakingModeSearchColumnProvider(column); break; case "BakingSets/SkyOcclusionBakingSamples": - CoreLightingSearchSelectors.SkyOcclusionBakingSamplesSearchColumnProvider(column); + CoreLightingSearchColumnProviders.SkyOcclusionBakingSamplesSearchColumnProvider(column); break; case "Volume/Mode": - CoreLightingSearchSelectors.VolumeModeSearchColumnProvider(column); + CoreLightingSearchColumnProviders.VolumeModeSearchColumnProvider(column); break; case "Volume/Profile": - CoreLightingSearchSelectors.VolumeProfileSearchColumnProvider(column); + CoreLightingSearchColumnProviders.VolumeProfileSearchColumnProvider(column); break; case "Light/Shape": - CoreLightingSearchSelectors.LightShapeSearchColumnProvider(column); + CoreLightingSearchColumnProviders.LightShapeSearchColumnProvider(column); break; } }, $"Column initialization for {columnType} should not throw"); diff --git a/Packages/com.unity.render-pipelines.core/Tests/Editor/CoreLightingSearchSelectorsTests.cs.meta b/Packages/com.unity.render-pipelines.core/Tests/Editor/CoreLightingSearchColumnProvidersTests.cs.meta similarity index 100% rename from Packages/com.unity.render-pipelines.core/Tests/Editor/CoreLightingSearchSelectorsTests.cs.meta rename to Packages/com.unity.render-pipelines.core/Tests/Editor/CoreLightingSearchColumnProvidersTests.cs.meta diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightingSearchSelectors.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightingSearchColumnProviders.cs similarity index 91% rename from Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightingSearchSelectors.cs rename to Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightingSearchColumnProviders.cs index a34bd747095..2a6ead6f038 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightingSearchSelectors.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightingSearchColumnProviders.cs @@ -7,22 +7,23 @@ namespace UnityEditor.Rendering.HighDefinition { - static class HDLightingSearchSelectors + static class HDLightingSearchColumnProviders { internal const string k_SceneProvider = "scene"; internal const string k_LightPath = "Light/"; - internal const string k_LightShapePath = k_LightPath + "Shape"; + internal const string k_LightShapePath = k_LightPath + "ShapeHDRP"; internal const string k_LightIntensityPath = k_LightPath + "Intensity"; internal const string k_LightIntensityUnitPath = k_LightPath + "IntensityUnit"; + internal const string k_LightModePath = k_LightPath + "ModeHDRP"; internal const string k_ContactShadowsPath = k_LightPath + "ContactShadows"; internal const string k_ShadowResolutionPath = k_LightPath + "ShadowResolution"; internal const string k_ReflectionProbePath = "ReflectionProbe/"; internal const string k_ReflectionProbeResolutionPath = k_ReflectionProbePath + "Resolution"; - internal const string k_MeshRendererPath = "Renderer/MeshRenderer/"; + internal const string k_MeshRendererPath = "MeshRenderer/"; internal const string k_RayTracingModeFilter = "RayTracingMode"; internal const string k_RayTracingModePath = k_MeshRendererPath + "RayTracingMode"; - const string k_StyleSheetPath = "StyleSheets/HDLightingSearchSelectors.uss"; + const string k_StyleSheetPath = "StyleSheets/HDLightingSearchColumnProviders.uss"; const float k_FlexGrowDefault = 1f; const float k_ImguiContainerHeight = 20f; const float k_RectLeftWidthRatio = 0.3f; @@ -189,16 +190,6 @@ public static void LightIntensityUnitSearchColumnProvider(SearchColumn column) }; } - [SearchSelector(k_RayTracingModePath, provider: k_SceneProvider, priority: 99)] - static object RayTracingModeSearchSelector(SearchSelectorArgs args) - { - var go = args.current.ToObject(); - if (go == null) - return null; - - return HDLightingSearchDataAccessors.GetRayTracingMode(go); - } - [SearchColumnProvider(k_RayTracingModePath)] public static void RayTracingModeSearchColumnProvider(SearchColumn column) { @@ -547,6 +538,48 @@ public static void LightShapeSearchColumnProvider(SearchColumn column) }; } + [SearchColumnProvider(k_LightModePath)] + public static void LightModeSearchColumnProvider(SearchColumn column) + { + column.getter = args => + { + var go = args.item.data as GameObject ?? args.item.ToObject(); + if (go == null) + return null; + return HDLightingSearchDataAccessors.GetLightMode(go); + }; + column.setter = args => + { + if (args.value == null || !args.value.GetType().IsEnum) + return; + var go = args.item.data as GameObject ?? args.item.ToObject(); + if (go == null) + return; + HDLightingSearchDataAccessors.SetLightMode(go, (LightmapBakeType)args.value); + }; + column.cellCreator = _ => new EnumField(LightmapBakeType.Realtime) { style = { flexGrow = k_FlexGrowDefault } }; + column.binder = (args, ve) => + { + var field = (EnumField)ve; + var go = args.item.data as GameObject ?? args.item.ToObject(); + if (go == null || !go.TryGetComponent(out var light)) + { + field.visible = false; + return; + } + if (args.value is LightmapBakeType bakeType) + { + field.visible = true; + field.SetValueWithoutNotify(bakeType); + field.SetEnabled(!HDLightingSearchDataAccessors.IsLightModeLocked(light.type)); + } + else + { + field.visible = false; + } + }; + } + static VisualElement CreateImguiContainer() { var visualElement = new VisualElement() { style = { height = k_ImguiContainerHeight } }; @@ -735,6 +768,32 @@ internal static void SetRayTracingMode(GameObject go, UnityEngine.Experimental.R meshRenderer.rayTracingMode = value; } + internal static LightmapBakeType? GetLightMode(GameObject go) + { + if (!go.TryGetComponent(out var light)) + return null; + if (light.type == LightType.Tube) + return LightmapBakeType.Realtime; + if (light.type == LightType.Disc) + return LightmapBakeType.Baked; + return light.lightmapBakeType; + } + + internal static void SetLightMode(GameObject go, LightmapBakeType value) + { + if (!go.TryGetComponent(out var light)) + return; + if (light.type == LightType.Tube || light.type == LightType.Disc) + return; + light.lightmapBakeType = value; + EditorUtility.SetDirty(light); + } + + internal static bool IsLightModeLocked(LightType type) + { + return type == LightType.Tube || type == LightType.Disc; + } + internal static LightType? GetLightShape(GameObject go) { if (!go.TryGetComponent(out var light)) @@ -753,19 +812,15 @@ internal static void SetLightShape(GameObject go, LightType value) light.type = value; if (!LightUnitUtils.IsLightUnitSupported(value, light.lightUnit)) - { light.lightUnit = LightUnitUtils.GetNativeLightUnit(value); - } - // Mark the light component as dirty so the intensity and unit columns refresh - // when the light type changes. EditorUtility.SetDirty(light); } } internal static bool IsLightShapeApplicable(LightType lightType) { - return IsAreaLight(lightType) || IsSpotLight(lightType); + return IsSpotLight(lightType) || lightType is LightType.Rectangle or LightType.Disc or LightType.Tube; } internal static bool IsSpotLight(LightType lightType) @@ -823,7 +878,7 @@ void UpdateEnumField() { Init((SpotLightShape)m_Value); } - else + else if (HDLightingSearchDataAccessors.IsAreaLight(m_Value)) { Init((AreaLightShape)m_Value); } diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightingSearchSelectors.cs.meta b/Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightingSearchColumnProviders.cs.meta similarity index 100% rename from Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightingSearchSelectors.cs.meta rename to Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightingSearchColumnProviders.cs.meta diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/StyleSheets/HDLightingSearchSelectors.uss b/Packages/com.unity.render-pipelines.high-definition/Editor/StyleSheets/HDLightingSearchColumnProviders.uss similarity index 100% rename from Packages/com.unity.render-pipelines.high-definition/Editor/StyleSheets/HDLightingSearchSelectors.uss rename to Packages/com.unity.render-pipelines.high-definition/Editor/StyleSheets/HDLightingSearchColumnProviders.uss diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/StyleSheets/HDLightingSearchSelectors.uss.meta b/Packages/com.unity.render-pipelines.high-definition/Editor/StyleSheets/HDLightingSearchColumnProviders.uss.meta similarity index 100% rename from Packages/com.unity.render-pipelines.high-definition/Editor/StyleSheets/HDLightingSearchSelectors.uss.meta rename to Packages/com.unity.render-pipelines.high-definition/Editor/StyleSheets/HDLightingSearchColumnProviders.uss.meta diff --git a/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDLightingSearchColumnProvidersTests.cs b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDLightingSearchColumnProvidersTests.cs new file mode 100644 index 00000000000..698c272abeb --- /dev/null +++ b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDLightingSearchColumnProvidersTests.cs @@ -0,0 +1,598 @@ +using NUnit.Framework; +using UnityEditor; +using UnityEditor.Rendering.HighDefinition; +using UnityEditor.Search; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.UIElements; + +namespace UnityEditor.Rendering.HighDefinition.Tests +{ + [TestFixture] + class HDLightingSearchColumnProvidersTests + { + GameObject m_TestGameObject; + Light m_Light; + MeshRenderer m_MeshRenderer; + HDAdditionalLightData m_HDLightData; + SearchProvider m_SceneProvider; + SearchContext m_Context; + SearchItem m_SearchItem; + + [SetUp] + public void Setup() + { + m_TestGameObject = new GameObject("TestHDLightingObject"); + m_Light = m_TestGameObject.AddComponent(); + m_Light.type = LightType.Point; + m_HDLightData = m_TestGameObject.AddComponent(); + var meshFilter = m_TestGameObject.AddComponent(); + meshFilter.mesh = Resources.GetBuiltinResource("Quad.fbx"); + m_MeshRenderer = m_TestGameObject.AddComponent(); + m_MeshRenderer.material = new Material(Shader.Find("Standard")); + + m_SceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); + m_Context = UnityEditor.Search.SearchService.CreateContext("scene"); + m_SearchItem = CreateSearchItem(m_TestGameObject); + } + + [TearDown] + public void TearDown() + { + if (m_TestGameObject != null) + { + Object.DestroyImmediate(m_TestGameObject); + } + } + + SearchItem CreateSearchItem(GameObject go) + { + var searchItem = m_SceneProvider.CreateItem(m_Context, $"scene:{go.GetEntityId().ToString()}"); + searchItem.data = go; + return searchItem; + } + + SearchColumn CreateColumn(string path, System.Action columnProvider) + { + var column = new SearchColumn("test", path, "scene"); + columnProvider(column); + return column; + } + + SearchColumnEventArgs CreateColumnEventArgs(SearchItem item, SearchColumn column, object value = null) + { + var args = new SearchColumnEventArgs(item, m_Context, column); + if (value != null) + args.value = value; + return args; + } + + #region Light Intensity Tests + + [Test] + public void LightIntensity_Column_SetterAndGetter_WorkCorrectly() + { + m_Light.type = LightType.Point; + m_Light.lightUnit = LightUnit.Lumen; + m_Light.intensity = LightUnitUtils.ConvertIntensity(m_Light, 1000f, LightUnit.Lumen, LightUnit.Candela); + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightIntensitySearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + Assert.IsNotNull(getterResult, "Getter should return a value"); + Assert.IsInstanceOf(getterResult, "Getter should return a float"); + + float intensity = (float)getterResult; + Assert.AreEqual(1000f, intensity, 0.01f, "Getter should return intensity in UI unit (Lumen)"); + + var setterArgs = CreateColumnEventArgs(m_SearchItem, column, 2000f); + column.setter(setterArgs); + + float expectedNativeIntensity = LightUnitUtils.ConvertIntensity(m_Light, 2000f, LightUnit.Lumen, LightUnit.Candela); + Assert.AreEqual(expectedNativeIntensity, m_Light.intensity, 0.01f, "Light intensity should be updated in native unit"); + } + + [Test] + public void LightIntensity_Column_HandlesUnitConversion_Directional() + { + m_Light.type = LightType.Directional; + m_Light.lightUnit = LightUnit.Lux; + m_Light.intensity = 100f; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightIntensitySearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + Assert.IsInstanceOf(getterResult, "Getter should return a float"); + + float intensity = (float)getterResult; + Assert.AreEqual(100f, intensity, 0.01f, "Directional light intensity should match (Lux is native unit)"); + } + + [Test] + public void LightIntensity_Column_HandlesUnitConversion_Area() + { + m_Light.type = LightType.Rectangle; + m_Light.areaSize = new Vector2(1f, 1f); + m_Light.lightUnit = LightUnit.Lumen; + float nativeIntensity = LightUnitUtils.ConvertIntensity(m_Light, 500f, LightUnit.Lumen, LightUnit.Nits); + m_Light.intensity = nativeIntensity; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightIntensitySearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + Assert.IsInstanceOf(getterResult, "Getter should return a float"); + + float intensity = (float)getterResult; + Assert.AreEqual(500f, intensity, 0.01f, "Area light intensity should be converted to Lumen for UI"); + } + + [Test] + public void LightIntensity_Column_UnitChangeConvertsDisplay() + { + m_Light.type = LightType.Point; + m_Light.lightUnit = LightUnit.Lumen; + m_Light.intensity = LightUnitUtils.ConvertIntensity(m_Light, 1000f, LightUnit.Lumen, LightUnit.Candela); + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightIntensitySearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var initialData = column.getter(args); + Assert.IsInstanceOf(initialData, "Getter should return a float"); + + float initialIntensity = (float)initialData; + Assert.AreEqual(1000f, initialIntensity, 0.01f, "Initial intensity should be 1000 Lumen"); + + m_Light.lightUnit = LightUnit.Candela; + + var updatedData = column.getter(args); + Assert.IsInstanceOf(updatedData, "Getter should return a float"); + + float updatedIntensity = (float)updatedData; + Assert.AreEqual(m_Light.intensity, updatedIntensity, 0.01f, "Intensity should now be displayed in native unit (Candela)"); + } + + #endregion + + #region Light Intensity Unit Tests + + [Test] + public void LightIntensityUnit_Column_SetterAndGetter_WorkCorrectly() + { + m_Light.lightUnit = LightUnit.Lumen; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightIntensityUnitSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + Assert.AreEqual(LightUnit.Lumen, getterResult, "Getter should return the light unit"); + + var setterArgs = CreateColumnEventArgs(m_SearchItem, column, LightUnit.Lux); + column.setter(setterArgs); + + Assert.AreEqual(LightUnit.Lux, m_Light.lightUnit, "Setter should update light unit"); + } + + [Test] + public void LightIntensityUnit_Column_CellCreator_CreatesValidElement() + { + var column = new SearchColumn("test", "test", "test"); + HDLightingSearchColumnProviders.LightIntensityUnitSearchColumnProvider(column); + + var element = column.cellCreator(column); + Assert.IsNotNull(element, "Cell creator should return a valid element"); + Assert.IsInstanceOf(element, "Should create an EnumField"); + } + + [Test] + public void LightIntensityUnit_Column_HandlesInvalidSetter() + { + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightIntensityUnitSearchColumnProvider); + + var initialUnit = m_Light.lightUnit; + + var setterArgs = CreateColumnEventArgs(m_SearchItem, column, null); + column.setter(setterArgs); + + Assert.AreEqual(initialUnit, m_Light.lightUnit, "Light unit should not change when setting null"); + + setterArgs.value = "invalid"; + column.setter(setterArgs); + Assert.AreEqual(initialUnit, m_Light.lightUnit, "Light unit should not change when setting invalid value"); + } + + [Test] + public void LightIntensityUnit_Column_Binder_HandlesDiscLight() + { + m_Light.type = LightType.Disc; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightIntensityUnitSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + var element = column.cellCreator(column); + var binderArgs = CreateColumnEventArgs(m_SearchItem, column, getterResult); + Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for Disc lights"); + + var enumField = (EnumField)element; + Assert.IsTrue(enumField.visible, "EnumField should be visible for Disc lights"); + } + + [Test] + public void LightIntensityUnit_Column_Binder_HandlesTubeLight() + { + m_Light.type = LightType.Tube; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightIntensityUnitSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + var element = column.cellCreator(column); + var binderArgs = CreateColumnEventArgs(m_SearchItem, column, getterResult); + Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for Tube lights"); + + var enumField = (EnumField)element; + Assert.IsTrue(enumField.visible, "EnumField should be visible for Tube lights"); + } + + [Test] + public void LightIntensityUnit_Column_Binder_HandlesRectangleLight() + { + m_Light.type = LightType.Rectangle; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightIntensityUnitSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + var element = column.cellCreator(column); + var binderArgs = CreateColumnEventArgs(m_SearchItem, column, getterResult); + Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for Rectangle lights"); + + var enumField = (EnumField)element; + Assert.IsTrue(enumField.visible, "EnumField should be visible for Rectangle lights"); + } + + [Test] + public void LightIntensityUnit_Column_Binder_HandlesDirectionalLight() + { + m_Light.type = LightType.Directional; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightIntensityUnitSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + var element = column.cellCreator(column); + var binderArgs = CreateColumnEventArgs(m_SearchItem, column, getterResult); + Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for Directional lights"); + + var enumField = (EnumField)element; + Assert.IsTrue(enumField.visible, "EnumField should be visible for Directional lights"); + } + + [Test] + public void LightIntensityUnit_Column_Binder_HandlesPunctualLights() + { + var punctualTypes = new[] { LightType.Point, LightType.Spot }; + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightIntensityUnitSearchColumnProvider); + + foreach (var lightType in punctualTypes) + { + m_Light.type = lightType; + + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + var element = column.cellCreator(column); + var binderArgs = CreateColumnEventArgs(m_SearchItem, column, getterResult); + Assert.DoesNotThrow(() => column.binder(binderArgs, element), $"Binder should not throw for {lightType} lights"); + + var enumField = (EnumField)element; + Assert.IsTrue(enumField.visible, $"EnumField should be visible for {lightType} lights"); + } + } + + #endregion + + #region Light Shape Tests + + [Test] + public void LightShape_Column_Configuration_IsValid() + { + m_Light.type = LightType.Rectangle; + + var column = new SearchColumn("test", HDLightingSearchColumnProviders.k_LightShapePath, "scene"); + HDLightingSearchColumnProviders.LightShapeSearchColumnProvider(column); + + Assert.IsNotNull(column.getter, "Column should have a getter"); + Assert.IsNotNull(column.setter, "Column should have a setter"); + Assert.IsNotNull(column.cellCreator, "Column should have a cell creator"); + Assert.IsNotNull(column.binder, "Column should have a binder"); + } + + #endregion + + #region Contact Shadows Tests + + [Test] + public void ContactShadows_Column_Getter_ReturnsContactShadowsData() + { + m_HDLightData.useContactShadow.useOverride = true; + m_HDLightData.useContactShadow.@override = true; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.ContactShadowsSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + Assert.IsNotNull(getterResult, "Getter should return a value"); + Assert.IsTrue(getterResult.GetType().Name.Contains("ContactShadowsData"), "Getter should return ContactShadowsData"); + } + + #endregion + + #region Ray Tracing Mode Tests + + [Test] + public void RayTracingMode_Column_SetterAndGetter_WorkCorrectly() + { + m_MeshRenderer.rayTracingMode = UnityEngine.Experimental.Rendering.RayTracingMode.Static; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.RayTracingModeSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + Assert.IsNotNull(getterResult, "Getter should return a value"); + Assert.AreEqual(UnityEngine.Experimental.Rendering.RayTracingMode.Static, getterResult, "Getter should return Static"); + + var setterArgs = CreateColumnEventArgs(m_SearchItem, column, UnityEngine.Experimental.Rendering.RayTracingMode.Off); + column.setter(setterArgs); + Assert.AreEqual(UnityEngine.Experimental.Rendering.RayTracingMode.Off, m_MeshRenderer.rayTracingMode, "RayTracingMode should be Off after setting"); + } + + [Test] + public void RayTracingMode_Column_CellCreator_CreatesValidElement() + { + var column = new SearchColumn("test", "test", "test"); + HDLightingSearchColumnProviders.RayTracingModeSearchColumnProvider(column); + + var element = column.cellCreator(column); + Assert.IsNotNull(element, "Cell creator should return a valid element"); + Assert.IsInstanceOf(element, "Should create an EnumField"); + } + + #endregion + + #region Reflection Probe Resolution Tests + + [Test] + public void ReflectionProbeResolution_Column_Getter_WithHDProbe_ReturnsResolutionData() + { + m_TestGameObject.AddComponent(); + m_TestGameObject.AddComponent(); + + var column = CreateColumn(HDLightingSearchColumnProviders.k_ReflectionProbeResolutionPath, HDLightingSearchColumnProviders.ReflectionProbeResolutionSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + + Assert.IsNotNull(getterResult, "Getter should return a value"); + Assert.IsTrue(getterResult.GetType().Name.Contains("ReflectionProbeResolutionData"), "Getter should return ReflectionProbeResolutionData"); + } + + [Test] + public void ReflectionProbeResolution_Column_Getter_WithoutHDProbe_ReturnsNull() + { + var testObj = new GameObject("TestReflectionProbeOnly"); + try + { + testObj.AddComponent(); + + var searchItem = CreateSearchItem(testObj); + var column = CreateColumn(HDLightingSearchColumnProviders.k_ReflectionProbeResolutionPath, HDLightingSearchColumnProviders.ReflectionProbeResolutionSearchColumnProvider); + var args = CreateColumnEventArgs(searchItem, column); + + var getterResult = column.getter(args); + + Assert.IsNull(getterResult, "Getter should return null without HDProbe component"); + } + finally + { + Object.DestroyImmediate(testObj); + } + } + + #endregion + + #region Shadow Resolution Tests + + [Test] + public void ShadowResolution_Column_Getter_ReturnsShadowResolutionData() + { + m_HDLightData.shadowResolution.useOverride = true; + m_HDLightData.shadowResolution.level = 2; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.ShadowResolutionSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + Assert.IsNotNull(getterResult, "Getter should return a value"); + Assert.IsTrue(getterResult.GetType().Name.Contains("ShadowResolutionData"), "Getter should return ShadowResolutionData"); + } + + #endregion + + #region Light Shape Tests + + [Test] + public void LightShape_Column_Getter_ReturnsValue() + { + m_Light.type = LightType.Spot; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + Assert.IsNotNull(getterResult, "Getter should return a value"); + } + + [Test] + public void LightShape_Column_Getter_WithoutLight_ReturnsNull() + { + var testObj = new GameObject("TestNoLight"); + try + { + var searchItem = CreateSearchItem(testObj); + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var args = CreateColumnEventArgs(searchItem, column); + + var getterResult = column.getter(args); + Assert.IsNull(getterResult, "Getter should return null for GameObject without Light component"); + } + finally + { + Object.DestroyImmediate(testObj); + } + } + + [Test] + public void LightShape_Column_Setter_UpdatesSpotLightValue() + { + m_Light.type = LightType.Point; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var setterArgs = CreateColumnEventArgs(m_SearchItem, column, LightType.Spot); + + column.setter(setterArgs); + + Assert.AreEqual(LightType.Spot, m_Light.type, "Light should have type Spot after setting"); + } + + [Test] + public void LightShape_Column_Setter_UpdatesAreaLightValue() + { + m_Light.type = LightType.Point; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var setterArgs = CreateColumnEventArgs(m_SearchItem, column, LightType.Rectangle); + + column.setter(setterArgs); + Assert.AreEqual(LightType.Rectangle, m_Light.type, "Light should have type Rectangle after setting"); + } + + [Test] + public void LightShape_Column_Setter_RejectsNonApplicableLightTypes() + { + m_Light.type = LightType.Spot; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var setterArgs = CreateColumnEventArgs(m_SearchItem, column, LightType.Point); + + column.setter(setterArgs); + Assert.AreEqual(LightType.Spot, m_Light.type, "Light type should not change when setting non-applicable type"); + } + + [Test] + public void LightShape_Column_CellCreator_CreatesValidElement() + { + var column = new SearchColumn("test", "test", "test"); + HDLightingSearchColumnProviders.LightShapeSearchColumnProvider(column); + + var element = column.cellCreator(column); + Assert.IsNotNull(element, "Cell creator should return a valid element"); + Assert.IsInstanceOf(element, "Should create a VisualElement"); + } + + [Test] + public void LightShape_Column_Binder_HandlesSpotLights() + { + m_Light.type = LightType.Spot; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + var element = column.cellCreator(column); + var binderArgs = CreateColumnEventArgs(m_SearchItem, column, getterResult); + Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for spot lights"); + } + + [Test] + public void LightShape_Column_Binder_HandlesAreaLights() + { + m_Light.type = LightType.Rectangle; + + var column = CreateColumn("test", HDLightingSearchColumnProviders.LightShapeSearchColumnProvider); + var args = CreateColumnEventArgs(m_SearchItem, column); + + var getterResult = column.getter(args); + var element = column.cellCreator(column); + var binderArgs = CreateColumnEventArgs(m_SearchItem, column, getterResult); + Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for area lights"); + } + + #endregion + + #region Integration Tests + + [Test] + public void AllHDRPColumns_HaveValidConfiguration() + { + var columnTypes = new[] + { + HDLightingSearchColumnProviders.k_LightIntensityPath, + HDLightingSearchColumnProviders.k_LightIntensityUnitPath, + HDLightingSearchColumnProviders.k_ContactShadowsPath, + HDLightingSearchColumnProviders.k_RayTracingModePath, + HDLightingSearchColumnProviders.k_ReflectionProbeResolutionPath, + HDLightingSearchColumnProviders.k_ShadowResolutionPath, + HDLightingSearchColumnProviders.k_LightShapePath, + HDLightingSearchColumnProviders.k_LightModePath + }; + + foreach (var columnType in columnTypes) + { + var column = new SearchColumn("test", columnType, "test"); + + Assert.DoesNotThrow(() => + { + switch (columnType) + { + case "Light/Intensity": + HDLightingSearchColumnProviders.LightIntensitySearchColumnProvider(column); + break; + case "Light/IntensityUnit": + HDLightingSearchColumnProviders.LightIntensityUnitSearchColumnProvider(column); + break; + case "Light/ContactShadows": + HDLightingSearchColumnProviders.ContactShadowsSearchColumnProvider(column); + break; + case "MeshRenderer/RayTracingMode": + HDLightingSearchColumnProviders.RayTracingModeSearchColumnProvider(column); + break; + case "ReflectionProbe/Resolution": + HDLightingSearchColumnProviders.ReflectionProbeResolutionSearchColumnProvider(column); + break; + case "Light/ShadowResolution": + HDLightingSearchColumnProviders.ShadowResolutionSearchColumnProvider(column); + break; + case "Light/ShapeHDRP": + HDLightingSearchColumnProviders.LightShapeSearchColumnProvider(column); + break; + case "Light/ModeHDRP": + HDLightingSearchColumnProviders.LightModeSearchColumnProvider(column); + break; + } + }, $"Column initialization for {columnType} should not throw"); + + Assert.IsNotNull(column.getter, $"Column {columnType} should have a getter"); + Assert.IsNotNull(column.cellCreator, $"Column {columnType} should have a cell creator"); + Assert.IsNotNull(column.binder, $"Column {columnType} should have a binder"); + Assert.IsNotNull(column.setter, $"Column {columnType} should have a setter"); + } + } + + #endregion + } +} diff --git a/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDLightingSearchSelectorsTests.cs.meta b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDLightingSearchColumnProvidersTests.cs.meta similarity index 100% rename from Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDLightingSearchSelectorsTests.cs.meta rename to Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDLightingSearchColumnProvidersTests.cs.meta diff --git a/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDLightingSearchSelectorsTests.cs b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDLightingSearchSelectorsTests.cs deleted file mode 100644 index cb98126adc7..00000000000 --- a/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDLightingSearchSelectorsTests.cs +++ /dev/null @@ -1,714 +0,0 @@ -using NUnit.Framework; -using UnityEditor; -using UnityEditor.Rendering.HighDefinition; -using UnityEditor.Search; -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Rendering.HighDefinition; -using UnityEngine.UIElements; - -namespace UnityEditor.Rendering.HighDefinition.Tests -{ - [TestFixture] - class HDLightingSearchSelectorsTests - { - GameObject m_TestGameObject; - Light m_Light; - MeshRenderer m_MeshRenderer; - HDAdditionalLightData m_HDLightData; - - [SetUp] - public void Setup() - { - m_TestGameObject = new GameObject("TestHDLightingObject"); - m_Light = m_TestGameObject.AddComponent(); - m_Light.type = LightType.Point; - m_HDLightData = m_TestGameObject.AddComponent(); - var meshFilter = m_TestGameObject.AddComponent(); - meshFilter.mesh = Resources.GetBuiltinResource("Quad.fbx"); - m_MeshRenderer = m_TestGameObject.AddComponent(); - m_MeshRenderer.material = new Material(Shader.Find("Standard")); - } - - [TearDown] - public void TearDown() - { - if (m_TestGameObject != null) - { - Object.DestroyImmediate(m_TestGameObject); - } - } - - #region Light Intensity Tests - - [Test] - public void LightIntensity_Column_SetterAndGetter_WorkCorrectly() - { - m_Light.type = LightType.Point; - m_Light.lightUnit = LightUnit.Lumen; - m_Light.intensity = LightUnitUtils.ConvertIntensity(m_Light, 1000f, LightUnit.Lumen, LightUnit.Candela); - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightIntensitySearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - Assert.IsNotNull(getterResult, "Getter should return a value"); - Assert.IsInstanceOf(getterResult, "Getter should return a float"); - - float intensity = (float)getterResult; - Assert.AreEqual(1000f, intensity, 0.01f, "Getter should return intensity in UI unit (Lumen)"); - - var setterArgs = new SearchColumnEventArgs(searchItem, context, column); - setterArgs.value = 2000f; - column.setter(setterArgs); - - float expectedNativeIntensity = LightUnitUtils.ConvertIntensity(m_Light, 2000f, LightUnit.Lumen, LightUnit.Candela); - Assert.AreEqual(expectedNativeIntensity, m_Light.intensity, 0.01f, "Light intensity should be updated in native unit"); - } - - [Test] - public void LightIntensity_Column_HandlesUnitConversion_Directional() - { - m_Light.type = LightType.Directional; - m_Light.lightUnit = LightUnit.Lux; - m_Light.intensity = 100f; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightIntensitySearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - Assert.IsInstanceOf(getterResult, "Getter should return a float"); - - float intensity = (float)getterResult; - Assert.AreEqual(100f, intensity, 0.01f, "Directional light intensity should match (Lux is native unit)"); - } - - [Test] - public void LightIntensity_Column_HandlesUnitConversion_Area() - { - m_Light.type = LightType.Rectangle; - m_Light.areaSize = new Vector2(1f, 1f); - m_Light.lightUnit = LightUnit.Lumen; - float nativeIntensity = LightUnitUtils.ConvertIntensity(m_Light, 500f, LightUnit.Lumen, LightUnit.Nits); - m_Light.intensity = nativeIntensity; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightIntensitySearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - Assert.IsInstanceOf(getterResult, "Getter should return a float"); - - float intensity = (float)getterResult; - Assert.AreEqual(500f, intensity, 0.01f, "Area light intensity should be converted to Lumen for UI"); - } - - [Test] - public void LightIntensity_Column_UnitChangeConvertsDisplay() - { - m_Light.type = LightType.Point; - m_Light.lightUnit = LightUnit.Lumen; - m_Light.intensity = LightUnitUtils.ConvertIntensity(m_Light, 1000f, LightUnit.Lumen, LightUnit.Candela); - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightIntensitySearchColumnProvider(column); - - var args = new SearchColumnEventArgs(searchItem, context, column); - var initialData = column.getter(args); - Assert.IsInstanceOf(initialData, "Getter should return a float"); - - float initialIntensity = (float)initialData; - Assert.AreEqual(1000f, initialIntensity, 0.01f, "Initial intensity should be 1000 Lumen"); - - m_Light.lightUnit = LightUnit.Candela; - - var updatedData = column.getter(args); - Assert.IsInstanceOf(updatedData, "Getter should return a float"); - - float updatedIntensity = (float)updatedData; - Assert.AreEqual(m_Light.intensity, updatedIntensity, 0.01f, "Intensity should now be displayed in native unit (Candela)"); - } - - #endregion - - #region Light Intensity Unit Tests - - [Test] - public void LightIntensityUnit_Column_SetterAndGetter_WorkCorrectly() - { - m_Light.lightUnit = LightUnit.Lumen; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightIntensityUnitSearchColumnProvider(column); - - var getterResult = column.getter(new SearchColumnEventArgs(searchItem, context, column)); - Assert.AreEqual(LightUnit.Lumen, getterResult, "Getter should return the light unit"); - - var setterArgs = new SearchColumnEventArgs(searchItem, context, column); - setterArgs.value = LightUnit.Lux; - column.setter(setterArgs); - - Assert.AreEqual(LightUnit.Lux, m_Light.lightUnit, "Setter should update light unit"); - } - - [Test] - public void LightIntensityUnit_Column_CellCreator_CreatesValidElement() - { - var column = new SearchColumn("test", "test", "test"); - HDLightingSearchSelectors.LightIntensityUnitSearchColumnProvider(column); - - var element = column.cellCreator(column); - Assert.IsNotNull(element, "Cell creator should return a valid element"); - Assert.IsInstanceOf(element, "Should create an EnumField"); - } - - [Test] - public void LightIntensityUnit_Column_HandlesInvalidSetter() - { - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightIntensityUnitSearchColumnProvider(column); - - var initialUnit = m_Light.lightUnit; - - var setterArgs = new SearchColumnEventArgs(searchItem, context, column); - setterArgs.value = null; - column.setter(setterArgs); - - Assert.AreEqual(initialUnit, m_Light.lightUnit, "Light unit should not change when setting null"); - - setterArgs.value = "invalid"; - column.setter(setterArgs); - Assert.AreEqual(initialUnit, m_Light.lightUnit, "Light unit should not change when setting invalid value"); - } - - [Test] - public void LightIntensityUnit_Column_Binder_HandlesDiscLight() - { - m_Light.type = LightType.Disc; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightIntensityUnitSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - - var element = column.cellCreator(column); - var binderArgs = new SearchColumnEventArgs(searchItem, context, column) { value = getterResult }; - Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for Disc lights"); - - var enumField = (EnumField)element; - Assert.IsTrue(enumField.visible, "EnumField should be visible for Disc lights"); - } - - [Test] - public void LightIntensityUnit_Column_Binder_HandlesTubeLight() - { - m_Light.type = LightType.Tube; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightIntensityUnitSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - - var element = column.cellCreator(column); - var binderArgs = new SearchColumnEventArgs(searchItem, context, column) { value = getterResult }; - Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for Tube lights"); - - var enumField = (EnumField)element; - Assert.IsTrue(enumField.visible, "EnumField should be visible for Tube lights"); - } - - [Test] - public void LightIntensityUnit_Column_Binder_HandlesRectangleLight() - { - m_Light.type = LightType.Rectangle; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightIntensityUnitSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - - var element = column.cellCreator(column); - var binderArgs = new SearchColumnEventArgs(searchItem, context, column) { value = getterResult }; - Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for Rectangle lights"); - - var enumField = (EnumField)element; - Assert.IsTrue(enumField.visible, "EnumField should be visible for Rectangle lights"); - } - - [Test] - public void LightIntensityUnit_Column_Binder_HandlesDirectionalLight() - { - m_Light.type = LightType.Directional; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightIntensityUnitSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - - var element = column.cellCreator(column); - var binderArgs = new SearchColumnEventArgs(searchItem, context, column) { value = getterResult }; - Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for Directional lights"); - - var enumField = (EnumField)element; - Assert.IsTrue(enumField.visible, "EnumField should be visible for Directional lights"); - } - - [Test] - public void LightIntensityUnit_Column_Binder_HandlesPunctualLights() - { - var punctualTypes = new[] { LightType.Point, LightType.Spot }; - - foreach (var lightType in punctualTypes) - { - m_Light.type = lightType; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightIntensityUnitSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - - var element = column.cellCreator(column); - var binderArgs = new SearchColumnEventArgs(searchItem, context, column) { value = getterResult }; - Assert.DoesNotThrow(() => column.binder(binderArgs, element), $"Binder should not throw for {lightType} lights"); - - var enumField = (EnumField)element; - Assert.IsTrue(enumField.visible, $"EnumField should be visible for {lightType} lights"); - } - } - - #endregion - - #region Light Shape Tests - - [Test] - public void LightShape_Column_Configuration_IsValid() - { - m_Light.type = LightType.Rectangle; - - var column = new SearchColumn("test", HDLightingSearchSelectors.k_LightShapePath, "scene"); - HDLightingSearchSelectors.LightShapeSearchColumnProvider(column); - - Assert.IsNotNull(column.getter, "Column should have a getter"); - Assert.IsNotNull(column.setter, "Column should have a setter"); - Assert.IsNotNull(column.cellCreator, "Column should have a cell creator"); - Assert.IsNotNull(column.binder, "Column should have a binder"); - } - - #endregion - - #region Contact Shadows Tests - - [Test] - public void ContactShadows_Column_Getter_ReturnsContactShadowsData() - { - m_HDLightData.useContactShadow.useOverride = true; - m_HDLightData.useContactShadow.@override = true; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.ContactShadowsSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - Assert.IsNotNull(getterResult, "Getter should return a value"); - Assert.IsTrue(getterResult.GetType().Name.Contains("ContactShadowsData"), "Getter should return ContactShadowsData"); - } - - #endregion - - #region Ray Tracing Mode Tests - - [Test] - public void RayTracingMode_Column_SetterAndGetter_WorkCorrectly() - { - m_MeshRenderer.rayTracingMode = UnityEngine.Experimental.Rendering.RayTracingMode.Static; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.RayTracingModeSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - Assert.IsNotNull(getterResult, "Getter should return a value"); - Assert.AreEqual(UnityEngine.Experimental.Rendering.RayTracingMode.Static, getterResult, "Getter should return Static"); - - var setterArgs = new SearchColumnEventArgs(searchItem, context, column); - setterArgs.value = UnityEngine.Experimental.Rendering.RayTracingMode.Off; - column.setter(setterArgs); - Assert.AreEqual(UnityEngine.Experimental.Rendering.RayTracingMode.Off, m_MeshRenderer.rayTracingMode, "RayTracingMode should be Off after setting"); - } - - [Test] - public void RayTracingMode_Column_CellCreator_CreatesValidElement() - { - var column = new SearchColumn("test", "test", "test"); - HDLightingSearchSelectors.RayTracingModeSearchColumnProvider(column); - - var element = column.cellCreator(column); - Assert.IsNotNull(element, "Cell creator should return a valid element"); - Assert.IsInstanceOf(element, "Should create an EnumField"); - } - - #endregion - - #region Reflection Probe Resolution Tests - - [Test] - public void ReflectionProbeResolution_Column_Getter_WithHDProbe_ReturnsResolutionData() - { - m_TestGameObject.AddComponent(); - m_TestGameObject.AddComponent(); - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", HDLightingSearchSelectors.k_ReflectionProbeResolutionPath, "scene"); - HDLightingSearchSelectors.ReflectionProbeResolutionSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - - Assert.IsNotNull(getterResult, "Getter should return a value"); - Assert.IsTrue(getterResult.GetType().Name.Contains("ReflectionProbeResolutionData"), "Getter should return ReflectionProbeResolutionData"); - } - - [Test] - public void ReflectionProbeResolution_Column_Getter_WithoutHDProbe_ReturnsNull() - { - var testObj = new GameObject("TestReflectionProbeOnly"); - try - { - testObj.AddComponent(); - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{testObj.GetEntityId().ToString()}"); - searchItem.data = testObj; - - var column = new SearchColumn("test", HDLightingSearchSelectors.k_ReflectionProbeResolutionPath, "scene"); - HDLightingSearchSelectors.ReflectionProbeResolutionSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - - Assert.IsNull(getterResult, "Getter should return null without HDProbe component"); - } - finally - { - Object.DestroyImmediate(testObj); - } - } - - #endregion - - #region Shadow Resolution Tests - - [Test] - public void ShadowResolution_Column_Getter_ReturnsShadowResolutionData() - { - m_HDLightData.shadowResolution.useOverride = true; - m_HDLightData.shadowResolution.level = 2; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.ShadowResolutionSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - Assert.IsNotNull(getterResult, "Getter should return a value"); - Assert.IsTrue(getterResult.GetType().Name.Contains("ShadowResolutionData"), "Getter should return ShadowResolutionData"); - } - - #endregion - - #region Light Shape Tests - - [Test] - public void LightShape_Column_Getter_ReturnsValue() - { - m_Light.type = LightType.Spot; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightShapeSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - Assert.IsNotNull(getterResult, "Getter should return a value"); - } - - [Test] - public void LightShape_Column_Getter_WithoutLight_ReturnsNull() - { - var testObj = new GameObject("TestNoLight"); - try - { - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{testObj.GetEntityId().ToString()}"); - searchItem.data = testObj; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightShapeSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - Assert.IsNull(getterResult, "Getter should return null for GameObject without Light component"); - } - finally - { - Object.DestroyImmediate(testObj); - } - } - - [Test] - public void LightShape_Column_Setter_UpdatesSpotLightValue() - { - m_Light.type = LightType.Point; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightShapeSearchColumnProvider(column); - - var setterArgs = new SearchColumnEventArgs(searchItem, context, column); - setterArgs.value = LightType.Spot; - column.setter(setterArgs); - - Assert.AreEqual(LightType.Spot, m_Light.type, "Light should have type Spot after setting"); - } - - [Test] - public void LightShape_Column_Setter_UpdatesAreaLightValue() - { - m_Light.type = LightType.Point; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightShapeSearchColumnProvider(column); - - var setterArgs = new SearchColumnEventArgs(searchItem, context, column); - setterArgs.value = LightType.Rectangle; - column.setter(setterArgs); - Assert.AreEqual(LightType.Rectangle, m_Light.type, "Light should have type Rectangle after setting"); - } - - [Test] - public void LightShape_Column_Setter_RejectsNonApplicableLightTypes() - { - m_Light.type = LightType.Spot; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightShapeSearchColumnProvider(column); - - var setterArgs = new SearchColumnEventArgs(searchItem, context, column); - setterArgs.value = LightType.Point; - column.setter(setterArgs); - Assert.AreEqual(LightType.Spot, m_Light.type, "Light type should not change when setting non-applicable type"); - } - - [Test] - public void LightShape_Column_CellCreator_CreatesValidElement() - { - var column = new SearchColumn("test", "test", "test"); - HDLightingSearchSelectors.LightShapeSearchColumnProvider(column); - - var element = column.cellCreator(column); - Assert.IsNotNull(element, "Cell creator should return a valid element"); - Assert.IsInstanceOf(element, "Should create a VisualElement"); - } - - [Test] - public void LightShape_Column_Binder_HandlesSpotLights() - { - m_Light.type = LightType.Spot; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightShapeSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - - var element = column.cellCreator(column); - var binderArgs = new SearchColumnEventArgs(searchItem, context, column) { value = getterResult }; - Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for spot lights"); - } - - [Test] - public void LightShape_Column_Binder_HandlesAreaLights() - { - m_Light.type = LightType.Rectangle; - - var sceneProvider = UnityEditor.Search.SearchService.GetProvider("scene"); - var context = UnityEditor.Search.SearchService.CreateContext("scene"); - var searchItem = sceneProvider.CreateItem(context, $"scene:{m_TestGameObject.GetEntityId().ToString()}"); - searchItem.data = m_TestGameObject; - - var column = new SearchColumn("test", "test", "scene"); - HDLightingSearchSelectors.LightShapeSearchColumnProvider(column); - - var searchColumnEventArgs = new SearchColumnEventArgs(searchItem, context, column); - var getterResult = column.getter(searchColumnEventArgs); - - var element = column.cellCreator(column); - var binderArgs = new SearchColumnEventArgs(searchItem, context, column) { value = getterResult }; - Assert.DoesNotThrow(() => column.binder(binderArgs, element), "Binder should not throw for area lights"); - } - - #endregion - - #region Integration Tests - - [Test] - public void AllHDRPColumns_HaveValidConfiguration() - { - var columnTypes = new[] - { - HDLightingSearchSelectors.k_LightIntensityPath, - HDLightingSearchSelectors.k_LightIntensityUnitPath, - HDLightingSearchSelectors.k_ContactShadowsPath, - HDLightingSearchSelectors.k_RayTracingModePath, - HDLightingSearchSelectors.k_ReflectionProbeResolutionPath, - HDLightingSearchSelectors.k_ShadowResolutionPath, - HDLightingSearchSelectors.k_LightShapePath - }; - - foreach (var columnType in columnTypes) - { - var column = new SearchColumn("test", columnType, "test"); - - Assert.DoesNotThrow(() => - { - switch (columnType) - { - case "Light/Intensity": - HDLightingSearchSelectors.LightIntensitySearchColumnProvider(column); - break; - case "Light/IntensityUnit": - HDLightingSearchSelectors.LightIntensityUnitSearchColumnProvider(column); - break; - case "Light/ContactShadows": - HDLightingSearchSelectors.ContactShadowsSearchColumnProvider(column); - break; - case "Renderer/MeshRenderer/RayTracingMode": - HDLightingSearchSelectors.RayTracingModeSearchColumnProvider(column); - break; - case "ReflectionProbe/Resolution": - HDLightingSearchSelectors.ReflectionProbeResolutionSearchColumnProvider(column); - break; - case "Light/ShadowResolution": - HDLightingSearchSelectors.ShadowResolutionSearchColumnProvider(column); - break; - case "Light/Shape": - HDLightingSearchSelectors.LightShapeSearchColumnProvider(column); - break; - } - }, $"Column initialization for {columnType} should not throw"); - - Assert.IsNotNull(column.getter, $"Column {columnType} should have a getter"); - Assert.IsNotNull(column.cellCreator, $"Column {columnType} should have a cell creator"); - Assert.IsNotNull(column.binder, $"Column {columnType} should have a binder"); - Assert.IsNotNull(column.setter, $"Column {columnType} should have a setter"); - } - } - - #endregion - } -} From 9e5b3523d42519328267d5ac79adba4bfebcf3de Mon Sep 17 00:00:00 2001 From: Cian Noonan Date: Sat, 28 Feb 2026 06:05:14 +0000 Subject: [PATCH 16/95] Initialise VolumeManager BaseComponentTypes from DefaultProfile to avoid reflection and reduce startup overhead --- .../Editor/Volume/VolumeComponentEditor.cs | 16 +- .../Editor/Volume/VolumeProfileUtils.cs | 15 +- .../Runtime/Volume/VolumeComponent.cs | 8 +- .../Runtime/Volume/VolumeManager.cs | 113 +- .../BuildProcessors/HDRPPreprocessBuild.cs | 8 +- .../HDRenderPipelineGlobalSettings.cs | 26 +- .../CustomPostProcessComponentListTest.cs | 4 + .../CustomPostProcessOrdersMigrationTests.cs | 7 +- .../BuildProcessors/URPPreprocessBuild.cs | 21 + .../RuntimeTestsDefaultVolumeProfile.asset | 287 +- .../Assets/Scenes/006-Compositor.unity | 2380 ++++++++++------- .../VolumeComponentEditorSupportedOnTests.cs | 2 +- .../Editor/Volumes/VolumeComponentTests.cs | 8 - .../Runtime/Volumes/VolumeManagerTests.cs | 21 +- .../Test/Editor/PhysicsDependencyTests.cs | 26 - .../Editor/PhysicsDependencyTests.cs.meta | 2 +- .../Assets/Test/Editor/TestVolumeComponent.cs | 13 - .../Test/Editor/TestVolumeComponent.cs.meta | 3 - 18 files changed, 1747 insertions(+), 1213 deletions(-) delete mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/TestVolumeComponent.cs delete mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/TestVolumeComponent.cs.meta diff --git a/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs b/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs index 13367b7e2ac..e003810517d 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs @@ -196,7 +196,6 @@ internal void SetVolumeProfile(VolumeProfile p) static Dictionary s_ParameterDrawers; SupportedOnRenderPipelineAttribute m_SupportedOnRenderPipelineAttribute; - Type[] m_LegacyPipelineTypes; static VolumeComponentEditor() { @@ -274,11 +273,6 @@ internal void Init() var volumeComponentType = volumeComponent.GetType(); m_SupportedOnRenderPipelineAttribute = volumeComponentType.GetCustomAttribute(); - -#pragma warning disable CS0618 - var supportedOn = volumeComponentType.GetCustomAttribute(); - m_LegacyPipelineTypes = supportedOn != null ? supportedOn.pipelineTypes : Array.Empty(); -#pragma warning restore CS0618 } internal void DetermineVisibility(Type renderPipelineAssetType, Type renderPipelineType) @@ -295,12 +289,6 @@ internal void DetermineVisibility(Type renderPipelineAssetType, Type renderPipel return; } - if (renderPipelineType != null && m_LegacyPipelineTypes.Length > 0) - { - visible = m_LegacyPipelineTypes.Contains(renderPipelineType); - return; - } - visible = true; } @@ -451,12 +439,12 @@ public virtual GUIContent GetDisplayTitle() var displayInfo = volumeComponentType.GetCustomAttribute(); if (displayInfo != null && !string.IsNullOrWhiteSpace(displayInfo.name)) return EditorGUIUtility.TrTextContent(displayInfo.name, string.Empty); - + #pragma warning disable CS0618 if (!string.IsNullOrWhiteSpace(volumeComponent.displayName)) return EditorGUIUtility.TrTextContent(volumeComponent.displayName, string.Empty); #pragma warning restore CS0618 - + return EditorGUIUtility.TrTextContent(ObjectNames.NicifyVariableName(volumeComponentType.Name) , string.Empty); } diff --git a/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileUtils.cs b/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileUtils.cs index 59b79a90346..f1e43c43019 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileUtils.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileUtils.cs @@ -140,19 +140,19 @@ static VolumeComponent GetVolumeComponentOfTypeOrDefault(this VolumeProfile prof static List GetTypesMissingFromDefaultProfile(VolumeProfile profile) { List missingTypes = new List(); - var volumeComponentTypes = VolumeManager.instance.baseComponentTypeArray; + + var volumeComponentTypes = VolumeManager.instance.isInitialized ? + VolumeManager.instance.baseComponentTypeArray : VolumeManager.instance.LoadBaseTypesByReflection(GraphicsSettings.currentRenderPipelineAssetType); foreach (var type in volumeComponentTypes) { if (profile.components.Find(c => c.GetType() == type) == null) { - if (type.IsDefined(typeof(ObsoleteAttribute), false) || - type.IsDefined(typeof(HideInInspector), false)) + if (type.IsDefined(typeof(ObsoleteAttribute), false)) continue; missingTypes.Add(type); } } - return missingTypes; } @@ -163,13 +163,14 @@ static List GetTypesMissingFromDefaultProfile(VolumeProfile profile) /// VolumeProfile to use. /// An optional VolumeProfile asset containing default values to use for /// any components that are added to . - public static void EnsureAllOverridesForDefaultProfile(VolumeProfile profile, VolumeProfile defaultValueSource = null) + public static void EnsureAllOverridesForDefaultProfile(VolumeProfile profile, VolumeProfile defaultValueSource = null) => TryEnsureAllOverridesForDefaultProfile(profile, defaultValueSource); + internal static bool TryEnsureAllOverridesForDefaultProfile(VolumeProfile profile, VolumeProfile defaultValueSource = null) { // It's possible that the volume profile is assigned to the default asset inside the HDRP package. In // this case it cannot be modified. User is expected to use HDRP Wizard "Fix" to create a local profile. var path = AssetDatabase.GetAssetPath(profile); if (CoreEditorUtils.IsAssetInReadOnlyPackage(path)) - return; + return false; bool changed = false; int numComponentsBefore = profile.components.Count; @@ -241,6 +242,8 @@ public static void EnsureAllOverridesForDefaultProfile(VolumeProfile profile, Vo VolumeManager.instance.OnVolumeProfileChanged(profile); EditorUtility.SetDirty(profile); } + + return changed; } /// diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs b/Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs index 1773e492c4f..f9c60fcdda3 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs @@ -45,7 +45,7 @@ public VolumeComponentMenu(string menu) /// This attribute allows you to add commands to the Add Override popup menu on Volumes, /// while also specifying the render pipeline(s) for which the command will be supported. /// - [Obsolete(@"VolumeComponentMenuForRenderPipelineAttribute is deprecated. Use VolumeComponentMenu with SupportedOnRenderPipeline instead. #from(2023.1)")] + [Obsolete(@"VolumeComponentMenuForRenderPipelineAttribute is deprecated. Use VolumeComponentMenu with SupportedOnRenderPipeline instead. #from(2023.1)", true)] public class VolumeComponentMenuForRenderPipeline : VolumeComponentMenu { /// @@ -126,7 +126,7 @@ public sealed class VolumeComponentDeprecated : Attribute /// /// In the example above, the custom component `ExampleComponent` extends `VolumeComponent` and defines a parameter /// (`intensity`) that can be manipulated within the volume framework. The `ClampedFloatParameter` is a type of - /// that ensures the value remains within a specified range. + /// that ensures the value remains within a specified range. /// /// [Serializable] @@ -164,7 +164,7 @@ public Indent(int relativeAmount = 1) /// The backing storage of . Use this for performance-critical work. /// internal VolumeParameter[] parameterList; - + ReadOnlyCollection m_ParameterReadOnlyCollection; /// @@ -355,7 +355,7 @@ public bool AnyPropertiesIsOverridden() { for (int i = 0; i < parameterList.Length; ++i) { - if (parameterList[i].overrideState) + if (parameterList[i].overrideState) return true; } return false; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs b/Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs index b246d550b03..dce529e4e28 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs @@ -41,6 +41,8 @@ namespace UnityEngine.Rendering /// public sealed partial class VolumeManager { + static readonly ProfilerMarker k_ProfilerMarkerInitialize = new ("VolumeManager.Initialize"); + static readonly ProfilerMarker k_ProfilerMarkerInitializeBaseTypesArray = new ("VolumeManager.InitializeBaseTypesArray"); static readonly ProfilerMarker k_ProfilerMarkerUpdate = new ("VolumeManager.Update"); static readonly ProfilerMarker k_ProfilerMarkerReplaceData = new ("VolumeManager.ReplaceData"); static readonly ProfilerMarker k_ProfilerMarkerEvaluateVolumeDefaultState = new ("VolumeManager.EvaluateVolumeDefaultState"); @@ -78,7 +80,7 @@ public sealed partial class VolumeManager return supportedVolumeComponents; if (baseComponentTypeArray == null) - LoadBaseTypes(currentPipelineAssetType); + InitializeBaseTypesArray(); supportedVolumeComponents = BuildVolumeComponentDisplayList(baseComponentTypeArray); s_SupportedVolumeComponentsForRenderPipeline[currentPipelineAssetType] = supportedVolumeComponents; @@ -145,18 +147,17 @@ internal bool TryGetVolumePathAndType(Type type, out (string path, Type t) resul volumes.Add(result); } - return volumes - .OrderBy(i => i.Item1) - .ToList(); + volumes.Sort((a, b) => string.Compare(a.Item1, b.Item1)); + return volumes; } - + Type[] m_BaseComponentTypeArray; /// /// The current list of all available types that derive from . /// - public Type[] baseComponentTypeArray - { + public Type[] baseComponentTypeArray + { get { if (isInitialized) @@ -165,7 +166,7 @@ public Type[] baseComponentTypeArray throw new InvalidOperationException($"{nameof(VolumeManager)}.{nameof(instance)}.{nameof(baseComponentTypeArray)} cannot be called before the {nameof(VolumeManager)} is initialized. (See {nameof(VolumeManager)}.{nameof(instance)}.{nameof(isInitialized)} and {nameof(RenderPipelineManager)} for creation callback)."); } internal set => m_BaseComponentTypeArray = value; // internal only for tests - } + } /// /// Global default profile that provides default values for volume components. VolumeManager applies @@ -259,13 +260,30 @@ internal VolumeManager() /// Quality default volume profile. public void Initialize(VolumeProfile globalDefaultVolumeProfile = null, VolumeProfile qualityDefaultVolumeProfile = null) { + using var profilerScope = k_ProfilerMarkerInitialize.Auto(); Debug.Assert(!isInitialized); Debug.Assert(m_CreatedVolumeStacks.Count == 0); - LoadBaseTypes(GraphicsSettings.currentRenderPipelineAssetType); + InitializeBaseTypesArray(globalDefaultVolumeProfile); + InitializeInternal(globalDefaultVolumeProfile, qualityDefaultVolumeProfile); } + void InitializeBaseTypesArray(VolumeProfile globalDefaultVolumeProfile = null) + { + using var profilerScope = k_ProfilerMarkerInitializeBaseTypesArray.Auto(); +#if UNITY_EDITOR + LoadBaseTypesByReflection(GraphicsSettings.currentRenderPipelineAssetType); +#else + if (globalDefaultVolumeProfile == null) + { + var defaultVolumeProfileSettings = GraphicsSettings.GetRenderPipelineSettings(); + globalDefaultVolumeProfile = defaultVolumeProfileSettings?.defaultVolumeProfile; + } + LoadBaseTypes(globalDefaultVolumeProfile); +#endif + } + //This is called by test where the basetypes are tuned for the purpose of the test. internal void InitializeInternal(VolumeProfile globalDefaultVolumeProfile = null, VolumeProfile qualityDefaultVolumeProfile = null) { @@ -305,6 +323,7 @@ public void Deinitialize() /// The VolumeProfile to use as the global default profile. public void SetGlobalDefaultProfile(VolumeProfile profile) { + LoadBaseTypes(profile); globalDefaultProfile = profile; EvaluateVolumeDefaultState(); } @@ -327,6 +346,10 @@ public void SetCustomDefaultProfiles(List profiles) { var validProfiles = profiles ?? new List(); validProfiles.RemoveAll(x => x == null); + + if (globalDefaultProfile == null && validProfiles.Count > 0) + globalDefaultProfile = validProfiles[0]; + customDefaultProfiles = new ReadOnlyCollection(validProfiles); EvaluateVolumeDefaultState(); } @@ -408,38 +431,44 @@ public void DestroyStack(VolumeStack stack) stack.Dispose(); } - // For now, if a user is having a VolumeComponent with the old attribute for filtering support. - // We are adding it to the supported volume components, but we are showing a warning. - bool IsSupportedByObsoleteVolumeComponentMenuForRenderPipeline(Type t, Type pipelineAssetType) + /// + /// LoadBaseTypes is responsible for loading the list of VolumeComponent types that will be used to build the default state of the VolumeStack. It uses the provided global default profile to determine which component types are relevant for the current render pipeline. + /// This will be called only once at runtime on app boot + /// + /// The global default volume profile to use to build the base component type array. + internal void LoadBaseTypes(VolumeProfile globalDefaultVolumeProfile) { - var legacySupported = false; - -#pragma warning disable CS0618 - var legacyPipelineAttribute = t.GetCustomAttribute(); - if (legacyPipelineAttribute != null) + if (globalDefaultVolumeProfile == null) { - Debug.LogWarning($"{nameof(VolumeComponentMenuForRenderPipeline)} is deprecated, use {nameof(SupportedOnRenderPipelineAttribute)} and {nameof(VolumeComponentMenu)} with {t} instead. #from(2023.1)"); -#if UNITY_EDITOR - var renderPipelineTypeFromAsset = RenderPipelineEditorUtility.GetPipelineTypeFromPipelineAssetType(pipelineAssetType); + m_BaseComponentTypeArray = Array.Empty(); + return; + } - for (int i = 0; i < legacyPipelineAttribute.pipelineTypes.Length; ++i) + using (ListPool.Get(out var list)) + { + var pipelineAssetType = GraphicsSettings.currentRenderPipelineAssetType; + foreach (var comp in globalDefaultVolumeProfile.components) { - if (legacyPipelineAttribute.pipelineTypes[i] == renderPipelineTypeFromAsset) - { - legacySupported = true; - break; - } + if (comp == null) continue; + + var componentType = comp.GetType(); + if (!SupportedOnRenderPipelineAttribute.IsTypeSupportedOnRenderPipeline(componentType, pipelineAssetType)) + continue; + + list.Add(componentType); } -#endif - } -#pragma warning restore CS0618 - return legacySupported; + m_BaseComponentTypeArray = list.ToArray(); + } } - // This will be called only once at runtime and on domain reload / pipeline switch in the editor - // as we need to keep track of any compatible component in the project - internal void LoadBaseTypes(Type pipelineAssetType) +#if UNITY_EDITOR + /// + /// This should only be called when we need to load base types without being able to trust default profiles are up to date. This is slow and uses Reflection! + /// Will be called only once at runtime and on domain reload / pipeline switch in the editor as we need to keep track of any compatible component in the project + /// + /// The Pipeline Type used to check if each VolumeComponent is supported. + internal Type[] LoadBaseTypesByReflection(Type pipelineAssetType) { // Grab all the component types we can find that are compatible with current pipeline using (ListPool.Get(out var list)) @@ -449,23 +478,25 @@ internal void LoadBaseTypes(Type pipelineAssetType) if (t.IsAbstract) continue; - var isSupported = SupportedOnRenderPipelineAttribute.IsTypeSupportedOnRenderPipeline(t, pipelineAssetType) || - IsSupportedByObsoleteVolumeComponentMenuForRenderPipeline(t, pipelineAssetType); + if (!SupportedOnRenderPipelineAttribute.IsTypeSupportedOnRenderPipeline(t, pipelineAssetType)) + continue; - if (isSupported) - list.Add(t); + list.Add(t); } m_BaseComponentTypeArray = list.ToArray(); } + + return m_BaseComponentTypeArray; } +#endif internal void InitializeVolumeComponents() { if (m_BaseComponentTypeArray == null || m_BaseComponentTypeArray.Length == 0) return; - // Call custom static Init method if present + // Call deprecated static Init method if present var flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; foreach (var type in m_BaseComponentTypeArray) { @@ -481,7 +512,11 @@ internal void InitializeVolumeComponents() void EvaluateVolumeDefaultState() { if (m_BaseComponentTypeArray == null || m_BaseComponentTypeArray.Length == 0) + { + m_ComponentsDefaultState = Array.Empty(); + m_ParametersDefaultState = Array.Empty(); return; + } using var profilerScope = k_ProfilerMarkerEvaluateVolumeDefaultState.Auto(); @@ -490,7 +525,7 @@ void EvaluateVolumeDefaultState() // Initialize() and the default state can be updated a lot quicker. // First, default-construct all VolumeComponents - List componentsDefaultStateList = new(); + using var _ = ListPool.Get(out var componentsDefaultStateList); foreach (var type in m_BaseComponentTypeArray) { componentsDefaultStateList.Add((VolumeComponent) ScriptableObject.CreateInstance(type)); diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessBuild.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessBuild.cs index 6c42e4d5da7..466f109fec8 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessBuild.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessBuild.cs @@ -41,6 +41,12 @@ public void OnPreprocessBuild(BuildReport report) ConfigureMinimumMaxLoDValueForAllQualitySettings(); + if (HDRenderPipelineGlobalSettings.instance.TryInitializeDefaultVolumeProfile(out var defaultVolumeProfileSettings) || + VolumeProfileUtils.TryEnsureAllOverridesForDefaultProfile(defaultVolumeProfileSettings?.volumeProfile)) + { + Debug.Log("Default Volume Profile has been modified to ensure all overrides are present. This is required to avoid missing overrides at runtime which can lead to unexpected rendering issues. Please save these changes to avoid this message in the future."); + } + LogIncludedAssets(m_BuildData.renderPipelineAssets); if (!IsConfigurationValid()) @@ -48,7 +54,7 @@ public void OnPreprocessBuild(BuildReport report) if(!ProceedWithBuild()) throw new BuildFailedException("Build canceled by user due to HDRP configuration issues."); } - + GatherShaderFeatures(); } diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineGlobalSettings.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineGlobalSettings.cs index d68cc3d74cc..c226b7eeaf1 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineGlobalSettings.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineGlobalSettings.cs @@ -91,14 +91,28 @@ public override void Initialize(RenderPipelineGlobalSettings source = null) { SetUpRPAssetIncluded(); - TryGet(typeof(HDRenderPipelineEditorAssets), out var editorAssets); - var assets = editorAssets as HDRenderPipelineEditorAssets; - - if (TryGet(typeof(HDRPDefaultVolumeProfileSettings), out var defaultSettings) && - defaultSettings is HDRPDefaultVolumeProfileSettings defaultVolumeProfileSettings) + InitializeDefaultVolumeProfile(); + } + internal HDRPDefaultVolumeProfileSettings InitializeDefaultVolumeProfile() + { + TryInitializeDefaultVolumeProfile(out var defaultVolumeProfileSettings); + return defaultVolumeProfileSettings; + } + internal bool TryInitializeDefaultVolumeProfile(out HDRPDefaultVolumeProfileSettings defaultVolumeProfileSettings) + { + defaultVolumeProfileSettings = null; + var changed = false; + if (TryGet(typeof(HDRenderPipelineEditorAssets), out var editorAssets) && + TryGet(typeof(HDRPDefaultVolumeProfileSettings), out var defaultSettings) && + defaultSettings is HDRPDefaultVolumeProfileSettings settings && + editorAssets is HDRenderPipelineEditorAssets assets) { + defaultVolumeProfileSettings = settings; if (defaultVolumeProfileSettings.volumeProfile == null && assets != null) + { + changed = true; defaultVolumeProfileSettings.volumeProfile = VolumeUtils.CopyVolumeProfileFromResourcesToAssets(assets.defaultVolumeProfile); + } // Initialize the Volume Profile with the default diffusion profiles var diffusionProfileList = VolumeUtils.GetOrCreateDiffusionProfileList(defaultVolumeProfileSettings.volumeProfile); @@ -107,8 +121,10 @@ public override void Initialize(RenderPipelineGlobalSettings source = null) { diffusionProfileList.diffusionProfiles.value = VolumeUtils.CreateArrayWithDefaultDiffusionProfileSettingsList(assets); EditorUtility.SetDirty(diffusionProfileList); + changed = true; } } + return changed; } void SetUpRPAssetIncluded() diff --git a/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/CustomPostProcessComponentListTest.cs b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/CustomPostProcessComponentListTest.cs index 0c933ed514f..24e2844ece2 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/CustomPostProcessComponentListTest.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/CustomPostProcessComponentListTest.cs @@ -5,6 +5,8 @@ using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; +#pragma warning disable 618 + namespace UnityEditor.Rendering.HighDefinition.Tests { class CustomPostProcessComponentListTest @@ -14,6 +16,7 @@ public void TearDown() { } + [Obsolete("Obsolete to strip from builds")] class TestComponent : CustomPostProcessVolumeComponent { public override void Render(CommandBuffer cmd, HDCamera camera, RTHandle source, RTHandle destination) @@ -22,6 +25,7 @@ public override void Render(CommandBuffer cmd, HDCamera camera, RTHandle source, } } + [Obsolete("Obsolete to strip from builds")] class TestComponent2 : CustomPostProcessVolumeComponent { public override void Render(CommandBuffer cmd, HDCamera camera, RTHandle source, RTHandle destination) diff --git a/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDRPGlobalSettingsMigrationTests/CustomPostProcessOrdersMigrationTests.cs b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDRPGlobalSettingsMigrationTests/CustomPostProcessOrdersMigrationTests.cs index 1bc09d3b63d..47455cc62ef 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDRPGlobalSettingsMigrationTests/CustomPostProcessOrdersMigrationTests.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDRPGlobalSettingsMigrationTests/CustomPostProcessOrdersMigrationTests.cs @@ -7,9 +7,9 @@ namespace UnityEditor.Rendering.HighDefinition.Test.GlobalSettingsMigration { class CustomPostProcessOrdersMigrationTests : RenderPipelineGraphicsSettingsMigrationTestBase - { [Serializable, HideInInspector] + [Obsolete("Obsolete to strip from builds")] class CustomPostProcessesTestComponent : CustomPostProcessVolumeComponent, IPostProcessComponent { // For testing purposes we do not have a correct injection point for each setting as is not checked. @@ -34,9 +34,9 @@ class TestCase : IRenderPipelineGraphicsSettingsTestCase(); isMigrationCorrect &= settings.beforeTransparentCustomPostProcesses.Contains(); isMigrationCorrect &= settings.afterPostProcessBlursCustomPostProcesses.Contains(); @@ -62,6 +62,7 @@ public bool IsMigrationCorrect(CustomPostProcessOrdersSettings settings, out str if (!isMigrationCorrect) message = $"{nameof(CustomPostProcessesTestComponent)} has not been found in some list"; return isMigrationCorrect; +#pragma warning restore 618 } } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/URPPreprocessBuild.cs b/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/URPPreprocessBuild.cs index 17941842c23..664792ea8eb 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/URPPreprocessBuild.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/URPPreprocessBuild.cs @@ -27,10 +27,31 @@ public void OnPreprocessBuild(BuildReport report) if (!URPBuildDataValidator.IsProjectValidForBuilding(report, out var message)) throw new BuildFailedException(message); + EnsureVolumeProfile(); + LogIncludedAssets(m_BuildData.renderPipelineAssets); } } + static void EnsureVolumeProfile() + { + if (GraphicsSettings.TryGetRenderPipelineSettings(out var volumeProfileSettings)) + { + var initState = volumeProfileSettings.volumeProfile; + volumeProfileSettings.volumeProfile = UniversalRenderPipelineGlobalSettings.GetOrCreateDefaultVolumeProfile(volumeProfileSettings.volumeProfile); + + if (initState != volumeProfileSettings.volumeProfile) + { + Debug.Log($"Default Volume Profile was missing, one has been created automatically at '{AssetDatabase.GetAssetPath(volumeProfileSettings.volumeProfile)}'."); + } + + if (VolumeProfileUtils.TryEnsureAllOverridesForDefaultProfile(volumeProfileSettings.volumeProfile)) + { + Debug.Log("Default Volume Profile has been modified to ensure all overrides are present. This is required to avoid missing overrides at runtime which can lead to unexpected rendering issues. Please save these changes to avoid this message in the future."); + } + } + } + internal static void LogIncludedAssets(List assetsList) { using (GenericPool.Get(out var assetsIncluded)) diff --git a/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/HDRPDefaultResources/RuntimeTestsDefaultVolumeProfile.asset b/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/HDRPDefaultResources/RuntimeTestsDefaultVolumeProfile.asset index 22770b079fa..53708910487 100644 --- a/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/HDRPDefaultResources/RuntimeTestsDefaultVolumeProfile.asset +++ b/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/HDRPDefaultResources/RuntimeTestsDefaultVolumeProfile.asset @@ -142,6 +142,11 @@ MonoBehaviour: m_RayMaxIterationsRT: m_OverrideState: 1 m_Value: 48 + adaptiveProbeVolumesLayerMask: + m_OverrideState: 1 + m_Value: + serializedVersion: 0 + m_Bits: 1 --- !u!114 &-8709408532520374176 MonoBehaviour: m_ObjectHideFlags: 3 @@ -202,6 +207,22 @@ MonoBehaviour: tileOpacityThreshold: m_OverrideState: 1 m_Value: 1 + writeDepthAlphaThreshold: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-7739451323514130505 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: TestComponent + m_EditorClassIdentifier: Unity.RenderPipelines.HighDefinition.Editor.Tests:UnityEditor.Rendering.HighDefinition.Tests:CustomPostProcessComponentListTest/TestComponent + active: 1 --- !u!114 &-7246698617964109626 MonoBehaviour: m_ObjectHideFlags: 3 @@ -224,6 +245,19 @@ MonoBehaviour: balance: m_OverrideState: 1 m_Value: 0 +--- !u!114 &-7123124553783797643 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: TestComponent + m_EditorClassIdentifier: Unity.RenderPipelines.HighDefinition.Editor.Tests:UnityEditor.Rendering.HighDefinition.Tests:CustomPostProcessComponentListTest/TestComponent + active: 1 --- !u!114 &-7075947427743425047 MonoBehaviour: m_ObjectHideFlags: 3 @@ -480,9 +514,31 @@ MonoBehaviour: m_PhysicallyBased: m_OverrideState: 1 m_Value: 0 + m_AdaptiveSamplingWeight: + m_OverrideState: 1 + m_Value: 0.75 m_LimitManualRangeNearBlur: m_OverrideState: 1 m_Value: 0 + coCStabilization: + m_OverrideState: 1 + m_Value: 1 +--- !u!114 &-5764323527967918075 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cf4ca3f87079ba246a93410400bb24c4, type: 3} + m_Name: ChromaKeying + m_EditorClassIdentifier: Unity.RenderPipelines.HighDefinition.Runtime::UnityEngine.Rendering.HighDefinition.Compositor.ChromaKeying + active: 1 + activate: + m_OverrideState: 1 + m_Value: 0 --- !u!114 &-5708058657063037015 MonoBehaviour: m_ObjectHideFlags: 3 @@ -673,6 +729,32 @@ MonoBehaviour: m_PostInfinity: 2 m_RotationOrder: 4 m_SelectedCurve: 0 +--- !u!114 &-5518664618547686920 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: CustomPostProcessesTestComponent + m_EditorClassIdentifier: Unity.RenderPipelines.HighDefinition.Editor.Tests:UnityEditor.Rendering.HighDefinition.Test.GlobalSettingsMigration:CustomPostProcessOrdersMigrationTests/CustomPostProcessesTestComponent + active: 1 +--- !u!114 &-4999627956410936425 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: TestComponent2 + m_EditorClassIdentifier: Unity.RenderPipelines.HighDefinition.Editor.Tests:UnityEditor.Rendering.HighDefinition.Tests:CustomPostProcessComponentListTest/TestComponent2 + active: 1 --- !u!114 &-4827657061865861275 MonoBehaviour: m_ObjectHideFlags: 3 @@ -759,6 +841,19 @@ MonoBehaviour: sampleCount: m_OverrideState: 1 m_Value: 1 +--- !u!114 &-4663216890105621533 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da907761ad48a684aa45e5dc639d9304, type: 3} + m_Name: AlphaInjection + m_EditorClassIdentifier: Unity.RenderPipelines.HighDefinition.Runtime::UnityEngine.Rendering.HighDefinition.Compositor.AlphaInjection + active: 1 --- !u!114 &-4384083579854892528 MonoBehaviour: m_ObjectHideFlags: 3 @@ -839,6 +934,11 @@ MonoBehaviour: rayMiss: m_OverrideState: 1 m_Value: 3 + adaptiveProbeVolumesLayerMask: + m_OverrideState: 1 + m_Value: + serializedVersion: 0 + m_Bits: 1 depthBufferThickness: m_OverrideState: 1 m_Value: 0.1 @@ -1165,6 +1265,25 @@ MonoBehaviour: tilingParameters: m_OverrideState: 1 m_Value: {x: 1, y: 1, z: 0, w: 0} + seedMode: + m_OverrideState: 1 + m_Value: 0 + customSeed: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-1188996441049714604 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: TestComponent2 + m_EditorClassIdentifier: Unity.RenderPipelines.HighDefinition.Editor.Tests:UnityEditor.Rendering.HighDefinition.Tests:CustomPostProcessComponentListTest/TestComponent2 + active: 1 --- !u!114 &-688532562795869724 MonoBehaviour: m_ObjectHideFlags: 3 @@ -1370,17 +1489,10 @@ MonoBehaviour: - {fileID: -7075947427743425047} - {fileID: -8763409069734796491} - {fileID: 8905465521536762476} - - {fileID: 8915808375378866830} - - {fileID: 6048895169011428347} - - {fileID: -4283572591636895020} - {fileID: 4996846787334918998} - - {fileID: 5272879409583702316} - - {fileID: 2580024676090772256} - - {fileID: -8434016068765879828} - - {fileID: -2229819705722879696} - - {fileID: 6646219502037267185} - - {fileID: -4384083579854892528} - {fileID: 7464798260824706875} + - {fileID: -4663216890105621533} + - {fileID: -5764323527967918075} --- !u!114 &914979290351957011 MonoBehaviour: m_ObjectHideFlags: 3 @@ -1394,6 +1506,25 @@ MonoBehaviour: m_Name: VolumetricClouds m_EditorClassIdentifier: active: 1 + m_Version: 3 + localClouds: + m_OverrideState: 1 + m_Value: 0 + m_ObsoleteWindSpeed: + m_OverrideState: 1 + m_Value: 1 + m_ObsoleteOrientation: + m_OverrideState: 1 + m_Value: 0 + m_ObsoleteShapeOffsetX: + m_OverrideState: 1 + m_Value: 0 + m_ObsoleteShapeOffsetY: + m_OverrideState: 1 + m_Value: 0 + m_ObsoleteShapeOffsetZ: + m_OverrideState: 1 + m_Value: 0 enable: m_OverrideState: 1 m_Value: 0 @@ -1678,25 +1809,6 @@ MonoBehaviour: shadowOpacityFallback: m_OverrideState: 1 m_Value: 0 - m_Version: 3 - localClouds: - m_OverrideState: 1 - m_Value: 0 - m_ObsoleteWindSpeed: - m_OverrideState: 1 - m_Value: 1 - m_ObsoleteOrientation: - m_OverrideState: 1 - m_Value: 0 - m_ObsoleteShapeOffsetX: - m_OverrideState: 1 - m_Value: 0 - m_ObsoleteShapeOffsetY: - m_OverrideState: 1 - m_Value: 0 - m_ObsoleteShapeOffsetZ: - m_OverrideState: 1 - m_Value: 0 --- !u!114 &1019198869158007962 MonoBehaviour: m_ObjectHideFlags: 3 @@ -1829,6 +1941,9 @@ MonoBehaviour: sliceDistributionUniformity: m_OverrideState: 1 m_Value: 0.75 + multipleScatteringIntensity: + m_OverrideState: 1 + m_Value: 0 m_FogControlMode: m_OverrideState: 1 m_Value: 0 @@ -1847,6 +1962,9 @@ MonoBehaviour: directionalLightsOnly: m_OverrideState: 1 m_Value: 0 + volumetricLightingDensityCutoff: + m_OverrideState: 1 + m_Value: 0 --- !u!114 &2580024676090772256 MonoBehaviour: m_ObjectHideFlags: 3 @@ -2009,6 +2127,19 @@ MonoBehaviour: m_SampleCount: m_OverrideState: 1 m_Value: 10 +--- !u!114 &4299465874012644358 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: CustomPostProcessesTestComponent + m_EditorClassIdentifier: Unity.RenderPipelines.HighDefinition.Editor.Tests:UnityEditor.Rendering.HighDefinition.Test.GlobalSettingsMigration:CustomPostProcessOrdersMigrationTests/CustomPostProcessesTestComponent + active: 1 --- !u!114 &4555149668680963751 MonoBehaviour: m_ObjectHideFlags: 3 @@ -2120,6 +2251,7 @@ MonoBehaviour: m_Name: VisualEnvironment m_EditorClassIdentifier: active: 1 + m_Version: 1 skyType: m_OverrideState: 1 m_Value: 0 @@ -2150,7 +2282,6 @@ MonoBehaviour: fogType: m_OverrideState: 1 m_Value: 0 - m_Version: 1 --- !u!114 &4949846515292518198 MonoBehaviour: m_ObjectHideFlags: 3 @@ -2269,6 +2400,28 @@ MonoBehaviour: occlusionOnlyReflectionNormalization: m_OverrideState: 1 m_Value: 1 + intensityMultiplier: + m_OverrideState: 1 + m_Value: 1 + skyOcclusionIntensityMultiplier: + m_OverrideState: 1 + m_Value: 1 + worldOffset: + m_OverrideState: 1 + m_Value: {x: 0, y: 0, z: 0} +--- !u!114 &5003559593845283392 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: TestComponent2 + m_EditorClassIdentifier: Unity.RenderPipelines.HighDefinition.Editor.Tests:UnityEditor.Rendering.HighDefinition.Tests:CustomPostProcessComponentListTest/TestComponent2 + active: 1 --- !u!114 &5272879409583702316 MonoBehaviour: m_ObjectHideFlags: 3 @@ -2369,6 +2522,19 @@ MonoBehaviour: includeSunInBaking: m_OverrideState: 1 m_Value: 0 + m_SkyVersion: 1 + enableDistortion: + m_OverrideState: 1 + m_Value: 0 + procedural: + m_OverrideState: 1 + m_Value: 1 + scrollDirection: + m_OverrideState: 1 + m_Value: 0 + m_ObsoleteScrollSpeed: + m_OverrideState: 1 + m_Value: 1 hdriSky: m_OverrideState: 1 m_Value: {fileID: 0} @@ -2440,19 +2606,6 @@ MonoBehaviour: rectLightShadow: m_OverrideState: 1 m_Value: 0 - m_SkyVersion: 1 - enableDistortion: - m_OverrideState: 1 - m_Value: 0 - procedural: - m_OverrideState: 1 - m_Value: 1 - scrollDirection: - m_OverrideState: 1 - m_Value: 0 - m_ObsoleteScrollSpeed: - m_OverrideState: 1 - m_Value: 1 --- !u!114 &6046202428831047222 MonoBehaviour: m_ObjectHideFlags: 3 @@ -2466,6 +2619,7 @@ MonoBehaviour: m_Name: HDShadowSettings m_EditorClassIdentifier: active: 1 + interCascadeBorders: 1 maxShadowDistance: m_OverrideState: 1 m_Value: 500 @@ -2547,6 +2701,19 @@ MonoBehaviour: p21: m_OverrideState: 1 m_Value: 0 +--- !u!114 &6682535370678827113 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: CustomPostProcessesTestComponent + m_EditorClassIdentifier: Unity.RenderPipelines.HighDefinition.Editor.Tests:UnityEditor.Rendering.HighDefinition.Test.GlobalSettingsMigration:CustomPostProcessOrdersMigrationTests/CustomPostProcessesTestComponent + active: 1 --- !u!114 &6713115047983291795 MonoBehaviour: m_ObjectHideFlags: 3 @@ -2590,6 +2757,16 @@ MonoBehaviour: includeSunInBaking: m_OverrideState: 1 m_Value: 0 + m_SkyVersion: 2 + m_ObsoleteEarthPreset: + m_OverrideState: 1 + m_Value: 1 + planetaryRadius: + m_OverrideState: 1 + m_Value: 6378100 + planetCenterPosition: + m_OverrideState: 1 + m_Value: {x: 0, y: -6378100, z: 0} type: m_OverrideState: 1 m_Value: 2 @@ -2681,16 +2858,6 @@ MonoBehaviour: horizonZenithShift: m_OverrideState: 1 m_Value: 0 - m_SkyVersion: 2 - m_ObsoleteEarthPreset: - m_OverrideState: 1 - m_Value: 1 - planetaryRadius: - m_OverrideState: 1 - m_Value: 6378100 - planetCenterPosition: - m_OverrideState: 1 - m_Value: {x: 0, y: -6378100, z: 0} --- !u!114 &6960557901262462549 MonoBehaviour: m_ObjectHideFlags: 3 @@ -2783,6 +2950,19 @@ MonoBehaviour: tint: m_OverrideState: 1 m_Value: {r: 0, g: 0, b: 0, a: 1} +--- !u!114 &8659316401418472115 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: TestComponent + m_EditorClassIdentifier: Unity.RenderPipelines.HighDefinition.Editor.Tests:UnityEditor.Rendering.HighDefinition.Tests:CustomPostProcessComponentListTest/TestComponent + active: 1 --- !u!114 &8905465521536762476 MonoBehaviour: m_ObjectHideFlags: 3 @@ -2823,6 +3003,9 @@ MonoBehaviour: cullingDistance: m_OverrideState: 1 m_Value: 1000 + minSolidAngle: + m_OverrideState: 1 + m_Value: 4 --- !u!114 &8915808375378866830 MonoBehaviour: m_ObjectHideFlags: 3 diff --git a/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Scenes/006-Compositor.unity b/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Scenes/006-Compositor.unity index 161e5c0358e..4d7ab1769ac 100644 --- a/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Scenes/006-Compositor.unity +++ b/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Scenes/006-Compositor.unity @@ -38,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 2035111234} - m_IndirectSpecularColor: {r: 3074.1802, g: 3809.067, b: 5041.4185, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 12 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -352,23 +352,28 @@ MonoBehaviour: m_PointlightHDType: 0 m_SpotLightShape: 0 m_AreaLightShape: 0 - m_Intensity: 100000 m_EnableSpotReflector: 0 + m_LightUnit: 0 m_LuxAtDistance: 1 - m_InnerSpotPercent: 82.6 + m_Intensity: 100000 + m_InnerSpotPercent: -1 + m_ShapeWidth: -1 + m_ShapeHeight: -1 + m_AspectRatio: 1 + m_ShapeRadius: -1 + m_Version: 15 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 m_SpotIESCutoffPercent: 100 m_LightDimmer: 1 m_VolumetricDimmer: 1 - m_LightUnit: 0 m_FadeDistance: 10000 m_VolumetricFadeDistance: 10000 m_AffectDiffuse: 1 m_AffectSpecular: 1 m_NonLightmappedOnly: 0 - m_ShapeWidth: 0.5 - m_ShapeHeight: 0.5 - m_AspectRatio: 1 - m_ShapeRadius: 0.025 m_SoftnessScale: 1 m_UseCustomSpotLightShadowCone: 0 m_CustomSpotLightShadowCone: 30 @@ -379,30 +384,33 @@ MonoBehaviour: m_IESPoint: {fileID: 0} m_IESSpot: {fileID: 0} m_IncludeForRayTracing: 1 + m_IncludeForPathTracing: 1 m_AreaLightShadowCone: 120 m_UseScreenSpaceShadows: 0 m_InteractsWithSky: 1 m_AngularDiameter: 0.5 - m_DiameterMultiplerMode: 1 - m_DiameterMultiplier: 1 - m_DiameterOverride: 0.5 - m_EmissiveLightSource: 1 - m_FlareSize: 2 - m_FlareTint: {r: 1, g: 1, b: 1, a: 1} - m_FlareFalloff: 4 - m_AutomaticMoonPhase: 1 - m_MoonPhase: 0.2 - m_MoonPhaseRotation: 0 - m_Earthshine: 1 - m_SurfaceTexture: {fileID: 0} - m_SurfaceTint: {r: 1, g: 1, b: 1, a: 1} + diameterMultiplerMode: 1 + diameterMultiplier: 1 + diameterOverride: 0.5 + celestialBodyShadingSource: 1 + sunLightOverride: {fileID: 0} + sunColor: {r: 1, g: 1, b: 1, a: 1} + sunIntensity: 130000 + moonPhase: 0.2 + moonPhaseRotation: 0 + earthshine: 1 + flareSize: 2 + flareTint: {r: 1, g: 1, b: 1, a: 1} + flareFalloff: 4 + flareMultiplier: 1 + surfaceTexture: {fileID: 0} + surfaceTint: {r: 1, g: 1, b: 1, a: 1} m_Distance: 1.5e+11 m_UseRayTracedShadows: 0 m_NumRayTracingSamples: 4 m_FilterTracedShadow: 1 m_FilterSizeTraced: 16 m_SunLightConeAngle: 0.5 - m_LightShadowRadius: 0.5 m_SemiTransparentShadow: 0 m_ColorShadow: 1 m_DistanceBasedFiltering: 0 @@ -418,7 +426,7 @@ MonoBehaviour: m_MinFilterSize: 1 m_DirLightPCSSBlockerSampleCount: 24 m_DirLightPCSSFilterSampleCount: 16 - m_DirLightPCSSMaxBlockerDistance: 64 + m_DirLightPCSSMaxPenumbraSize: 0.56 m_DirLightPCSSMaxSamplingDistance: 0.5 m_DirLightPCSSMinFilterSizeTexels: 1.5 m_DirLightPCSSMinFilterMaxAngularDiameter: 10 @@ -470,11 +478,6 @@ MonoBehaviour: m_AreaLightEmissiveMeshShadowCastingMode: 0 m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 m_AreaLightEmissiveMeshLayer: -1 - m_Version: 12 - m_ObsoleteShadowResolutionTier: 1 - m_ObsoleteUseShadowQualitySettings: 0 - m_ObsoleteCustomShadowResolution: 512 - m_ObsoleteContactShadows: 0 --- !u!108 &109571089 Light: m_ObjectHideFlags: 0 @@ -483,14 +486,14 @@ Light: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 109571086} m_Enabled: 1 - serializedVersion: 11 + serializedVersion: 13 m_Type: 0 m_Color: {r: 1, g: 1, b: 1, a: 1} m_Intensity: 7957.747 m_Range: 5 m_SpotAngle: 88.2 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 + m_InnerSpotAngle: 72.853195 + m_CookieSize2D: {x: 10, y: 10} m_Shadows: m_Type: 1 m_Resolution: -1 @@ -534,45 +537,12 @@ Light: m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} m_UseBoundingSphereOverride: 0 m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 + m_ForceVisible: 0 + m_ShapeRadius: 0.025 m_ShadowAngle: 0 ---- !u!84 &114834915 -RenderTexture: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_ImageContentsHash: - serializedVersion: 2 - Hash: 00000000000000000000000000000000 - m_IsAlphaChannelOptional: 0 - serializedVersion: 6 - m_Width: 960 - m_Height: 540 - m_AntiAliasing: 1 - m_MipCount: -1 - m_DepthStencilFormat: 94 - m_ColorFormat: 48 - m_MipMap: 0 - m_GenerateMips: 1 - m_SRGB: 0 - m_UseDynamicScale: 0 - m_UseDynamicScaleExplicit: 0 - m_BindMS: 0 - m_EnableCompatibleFormat: 1 - m_EnableRandomWrite: 0 - m_TextureSettings: - serializedVersion: 2 - m_FilterMode: 1 - m_Aniso: 0 - m_MipBias: 0 - m_WrapU: 1 - m_WrapV: 1 - m_WrapW: 1 - m_Dimension: 2 - m_VolumeDepth: 1 - m_ShadowSamplingMode: 2 + m_LightUnit: 0 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 0 --- !u!1 &168218571 GameObject: m_ObjectHideFlags: 0 @@ -602,7 +572,7 @@ Transform: m_GameObject: {fileID: 168218571} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.019999983, y: 1.196, z: 1.8100562} + m_LocalPosition: {x: 0.019999983, y: 1.196, z: 1.8100605} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -653,6 +623,101 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0ef8dc2c2eabfa4e8cb77be57a837c0, type: 3} m_Name: m_EditorClassIdentifier: + m_HDProbeVersion: 9 + m_ObsoleteInfiniteProjection: 0 + m_ObsoleteInfluenceVolume: + m_EditorAdvancedModeBlendDistancePositive: {x: 0.1, y: 0.33046675, z: 0} + m_EditorAdvancedModeBlendDistanceNegative: {x: 0, y: 0, z: 0.1} + m_EditorSimplifiedModeBlendDistance: 0.33046675 + m_EditorAdvancedModeBlendNormalDistancePositive: {x: 0.1, y: 0, z: 0} + m_EditorAdvancedModeBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_EditorSimplifiedModeBlendNormalDistance: 0.1 + m_EditorAdvancedModeEnabled: 1 + m_EditorAdvancedModeFaceFadePositive: {x: 1, y: 1, z: 1} + m_EditorAdvancedModeFaceFadeNegative: {x: 1, y: 1, z: 1} + m_Version: 1 + m_ObsoleteSphereBaseOffset: {x: 0, y: 0, z: 0} + m_ObsoleteOffset: {x: 0, y: 0, z: 0} + m_Shape: 0 + m_BoxSize: {x: 3.683801, y: 2.547348, z: 3.717638} + m_BoxBlendDistancePositive: {x: 0.1, y: 0.33046675, z: 0} + m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0.1} + m_BoxBlendNormalDistancePositive: {x: 0.1, y: 0, z: 0} + m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxSideFadePositive: {x: 1, y: 1, z: 1} + m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} + m_SphereRadius: 3 + m_SphereBlendDistance: 0 + m_SphereBlendNormalDistance: 0 + m_ObsoleteFrameSettings: + overrides: 0 + enableShadow: 1 + enableContactShadows: 1 + enableShadowMask: 1 + enableSSR: 0 + enableSSAO: 1 + enableSubsurfaceScattering: 1 + enableTransmission: 1 + enableAtmosphericScattering: 1 + enableVolumetrics: 1 + enableReprojectionForVolumetrics: 1 + enableLightLayers: 1 + enableExposureControl: 1 + diffuseGlobalDimmer: 1 + specularGlobalDimmer: 1 + shaderLitMode: 1 + enableDepthPrepassWithDeferredRendering: 0 + enableTransparentPrepass: 1 + enableMotionVectors: 1 + enableObjectMotionVectors: 1 + enableDecals: 1 + enableRoughRefraction: 1 + enableTransparentPostpass: 1 + enableDistortion: 1 + enablePostprocess: 1 + enableOpaqueObjects: 1 + enableTransparentObjects: 1 + enableRealtimePlanarReflection: 1 + enableMSAA: 0 + enableAsyncCompute: 1 + runLightListAsync: 1 + runSSRAsync: 1 + runSSAOAsync: 1 + runContactShadowsAsync: 1 + runVolumeVoxelizationAsync: 1 + lightLoopSettings: + overrides: 0 + enableDeferredTileAndCluster: 1 + enableComputeLightEvaluation: 1 + enableComputeLightVariants: 1 + enableComputeMaterialVariants: 1 + enableFptlForForwardOpaque: 1 + enableBigTilePrepass: 1 + isFptlEnabled: 1 + m_ObsoleteMultiplier: 1 + m_ObsoleteWeight: 1 + m_ObsoleteMode: 0 + m_ObsoleteLightLayers: 1 + m_ObsoleteCaptureSettings: + overrides: 0 + clearColorMode: 0 + backgroundColorHDR: {r: 0.023529412, g: 0.07058824, b: 0.1882353, a: 0} + clearDepth: 1 + cullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + useOcclusionCulling: 1 + volumeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + volumeAnchorOverride: {fileID: 0} + projection: 0 + nearClipPlane: 0.3 + farClipPlane: 1000 + fieldOfView: 90 + orthographicSize: 5 + renderingPath: 0 + shadowDistance: 100 m_ProbeSettings: frustum: fieldOfViewMode: 1 @@ -664,23 +729,13 @@ MonoBehaviour: realtimeMode: 0 timeSlicing: 0 lighting: + importance: 1 multiplier: 1 weight: 1 lightLayer: 1 fadeDistance: 10000 rangeCompressionFactor: 1 influence: - m_Shape: 0 - m_BoxSize: {x: 3.683801, y: 2.547348, z: 3.717638} - m_BoxBlendDistancePositive: {x: 0.1, y: 0.33046675, z: 0} - m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0.1} - m_BoxBlendNormalDistancePositive: {x: 0.1, y: 0, z: 0} - m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxSideFadePositive: {x: 1, y: 1, z: 1} - m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} - m_SphereRadius: 3 - m_SphereBlendDistance: 0 - m_SphereBlendNormalDistance: 0 m_EditorAdvancedModeBlendDistancePositive: {x: 0.1, y: 0.33046675, z: 0} m_EditorAdvancedModeBlendDistanceNegative: {x: 0, y: 0, z: 0.1} m_EditorSimplifiedModeBlendDistance: 0.33046675 @@ -693,13 +748,24 @@ MonoBehaviour: m_Version: 1 m_ObsoleteSphereBaseOffset: {x: 0, y: 0, z: 0} m_ObsoleteOffset: {x: 0, y: 0, z: 0} - proxy: m_Shape: 0 - m_BoxSize: {x: 1, y: 1, z: 1} - m_SphereRadius: 1 + m_BoxSize: {x: 3.683801, y: 2.547348, z: 3.717638} + m_BoxBlendDistancePositive: {x: 0.1, y: 0.33046675, z: 0} + m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0.1} + m_BoxBlendNormalDistancePositive: {x: 0.1, y: 0, z: 0} + m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxSideFadePositive: {x: 1, y: 1, z: 1} + m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} + m_SphereRadius: 3 + m_SphereBlendDistance: 0 + m_SphereBlendNormalDistance: 0 + proxy: m_CSVersion: 2 m_ObsoleteSphereInfiniteProjection: 0 m_ObsoleteBoxInfiniteProjection: 0 + m_Shape: 0 + m_BoxSize: {x: 1, y: 1, z: 1} + m_SphereRadius: 1 proxySettings: useInfluenceVolumeAsProxyVolume: 1 capturePositionProxySpace: {x: -2.2351372e-10, y: 0, z: -0.0000004518032} @@ -945,102 +1011,7 @@ MonoBehaviour: 'sh[26]': 0 m_SHValidForCapturePosition: {x: 0, y: 0, z: 0} m_SHValidForSourcePosition: {x: 0, y: 0, z: 0} - m_HDProbeVersion: 3 - m_ObsoleteInfiniteProjection: 0 - m_ObsoleteInfluenceVolume: - m_Shape: 0 - m_BoxSize: {x: 3.683801, y: 2.547348, z: 3.717638} - m_BoxBlendDistancePositive: {x: 0.1, y: 0.33046675, z: 0} - m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0.1} - m_BoxBlendNormalDistancePositive: {x: 0.1, y: 0, z: 0} - m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxSideFadePositive: {x: 1, y: 1, z: 1} - m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} - m_SphereRadius: 3 - m_SphereBlendDistance: 0 - m_SphereBlendNormalDistance: 0 - m_EditorAdvancedModeBlendDistancePositive: {x: 0.1, y: 0.33046675, z: 0} - m_EditorAdvancedModeBlendDistanceNegative: {x: 0, y: 0, z: 0.1} - m_EditorSimplifiedModeBlendDistance: 0.33046675 - m_EditorAdvancedModeBlendNormalDistancePositive: {x: 0.1, y: 0, z: 0} - m_EditorAdvancedModeBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} - m_EditorSimplifiedModeBlendNormalDistance: 0.1 - m_EditorAdvancedModeEnabled: 1 - m_EditorAdvancedModeFaceFadePositive: {x: 1, y: 1, z: 1} - m_EditorAdvancedModeFaceFadeNegative: {x: 1, y: 1, z: 1} - m_Version: 1 - m_ObsoleteSphereBaseOffset: {x: 0, y: 0, z: 0} - m_ObsoleteOffset: {x: 0, y: 0, z: 0} - m_ObsoleteFrameSettings: - overrides: 0 - enableShadow: 1 - enableContactShadows: 1 - enableShadowMask: 1 - enableSSR: 0 - enableSSAO: 1 - enableSubsurfaceScattering: 1 - enableTransmission: 1 - enableAtmosphericScattering: 1 - enableVolumetrics: 1 - enableReprojectionForVolumetrics: 1 - enableLightLayers: 1 - enableExposureControl: 1 - diffuseGlobalDimmer: 1 - specularGlobalDimmer: 1 - shaderLitMode: 1 - enableDepthPrepassWithDeferredRendering: 0 - enableTransparentPrepass: 1 - enableMotionVectors: 1 - enableObjectMotionVectors: 1 - enableDecals: 1 - enableRoughRefraction: 1 - enableTransparentPostpass: 1 - enableDistortion: 1 - enablePostprocess: 1 - enableOpaqueObjects: 1 - enableTransparentObjects: 1 - enableRealtimePlanarReflection: 1 - enableMSAA: 0 - enableAsyncCompute: 1 - runLightListAsync: 1 - runSSRAsync: 1 - runSSAOAsync: 1 - runContactShadowsAsync: 1 - runVolumeVoxelizationAsync: 1 - lightLoopSettings: - overrides: 0 - enableDeferredTileAndCluster: 1 - enableComputeLightEvaluation: 1 - enableComputeLightVariants: 1 - enableComputeMaterialVariants: 1 - enableFptlForForwardOpaque: 1 - enableBigTilePrepass: 1 - isFptlEnabled: 1 - m_ObsoleteMultiplier: 1 - m_ObsoleteWeight: 1 - m_ObsoleteMode: 0 - m_ObsoleteLightLayers: 1 - m_ObsoleteCaptureSettings: - overrides: 0 - clearColorMode: 0 - backgroundColorHDR: {r: 0.023529412, g: 0.07058824, b: 0.1882353, a: 0} - clearDepth: 1 - cullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - useOcclusionCulling: 1 - volumeLayerMask: - serializedVersion: 2 - m_Bits: 4294967295 - volumeAnchorOverride: {fileID: 0} - projection: 0 - nearClipPlane: 0.3 - farClipPlane: 1000 - fieldOfView: 90 - orthographicSize: 5 - renderingPath: 0 - shadowDistance: 100 - m_ReflectionProbeVersion: 9 + m_ReflectionProbeVersion: 10 m_ObsoleteInfluenceShape: 0 m_ObsoleteInfluenceSphereRadius: 3 m_ObsoleteBlendDistancePositive: {x: 0.1, y: 0.33046675, z: 0} @@ -1068,6 +1039,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -1089,9 +1063,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &168218576 MeshFilter: @@ -1155,6 +1131,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1176,9 +1155,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &309522793 MeshFilter: @@ -1289,6 +1270,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -1310,9 +1294,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &374923935 MeshFilter: @@ -1356,43 +1342,6 @@ Transform: - {fileID: 2059789767} m_Father: {fileID: 1444734336} m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} ---- !u!84 &471121842 -RenderTexture: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_ImageContentsHash: - serializedVersion: 2 - Hash: 00000000000000000000000000000000 - m_IsAlphaChannelOptional: 0 - serializedVersion: 6 - m_Width: 960 - m_Height: 540 - m_AntiAliasing: 1 - m_MipCount: -1 - m_DepthStencilFormat: 94 - m_ColorFormat: 48 - m_MipMap: 0 - m_GenerateMips: 1 - m_SRGB: 0 - m_UseDynamicScale: 0 - m_UseDynamicScaleExplicit: 0 - m_BindMS: 0 - m_EnableCompatibleFormat: 1 - m_EnableRandomWrite: 0 - m_TextureSettings: - serializedVersion: 2 - m_FilterMode: 1 - m_Aniso: 0 - m_MipBias: 0 - m_WrapU: 1 - m_WrapV: 1 - m_WrapW: 1 - m_Dimension: 2 - m_VolumeDepth: 1 - m_ShadowSamplingMode: 2 --- !u!1 &497075323 GameObject: m_ObjectHideFlags: 0 @@ -1471,6 +1420,53 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} m_Name: m_EditorClassIdentifier: + m_Version: 8 + m_ObsoleteRenderingPath: 0 + m_ObsoleteFrameSettings: + overrides: 0 + enableShadow: 0 + enableContactShadows: 0 + enableShadowMask: 0 + enableSSR: 0 + enableSSAO: 0 + enableSubsurfaceScattering: 0 + enableTransmission: 0 + enableAtmosphericScattering: 0 + enableVolumetrics: 0 + enableReprojectionForVolumetrics: 0 + enableLightLayers: 0 + enableExposureControl: 1 + diffuseGlobalDimmer: 0 + specularGlobalDimmer: 0 + shaderLitMode: 0 + enableDepthPrepassWithDeferredRendering: 0 + enableTransparentPrepass: 0 + enableMotionVectors: 0 + enableObjectMotionVectors: 0 + enableDecals: 0 + enableRoughRefraction: 0 + enableTransparentPostpass: 0 + enableDistortion: 0 + enablePostprocess: 0 + enableOpaqueObjects: 0 + enableTransparentObjects: 0 + enableRealtimePlanarReflection: 0 + enableMSAA: 0 + enableAsyncCompute: 0 + runLightListAsync: 0 + runSSRAsync: 0 + runSSAOAsync: 0 + runContactShadowsAsync: 0 + runVolumeVoxelizationAsync: 0 + lightLoopSettings: + overrides: 0 + enableDeferredTileAndCluster: 0 + enableComputeLightEvaluation: 0 + enableComputeLightVariants: 0 + enableComputeMaterialVariants: 0 + enableFptlForForwardOpaque: 0 + enableBigTilePrepass: 0 + isFptlEnabled: 0 clearColorMode: 1 backgroundColorHDR: {r: 0.025, g: 0.07, b: 0.19, a: 0} clearDepth: 1 @@ -1519,6 +1515,13 @@ MonoBehaviour: deepLearningSuperSamplingUseCustomAttributes: 0 deepLearningSuperSamplingUseOptimalSettings: 1 deepLearningSuperSamplingSharpening: 0 + allowFidelityFX2SuperResolution: 1 + fidelityFX2SuperResolutionUseCustomQualitySettings: 0 + fidelityFX2SuperResolutionQuality: 0 + fidelityFX2SuperResolutionUseCustomAttributes: 0 + fidelityFX2SuperResolutionUseOptimalSettings: 1 + fidelityFX2SuperResolutionEnableSharpening: 0 + fidelityFX2SuperResolutionSharpening: 0 fsrOverrideSharpness: 0 fsrSharpness: 0.92 exposureTarget: {fileID: 0} @@ -1544,53 +1547,6 @@ MonoBehaviour: data1: 0 data2: 0 defaultFrameSettings: 0 - m_Version: 8 - m_ObsoleteRenderingPath: 0 - m_ObsoleteFrameSettings: - overrides: 0 - enableShadow: 0 - enableContactShadows: 0 - enableShadowMask: 0 - enableSSR: 0 - enableSSAO: 0 - enableSubsurfaceScattering: 0 - enableTransmission: 0 - enableAtmosphericScattering: 0 - enableVolumetrics: 0 - enableReprojectionForVolumetrics: 0 - enableLightLayers: 0 - enableExposureControl: 1 - diffuseGlobalDimmer: 0 - specularGlobalDimmer: 0 - shaderLitMode: 0 - enableDepthPrepassWithDeferredRendering: 0 - enableTransparentPrepass: 0 - enableMotionVectors: 0 - enableObjectMotionVectors: 0 - enableDecals: 0 - enableRoughRefraction: 0 - enableTransparentPostpass: 0 - enableDistortion: 0 - enablePostprocess: 0 - enableOpaqueObjects: 0 - enableTransparentObjects: 0 - enableRealtimePlanarReflection: 0 - enableMSAA: 0 - enableAsyncCompute: 0 - runLightListAsync: 0 - runSSRAsync: 0 - runSSAOAsync: 0 - runContactShadowsAsync: 0 - runVolumeVoxelizationAsync: 0 - lightLoopSettings: - overrides: 0 - enableDeferredTileAndCluster: 0 - enableComputeLightEvaluation: 0 - enableComputeLightVariants: 0 - enableComputeMaterialVariants: 0 - enableFptlForForwardOpaque: 0 - enableBigTilePrepass: 0 - isFptlEnabled: 0 --- !u!20 &498191327 Camera: m_ObjectHideFlags: 0 @@ -1774,6 +1730,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1795,9 +1754,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &540979857 MeshFilter: @@ -1855,23 +1816,28 @@ MonoBehaviour: m_PointlightHDType: 0 m_SpotLightShape: 0 m_AreaLightShape: 0 - m_Intensity: 200000 m_EnableSpotReflector: 1 + m_LightUnit: 0 m_LuxAtDistance: 1 - m_InnerSpotPercent: 80 + m_Intensity: 200000 + m_InnerSpotPercent: -1 + m_ShapeWidth: -1 + m_ShapeHeight: -1 + m_AspectRatio: 1 + m_ShapeRadius: -1 + m_Version: 15 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 m_SpotIESCutoffPercent: 100 m_LightDimmer: 1 m_VolumetricDimmer: 1 - m_LightUnit: 0 m_FadeDistance: 10000 m_VolumetricFadeDistance: 10000 m_AffectDiffuse: 1 m_AffectSpecular: 1 m_NonLightmappedOnly: 0 - m_ShapeWidth: 0.5 - m_ShapeHeight: 0.5 - m_AspectRatio: 1 - m_ShapeRadius: 0.1 m_SoftnessScale: 1 m_UseCustomSpotLightShadowCone: 0 m_CustomSpotLightShadowCone: 55.8 @@ -1882,30 +1848,33 @@ MonoBehaviour: m_IESPoint: {fileID: 0} m_IESSpot: {fileID: 0} m_IncludeForRayTracing: 1 + m_IncludeForPathTracing: 1 m_AreaLightShadowCone: 120 m_UseScreenSpaceShadows: 0 m_InteractsWithSky: 1 m_AngularDiameter: 0 - m_DiameterMultiplerMode: 1 - m_DiameterMultiplier: 1 - m_DiameterOverride: 0.5 - m_EmissiveLightSource: 1 - m_FlareSize: 2 - m_FlareTint: {r: 1, g: 1, b: 1, a: 1} - m_FlareFalloff: 4 - m_AutomaticMoonPhase: 1 - m_MoonPhase: 0.2 - m_MoonPhaseRotation: 0 - m_Earthshine: 1 - m_SurfaceTexture: {fileID: 0} - m_SurfaceTint: {r: 1, g: 1, b: 1, a: 1} + diameterMultiplerMode: 1 + diameterMultiplier: 1 + diameterOverride: 0.5 + celestialBodyShadingSource: 1 + sunLightOverride: {fileID: 0} + sunColor: {r: 1, g: 1, b: 1, a: 1} + sunIntensity: 130000 + moonPhase: 0.2 + moonPhaseRotation: 0 + earthshine: 1 + flareSize: 2 + flareTint: {r: 1, g: 1, b: 1, a: 1} + flareFalloff: 4 + flareMultiplier: 1 + surfaceTexture: {fileID: 0} + surfaceTint: {r: 1, g: 1, b: 1, a: 1} m_Distance: 150000000 m_UseRayTracedShadows: 0 m_NumRayTracingSamples: 4 m_FilterTracedShadow: 1 m_FilterSizeTraced: 16 m_SunLightConeAngle: 0.5 - m_LightShadowRadius: 0.5 m_SemiTransparentShadow: 0 m_ColorShadow: 1 m_DistanceBasedFiltering: 0 @@ -1921,7 +1890,7 @@ MonoBehaviour: m_MinFilterSize: 0.01 m_DirLightPCSSBlockerSampleCount: 24 m_DirLightPCSSFilterSampleCount: 16 - m_DirLightPCSSMaxBlockerDistance: 64 + m_DirLightPCSSMaxPenumbraSize: 0.56 m_DirLightPCSSMaxSamplingDistance: 0.5 m_DirLightPCSSMinFilterSizeTexels: 1.5 m_DirLightPCSSMinFilterMaxAngularDiameter: 10 @@ -1973,11 +1942,6 @@ MonoBehaviour: m_AreaLightEmissiveMeshShadowCastingMode: 0 m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 m_AreaLightEmissiveMeshLayer: -1 - m_Version: 12 - m_ObsoleteShadowResolutionTier: 1 - m_ObsoleteUseShadowQualitySettings: 0 - m_ObsoleteCustomShadowResolution: 512 - m_ObsoleteContactShadows: 0 --- !u!108 &551887031 Light: m_ObjectHideFlags: 0 @@ -1986,14 +1950,14 @@ Light: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 551887028} m_Enabled: 1 - serializedVersion: 11 + serializedVersion: 13 m_Type: 0 m_Color: {r: 0.9529412, g: 0.9254902, b: 0.8039216, a: 1} m_Intensity: 108677.79 m_Range: 15 m_SpotAngle: 90 - m_InnerSpotAngle: 9 - m_CookieSize: 10 + m_InnerSpotAngle: 72 + m_CookieSize2D: {x: 10, y: 10} m_Shadows: m_Type: 1 m_Resolution: -1 @@ -2037,8 +2001,12 @@ Light: m_BoundingSphereOverride: {x: 0, y: -0.000000004421082, z: 6.99e-43, w: 7.8e-44} m_UseBoundingSphereOverride: 0 m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0.1 + m_ForceVisible: 0 + m_ShapeRadius: 0.1 m_ShadowAngle: 0 + m_LightUnit: 0 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 --- !u!1 &587141976 GameObject: m_ObjectHideFlags: 0 @@ -2091,6 +2059,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2112,9 +2083,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &587141979 MeshFilter: @@ -2134,16 +2107,32 @@ PrefabInstance: m_Modifications: - target: {fileID: 420649283, guid: 56207039676fd3345bc93c40b7b5731e, type: 3} propertyPath: m_Version - value: 12 + value: 15 objectReference: {fileID: 0} - target: {fileID: 420649283, guid: 56207039676fd3345bc93c40b7b5731e, type: 3} propertyPath: m_Intensity value: 10000 objectReference: {fileID: 0} + - target: {fileID: 420649283, guid: 56207039676fd3345bc93c40b7b5731e, type: 3} + propertyPath: m_ShapeWidth + value: -1 + objectReference: {fileID: 0} + - target: {fileID: 420649283, guid: 56207039676fd3345bc93c40b7b5731e, type: 3} + propertyPath: m_ShapeHeight + value: -1 + objectReference: {fileID: 0} + - target: {fileID: 420649283, guid: 56207039676fd3345bc93c40b7b5731e, type: 3} + propertyPath: m_ShapeRadius + value: -1 + objectReference: {fileID: 0} - target: {fileID: 420649283, guid: 56207039676fd3345bc93c40b7b5731e, type: 3} propertyPath: m_MinFilterSize value: 0.01 objectReference: {fileID: 0} + - target: {fileID: 420649283, guid: 56207039676fd3345bc93c40b7b5731e, type: 3} + propertyPath: m_InnerSpotPercent + value: -1 + objectReference: {fileID: 0} - target: {fileID: 420649283, guid: 56207039676fd3345bc93c40b7b5731e, type: 3} propertyPath: m_ShadowResolution.m_Level value: 1 @@ -2275,6 +2264,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -2296,9 +2288,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &776547617 MeshFilter: @@ -2339,6 +2333,53 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} m_Name: m_EditorClassIdentifier: + m_Version: 9 + m_ObsoleteRenderingPath: 0 + m_ObsoleteFrameSettings: + overrides: 0 + enableShadow: 0 + enableContactShadows: 0 + enableShadowMask: 0 + enableSSR: 0 + enableSSAO: 0 + enableSubsurfaceScattering: 0 + enableTransmission: 0 + enableAtmosphericScattering: 0 + enableVolumetrics: 0 + enableReprojectionForVolumetrics: 0 + enableLightLayers: 0 + enableExposureControl: 1 + diffuseGlobalDimmer: 0 + specularGlobalDimmer: 0 + shaderLitMode: 0 + enableDepthPrepassWithDeferredRendering: 0 + enableTransparentPrepass: 0 + enableMotionVectors: 0 + enableObjectMotionVectors: 0 + enableDecals: 0 + enableRoughRefraction: 0 + enableTransparentPostpass: 0 + enableDistortion: 0 + enablePostprocess: 0 + enableOpaqueObjects: 0 + enableTransparentObjects: 0 + enableRealtimePlanarReflection: 0 + enableMSAA: 0 + enableAsyncCompute: 0 + runLightListAsync: 0 + runSSRAsync: 0 + runSSAOAsync: 0 + runContactShadowsAsync: 0 + runVolumeVoxelizationAsync: 0 + lightLoopSettings: + overrides: 0 + enableDeferredTileAndCluster: 0 + enableComputeLightEvaluation: 0 + enableComputeLightVariants: 0 + enableComputeMaterialVariants: 0 + enableFptlForForwardOpaque: 0 + enableBigTilePrepass: 0 + isFptlEnabled: 0 clearColorMode: 0 backgroundColorHDR: {r: 0.025, g: 0.07, b: 0.19, a: 0} clearDepth: 1 @@ -2387,6 +2428,13 @@ MonoBehaviour: deepLearningSuperSamplingUseCustomAttributes: 0 deepLearningSuperSamplingUseOptimalSettings: 1 deepLearningSuperSamplingSharpening: 0 + allowFidelityFX2SuperResolution: 1 + fidelityFX2SuperResolutionUseCustomQualitySettings: 0 + fidelityFX2SuperResolutionQuality: 0 + fidelityFX2SuperResolutionUseCustomAttributes: 0 + fidelityFX2SuperResolutionUseOptimalSettings: 1 + fidelityFX2SuperResolutionEnableSharpening: 0 + fidelityFX2SuperResolutionSharpening: 0 fsrOverrideSharpness: 0 fsrSharpness: 0.92 exposureTarget: {fileID: 0} @@ -2412,53 +2460,6 @@ MonoBehaviour: data1: 1 data2: 0 defaultFrameSettings: 0 - m_Version: 9 - m_ObsoleteRenderingPath: 0 - m_ObsoleteFrameSettings: - overrides: 0 - enableShadow: 0 - enableContactShadows: 0 - enableShadowMask: 0 - enableSSR: 0 - enableSSAO: 0 - enableSubsurfaceScattering: 0 - enableTransmission: 0 - enableAtmosphericScattering: 0 - enableVolumetrics: 0 - enableReprojectionForVolumetrics: 0 - enableLightLayers: 0 - enableExposureControl: 1 - diffuseGlobalDimmer: 0 - specularGlobalDimmer: 0 - shaderLitMode: 0 - enableDepthPrepassWithDeferredRendering: 0 - enableTransparentPrepass: 0 - enableMotionVectors: 0 - enableObjectMotionVectors: 0 - enableDecals: 0 - enableRoughRefraction: 0 - enableTransparentPostpass: 0 - enableDistortion: 0 - enablePostprocess: 0 - enableOpaqueObjects: 0 - enableTransparentObjects: 0 - enableRealtimePlanarReflection: 0 - enableMSAA: 0 - enableAsyncCompute: 0 - runLightListAsync: 0 - runSSRAsync: 0 - runSSAOAsync: 0 - runContactShadowsAsync: 0 - runVolumeVoxelizationAsync: 0 - lightLoopSettings: - overrides: 0 - enableDeferredTileAndCluster: 0 - enableComputeLightEvaluation: 0 - enableComputeLightVariants: 0 - enableComputeMaterialVariants: 0 - enableFptlForForwardOpaque: 0 - enableBigTilePrepass: 0 - isFptlEnabled: 0 --- !u!20 &821430578 Camera: m_ObjectHideFlags: 0 @@ -2549,17 +2550,17 @@ MonoBehaviour: IncorrectPixelsThreshold: 0.0000038146973 UseHDR: 0 UseBackBuffer: 0 - ImageResolution: 0 ActiveImageTests: 1 ActivePixelTests: 7 doBeforeTest: m_PersistentCalls: m_Calls: [] captureFramerate: 0 - waitFrames: 20 + waitFrames: 60 waitForFrameCountMultiple: 0 frameCountMultiple: 8 xrCompatible: 1 + gpuDrivenCompatible: 1 xrThresholdMultiplier: 1 checkMemoryAllocation: 0 renderPipelineAsset: {fileID: 11400000, guid: 06ecab3b4a26ece4eb73cb23fbd506b5, @@ -2703,23 +2704,28 @@ MonoBehaviour: m_PointlightHDType: 1 m_SpotLightShape: 0 m_AreaLightShape: 0 - m_Intensity: 10000 m_EnableSpotReflector: 0 + m_LightUnit: 0 m_LuxAtDistance: 1 - m_InnerSpotPercent: 0 + m_Intensity: 10000 + m_InnerSpotPercent: -1 + m_ShapeWidth: -1 + m_ShapeHeight: -1 + m_AspectRatio: 1 + m_ShapeRadius: -1 + m_Version: 15 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 m_SpotIESCutoffPercent: 100 m_LightDimmer: 1 m_VolumetricDimmer: 1 - m_LightUnit: 0 m_FadeDistance: 10000 m_VolumetricFadeDistance: 10000 m_AffectDiffuse: 1 m_AffectSpecular: 1 m_NonLightmappedOnly: 0 - m_ShapeWidth: 0.34999964 - m_ShapeHeight: 0.35 - m_AspectRatio: 1 - m_ShapeRadius: 0 m_SoftnessScale: 1 m_UseCustomSpotLightShadowCone: 0 m_CustomSpotLightShadowCone: 30 @@ -2730,30 +2736,33 @@ MonoBehaviour: m_IESPoint: {fileID: 0} m_IESSpot: {fileID: 0} m_IncludeForRayTracing: 1 + m_IncludeForPathTracing: 1 m_AreaLightShadowCone: 120 m_UseScreenSpaceShadows: 0 m_InteractsWithSky: 1 m_AngularDiameter: 0 - m_DiameterMultiplerMode: 1 - m_DiameterMultiplier: 1 - m_DiameterOverride: 0.5 - m_EmissiveLightSource: 1 - m_FlareSize: 2 - m_FlareTint: {r: 1, g: 1, b: 1, a: 1} - m_FlareFalloff: 4 - m_AutomaticMoonPhase: 1 - m_MoonPhase: 0.2 - m_MoonPhaseRotation: 0 - m_Earthshine: 1 - m_SurfaceTexture: {fileID: 0} - m_SurfaceTint: {r: 1, g: 1, b: 1, a: 1} + diameterMultiplerMode: 1 + diameterMultiplier: 1 + diameterOverride: 0.5 + celestialBodyShadingSource: 1 + sunLightOverride: {fileID: 0} + sunColor: {r: 1, g: 1, b: 1, a: 1} + sunIntensity: 130000 + moonPhase: 0.2 + moonPhaseRotation: 0 + earthshine: 1 + flareSize: 2 + flareTint: {r: 1, g: 1, b: 1, a: 1} + flareFalloff: 4 + flareMultiplier: 1 + surfaceTexture: {fileID: 0} + surfaceTint: {r: 1, g: 1, b: 1, a: 1} m_Distance: 150000000 m_UseRayTracedShadows: 0 m_NumRayTracingSamples: 4 m_FilterTracedShadow: 1 m_FilterSizeTraced: 16 m_SunLightConeAngle: 0.5 - m_LightShadowRadius: 0.5 m_SemiTransparentShadow: 0 m_ColorShadow: 1 m_DistanceBasedFiltering: 0 @@ -2769,7 +2778,7 @@ MonoBehaviour: m_MinFilterSize: 0.01 m_DirLightPCSSBlockerSampleCount: 24 m_DirLightPCSSFilterSampleCount: 16 - m_DirLightPCSSMaxBlockerDistance: 64 + m_DirLightPCSSMaxPenumbraSize: 0.56 m_DirLightPCSSMaxSamplingDistance: 0.5 m_DirLightPCSSMinFilterSizeTexels: 1.5 m_DirLightPCSSMinFilterMaxAngularDiameter: 10 @@ -2821,11 +2830,6 @@ MonoBehaviour: m_AreaLightEmissiveMeshShadowCastingMode: 1 m_AreaLightEmissiveMeshMotionVectorGenerationMode: 1 m_AreaLightEmissiveMeshLayer: -1 - m_Version: 12 - m_ObsoleteShadowResolutionTier: 1 - m_ObsoleteUseShadowQualitySettings: 0 - m_ObsoleteCustomShadowResolution: 512 - m_ObsoleteContactShadows: 0 --- !u!108 &886047838 Light: m_ObjectHideFlags: 0 @@ -2834,14 +2838,14 @@ Light: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 886047833} m_Enabled: 1 - serializedVersion: 11 + serializedVersion: 13 m_Type: 3 m_Color: {r: 1, g: 1, b: 1, a: 1} m_Intensity: 25984.508 m_Range: 5 m_SpotAngle: 30 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 + m_InnerSpotAngle: 0 + m_CookieSize2D: {x: 10, y: 10} m_Shadows: m_Type: 0 m_Resolution: -1 @@ -2882,11 +2886,15 @@ Light: m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 - m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 5} + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 5.247487} m_UseBoundingSphereOverride: 1 m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 + m_ForceVisible: 0 + m_ShapeRadius: 0 m_ShadowAngle: 0 + m_LightUnit: 0 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 0 --- !u!1 &957496292 GameObject: m_ObjectHideFlags: 0 @@ -2996,6 +3004,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -3017,9 +3028,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &981181528 MeshFilter: @@ -3095,7 +3108,7 @@ Transform: m_GameObject: {fileID: 1037846703} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.019999983, y: 1.196, z: -0.68701315} + m_LocalPosition: {x: 0.019999983, y: 1.196, z: -0.6870142} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -3146,6 +3159,101 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0ef8dc2c2eabfa4e8cb77be57a837c0, type: 3} m_Name: m_EditorClassIdentifier: + m_HDProbeVersion: 9 + m_ObsoleteInfiniteProjection: 0 + m_ObsoleteInfluenceVolume: + m_EditorAdvancedModeBlendDistancePositive: {x: 0, y: 0, z: 0} + m_EditorAdvancedModeBlendDistanceNegative: {x: 0, y: 0, z: 0} + m_EditorSimplifiedModeBlendDistance: 0 + m_EditorAdvancedModeBlendNormalDistancePositive: {x: 0, y: 0, z: 0} + m_EditorAdvancedModeBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_EditorSimplifiedModeBlendNormalDistance: 0 + m_EditorAdvancedModeEnabled: 0 + m_EditorAdvancedModeFaceFadePositive: {x: 1, y: 1, z: 1} + m_EditorAdvancedModeFaceFadeNegative: {x: 1, y: 1, z: 1} + m_Version: 1 + m_ObsoleteSphereBaseOffset: {x: 0, y: 0, z: 0} + m_ObsoleteOffset: {x: 0, y: 0, z: 0} + m_Shape: 0 + m_BoxSize: {x: 3.7381597, y: 2.5, z: 1.25} + m_BoxBlendDistancePositive: {x: 0, y: 0, z: 0} + m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxBlendNormalDistancePositive: {x: 0, y: 0, z: 0} + m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxSideFadePositive: {x: 1, y: 1, z: 1} + m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} + m_SphereRadius: 3 + m_SphereBlendDistance: 0 + m_SphereBlendNormalDistance: 0 + m_ObsoleteFrameSettings: + overrides: 0 + enableShadow: 1 + enableContactShadows: 1 + enableShadowMask: 1 + enableSSR: 0 + enableSSAO: 1 + enableSubsurfaceScattering: 1 + enableTransmission: 1 + enableAtmosphericScattering: 1 + enableVolumetrics: 1 + enableReprojectionForVolumetrics: 1 + enableLightLayers: 1 + enableExposureControl: 1 + diffuseGlobalDimmer: 1 + specularGlobalDimmer: 1 + shaderLitMode: 1 + enableDepthPrepassWithDeferredRendering: 0 + enableTransparentPrepass: 1 + enableMotionVectors: 1 + enableObjectMotionVectors: 1 + enableDecals: 1 + enableRoughRefraction: 1 + enableTransparentPostpass: 1 + enableDistortion: 1 + enablePostprocess: 1 + enableOpaqueObjects: 1 + enableTransparentObjects: 1 + enableRealtimePlanarReflection: 1 + enableMSAA: 0 + enableAsyncCompute: 1 + runLightListAsync: 1 + runSSRAsync: 1 + runSSAOAsync: 1 + runContactShadowsAsync: 1 + runVolumeVoxelizationAsync: 1 + lightLoopSettings: + overrides: 0 + enableDeferredTileAndCluster: 1 + enableComputeLightEvaluation: 1 + enableComputeLightVariants: 1 + enableComputeMaterialVariants: 1 + enableFptlForForwardOpaque: 1 + enableBigTilePrepass: 1 + isFptlEnabled: 1 + m_ObsoleteMultiplier: 1 + m_ObsoleteWeight: 1 + m_ObsoleteMode: 0 + m_ObsoleteLightLayers: 1 + m_ObsoleteCaptureSettings: + overrides: 0 + clearColorMode: 0 + backgroundColorHDR: {r: 0.023529412, g: 0.07058824, b: 0.1882353, a: 0} + clearDepth: 1 + cullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + useOcclusionCulling: 1 + volumeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + volumeAnchorOverride: {fileID: 0} + projection: 0 + nearClipPlane: 0.3 + farClipPlane: 1000 + fieldOfView: 90 + orthographicSize: 5 + renderingPath: 0 + shadowDistance: 100 m_ProbeSettings: frustum: fieldOfViewMode: 1 @@ -3157,23 +3265,13 @@ MonoBehaviour: realtimeMode: 0 timeSlicing: 0 lighting: + importance: 1 multiplier: 1 weight: 1 lightLayer: 1 fadeDistance: 10000 rangeCompressionFactor: 1 influence: - m_Shape: 0 - m_BoxSize: {x: 3.7381597, y: 2.5, z: 1.25} - m_BoxBlendDistancePositive: {x: 0, y: 0, z: 0} - m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxBlendNormalDistancePositive: {x: 0, y: 0, z: 0} - m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxSideFadePositive: {x: 1, y: 1, z: 1} - m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} - m_SphereRadius: 3 - m_SphereBlendDistance: 0 - m_SphereBlendNormalDistance: 0 m_EditorAdvancedModeBlendDistancePositive: {x: 0, y: 0, z: 0} m_EditorAdvancedModeBlendDistanceNegative: {x: 0, y: 0, z: 0} m_EditorSimplifiedModeBlendDistance: 0 @@ -3186,13 +3284,24 @@ MonoBehaviour: m_Version: 1 m_ObsoleteSphereBaseOffset: {x: 0, y: 0, z: 0} m_ObsoleteOffset: {x: 0, y: 0, z: 0} - proxy: m_Shape: 0 - m_BoxSize: {x: 1, y: 1, z: 1} - m_SphereRadius: 1 + m_BoxSize: {x: 3.7381597, y: 2.5, z: 1.25} + m_BoxBlendDistancePositive: {x: 0, y: 0, z: 0} + m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxBlendNormalDistancePositive: {x: 0, y: 0, z: 0} + m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxSideFadePositive: {x: 1, y: 1, z: 1} + m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} + m_SphereRadius: 3 + m_SphereBlendDistance: 0 + m_SphereBlendNormalDistance: 0 + proxy: m_CSVersion: 2 m_ObsoleteSphereInfiniteProjection: 0 m_ObsoleteBoxInfiniteProjection: 0 + m_Shape: 0 + m_BoxSize: {x: 1, y: 1, z: 1} + m_SphereRadius: 1 proxySettings: useInfluenceVolumeAsProxyVolume: 1 capturePositionProxySpace: {x: -5.8120087e-10, y: 0, z: 0.00000014388556} @@ -3438,102 +3547,7 @@ MonoBehaviour: 'sh[26]': 0 m_SHValidForCapturePosition: {x: 0, y: 0, z: 0} m_SHValidForSourcePosition: {x: 0, y: 0, z: 0} - m_HDProbeVersion: 3 - m_ObsoleteInfiniteProjection: 0 - m_ObsoleteInfluenceVolume: - m_Shape: 0 - m_BoxSize: {x: 3.7381597, y: 2.5, z: 1.25} - m_BoxBlendDistancePositive: {x: 0, y: 0, z: 0} - m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxBlendNormalDistancePositive: {x: 0, y: 0, z: 0} - m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxSideFadePositive: {x: 1, y: 1, z: 1} - m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} - m_SphereRadius: 3 - m_SphereBlendDistance: 0 - m_SphereBlendNormalDistance: 0 - m_EditorAdvancedModeBlendDistancePositive: {x: 0, y: 0, z: 0} - m_EditorAdvancedModeBlendDistanceNegative: {x: 0, y: 0, z: 0} - m_EditorSimplifiedModeBlendDistance: 0 - m_EditorAdvancedModeBlendNormalDistancePositive: {x: 0, y: 0, z: 0} - m_EditorAdvancedModeBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} - m_EditorSimplifiedModeBlendNormalDistance: 0 - m_EditorAdvancedModeEnabled: 0 - m_EditorAdvancedModeFaceFadePositive: {x: 1, y: 1, z: 1} - m_EditorAdvancedModeFaceFadeNegative: {x: 1, y: 1, z: 1} - m_Version: 1 - m_ObsoleteSphereBaseOffset: {x: 0, y: 0, z: 0} - m_ObsoleteOffset: {x: 0, y: 0, z: 0} - m_ObsoleteFrameSettings: - overrides: 0 - enableShadow: 1 - enableContactShadows: 1 - enableShadowMask: 1 - enableSSR: 0 - enableSSAO: 1 - enableSubsurfaceScattering: 1 - enableTransmission: 1 - enableAtmosphericScattering: 1 - enableVolumetrics: 1 - enableReprojectionForVolumetrics: 1 - enableLightLayers: 1 - enableExposureControl: 1 - diffuseGlobalDimmer: 1 - specularGlobalDimmer: 1 - shaderLitMode: 1 - enableDepthPrepassWithDeferredRendering: 0 - enableTransparentPrepass: 1 - enableMotionVectors: 1 - enableObjectMotionVectors: 1 - enableDecals: 1 - enableRoughRefraction: 1 - enableTransparentPostpass: 1 - enableDistortion: 1 - enablePostprocess: 1 - enableOpaqueObjects: 1 - enableTransparentObjects: 1 - enableRealtimePlanarReflection: 1 - enableMSAA: 0 - enableAsyncCompute: 1 - runLightListAsync: 1 - runSSRAsync: 1 - runSSAOAsync: 1 - runContactShadowsAsync: 1 - runVolumeVoxelizationAsync: 1 - lightLoopSettings: - overrides: 0 - enableDeferredTileAndCluster: 1 - enableComputeLightEvaluation: 1 - enableComputeLightVariants: 1 - enableComputeMaterialVariants: 1 - enableFptlForForwardOpaque: 1 - enableBigTilePrepass: 1 - isFptlEnabled: 1 - m_ObsoleteMultiplier: 1 - m_ObsoleteWeight: 1 - m_ObsoleteMode: 0 - m_ObsoleteLightLayers: 1 - m_ObsoleteCaptureSettings: - overrides: 0 - clearColorMode: 0 - backgroundColorHDR: {r: 0.023529412, g: 0.07058824, b: 0.1882353, a: 0} - clearDepth: 1 - cullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - useOcclusionCulling: 1 - volumeLayerMask: - serializedVersion: 2 - m_Bits: 4294967295 - volumeAnchorOverride: {fileID: 0} - projection: 0 - nearClipPlane: 0.3 - farClipPlane: 1000 - fieldOfView: 90 - orthographicSize: 5 - renderingPath: 0 - shadowDistance: 100 - m_ReflectionProbeVersion: 9 + m_ReflectionProbeVersion: 10 m_ObsoleteInfluenceShape: 0 m_ObsoleteInfluenceSphereRadius: 3 m_ObsoleteBlendDistancePositive: {x: 0, y: 0, z: 0} @@ -3561,6 +3575,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -3582,9 +3599,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1037846708 MeshFilter: @@ -3669,6 +3688,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -3690,9 +3712,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1090868674 MeshFilter: @@ -4013,6 +4037,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4034,9 +4061,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1236845696 MeshFilter: @@ -4098,6 +4127,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4119,9 +4151,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1243026021 MeshFilter: @@ -4183,6 +4217,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4204,9 +4241,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1247603196 MeshFilter: @@ -4310,6 +4349,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4331,9 +4373,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1295334279 MeshFilter: @@ -4388,21 +4432,68 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} m_Name: m_EditorClassIdentifier: - clearColorMode: 0 - backgroundColorHDR: {r: 0.025, g: 0.07, b: 0.19, a: 0} - clearDepth: 1 - volumeLayerMask: - serializedVersion: 2 - m_Bits: 4294967295 - volumeAnchorOverride: {fileID: 0} - antialiasing: 0 - SMAAQuality: 2 - dithering: 0 - stopNaNs: 0 - taaSharpenStrength: 0.6 - TAAQuality: 1 - taaSharpenMode: 0 - taaRingingReduction: 0 + m_Version: 8 + m_ObsoleteRenderingPath: 0 + m_ObsoleteFrameSettings: + overrides: 0 + enableShadow: 0 + enableContactShadows: 0 + enableShadowMask: 0 + enableSSR: 0 + enableSSAO: 0 + enableSubsurfaceScattering: 0 + enableTransmission: 0 + enableAtmosphericScattering: 0 + enableVolumetrics: 0 + enableReprojectionForVolumetrics: 0 + enableLightLayers: 0 + enableExposureControl: 1 + diffuseGlobalDimmer: 0 + specularGlobalDimmer: 0 + shaderLitMode: 0 + enableDepthPrepassWithDeferredRendering: 0 + enableTransparentPrepass: 0 + enableMotionVectors: 0 + enableObjectMotionVectors: 0 + enableDecals: 0 + enableRoughRefraction: 0 + enableTransparentPostpass: 0 + enableDistortion: 0 + enablePostprocess: 0 + enableOpaqueObjects: 0 + enableTransparentObjects: 0 + enableRealtimePlanarReflection: 0 + enableMSAA: 0 + enableAsyncCompute: 0 + runLightListAsync: 0 + runSSRAsync: 0 + runSSAOAsync: 0 + runContactShadowsAsync: 0 + runVolumeVoxelizationAsync: 0 + lightLoopSettings: + overrides: 0 + enableDeferredTileAndCluster: 0 + enableComputeLightEvaluation: 0 + enableComputeLightVariants: 0 + enableComputeMaterialVariants: 0 + enableFptlForForwardOpaque: 0 + enableBigTilePrepass: 0 + isFptlEnabled: 0 + clearColorMode: 0 + backgroundColorHDR: {r: 0.025, g: 0.07, b: 0.19, a: 0} + clearDepth: 1 + volumeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + volumeAnchorOverride: {fileID: 0} + antialiasing: 0 + SMAAQuality: 2 + dithering: 0 + stopNaNs: 0 + taaSharpenStrength: 0.6 + TAAQuality: 1 + taaSharpenMode: 0 + taaRingingReduction: 0 taaHistorySharpening: 0.35 taaAntiFlicker: 0.5 taaMotionVectorRejection: 0 @@ -4436,6 +4527,13 @@ MonoBehaviour: deepLearningSuperSamplingUseCustomAttributes: 0 deepLearningSuperSamplingUseOptimalSettings: 1 deepLearningSuperSamplingSharpening: 0 + allowFidelityFX2SuperResolution: 1 + fidelityFX2SuperResolutionUseCustomQualitySettings: 0 + fidelityFX2SuperResolutionQuality: 0 + fidelityFX2SuperResolutionUseCustomAttributes: 0 + fidelityFX2SuperResolutionUseOptimalSettings: 1 + fidelityFX2SuperResolutionEnableSharpening: 0 + fidelityFX2SuperResolutionSharpening: 0 fsrOverrideSharpness: 0 fsrSharpness: 0.92 exposureTarget: {fileID: 0} @@ -4461,53 +4559,6 @@ MonoBehaviour: data1: 17 data2: 0 defaultFrameSettings: 0 - m_Version: 8 - m_ObsoleteRenderingPath: 0 - m_ObsoleteFrameSettings: - overrides: 0 - enableShadow: 0 - enableContactShadows: 0 - enableShadowMask: 0 - enableSSR: 0 - enableSSAO: 0 - enableSubsurfaceScattering: 0 - enableTransmission: 0 - enableAtmosphericScattering: 0 - enableVolumetrics: 0 - enableReprojectionForVolumetrics: 0 - enableLightLayers: 0 - enableExposureControl: 1 - diffuseGlobalDimmer: 0 - specularGlobalDimmer: 0 - shaderLitMode: 0 - enableDepthPrepassWithDeferredRendering: 0 - enableTransparentPrepass: 0 - enableMotionVectors: 0 - enableObjectMotionVectors: 0 - enableDecals: 0 - enableRoughRefraction: 0 - enableTransparentPostpass: 0 - enableDistortion: 0 - enablePostprocess: 0 - enableOpaqueObjects: 0 - enableTransparentObjects: 0 - enableRealtimePlanarReflection: 0 - enableMSAA: 0 - enableAsyncCompute: 0 - runLightListAsync: 0 - runSSRAsync: 0 - runSSAOAsync: 0 - runContactShadowsAsync: 0 - runVolumeVoxelizationAsync: 0 - lightLoopSettings: - overrides: 0 - enableDeferredTileAndCluster: 0 - enableComputeLightEvaluation: 0 - enableComputeLightVariants: 0 - enableComputeMaterialVariants: 0 - enableFptlForForwardOpaque: 0 - enableBigTilePrepass: 0 - isFptlEnabled: 0 --- !u!20 &1297650283 Camera: m_ObjectHideFlags: 0 @@ -4574,109 +4625,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 17.5, y: 109.65, z: 0} ---- !u!21 &1336196516 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Shader Graphs/TestCompositionGraph - m_Shader: {fileID: -6465566751694194690, guid: 64fcbeb03211da74295e0878bd451f91, - type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: - - _ALPHATEST_ON - m_InvalidKeywords: - - _DOUBLESIDED_ON - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 1 - m_CustomRenderQueue: 2450 - stringTagMap: - MotionVector: User - RenderType: TransparentCutout - disabledShaderPasses: - - TransparentDepthPrepass - - TransparentDepthPostpass - - TransparentBackface - - MOTIONVECTORS - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - GreenScreen: - m_Texture: {fileID: 471121842} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - Layer0: - m_Texture: {fileID: 1969329230} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - Layer1: - m_Texture: {fileID: 114834915} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _AddPrecomputedVelocity: 0 - - _AlphaCutoffEnable: 1 - - _AlphaDstBlend: 0 - - _AlphaSrcBlend: 1 - - _BlendMode: 0 - - _ConservativeDepthOffsetEnable: 0 - - _CullMode: 0 - - _CullModeForward: 0 - - _DepthOffsetEnable: 0 - - _DoubleSidedEnable: 1 - - _DoubleSidedGIMode: 0 - - _DoubleSidedNormalMode: 2 - - _DstBlend: 0 - - _DstBlend2: 0 - - _EnableBlendModePreserveSpecularLighting: 0 - - _EnableFogOnTransparent: 1 - - _OpaqueCullMode: 2 - - _PerPixelSorting: 0 - - _RenderQueueType: 1 - - _SrcBlend: 1 - - _StencilRef: 0 - - _StencilRefDepth: 1 - - _StencilRefDistortionVec: 4 - - _StencilRefMV: 33 - - _StencilWriteMask: 6 - - _StencilWriteMaskDepth: 9 - - _StencilWriteMaskDistortionVec: 4 - - _StencilWriteMaskMV: 43 - - _SurfaceType: 0 - - _TransparentBackfaceEnable: 0 - - _TransparentCullMode: 2 - - _TransparentDepthPostpassEnable: 0 - - _TransparentDepthPrepassEnable: 0 - - _TransparentSortPriority: 0 - - _TransparentWritingMotionVec: 0 - - _TransparentZWrite: 0 - - _UseShadowThreshold: 0 - - _ZTestDepthEqualForOpaque: 3 - - _ZTestTransparent: 4 - - _ZWrite: 1 - m_Colors: - - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} - - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} - m_BuildTextureStacks: [] - m_AllowLocking: 1 --- !u!1 &1380583528 GameObject: m_ObjectHideFlags: 0 @@ -4762,6 +4710,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4783,9 +4734,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1382797349 MeshFilter: @@ -4919,6 +4872,43 @@ Transform: type: 3} m_PrefabInstance: {fileID: 1512143111} m_PrefabAsset: {fileID: 0} +--- !u!84 &1520012484 +RenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_IsAlphaChannelOptional: 0 + serializedVersion: 6 + m_Width: 480 + m_Height: 270 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthStencilFormat: 94 + m_ColorFormat: 48 + m_MipMap: 0 + m_GenerateMips: 1 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_UseDynamicScaleExplicit: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_EnableRandomWrite: 0 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 1 + m_Aniso: 0 + m_MipBias: 0 + m_WrapU: 1 + m_WrapV: 1 + m_WrapW: 1 + m_Dimension: 2 + m_VolumeDepth: 1 + m_ShadowSamplingMode: 2 --- !u!1 &1531545286 GameObject: m_ObjectHideFlags: 0 @@ -5221,6 +5211,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5242,9 +5235,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1613682959 MeshFilter: @@ -5299,6 +5294,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f19d9143a39eb3b46bc4563e9889cfbd, type: 3} m_Name: m_EditorClassIdentifier: + m_Version: 3 m_Material: {fileID: 2100000, guid: 759683ea64b540d4082e6fc951c94405, type: 2} m_DrawDistance: 1000 m_FadeScale: 0.9 @@ -5316,7 +5312,6 @@ MonoBehaviour: m_Offset: {x: 0, y: 0, z: 0.1} m_Size: {x: 3, y: 1.5, z: 0.2} m_FadeFactor: 1 - m_Version: 3 --- !u!4 &1695031467 Transform: m_ObjectHideFlags: 0 @@ -5384,6 +5379,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5405,9 +5403,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1761006931 MeshFilter: @@ -5466,33 +5466,70 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1825057978 -GameObject: +--- !u!84 &1786431202 +RenderTexture: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} + m_Name: + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_IsAlphaChannelOptional: 0 serializedVersion: 6 - m_Component: - - component: {fileID: 1825057979} - - component: {fileID: 1825057983} - - component: {fileID: 1825057982} - m_Layer: 0 - m_Name: LineLight - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1825057979 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1825057978} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_Width: 480 + m_Height: 270 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthStencilFormat: 94 + m_ColorFormat: 48 + m_MipMap: 0 + m_GenerateMips: 1 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_UseDynamicScaleExplicit: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_EnableRandomWrite: 0 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 1 + m_Aniso: 0 + m_MipBias: 0 + m_WrapU: 1 + m_WrapV: 1 + m_WrapW: 1 + m_Dimension: 2 + m_VolumeDepth: 1 + m_ShadowSamplingMode: 2 +--- !u!1 &1825057978 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1825057979} + - component: {fileID: 1825057983} + - component: {fileID: 1825057982} + m_Layer: 0 + m_Name: LineLight + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1825057979 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1825057978} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0.0576} m_LocalScale: {x: 0.749999, y: 0.01, z: 0.009999997} m_ConstrainProportionsScale: 0 @@ -5514,23 +5551,28 @@ MonoBehaviour: m_PointlightHDType: 1 m_SpotLightShape: 0 m_AreaLightShape: 1 - m_Intensity: 100000 m_EnableSpotReflector: 0 + m_LightUnit: 0 m_LuxAtDistance: 1 - m_InnerSpotPercent: 0 + m_Intensity: 100000 + m_InnerSpotPercent: -1 + m_ShapeWidth: -1 + m_ShapeHeight: -1 + m_AspectRatio: 1 + m_ShapeRadius: -1 + m_Version: 15 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 m_SpotIESCutoffPercent: 100 m_LightDimmer: 1 m_VolumetricDimmer: 1 - m_LightUnit: 0 m_FadeDistance: 10000 m_VolumetricFadeDistance: 10000 m_AffectDiffuse: 1 m_AffectSpecular: 1 m_NonLightmappedOnly: 0 - m_ShapeWidth: 0.74999917 - m_ShapeHeight: 0.5 - m_AspectRatio: 1 - m_ShapeRadius: 0 m_SoftnessScale: 1 m_UseCustomSpotLightShadowCone: 0 m_CustomSpotLightShadowCone: 30 @@ -5541,30 +5583,33 @@ MonoBehaviour: m_IESPoint: {fileID: 0} m_IESSpot: {fileID: 0} m_IncludeForRayTracing: 1 + m_IncludeForPathTracing: 1 m_AreaLightShadowCone: 120 m_UseScreenSpaceShadows: 0 m_InteractsWithSky: 1 m_AngularDiameter: 0 - m_DiameterMultiplerMode: 1 - m_DiameterMultiplier: 1 - m_DiameterOverride: 0.5 - m_EmissiveLightSource: 1 - m_FlareSize: 2 - m_FlareTint: {r: 1, g: 1, b: 1, a: 1} - m_FlareFalloff: 4 - m_AutomaticMoonPhase: 1 - m_MoonPhase: 0.2 - m_MoonPhaseRotation: 0 - m_Earthshine: 1 - m_SurfaceTexture: {fileID: 0} - m_SurfaceTint: {r: 1, g: 1, b: 1, a: 1} + diameterMultiplerMode: 1 + diameterMultiplier: 1 + diameterOverride: 0.5 + celestialBodyShadingSource: 1 + sunLightOverride: {fileID: 0} + sunColor: {r: 1, g: 1, b: 1, a: 1} + sunIntensity: 130000 + moonPhase: 0.2 + moonPhaseRotation: 0 + earthshine: 1 + flareSize: 2 + flareTint: {r: 1, g: 1, b: 1, a: 1} + flareFalloff: 4 + flareMultiplier: 1 + surfaceTexture: {fileID: 0} + surfaceTint: {r: 1, g: 1, b: 1, a: 1} m_Distance: 150000000 m_UseRayTracedShadows: 0 m_NumRayTracingSamples: 4 m_FilterTracedShadow: 1 m_FilterSizeTraced: 16 m_SunLightConeAngle: 0.5 - m_LightShadowRadius: 0.5 m_SemiTransparentShadow: 0 m_ColorShadow: 1 m_DistanceBasedFiltering: 0 @@ -5580,7 +5625,7 @@ MonoBehaviour: m_MinFilterSize: 0.01 m_DirLightPCSSBlockerSampleCount: 24 m_DirLightPCSSFilterSampleCount: 16 - m_DirLightPCSSMaxBlockerDistance: 64 + m_DirLightPCSSMaxPenumbraSize: 0.56 m_DirLightPCSSMaxSamplingDistance: 0.5 m_DirLightPCSSMinFilterSizeTexels: 1.5 m_DirLightPCSSMinFilterMaxAngularDiameter: 10 @@ -5632,11 +5677,6 @@ MonoBehaviour: m_AreaLightEmissiveMeshShadowCastingMode: 1 m_AreaLightEmissiveMeshMotionVectorGenerationMode: 1 m_AreaLightEmissiveMeshLayer: -1 - m_Version: 12 - m_ObsoleteShadowResolutionTier: 1 - m_ObsoleteUseShadowQualitySettings: 0 - m_ObsoleteCustomShadowResolution: 512 - m_ObsoleteContactShadows: 0 --- !u!108 &1825057983 Light: m_ObjectHideFlags: 0 @@ -5645,14 +5685,14 @@ Light: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1825057978} m_Enabled: 1 - serializedVersion: 11 + serializedVersion: 13 m_Type: 7 m_Color: {r: 1, g: 1, b: 1, a: 1} m_Intensity: 10610.341 m_Range: 5 m_SpotAngle: 30 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 + m_InnerSpotAngle: 0 + m_CookieSize2D: {x: 10, y: 10} m_Shadows: m_Type: 0 m_Resolution: -1 @@ -5693,11 +5733,15 @@ Light: m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 - m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 5} + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 5.3749995} m_UseBoundingSphereOverride: 1 m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 + m_ForceVisible: 0 + m_ShapeRadius: 0 m_ShadowAngle: 0 + m_LightUnit: 0 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 0 --- !u!1 &1859213454 GameObject: m_ObjectHideFlags: 0 @@ -5806,6 +5850,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5827,9 +5874,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1893658012 MeshFilter: @@ -5869,7 +5918,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Enable: 1 - m_Material: {fileID: 1336196516} + m_Material: {fileID: 1979693240} m_OutputDisplay: 0 m_InputLayers: - m_LayerName: Layer0 @@ -5900,7 +5949,7 @@ MonoBehaviour: m_InputFilters: [] m_AOVBitmask: 0 m_AOVRenderTargets: [] - m_RenderTarget: {fileID: 1969329230} + m_RenderTarget: {fileID: 1786431202} m_ClearsBackGround: 0 m_Show: 1 m_LayerCamera: {fileID: 0} @@ -6002,7 +6051,7 @@ MonoBehaviour: m_InputFilters: [] m_AOVBitmask: 0 m_AOVRenderTargets: [] - m_RenderTarget: {fileID: 114834915} + m_RenderTarget: {fileID: 1937071441} m_ClearsBackGround: 0 m_Show: 1 m_LayerCamera: {fileID: 0} @@ -6070,7 +6119,7 @@ MonoBehaviour: m_InputFilters: [] m_AOVBitmask: 0 m_AOVRenderTargets: [] - m_RenderTarget: {fileID: 471121842} + m_RenderTarget: {fileID: 1520012484} m_ClearsBackGround: 0 m_Show: 1 m_LayerCamera: {fileID: 0} @@ -6136,6 +6185,43 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!84 &1937071441 +RenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_IsAlphaChannelOptional: 0 + serializedVersion: 6 + m_Width: 480 + m_Height: 270 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthStencilFormat: 94 + m_ColorFormat: 48 + m_MipMap: 0 + m_GenerateMips: 1 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_UseDynamicScaleExplicit: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_EnableRandomWrite: 0 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 1 + m_Aniso: 0 + m_MipBias: 0 + m_WrapU: 1 + m_WrapV: 1 + m_WrapW: 1 + m_Dimension: 2 + m_VolumeDepth: 1 + m_ShadowSamplingMode: 2 --- !u!1 &1953544257 GameObject: m_ObjectHideFlags: 0 @@ -6180,6 +6266,101 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a4ee7c3a3b205a14a94094d01ff91d6b, type: 3} m_Name: m_EditorClassIdentifier: + m_HDProbeVersion: 9 + m_ObsoleteInfiniteProjection: 1 + m_ObsoleteInfluenceVolume: + m_EditorAdvancedModeBlendDistancePositive: {x: 0, y: 0, z: 0} + m_EditorAdvancedModeBlendDistanceNegative: {x: 0, y: 0, z: 0} + m_EditorSimplifiedModeBlendDistance: 0 + m_EditorAdvancedModeBlendNormalDistancePositive: {x: 0, y: 0, z: 0} + m_EditorAdvancedModeBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_EditorSimplifiedModeBlendNormalDistance: 0 + m_EditorAdvancedModeEnabled: 0 + m_EditorAdvancedModeFaceFadePositive: {x: 1, y: 1, z: 1} + m_EditorAdvancedModeFaceFadeNegative: {x: 1, y: 1, z: 1} + m_Version: 1 + m_ObsoleteSphereBaseOffset: {x: 0, y: 0, z: 0} + m_ObsoleteOffset: {x: 0, y: 0, z: 0} + m_Shape: 0 + m_BoxSize: {x: 10, y: 10, z: 10} + m_BoxBlendDistancePositive: {x: 0, y: 0, z: 0} + m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxBlendNormalDistancePositive: {x: 0, y: 0, z: 0} + m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxSideFadePositive: {x: 1, y: 1, z: 1} + m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} + m_SphereRadius: 3 + m_SphereBlendDistance: 0 + m_SphereBlendNormalDistance: 0 + m_ObsoleteFrameSettings: + overrides: 0 + enableShadow: 0 + enableContactShadows: 0 + enableShadowMask: 0 + enableSSR: 0 + enableSSAO: 0 + enableSubsurfaceScattering: 0 + enableTransmission: 0 + enableAtmosphericScattering: 0 + enableVolumetrics: 0 + enableReprojectionForVolumetrics: 0 + enableLightLayers: 0 + enableExposureControl: 1 + diffuseGlobalDimmer: 0 + specularGlobalDimmer: 0 + shaderLitMode: 0 + enableDepthPrepassWithDeferredRendering: 0 + enableTransparentPrepass: 0 + enableMotionVectors: 0 + enableObjectMotionVectors: 0 + enableDecals: 0 + enableRoughRefraction: 0 + enableTransparentPostpass: 0 + enableDistortion: 0 + enablePostprocess: 0 + enableOpaqueObjects: 0 + enableTransparentObjects: 0 + enableRealtimePlanarReflection: 0 + enableMSAA: 0 + enableAsyncCompute: 0 + runLightListAsync: 0 + runSSRAsync: 0 + runSSAOAsync: 0 + runContactShadowsAsync: 0 + runVolumeVoxelizationAsync: 0 + lightLoopSettings: + overrides: 0 + enableDeferredTileAndCluster: 0 + enableComputeLightEvaluation: 0 + enableComputeLightVariants: 0 + enableComputeMaterialVariants: 0 + enableFptlForForwardOpaque: 0 + enableBigTilePrepass: 0 + isFptlEnabled: 0 + m_ObsoleteMultiplier: 1 + m_ObsoleteWeight: 1 + m_ObsoleteMode: 0 + m_ObsoleteLightLayers: 1 + m_ObsoleteCaptureSettings: + overrides: 0 + clearColorMode: 0 + backgroundColorHDR: {r: 0.023529412, g: 0.07058824, b: 0.1882353, a: 0} + clearDepth: 1 + cullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + useOcclusionCulling: 1 + volumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + volumeAnchorOverride: {fileID: 0} + projection: 0 + nearClipPlane: 0.3 + farClipPlane: 1000 + fieldOfView: 90 + orthographicSize: 5 + renderingPath: 0 + shadowDistance: 100 m_ProbeSettings: frustum: fieldOfViewMode: 1 @@ -6191,23 +6372,13 @@ MonoBehaviour: realtimeMode: 0 timeSlicing: 0 lighting: + importance: 64 multiplier: 1 weight: 1 lightLayer: 1 fadeDistance: 10000 rangeCompressionFactor: 1 influence: - m_Shape: 0 - m_BoxSize: {x: 1, y: 0.01, z: 1} - m_BoxBlendDistancePositive: {x: 0, y: 0, z: 0} - m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxBlendNormalDistancePositive: {x: 0, y: 0, z: 0} - m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxSideFadePositive: {x: 1, y: 1, z: 1} - m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} - m_SphereRadius: 3 - m_SphereBlendDistance: 0 - m_SphereBlendNormalDistance: 0 m_EditorAdvancedModeBlendDistancePositive: {x: 0, y: 0, z: 0} m_EditorAdvancedModeBlendDistanceNegative: {x: 0, y: 0, z: 0} m_EditorSimplifiedModeBlendDistance: 0 @@ -6220,13 +6391,24 @@ MonoBehaviour: m_Version: 1 m_ObsoleteSphereBaseOffset: {x: 0, y: 0, z: 0} m_ObsoleteOffset: {x: 0, y: 0, z: 0} - proxy: m_Shape: 0 - m_BoxSize: {x: 1, y: 1, z: 1} - m_SphereRadius: 1 + m_BoxSize: {x: 1, y: 0.01, z: 1} + m_BoxBlendDistancePositive: {x: 0, y: 0, z: 0} + m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxBlendNormalDistancePositive: {x: 0, y: 0, z: 0} + m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxSideFadePositive: {x: 1, y: 1, z: 1} + m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} + m_SphereRadius: 3 + m_SphereBlendDistance: 0 + m_SphereBlendNormalDistance: 0 + proxy: m_CSVersion: 2 m_ObsoleteSphereInfiniteProjection: 0 m_ObsoleteBoxInfiniteProjection: 0 + m_Shape: 0 + m_BoxSize: {x: 1, y: 1, z: 1} + m_SphereRadius: 1 proxySettings: useInfluenceVolumeAsProxyVolume: 0 capturePositionProxySpace: {x: 0, y: 0, z: 0} @@ -6472,144 +6654,108 @@ MonoBehaviour: 'sh[26]': 0 m_SHValidForCapturePosition: {x: 0, y: 0, z: 0} m_SHValidForSourcePosition: {x: 0, y: 0, z: 0} - m_HDProbeVersion: 3 - m_ObsoleteInfiniteProjection: 1 - m_ObsoleteInfluenceVolume: - m_Shape: 0 - m_BoxSize: {x: 10, y: 10, z: 10} - m_BoxBlendDistancePositive: {x: 0, y: 0, z: 0} - m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxBlendNormalDistancePositive: {x: 0, y: 0, z: 0} - m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxSideFadePositive: {x: 1, y: 1, z: 1} - m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} - m_SphereRadius: 3 - m_SphereBlendDistance: 0 - m_SphereBlendNormalDistance: 0 - m_EditorAdvancedModeBlendDistancePositive: {x: 0, y: 0, z: 0} - m_EditorAdvancedModeBlendDistanceNegative: {x: 0, y: 0, z: 0} - m_EditorSimplifiedModeBlendDistance: 0 - m_EditorAdvancedModeBlendNormalDistancePositive: {x: 0, y: 0, z: 0} - m_EditorAdvancedModeBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} - m_EditorSimplifiedModeBlendNormalDistance: 0 - m_EditorAdvancedModeEnabled: 0 - m_EditorAdvancedModeFaceFadePositive: {x: 1, y: 1, z: 1} - m_EditorAdvancedModeFaceFadeNegative: {x: 1, y: 1, z: 1} - m_Version: 1 - m_ObsoleteSphereBaseOffset: {x: 0, y: 0, z: 0} - m_ObsoleteOffset: {x: 0, y: 0, z: 0} - m_ObsoleteFrameSettings: - overrides: 0 - enableShadow: 0 - enableContactShadows: 0 - enableShadowMask: 0 - enableSSR: 0 - enableSSAO: 0 - enableSubsurfaceScattering: 0 - enableTransmission: 0 - enableAtmosphericScattering: 0 - enableVolumetrics: 0 - enableReprojectionForVolumetrics: 0 - enableLightLayers: 0 - enableExposureControl: 1 - diffuseGlobalDimmer: 0 - specularGlobalDimmer: 0 - shaderLitMode: 0 - enableDepthPrepassWithDeferredRendering: 0 - enableTransparentPrepass: 0 - enableMotionVectors: 0 - enableObjectMotionVectors: 0 - enableDecals: 0 - enableRoughRefraction: 0 - enableTransparentPostpass: 0 - enableDistortion: 0 - enablePostprocess: 0 - enableOpaqueObjects: 0 - enableTransparentObjects: 0 - enableRealtimePlanarReflection: 0 - enableMSAA: 0 - enableAsyncCompute: 0 - runLightListAsync: 0 - runSSRAsync: 0 - runSSAOAsync: 0 - runContactShadowsAsync: 0 - runVolumeVoxelizationAsync: 0 - lightLoopSettings: - overrides: 0 - enableDeferredTileAndCluster: 0 - enableComputeLightEvaluation: 0 - enableComputeLightVariants: 0 - enableComputeMaterialVariants: 0 - enableFptlForForwardOpaque: 0 - enableBigTilePrepass: 0 - isFptlEnabled: 0 - m_ObsoleteMultiplier: 1 - m_ObsoleteWeight: 1 - m_ObsoleteMode: 0 - m_ObsoleteLightLayers: 1 - m_ObsoleteCaptureSettings: - overrides: 0 - clearColorMode: 0 - backgroundColorHDR: {r: 0.023529412, g: 0.07058824, b: 0.1882353, a: 0} - clearDepth: 1 - cullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - useOcclusionCulling: 1 - volumeLayerMask: - serializedVersion: 2 - m_Bits: 1 - volumeAnchorOverride: {fileID: 0} - projection: 0 - nearClipPlane: 0.3 - farClipPlane: 1000 - fieldOfView: 90 - orthographicSize: 5 - renderingPath: 0 - shadowDistance: 100 - m_LocalReferencePosition: {x: 0, y: 0.99999994, z: 0.000000059604645} - m_PlanarProbeVersion: 7 + m_PlanarProbeVersion: 8 m_ObsoleteCaptureNearPlane: 0.3 m_ObsoleteCaptureFarPlane: 1000 m_ObsoleteOverrideFieldOfView: 0 m_ObsoleteFieldOfViewOverride: 90 ---- !u!84 &1969329230 -RenderTexture: + m_LocalReferencePosition: {x: 0, y: 0.99999994, z: 0.000000059604645} +--- !u!21 &1979693240 +Material: + serializedVersion: 8 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: - m_ImageContentsHash: - serializedVersion: 2 - Hash: 00000000000000000000000000000000 - m_IsAlphaChannelOptional: 0 - serializedVersion: 6 - m_Width: 960 - m_Height: 540 - m_AntiAliasing: 1 - m_MipCount: -1 - m_DepthStencilFormat: 94 - m_ColorFormat: 48 - m_MipMap: 0 - m_GenerateMips: 1 - m_SRGB: 0 - m_UseDynamicScale: 0 - m_UseDynamicScaleExplicit: 0 - m_BindMS: 0 - m_EnableCompatibleFormat: 1 - m_EnableRandomWrite: 0 - m_TextureSettings: - serializedVersion: 2 - m_FilterMode: 1 - m_Aniso: 0 - m_MipBias: 0 - m_WrapU: 1 - m_WrapV: 1 - m_WrapW: 1 - m_Dimension: 2 - m_VolumeDepth: 1 - m_ShadowSamplingMode: 2 + m_Name: Shader Graphs/TestCompositionGraph + m_Shader: {fileID: -6465566751694194690, guid: 64fcbeb03211da74295e0878bd451f91, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - GreenScreen: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - Layer0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - Layer1: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaCutoffEnable: 1 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _BlendMode: 0 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _DepthOffsetEnable: 0 + - _DoubleSidedEnable: 1 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _DstBlend2: 0 + - _EnableBlendModePreserveSpecularLighting: 0 + - _EnableFogOnTransparent: 1 + - _ExcludeFromTUAndAA: 0 + - _OpaqueCullMode: 2 + - _PerPixelSorting: 0 + - _RenderQueueType: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 1 + - _StencilRefDistortionVec: 4 + - _StencilRefMV: 33 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 9 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskMV: 43 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!1 &1988564076 GameObject: m_ObjectHideFlags: 0 @@ -6662,6 +6808,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -6683,9 +6832,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1988564079 MeshFilter: @@ -6724,6 +6875,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f19d9143a39eb3b46bc4563e9889cfbd, type: 3} m_Name: m_EditorClassIdentifier: + m_Version: 3 m_Material: {fileID: 2100000, guid: 735f24af7101b4a43b60487db8217b85, type: 2} m_DrawDistance: 1000 m_FadeScale: 0.9 @@ -6741,7 +6893,6 @@ MonoBehaviour: m_Offset: {x: 0, y: 0, z: 0.1} m_Size: {x: 2, y: 2, z: 0.2} m_FadeFactor: 1 - m_Version: 3 --- !u!4 &2000874750 Transform: m_ObjectHideFlags: 0 @@ -6854,6 +7005,7 @@ Canvas: m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 m_VertexColorAlwaysGammaSpace: 0 + m_UseReflectionProbes: 0 m_AdditionalShaderChannelsFlag: 0 m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 @@ -6928,6 +7080,7 @@ MonoBehaviour: m_StaticLightingSkyUniqueID: 1 m_StaticLightingCloudsUniqueID: 0 m_StaticLightingVolumetricClouds: 0 + bounces: 1 --- !u!114 &2011204168 MonoBehaviour: m_ObjectHideFlags: 0 @@ -7019,14 +7172,14 @@ Light: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2035111233} m_Enabled: 1 - serializedVersion: 11 + serializedVersion: 13 m_Type: 1 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 80000 m_Range: 10 m_SpotAngle: 30 - m_InnerSpotAngle: 21.802082 - m_CookieSize: 10 + m_InnerSpotAngle: 0 + m_CookieSize2D: {x: 0.5, y: 0.5} m_Shadows: m_Type: 1 m_Resolution: -1 @@ -7070,8 +7223,12 @@ Light: m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} m_UseBoundingSphereOverride: 0 m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 + m_ForceVisible: 0 + m_ShapeRadius: 0 m_ShadowAngle: 0.53 + m_LightUnit: 2 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 0 --- !u!4 &2035111235 Transform: m_ObjectHideFlags: 0 @@ -7102,23 +7259,28 @@ MonoBehaviour: m_PointlightHDType: 0 m_SpotLightShape: 0 m_AreaLightShape: 0 - m_Intensity: 80000 m_EnableSpotReflector: 0 + m_LightUnit: 2 m_LuxAtDistance: 1 - m_InnerSpotPercent: 0 + m_Intensity: 80000 + m_InnerSpotPercent: -1 + m_ShapeWidth: -1 + m_ShapeHeight: -1 + m_AspectRatio: 1 + m_ShapeRadius: -1 + m_Version: 15 + m_ObsoleteShadowResolutionTier: 2 + m_ObsoleteUseShadowQualitySettings: 1 + m_ObsoleteCustomShadowResolution: 4096 + m_ObsoleteContactShadows: 0 m_SpotIESCutoffPercent: 100 m_LightDimmer: 1 m_VolumetricDimmer: 1 - m_LightUnit: 2 m_FadeDistance: 10000 m_VolumetricFadeDistance: 10000 m_AffectDiffuse: 1 m_AffectSpecular: 1 m_NonLightmappedOnly: 0 - m_ShapeWidth: 0.5 - m_ShapeHeight: 0.5 - m_AspectRatio: 1 - m_ShapeRadius: 0 m_SoftnessScale: 1 m_UseCustomSpotLightShadowCone: 0 m_CustomSpotLightShadowCone: 30 @@ -7129,30 +7291,33 @@ MonoBehaviour: m_IESPoint: {fileID: 0} m_IESSpot: {fileID: 0} m_IncludeForRayTracing: 1 + m_IncludeForPathTracing: 1 m_AreaLightShadowCone: 120 m_UseScreenSpaceShadows: 0 m_InteractsWithSky: 1 m_AngularDiameter: 0.53 - m_DiameterMultiplerMode: 1 - m_DiameterMultiplier: 1 - m_DiameterOverride: 0.5 - m_EmissiveLightSource: 1 - m_FlareSize: 2 - m_FlareTint: {r: 1, g: 1, b: 1, a: 1} - m_FlareFalloff: 4 - m_AutomaticMoonPhase: 1 - m_MoonPhase: 0.2 - m_MoonPhaseRotation: 0 - m_Earthshine: 1 - m_SurfaceTexture: {fileID: 0} - m_SurfaceTint: {r: 1, g: 1, b: 1, a: 1} + diameterMultiplerMode: 1 + diameterMultiplier: 1 + diameterOverride: 0.5 + celestialBodyShadingSource: 1 + sunLightOverride: {fileID: 0} + sunColor: {r: 1, g: 1, b: 1, a: 1} + sunIntensity: 130000 + moonPhase: 0.2 + moonPhaseRotation: 0 + earthshine: 1 + flareSize: 2 + flareTint: {r: 1, g: 1, b: 1, a: 1} + flareFalloff: 4 + flareMultiplier: 1 + surfaceTexture: {fileID: 0} + surfaceTint: {r: 1, g: 1, b: 1, a: 1} m_Distance: 150000000 m_UseRayTracedShadows: 0 m_NumRayTracingSamples: 4 m_FilterTracedShadow: 1 m_FilterSizeTraced: 16 m_SunLightConeAngle: 0.5 - m_LightShadowRadius: 0.5 m_SemiTransparentShadow: 0 m_ColorShadow: 1 m_DistanceBasedFiltering: 0 @@ -7168,7 +7333,7 @@ MonoBehaviour: m_MinFilterSize: 0.01 m_DirLightPCSSBlockerSampleCount: 24 m_DirLightPCSSFilterSampleCount: 16 - m_DirLightPCSSMaxBlockerDistance: 64 + m_DirLightPCSSMaxPenumbraSize: 0.56 m_DirLightPCSSMaxSamplingDistance: 0.5 m_DirLightPCSSMinFilterSizeTexels: 1.5 m_DirLightPCSSMinFilterMaxAngularDiameter: 10 @@ -7220,11 +7385,6 @@ MonoBehaviour: m_AreaLightEmissiveMeshShadowCastingMode: 0 m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 m_AreaLightEmissiveMeshLayer: -1 - m_Version: 12 - m_ObsoleteShadowResolutionTier: 2 - m_ObsoleteUseShadowQualitySettings: 1 - m_ObsoleteCustomShadowResolution: 4096 - m_ObsoleteContactShadows: 0 --- !u!1 &2044480112 GameObject: m_ObjectHideFlags: 0 @@ -7300,6 +7460,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -7321,9 +7484,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &2044480116 MeshFilter: @@ -7362,7 +7527,7 @@ Transform: m_GameObject: {fileID: 2059789766} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 2.510054, y: 1.196, z: 1.1760272} + m_LocalPosition: {x: 2.5100584, y: 1.196, z: 1.1760293} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -7413,6 +7578,101 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0ef8dc2c2eabfa4e8cb77be57a837c0, type: 3} m_Name: m_EditorClassIdentifier: + m_HDProbeVersion: 9 + m_ObsoleteInfiniteProjection: 0 + m_ObsoleteInfluenceVolume: + m_EditorAdvancedModeBlendDistancePositive: {x: 0, y: 0, z: 0} + m_EditorAdvancedModeBlendDistanceNegative: {x: 0, y: 0, z: 0} + m_EditorSimplifiedModeBlendDistance: 0 + m_EditorAdvancedModeBlendNormalDistancePositive: {x: 0, y: 0, z: 0} + m_EditorAdvancedModeBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_EditorSimplifiedModeBlendNormalDistance: 0 + m_EditorAdvancedModeEnabled: 0 + m_EditorAdvancedModeFaceFadePositive: {x: 1, y: 1, z: 1} + m_EditorAdvancedModeFaceFadeNegative: {x: 1, y: 1, z: 1} + m_Version: 1 + m_ObsoleteSphereBaseOffset: {x: 0, y: 0, z: 0} + m_ObsoleteOffset: {x: 0, y: 0, z: 0} + m_Shape: 0 + m_BoxSize: {x: 1.27, y: 2.5, z: 4.9506874} + m_BoxBlendDistancePositive: {x: 0, y: 0, z: 0} + m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxBlendNormalDistancePositive: {x: 0, y: 0, z: 0} + m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxSideFadePositive: {x: 1, y: 1, z: 1} + m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} + m_SphereRadius: 3 + m_SphereBlendDistance: 0 + m_SphereBlendNormalDistance: 0 + m_ObsoleteFrameSettings: + overrides: 0 + enableShadow: 1 + enableContactShadows: 1 + enableShadowMask: 1 + enableSSR: 0 + enableSSAO: 1 + enableSubsurfaceScattering: 1 + enableTransmission: 1 + enableAtmosphericScattering: 1 + enableVolumetrics: 1 + enableReprojectionForVolumetrics: 1 + enableLightLayers: 1 + enableExposureControl: 1 + diffuseGlobalDimmer: 1 + specularGlobalDimmer: 1 + shaderLitMode: 1 + enableDepthPrepassWithDeferredRendering: 0 + enableTransparentPrepass: 1 + enableMotionVectors: 1 + enableObjectMotionVectors: 1 + enableDecals: 1 + enableRoughRefraction: 1 + enableTransparentPostpass: 1 + enableDistortion: 1 + enablePostprocess: 1 + enableOpaqueObjects: 1 + enableTransparentObjects: 1 + enableRealtimePlanarReflection: 1 + enableMSAA: 0 + enableAsyncCompute: 1 + runLightListAsync: 1 + runSSRAsync: 1 + runSSAOAsync: 1 + runContactShadowsAsync: 1 + runVolumeVoxelizationAsync: 1 + lightLoopSettings: + overrides: 0 + enableDeferredTileAndCluster: 1 + enableComputeLightEvaluation: 1 + enableComputeLightVariants: 1 + enableComputeMaterialVariants: 1 + enableFptlForForwardOpaque: 1 + enableBigTilePrepass: 1 + isFptlEnabled: 1 + m_ObsoleteMultiplier: 1 + m_ObsoleteWeight: 1 + m_ObsoleteMode: 0 + m_ObsoleteLightLayers: 1 + m_ObsoleteCaptureSettings: + overrides: 0 + clearColorMode: 0 + backgroundColorHDR: {r: 0.023529412, g: 0.07058824, b: 0.1882353, a: 0} + clearDepth: 1 + cullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + useOcclusionCulling: 1 + volumeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + volumeAnchorOverride: {fileID: 0} + projection: 0 + nearClipPlane: 0.3 + farClipPlane: 1000 + fieldOfView: 90 + orthographicSize: 5 + renderingPath: 0 + shadowDistance: 100 m_ProbeSettings: frustum: fieldOfViewMode: 1 @@ -7424,23 +7684,13 @@ MonoBehaviour: realtimeMode: 0 timeSlicing: 0 lighting: + importance: 1 multiplier: 1 weight: 1 lightLayer: 1 fadeDistance: 10000 rangeCompressionFactor: 1 influence: - m_Shape: 0 - m_BoxSize: {x: 1.27, y: 2.5, z: 4.9506874} - m_BoxBlendDistancePositive: {x: 0, y: 0, z: 0} - m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxBlendNormalDistancePositive: {x: 0, y: 0, z: 0} - m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxSideFadePositive: {x: 1, y: 1, z: 1} - m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} - m_SphereRadius: 3 - m_SphereBlendDistance: 0 - m_SphereBlendNormalDistance: 0 m_EditorAdvancedModeBlendDistancePositive: {x: 0, y: 0, z: 0} m_EditorAdvancedModeBlendDistanceNegative: {x: 0, y: 0, z: 0} m_EditorSimplifiedModeBlendDistance: 0 @@ -7453,13 +7703,24 @@ MonoBehaviour: m_Version: 1 m_ObsoleteSphereBaseOffset: {x: 0, y: 0, z: 0} m_ObsoleteOffset: {x: 0, y: 0, z: 0} - proxy: m_Shape: 0 - m_BoxSize: {x: 1, y: 1, z: 1} - m_SphereRadius: 1 + m_BoxSize: {x: 1.27, y: 2.5, z: 4.9506874} + m_BoxBlendDistancePositive: {x: 0, y: 0, z: 0} + m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxBlendNormalDistancePositive: {x: 0, y: 0, z: 0} + m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_BoxSideFadePositive: {x: 1, y: 1, z: 1} + m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} + m_SphereRadius: 3 + m_SphereBlendDistance: 0 + m_SphereBlendNormalDistance: 0 + proxy: m_CSVersion: 2 m_ObsoleteSphereInfiniteProjection: 0 m_ObsoleteBoxInfiniteProjection: 0 + m_Shape: 0 + m_BoxSize: {x: 1, y: 1, z: 1} + m_SphereRadius: 1 proxySettings: useInfluenceVolumeAsProxyVolume: 1 capturePositionProxySpace: {x: -0.00000043940543, y: 0, z: -0.000000317812} @@ -7705,102 +7966,7 @@ MonoBehaviour: 'sh[26]': 0 m_SHValidForCapturePosition: {x: 0, y: 0, z: 0} m_SHValidForSourcePosition: {x: 0, y: 0, z: 0} - m_HDProbeVersion: 3 - m_ObsoleteInfiniteProjection: 0 - m_ObsoleteInfluenceVolume: - m_Shape: 0 - m_BoxSize: {x: 1.27, y: 2.5, z: 4.9506874} - m_BoxBlendDistancePositive: {x: 0, y: 0, z: 0} - m_BoxBlendDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxBlendNormalDistancePositive: {x: 0, y: 0, z: 0} - m_BoxBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} - m_BoxSideFadePositive: {x: 1, y: 1, z: 1} - m_BoxSideFadeNegative: {x: 1, y: 1, z: 1} - m_SphereRadius: 3 - m_SphereBlendDistance: 0 - m_SphereBlendNormalDistance: 0 - m_EditorAdvancedModeBlendDistancePositive: {x: 0, y: 0, z: 0} - m_EditorAdvancedModeBlendDistanceNegative: {x: 0, y: 0, z: 0} - m_EditorSimplifiedModeBlendDistance: 0 - m_EditorAdvancedModeBlendNormalDistancePositive: {x: 0, y: 0, z: 0} - m_EditorAdvancedModeBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} - m_EditorSimplifiedModeBlendNormalDistance: 0 - m_EditorAdvancedModeEnabled: 0 - m_EditorAdvancedModeFaceFadePositive: {x: 1, y: 1, z: 1} - m_EditorAdvancedModeFaceFadeNegative: {x: 1, y: 1, z: 1} - m_Version: 1 - m_ObsoleteSphereBaseOffset: {x: 0, y: 0, z: 0} - m_ObsoleteOffset: {x: 0, y: 0, z: 0} - m_ObsoleteFrameSettings: - overrides: 0 - enableShadow: 1 - enableContactShadows: 1 - enableShadowMask: 1 - enableSSR: 0 - enableSSAO: 1 - enableSubsurfaceScattering: 1 - enableTransmission: 1 - enableAtmosphericScattering: 1 - enableVolumetrics: 1 - enableReprojectionForVolumetrics: 1 - enableLightLayers: 1 - enableExposureControl: 1 - diffuseGlobalDimmer: 1 - specularGlobalDimmer: 1 - shaderLitMode: 1 - enableDepthPrepassWithDeferredRendering: 0 - enableTransparentPrepass: 1 - enableMotionVectors: 1 - enableObjectMotionVectors: 1 - enableDecals: 1 - enableRoughRefraction: 1 - enableTransparentPostpass: 1 - enableDistortion: 1 - enablePostprocess: 1 - enableOpaqueObjects: 1 - enableTransparentObjects: 1 - enableRealtimePlanarReflection: 1 - enableMSAA: 0 - enableAsyncCompute: 1 - runLightListAsync: 1 - runSSRAsync: 1 - runSSAOAsync: 1 - runContactShadowsAsync: 1 - runVolumeVoxelizationAsync: 1 - lightLoopSettings: - overrides: 0 - enableDeferredTileAndCluster: 1 - enableComputeLightEvaluation: 1 - enableComputeLightVariants: 1 - enableComputeMaterialVariants: 1 - enableFptlForForwardOpaque: 1 - enableBigTilePrepass: 1 - isFptlEnabled: 1 - m_ObsoleteMultiplier: 1 - m_ObsoleteWeight: 1 - m_ObsoleteMode: 0 - m_ObsoleteLightLayers: 1 - m_ObsoleteCaptureSettings: - overrides: 0 - clearColorMode: 0 - backgroundColorHDR: {r: 0.023529412, g: 0.07058824, b: 0.1882353, a: 0} - clearDepth: 1 - cullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - useOcclusionCulling: 1 - volumeLayerMask: - serializedVersion: 2 - m_Bits: 4294967295 - volumeAnchorOverride: {fileID: 0} - projection: 0 - nearClipPlane: 0.3 - farClipPlane: 1000 - fieldOfView: 90 - orthographicSize: 5 - renderingPath: 0 - shadowDistance: 100 - m_ReflectionProbeVersion: 9 + m_ReflectionProbeVersion: 10 m_ObsoleteInfluenceShape: 0 m_ObsoleteInfluenceSphereRadius: 3 m_ObsoleteBlendDistancePositive: {x: 0, y: 0, z: 0} @@ -7828,6 +7994,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -7849,9 +8018,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &2059789771 MeshFilter: @@ -8002,6 +8173,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -8023,9 +8197,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &2072213265 MeshFilter: @@ -8154,6 +8330,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -8175,9 +8354,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &2113397028 MeshFilter: @@ -9250,6 +9431,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9272,9 +9456,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23102778595975102 MeshRenderer: @@ -9295,6 +9481,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9316,9 +9505,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23105044117804180 MeshRenderer: @@ -9339,6 +9530,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9360,9 +9554,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23108239442236004 MeshRenderer: @@ -9383,6 +9579,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9405,9 +9604,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23113288655538896 MeshRenderer: @@ -9428,6 +9629,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9449,9 +9653,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23153506525441086 MeshRenderer: @@ -9472,6 +9678,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9493,9 +9702,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23159474732925824 MeshRenderer: @@ -9516,6 +9727,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9537,9 +9751,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23234624825969392 MeshRenderer: @@ -9560,6 +9776,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9581,9 +9800,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23280013929241180 MeshRenderer: @@ -9604,6 +9825,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9625,9 +9849,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23297504398282328 MeshRenderer: @@ -9648,6 +9874,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9670,9 +9899,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23313931999218306 MeshRenderer: @@ -9693,6 +9924,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9714,9 +9948,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23380737865223604 MeshRenderer: @@ -9737,6 +9973,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9760,9 +9999,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23417825174992344 MeshRenderer: @@ -9783,6 +10024,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9804,9 +10048,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23469017206319436 MeshRenderer: @@ -9827,6 +10073,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9848,9 +10097,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23660396016633692 MeshRenderer: @@ -9871,6 +10122,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9892,9 +10146,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23678019684133178 MeshRenderer: @@ -9915,6 +10171,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9936,9 +10195,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23820014581838294 MeshRenderer: @@ -9959,6 +10220,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -9980,9 +10244,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23834675469963112 MeshRenderer: @@ -10003,6 +10269,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -10027,9 +10296,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23855476998699522 MeshRenderer: @@ -10050,6 +10321,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -10074,9 +10348,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23862939749928067 MeshRenderer: @@ -10097,6 +10373,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -10120,9 +10399,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23912046455902760 MeshRenderer: @@ -10143,6 +10424,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -10166,9 +10450,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &23912405108167244 MeshRenderer: @@ -10189,6 +10475,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -10210,9 +10499,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &33055920987286580 MeshFilter: @@ -10419,14 +10710,14 @@ Light: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1507423174311380} m_Enabled: 1 - serializedVersion: 11 + serializedVersion: 13 m_Type: 0 m_Color: {r: 0.9529412, g: 0.9254902, b: 0.8039216, a: 1} m_Intensity: 108677.79 m_Range: 15 m_SpotAngle: 90 - m_InnerSpotAngle: 9 - m_CookieSize: 10 + m_InnerSpotAngle: 72 + m_CookieSize2D: {x: 10, y: 10} m_Shadows: m_Type: 1 m_Resolution: -1 @@ -10470,8 +10761,12 @@ Light: m_BoundingSphereOverride: {x: 0, y: -0.000000004421082, z: 6.99e-43, w: 7.8e-44} m_UseBoundingSphereOverride: 0 m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0.1 + m_ForceVisible: 0 + m_ShapeRadius: 0.1 m_ShadowAngle: 0 + m_LightUnit: 0 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 --- !u!114 &114600619915666046 MonoBehaviour: m_ObjectHideFlags: 0 @@ -10487,23 +10782,28 @@ MonoBehaviour: m_PointlightHDType: 0 m_SpotLightShape: 0 m_AreaLightShape: 0 - m_Intensity: 200000 m_EnableSpotReflector: 1 + m_LightUnit: 0 m_LuxAtDistance: 1 - m_InnerSpotPercent: 80 + m_Intensity: 200000 + m_InnerSpotPercent: -1 + m_ShapeWidth: -1 + m_ShapeHeight: -1 + m_AspectRatio: 1 + m_ShapeRadius: -1 + m_Version: 15 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 m_SpotIESCutoffPercent: 100 m_LightDimmer: 1 m_VolumetricDimmer: 1 - m_LightUnit: 0 m_FadeDistance: 10000 m_VolumetricFadeDistance: 10000 m_AffectDiffuse: 1 m_AffectSpecular: 1 m_NonLightmappedOnly: 0 - m_ShapeWidth: 0.5 - m_ShapeHeight: 0.5 - m_AspectRatio: 1 - m_ShapeRadius: 0.1 m_SoftnessScale: 1 m_UseCustomSpotLightShadowCone: 0 m_CustomSpotLightShadowCone: 55.8 @@ -10514,30 +10814,33 @@ MonoBehaviour: m_IESPoint: {fileID: 0} m_IESSpot: {fileID: 0} m_IncludeForRayTracing: 1 + m_IncludeForPathTracing: 1 m_AreaLightShadowCone: 120 m_UseScreenSpaceShadows: 0 m_InteractsWithSky: 1 m_AngularDiameter: 0 - m_DiameterMultiplerMode: 1 - m_DiameterMultiplier: 1 - m_DiameterOverride: 0.5 - m_EmissiveLightSource: 1 - m_FlareSize: 2 - m_FlareTint: {r: 1, g: 1, b: 1, a: 1} - m_FlareFalloff: 4 - m_AutomaticMoonPhase: 1 - m_MoonPhase: 0.2 - m_MoonPhaseRotation: 0 - m_Earthshine: 1 - m_SurfaceTexture: {fileID: 0} - m_SurfaceTint: {r: 1, g: 1, b: 1, a: 1} + diameterMultiplerMode: 1 + diameterMultiplier: 1 + diameterOverride: 0.5 + celestialBodyShadingSource: 1 + sunLightOverride: {fileID: 0} + sunColor: {r: 1, g: 1, b: 1, a: 1} + sunIntensity: 130000 + moonPhase: 0.2 + moonPhaseRotation: 0 + earthshine: 1 + flareSize: 2 + flareTint: {r: 1, g: 1, b: 1, a: 1} + flareFalloff: 4 + flareMultiplier: 1 + surfaceTexture: {fileID: 0} + surfaceTint: {r: 1, g: 1, b: 1, a: 1} m_Distance: 150000000 m_UseRayTracedShadows: 0 m_NumRayTracingSamples: 4 m_FilterTracedShadow: 1 m_FilterSizeTraced: 16 m_SunLightConeAngle: 0.5 - m_LightShadowRadius: 0.5 m_SemiTransparentShadow: 0 m_ColorShadow: 1 m_DistanceBasedFiltering: 0 @@ -10553,7 +10856,7 @@ MonoBehaviour: m_MinFilterSize: 0.01 m_DirLightPCSSBlockerSampleCount: 24 m_DirLightPCSSFilterSampleCount: 16 - m_DirLightPCSSMaxBlockerDistance: 64 + m_DirLightPCSSMaxPenumbraSize: 0.56 m_DirLightPCSSMaxSamplingDistance: 0.5 m_DirLightPCSSMinFilterSizeTexels: 1.5 m_DirLightPCSSMinFilterMaxAngularDiameter: 10 @@ -10605,11 +10908,6 @@ MonoBehaviour: m_AreaLightEmissiveMeshShadowCastingMode: 0 m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 m_AreaLightEmissiveMeshLayer: -1 - m_Version: 12 - m_ObsoleteShadowResolutionTier: 1 - m_ObsoleteUseShadowQualitySettings: 0 - m_ObsoleteCustomShadowResolution: 512 - m_ObsoleteContactShadows: 0 --- !u!1 &204727572796561979 GameObject: m_ObjectHideFlags: 0 @@ -10655,6 +10953,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10677,9 +10978,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!23 &909831428394599154 MeshRenderer: @@ -10700,6 +11003,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10721,9 +11027,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!4 &931851623488560781 Transform: @@ -10834,6 +11142,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10855,9 +11166,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!4 &6358232971868724209 Transform: @@ -10927,6 +11240,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10948,9 +11264,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!1660057539 &9223372036854775807 SceneRoots: diff --git a/Tests/SRPTests/Projects/SRP_SmokeTest/Assets/Tests/Editor/Volumes/VolumeComponentEditorSupportedOnTests.cs b/Tests/SRPTests/Projects/SRP_SmokeTest/Assets/Tests/Editor/Volumes/VolumeComponentEditorSupportedOnTests.cs index c92a3533127..d205479853d 100644 --- a/Tests/SRPTests/Projects/SRP_SmokeTest/Assets/Tests/Editor/Volumes/VolumeComponentEditorSupportedOnTests.cs +++ b/Tests/SRPTests/Projects/SRP_SmokeTest/Assets/Tests/Editor/Volumes/VolumeComponentEditorSupportedOnTests.cs @@ -33,7 +33,7 @@ class VolumeComponentEditorSupportedOnTests : RenderPipelineTests public void TestVolumeManagerSupportedOnFiltering(Type renderPipelineAssetType, Type[] expectedTypes, Type[] notExpectedTypes) { var volumeManager = new VolumeManager(); - volumeManager.LoadBaseTypes(renderPipelineAssetType); + volumeManager.LoadBaseTypesByReflection(renderPipelineAssetType); volumeManager.InitializeInternal(); foreach (var expectedType in expectedTypes) diff --git a/Tests/SRPTests/Projects/SRP_SmokeTest/Assets/Tests/Editor/Volumes/VolumeComponentTests.cs b/Tests/SRPTests/Projects/SRP_SmokeTest/Assets/Tests/Editor/Volumes/VolumeComponentTests.cs index 4a3dc401064..a91ca59de60 100644 --- a/Tests/SRPTests/Projects/SRP_SmokeTest/Assets/Tests/Editor/Volumes/VolumeComponentTests.cs +++ b/Tests/SRPTests/Projects/SRP_SmokeTest/Assets/Tests/Editor/Volumes/VolumeComponentTests.cs @@ -409,13 +409,5 @@ public void TestInputForGetVolumeComponentsForDisplay() Assert.That(() => volumeManager.GetVolumeComponentsForDisplay(typeof(CustomRenderPipeline)), Throws.ArgumentException); Assert.IsNotNull(volumeManager.GetVolumeComponentsForDisplay(null)); } - - [Test] - public void TestVolumeManagerFetchsTypesWhenNotInitialized() - { - var volumeManager = new VolumeManager(); - var typesForDisplay = volumeManager.GetVolumeComponentsForDisplay(typeof(CustomRenderPipelineAsset)); - Assert.IsTrue(typesForDisplay.Count > 0); - } } } diff --git a/Tests/SRPTests/Projects/SRP_SmokeTest/Assets/Tests/Runtime/Volumes/VolumeManagerTests.cs b/Tests/SRPTests/Projects/SRP_SmokeTest/Assets/Tests/Runtime/Volumes/VolumeManagerTests.cs index ec81fc9f781..bee767114bc 100644 --- a/Tests/SRPTests/Projects/SRP_SmokeTest/Assets/Tests/Runtime/Volumes/VolumeManagerTests.cs +++ b/Tests/SRPTests/Projects/SRP_SmokeTest/Assets/Tests/Runtime/Volumes/VolumeManagerTests.cs @@ -10,6 +10,7 @@ namespace UnityEngine.Rendering.Tests class VolumeManagerTests { readonly LayerMask k_defaultLayer = 1; + VolumeProfile m_defaultProfile; VolumeProfile m_VolumeProfile; readonly List m_Objects = new(); readonly bool m_IsGlobal; @@ -36,8 +37,12 @@ public void Setup() var volumeComponent = m_VolumeProfile.Add(); volumeComponent.param.Override(TestVolume.k_OverrideValue); + m_defaultProfile = ScriptableObject.CreateInstance(); + var defaultComponent = m_defaultProfile.Add(); + defaultComponent.param.Override(TestVolume.k_DefaultValue); + volumeManager = new VolumeManager(); - volumeManager.Initialize(); + volumeManager.Initialize(m_defaultProfile); camera = new GameObject("Camera", typeof(Camera)); m_Objects.Add(camera); } @@ -143,6 +148,7 @@ public void ParameterOverrideTest() class VolumeManagerDefaultProfileTests { + VolumeProfile m_VolumeProfileDefault; VolumeProfile m_VolumeProfile1; VolumeProfile m_VolumeProfile2; VolumeProfile m_VolumeProfile3; @@ -153,6 +159,9 @@ class VolumeManagerDefaultProfileTests [SetUp] public void Setup() { + m_VolumeProfileDefault = ScriptableObject.CreateInstance(); + m_VolumeProfileDefault.Add().param.Override(TestVolume.k_DefaultValue); + m_VolumeProfile1 = ScriptableObject.CreateInstance(); m_VolumeProfile1.Add().param.Override(TestVolume.k_OverrideValue); @@ -176,7 +185,7 @@ public void TearDown() public void ParameterIsCorrectByDefault() { volumeManager = new VolumeManager(); - volumeManager.Initialize(); + volumeManager.Initialize(m_VolumeProfileDefault); LayerMask defaultLayer = 1; var camera = new GameObject("Camera", typeof(Camera)); @@ -202,20 +211,20 @@ public void DefaultProfilesAreAppliedToDefaultState() Assert.AreEqual(TestVolume.k_OverrideValue3, GetDefaultState().param.value); volumeManager.SetGlobalDefaultProfile(null); - Assert.AreEqual(TestVolume.k_OverrideValue3, GetDefaultState().param.value); + Assert.IsNull(GetDefaultState()); // No global default profile - default state should be null even if quality and custom defaults are set, as global is the base for the default state volumeManager.SetQualityDefaultProfile(null); - Assert.AreEqual(TestVolume.k_OverrideValue3, GetDefaultState().param.value); + Assert.IsNull(GetDefaultState()); // No global default profile - default state should be null even if quality and custom defaults are set, as global is the base for the default state volumeManager.SetCustomDefaultProfiles(null); - Assert.AreEqual(TestVolume.k_DefaultValue, GetDefaultState().param.value); + Assert.IsNull(GetDefaultState()); // No global default profile - default state should be null even if quality and custom defaults are set, as global is the base for the default state } [Test] public void CustomDefaultProfilesAreAppliedInOrder() { volumeManager = new VolumeManager(); - volumeManager.Initialize(); + volumeManager.Initialize(m_VolumeProfileDefault); volumeManager.SetCustomDefaultProfiles(new List { m_VolumeProfile1, m_VolumeProfile2 }); Assert.AreEqual(TestVolume.k_OverrideValue2, GetDefaultState().param.value); diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/PhysicsDependencyTests.cs b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/PhysicsDependencyTests.cs index cd15f041dbe..fb35a1e2cc2 100644 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/PhysicsDependencyTests.cs +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/PhysicsDependencyTests.cs @@ -76,7 +76,6 @@ public PhysicsDependencyTests(bool physicsModuleInstalled) public IEnumerator AllTestsCombined() { yield return PhysicsModulePresence(); - yield return VolumeManager_LocalVolumesBehaveAsExpected(); } // Disabled - see AllTestsCombined() @@ -94,31 +93,6 @@ public IEnumerator PhysicsModulePresence() // move this test to a different project, or remove more packages to allow this test to run without Physics module present. Assert.False(isPhysicsInstalled, "Physics module should not be installed. Did you introduce a new dependency to Physics module somewhere?"); } - - // Disabled - see AllTestsCombined() - //[UnityTest] - public IEnumerator VolumeManager_LocalVolumesBehaveAsExpected() - { - EditorSceneManager.OpenScene("Assets/CommonAssets/Scenes/LocalVolumeTestScene.unity"); - yield return null; - - // Ensure VolumeManager is updated with the main camera position (might not be true depending on editor layout as we are not in Play Mode) - Assume.That(Camera.main != null); - VolumeManager.instance.Update(Camera.main.transform, (LayerMask)1); - - var volumeComponent = VolumeManager.instance.stack.GetComponent(); - - if (m_PhysicsModuleInstalled) - { - Assert.True(volumeComponent.parameter.overrideState, "Expected local volumes to be enabled when Physics module is installed."); - Assert.AreEqual(TestVolumeComponent.k_OverrideValue, volumeComponent.parameter.value); - } - else - { - Assert.False(volumeComponent.parameter.overrideState, "Expected local volumes to be disabled when Physics module is not installed."); - Assert.AreEqual(TestVolumeComponent.k_DefaultValue, volumeComponent.parameter.value); - } - } } diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/PhysicsDependencyTests.cs.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/PhysicsDependencyTests.cs.meta index 6539cf0e023..79ae95911c2 100644 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/PhysicsDependencyTests.cs.meta +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/PhysicsDependencyTests.cs.meta @@ -1,2 +1,2 @@ fileFormatVersion: 2 -guid: 46a777ea74bb81840a3d9b5de9a2c5c0 \ No newline at end of file +guid: 5de2a45728a9d47ac90a1ffc99bdb056 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/TestVolumeComponent.cs b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/TestVolumeComponent.cs deleted file mode 100644 index 3325769a398..00000000000 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/TestVolumeComponent.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using UnityEngine.Rendering; - -namespace UnityEngine.Rendering.Tests -{ - public class TestVolumeComponent : VolumeComponent - { - public const int k_DefaultValue = 255; - public const int k_OverrideValue = 999; - - public IntParameter parameter = new IntParameter(k_DefaultValue); - } -} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/TestVolumeComponent.cs.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/TestVolumeComponent.cs.meta deleted file mode 100644 index 621d357f061..00000000000 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_PostPro/Assets/Test/Editor/TestVolumeComponent.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 84ad071f7bcf46fbba07d927ef8233a4 -timeCreated: 1754395345 \ No newline at end of file From 982195955ae2d119d1bd1efa34428c163ed3a3bf Mon Sep 17 00:00:00 2001 From: Yvain Raeymaekers Date: Sat, 28 Feb 2026 12:17:40 +0000 Subject: [PATCH 17/95] [GFXLIGHT-1894] Handle camera's renderScale in Surface Cache GI --- .../SurfaceCacheGIRendererFeature.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs index 96b9c419577..5c9552dfedb 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs @@ -436,7 +436,9 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer var worldToClipTransform = viewToClipTransform * worldToViewTransform; var clipToWorldTransform = worldToClipTransform.inverse; - var screenResolution = new int2(cameraData.pixelWidth, cameraData.pixelHeight); + var screenResolution = new int2( + (int)(cameraData.pixelWidth * cameraData.renderScale), + (int)(cameraData.pixelHeight * cameraData.renderScale)); // This avoids applying surface cache to e.g. preview cameras. if (cameraData.cameraType != CameraType.Game && cameraData.cameraType != CameraType.SceneView) From 3fad5a721d1313efccbd48232db0a29ed4f8b754 Mon Sep 17 00:00:00 2001 From: Pema Malling Date: Sat, 28 Feb 2026 12:17:42 +0000 Subject: [PATCH 18/95] GFXLIGHT-2134: Fix missing initialization of probe expansion buffer --- .../Shaders/ProbeIntegrationDirect.urtshader | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationDirect.urtshader b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationDirect.urtshader index c5c83203256..5d5123c1133 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationDirect.urtshader +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationDirect.urtshader @@ -80,11 +80,20 @@ void IntegrateDirectRadiance(UnifiedRT::DispatchInfo dispatchInfo) #else const float monteCarloNormalization = 1.0f / (float)g_SampleCount; #endif + for (uint channel = 0; channel < SH_COLOR_CHANNELS; ++channel) { for (uint i = 0; i < SH_COEFFICIENTS_PER_CHANNEL; ++i) { - g_RadianceShl2[SHIndex(outProbeIdx, channel, i)] += accumulatedRadianceSH[i][channel] * monteCarloNormalization; + #ifdef LIGHT_SAMPLING_ROUND_ROBIN + float result = accumulatedRadianceSH[i][channel] * monteCarloNormalization; + // If we are past the first iteration, we want to accumulate into the buffer rather than overwriting the current value. + if (g_LightIndexInCell > 0) + result += g_RadianceShl2[SHIndex(outProbeIdx, channel, i)]; + g_RadianceShl2[SHIndex(outProbeIdx, channel, i)] = result; + #else + g_RadianceShl2[SHIndex(outProbeIdx, channel, i)] = accumulatedRadianceSH[i][channel] * monteCarloNormalization; + #endif } } } From 6df248fdafa80c8454c492d80c797281fb8928dd Mon Sep 17 00:00:00 2001 From: Layla Arab Date: Sat, 28 Feb 2026 12:17:44 +0000 Subject: [PATCH 19/95] Add overload of GetLinearLightColor to incorporate an intensityMultiplier --- .../Runtime/PathTracing/PathTracingUtil.cs | 8 +++++++- .../SurfaceCacheGIRendererFeature.cs | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingUtil.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingUtil.cs index 80b52051806..5ca6692bc0c 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingUtil.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingUtil.cs @@ -235,7 +235,13 @@ private static Color RGBMultiplied(Color color, float multiplier) internal static Vector3 GetLinearLightColor(Light light) { - Color lightColor = (GraphicsSettings.lightsUseLinearIntensity) ? RGBMultiplied(light.color.linear, light.intensity) : RGBMultiplied(light.color, light.intensity).linear; + return GetLinearLightColor(light, 1.0f); + } + + internal static Vector3 GetLinearLightColor(Light light, float intensityMultiplier) + { + float effectiveIntensity = light.intensity * intensityMultiplier; + Color lightColor = (GraphicsSettings.lightsUseLinearIntensity) ? RGBMultiplied(light.color.linear, effectiveIntensity) : RGBMultiplied(light.color, effectiveIntensity).linear; lightColor *= light.useColorTemperature ? Mathf.CorrelatedColorTemperatureToRGB(light.colorTemperature) : Color.white; return new Vector3(lightColor.r, lightColor.g, lightColor.b) * lightColor.a; } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs index 5c9552dfedb..99356fbfcc8 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs @@ -1159,7 +1159,7 @@ internal static SurfaceCacheWorld.LightDescriptor[] ConvertUnityLightsToLightDes Light light = lights[i]; ref SurfaceCacheWorld.LightDescriptor descriptor = ref descriptors[i]; descriptor.Type = light.type; - descriptor.LinearLightColor = Util.GetLinearLightColor(light) * light.bounceIntensity; + descriptor.LinearLightColor = Util.GetLinearLightColor(light, light.bounceIntensity); if (multiplyPunctualLightIntensityByPI && Util.IsPunctualLightType(light.type)) descriptor.LinearLightColor *= Mathf.PI; descriptor.Transform = light.transform.localToWorldMatrix; From e11e9ca93db6cbf6a83f6488d4b7e1e88f5e1450 Mon Sep 17 00:00:00 2001 From: Rasmus Roenn Nielsen Date: Sat, 28 Feb 2026 12:17:45 +0000 Subject: [PATCH 20/95] Restore view and projection matrices when Surface Cache modifies them --- .../Lighting/SurfaceCache/SurfaceCacheWorld.cs | 4 ++-- .../Runtime/PathTracing/Environment/CubemapRender.cs | 10 +++++++--- .../Runtime/PathTracing/World.cs | 2 +- .../SurfaceCacheGIRendererFeature.cs | 12 +++++++++--- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCacheWorld.cs b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCacheWorld.cs index c47b9838cb3..c29c2d48d14 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCacheWorld.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCacheWorld.cs @@ -489,12 +489,12 @@ public void RemoveLights(Span lightHandles) } } - public void Commit(CommandBuffer cmdBuf, ref GraphicsBuffer scratchBuffer, uint envCubemapResolution, UnityEngine.Light sun) + public void Commit(CommandBuffer cmdBuf, ref GraphicsBuffer scratchBuffer, uint envCubemapResolution, UnityEngine.Light sun, out bool viewAndProjectionMatricesChanged) { Debug.Assert(_rayTracingAccelerationStructure != null); _materialPool.Build(cmdBuf); _rayTracingAccelerationStructure.Build(cmdBuf, ref scratchBuffer); - _cubemapRender.Update(cmdBuf, sun, (int)envCubemapResolution); + _cubemapRender.Update(cmdBuf, sun, (int)envCubemapResolution, out viewAndProjectionMatricesChanged); _lights.Commit(cmdBuf); } } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Environment/CubemapRender.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Environment/CubemapRender.cs index 6e59d8f8ec2..0d111d6a488 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Environment/CubemapRender.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Environment/CubemapRender.cs @@ -76,8 +76,10 @@ Color LightColorInRenderingSpace(Light light) return cct * filter * light.intensity; } - public void Update(CommandBuffer cmd, Light sun, int resolution) + public void Update(CommandBuffer cmd, Light sun, int resolution, out bool viewAndProjectionMatricesChanged) { + viewAndProjectionMatricesChanged = false; + int newHash = ((int)_mode) + 1; if (_mode == Mode.Color) { @@ -100,7 +102,7 @@ public void Update(CommandBuffer cmd, Light sun, int resolution) } if (newHash != _hash) - RenderWithMaterial(cmd, sun, resolution); + RenderWithMaterial(cmd, sun, resolution, out viewAndProjectionMatricesChanged); } else { @@ -138,7 +140,7 @@ private void RenderWithColor(CommandBuffer cmd) } } - private void RenderWithMaterial(CommandBuffer cmd, Light sun, int cubemapResolution) + private void RenderWithMaterial(CommandBuffer cmd, Light sun, int cubemapResolution, out bool viewAndProjectionMatricesChanged) { EnsureCubemapExistsWithParticularResolution(cubemapResolution); @@ -193,6 +195,8 @@ private void RenderWithMaterial(CommandBuffer cmd, Light sun, int cubemapResolut #endif } + viewAndProjectionMatricesChanged = true; + if (_noSunKeyword.HasValue) cmd.DisableKeyword(_material, _noSunKeyword.Value); } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/World.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/World.cs index bea71940939..e9fcb15d344 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/World.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/World.cs @@ -939,7 +939,7 @@ public void Build(Bounds sceneBounds, CommandBuffer cmdBuf, ref GraphicsBuffer s _materialPool.Build(cmdBuf); _rayTracingAccelerationStructure.Build(cmdBuf, ref scratchBuffer); - _cubemapRender.Update(cmdBuf, RenderSettings.sun, envCubemapResolution); + _cubemapRender.Update(cmdBuf, RenderSettings.sun, envCubemapResolution, out _); } public UInt64 GetInstanceHandles(InstanceHandle handle) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs index 99356fbfcc8..6187a5ba71e 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs @@ -164,6 +164,8 @@ private class WorldUpdatePassData internal SurfaceCacheWorld World; internal uint EnvCubemapResolution; internal Light Sun; + internal Matrix4x4 RestoreViewMatrix; + internal Matrix4x4 RestoreProjectionMatrix; } private class DebugPassData @@ -596,8 +598,8 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer passData.World = _world; passData.EnvCubemapResolution = _environmentCubemapResolution; passData.Sun = RenderSettings.sun; - - + passData.RestoreProjectionMatrix = cameraData.GetProjectionMatrix(); + passData.RestoreViewMatrix = worldToViewTransform; builder.AllowGlobalStateModification(true); builder.SetRenderFunc((WorldUpdatePassData data, UnsafeGraphContext graphCtx) => UpdateWorld(data, graphCtx, ref _worldUpdateScratch)); @@ -723,7 +725,11 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer static void UpdateWorld(WorldUpdatePassData data, UnsafeGraphContext graphCtx, ref GraphicsBuffer scratch) { var cmd = CommandBufferHelpers.GetNativeCommandBuffer(graphCtx.cmd); - data.World.Commit(cmd, ref scratch, data.EnvCubemapResolution, data.Sun); + data.World.Commit(cmd, ref scratch, data.EnvCubemapResolution, data.Sun, out bool viewAndProjectionMatricesChanged); + if (viewAndProjectionMatricesChanged) + { + cmd.SetViewProjectionMatrices(data.RestoreViewMatrix, data.RestoreProjectionMatrix); + } } static void LookupScreenIrradiance(ScreenIrradianceLookupPassData data, ComputeGraphContext cgContext) From e0efe807b300731ad74f777ca8665abb078cbf6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Slysz?= Date: Sat, 28 Feb 2026 22:18:40 +0000 Subject: [PATCH 21/95] Graphics/srp/fix performence regression texturexr --- .../RenderGraphDefaultResources.cs | 2 - .../Runtime/Textures/TextureXR.cs | 21 +++-- .../RenderPipeline/HDRenderPipeline.cs | 1 + .../Tests/Editor/TextureXRTests.cs | 90 +++++++++++++++++++ .../Tests/Editor/TextureXRTests.cs.meta | 2 + 5 files changed, 107 insertions(+), 9 deletions(-) create mode 100644 Packages/com.unity.render-pipelines.high-definition/Tests/Editor/TextureXRTests.cs create mode 100644 Packages/com.unity.render-pipelines.high-definition/Tests/Editor/TextureXRTests.cs.meta diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphDefaultResources.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphDefaultResources.cs index 10e22610c76..f3e9b8a7f82 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphDefaultResources.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphDefaultResources.cs @@ -80,8 +80,6 @@ internal void InitializeForRendering(RenderGraph renderGraph) whiteTexture = renderGraph.ImportTexture(m_WhiteTexture2D, true); defaultShadowTexture = renderGraph.ImportTexture(m_ShadowTexture2D, true); - if (!TextureXR.initialized) - return; clearTextureXR = renderGraph.ImportTexture(TextureXR.GetClearTexture(), true); magentaTextureXR = renderGraph.ImportTexture(TextureXR.GetMagentaTexture(), true); blackTextureXR = renderGraph.ImportTexture(TextureXR.GetBlackTexture(), true); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs b/Packages/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs index 19b440378bb..2e12b56c106 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs @@ -177,50 +177,57 @@ public static void Initialize(CommandBuffer cmd, ComputeShader clearR32_UIntShad s_WhiteTextureRTH = RTHandles.Alloc(Texture2D.whiteTexture); s_WhiteTexture2DArray = CreateTexture2DArrayFromTexture2D(Texture2D.whiteTexture, "White Texture2DArray"); s_WhiteTexture2DArrayRTH = RTHandles.Alloc(s_WhiteTexture2DArray); - - //Auto cleanup if pipeline type is changed as all pipelines may not rely on TextureXR - //By time PipelineChange is raised though, it may be too late. So do it at each pipeline disposal instead. - RenderPipelineManager.activeRenderPipelineDisposed += Cleanup; } - static void Cleanup() + /// + /// Release XR textures. Must be called at when destroying a RenderPipeline using TextureXR + /// + public static void Cleanup() { if (!initialized) return; // Black UINT RTHandles.Release(s_BlackUIntTexture2DArrayRTH); + s_BlackUIntTexture2DArrayRTH = null; s_BlackUIntTexture2DArray = null; RTHandles.Release(s_BlackUIntTextureRTH); + s_BlackUIntTextureRTH = null; s_BlackUIntTexture = null; // Clear RTHandles.Release(s_ClearTextureRTH); + s_ClearTextureRTH = null; s_ClearTexture = null; RTHandles.Release(s_ClearTexture2DArrayRTH); + s_ClearTexture2DArrayRTH = null; s_ClearTexture2DArray = null; // Magenta RTHandles.Release(s_MagentaTextureRTH); + s_MagentaTextureRTH = null; s_MagentaTexture = null; RTHandles.Release(s_MagentaTexture2DArrayRTH); + s_MagentaTexture2DArrayRTH = null; s_MagentaTexture2DArray = null; // Black RTHandles.Release(s_BlackTextureRTH); + s_BlackTextureRTH = null; s_BlackTexture = null; RTHandles.Release(s_BlackTexture2DArrayRTH); + s_BlackTexture2DArrayRTH = null; s_BlackTexture2DArray = null; RTHandles.Release(s_BlackTexture3DRTH); + s_BlackTexture3DRTH = null; s_BlackTexture3D = null; // White RTHandles.Release(s_WhiteTextureRTH); s_WhiteTextureRTH = null; RTHandles.Release(s_WhiteTexture2DArrayRTH); + s_WhiteTexture2DArrayRTH = null; s_WhiteTexture2DArray = null; - - RenderPipelineManager.activeRenderPipelineDisposed -= Cleanup; } static Texture2DArray CreateTexture2DArrayFromTexture2D(Texture2D source, string name) 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 fac45c6b779..0a3781261d6 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 @@ -1043,6 +1043,7 @@ protected override void Dispose(bool disposing) CoreUtils.Destroy(m_FinalBlitWithOETFTexArraySingleSlice); XRSystem.Dispose(); + TextureXR.Cleanup(); m_WaterSystem.Cleanup(); m_VolumetricClouds.Cleanup(); m_SkyManager.Cleanup(); diff --git a/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/TextureXRTests.cs b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/TextureXRTests.cs new file mode 100644 index 00000000000..8de602c69ec --- /dev/null +++ b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/TextureXRTests.cs @@ -0,0 +1,90 @@ +using NUnit.Framework; +using UnityEngine.TestTools; +using UnityEditor.SceneManagement; +using System.Collections; +using UnityEngine.Rendering.HighDefinition; + +// Important: TextureXR is only init and CleanedUP on HDRP as it rely on a compute shader for initiallization. +// If this change and TextureXR become also init on URP, we should move ths tests to Core package tests as they should have been from start (TextureXR is in Core pkg) +namespace UnityEngine.Rendering.Tests +{ + class TextureXRTests + { + bool m_WasInitializedBeforeTests; + Camera m_Camera; + + [OneTimeSetUp] + public void OneTimeSetUp() + { + if (GraphicsSettings.currentRenderPipelineAssetType != typeof(HDRenderPipelineAsset)) + Assert.Ignore("This is an HDRP Tests, and the current pipeline is not HDRP."); + + m_WasInitializedBeforeTests = TextureXR.initialized; + + EditorSceneManager.NewScene(NewSceneSetup.EmptyScene); + var go = new GameObject("TestObject", typeof(Camera)); + m_Camera = go.GetComponent(); + } + + [UnityOneTimeTearDown] + public IEnumerator OneTimeTearDown() + { + if (m_WasInitializedBeforeTests) + yield return new InitializeTextureXR(m_Camera); + + GameObject.DestroyImmediate(m_Camera.gameObject); + } + + void AssertUninitialized() + { + Assert.That(TextureXR.initialized, Is.False, $"{nameof(TextureXR.initialized)} is not false after CleanUp"); + Assert.That(TextureXR.GetBlackUIntTexture(), Is.Null, $"{nameof(TextureXR.GetBlackUIntTexture)} is not null after CleanUp"); + Assert.That(TextureXR.GetClearTexture(), Is.Null, $"{nameof(TextureXR.GetClearTexture)} is not null after CleanUp"); + Assert.That(TextureXR.GetMagentaTexture(), Is.Null, $"{nameof(TextureXR.GetMagentaTexture)} is not null after CleanUp"); + Assert.That(TextureXR.GetBlackTexture(), Is.Null, $"{nameof(TextureXR.GetBlackTexture)} is not null after CleanUp"); + Assert.That(TextureXR.GetBlackTexture3D(), Is.Null, $"{nameof(TextureXR.GetBlackTexture3D)} is not null after CleanUp"); + Assert.That(TextureXR.GetWhiteTexture(), Is.Null, $"{nameof(TextureXR.GetWhiteTexture)} is not null after CleanUp"); + } + + void AssertValidRTHandle(RTHandle handle) + { + Assert.That(handle, Is.Not.Null); + Assert.That(handle.nameID.ToString(), Does.Not.StartWith("Type None "), $"{handle.name} is not valid"); + } + + void AssertInitialized() + { + Assert.That(TextureXR.initialized, Is.True); + AssertValidRTHandle(TextureXR.GetBlackUIntTexture()); + AssertValidRTHandle(TextureXR.GetClearTexture()); + AssertValidRTHandle(TextureXR.GetMagentaTexture()); + AssertValidRTHandle(TextureXR.GetBlackTexture()); + AssertValidRTHandle(TextureXR.GetBlackTexture3D()); + AssertValidRTHandle(TextureXR.GetWhiteTexture()); + } + + [UnityTest] + public IEnumerator CheckInitialization() + { + TextureXR.Cleanup(); + AssertUninitialized(); + yield return new InitializeTextureXR(m_Camera); + AssertInitialized(); + TextureXR.Cleanup(); + AssertUninitialized(); + } + + sealed class InitializeTextureXR : YieldInstruction + { + public InitializeTextureXR(Camera camera) + { + RenderTextureDescriptor desc = new RenderTextureDescriptor(1, 1, RenderTextureFormat.Default, 1); //short size to speed up. We don't really care what will be rendered + var request = new RenderPipeline.StandardRequest(); + request.destination = RenderTexture.GetTemporary(desc); + + RenderPipeline.SubmitRenderRequest(camera, request); //The rendering of HDRP will call TextureXR.Initialize with RenderContext and right compute shader + RenderTexture.ReleaseTemporary(request.destination); + } + } + } +} diff --git a/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/TextureXRTests.cs.meta b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/TextureXRTests.cs.meta new file mode 100644 index 00000000000..53a631dfc9b --- /dev/null +++ b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/TextureXRTests.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ea9cafc8640c65c43baba7561d328d7c \ No newline at end of file From 74016ca34cee77a868e76b89c71c32b67e46baed Mon Sep 17 00:00:00 2001 From: Kazuki Matsumoto Date: Mon, 2 Mar 2026 10:34:11 +0000 Subject: [PATCH 22/95] [2d] Add sprite blendshape test cases into 2D graphics project --- .../Scenes/120_SpriteSkin_CPUSkinning.unity | 814 ++++++++++ .../120_SpriteSkin_CPUSkinning.unity.meta | 7 + .../Scenes/120_SpriteSkin_GPUSkinning.unity | 814 ++++++++++ .../120_SpriteSkin_GPUSkinning.unity.meta | 7 + .../Assets/Scenes/130_Blendshape.meta | 8 + .../Scenes/130_Blendshape/BlendShapeTest.cs | 113 ++ .../130_Blendshape/BlendShapeTest.cs.meta | 2 + .../Scenes/130_Blendshape/Weight -50,0.png | Bin 0 -> 2097 bytes .../130_Blendshape/Weight -50,0.png.meta | 712 +++++++++ .../Scenes/130_Blendshape/Weight -50,50.png | Bin 0 -> 2097 bytes .../130_Blendshape/Weight -50,50.png.meta | 712 +++++++++ .../Scenes/130_Blendshape/Weight 50,100.png | Bin 0 -> 2097 bytes .../130_Blendshape/Weight 50,100.png.meta | 712 +++++++++ .../Scenes/130_Blendshape_CPUSkinning.unity | 1353 +++++++++++++++++ .../130_Blendshape_CPUSkinning.unity.meta | 7 + .../Scenes/130_Blendshape_GPUSkinning.unity | 1353 +++++++++++++++++ .../130_Blendshape_GPUSkinning.unity.meta | 7 + .../Scenes/130_Blendshape_Multiple.meta | 8 + .../BlendShapeMultipleTest.cs | 110 ++ .../BlendShapeMultipleTest.cs.meta | 2 + .../130_Blendshape_Multiple/Multple.png | Bin 0 -> 2097 bytes .../130_Blendshape_Multiple/Multple.png.meta | 712 +++++++++ .../130_Blendshape_Multiple_CPUSkinning.unity | 1289 ++++++++++++++++ ...Blendshape_Multiple_CPUSkinning.unity.meta | 7 + .../130_Blendshape_Multiple_GPUSkinning.unity | 1289 ++++++++++++++++ ...Blendshape_Multiple_GPUSkinning.unity.meta | 7 + ...30_Blendshape_SpriteSkin_GPUSkinning.unity | 894 +++++++++++ ...endshape_SpriteSkin_GPUSkinning.unity.meta | 7 + 28 files changed, 10946 insertions(+) create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_CPUSkinning.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_CPUSkinning.unity.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_GPUSkinning.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_GPUSkinning.unity.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/BlendShapeTest.cs create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/BlendShapeTest.cs.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,0.png create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,0.png.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,50.png create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,50.png.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight 50,100.png create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight 50,100.png.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_CPUSkinning.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_CPUSkinning.unity.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_GPUSkinning.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_GPUSkinning.unity.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/BlendShapeMultipleTest.cs create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/BlendShapeMultipleTest.cs.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/Multple.png create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/Multple.png.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_CPUSkinning.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_CPUSkinning.unity.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_GPUSkinning.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_GPUSkinning.unity.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_SpriteSkin_GPUSkinning.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_SpriteSkin_GPUSkinning.unity.meta diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_CPUSkinning.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_CPUSkinning.unity new file mode 100644 index 00000000000..e995038f5db --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_CPUSkinning.unity @@ -0,0 +1,814 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &1256847587 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 100000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_Name + value: Fei + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalScale.x + value: 0.4 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalScale.y + value: 0.4 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalScale.z + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.y + value: -4.5 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_ConstrainProportionsScale + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.x + value: 6.74 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.y + value: 11.48 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9790935 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.20341079 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -23.473 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7667069 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.6419974 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 79.882 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9993317 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.036553167 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 4.19 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.98464245 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.17458297 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 20.109 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9937981 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.11120053 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 12.769 + objectReference: {fileID: 0} + - target: {fileID: 400030, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.77518386 + objectReference: {fileID: 0} + - target: {fileID: 400030, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400030, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.63173574 + objectReference: {fileID: 0} + - target: {fileID: 400030, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 78.357 + objectReference: {fileID: 0} + - target: {fileID: 400032, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.98256385 + objectReference: {fileID: 0} + - target: {fileID: 400032, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400032, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400032, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.18592538 + objectReference: {fileID: 0} + - target: {fileID: 400032, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 21.43 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9974662 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.07114264 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.159 + objectReference: {fileID: 0} + - target: {fileID: 400036, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.5299309 + objectReference: {fileID: 0} + - target: {fileID: 400036, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400036, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.8480409 + objectReference: {fileID: 0} + - target: {fileID: 400036, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 115.998 + objectReference: {fileID: 0} + - target: {fileID: 400038, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9893572 + objectReference: {fileID: 0} + - target: {fileID: 400038, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400038, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400038, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.1455072 + objectReference: {fileID: 0} + - target: {fileID: 400038, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -16.733 + objectReference: {fileID: 0} + - target: {fileID: 400040, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.1779755 + objectReference: {fileID: 0} + - target: {fileID: 400040, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400040, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.98403496 + objectReference: {fileID: 0} + - target: {fileID: 400040, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 159.496 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.5173562 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.85577023 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 117.69 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.95292664 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.30320126 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 35.3 + objectReference: {fileID: 0} + - target: {fileID: 400046, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.29249913 + objectReference: {fileID: 0} + - target: {fileID: 400046, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400046, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.95626587 + objectReference: {fileID: 0} + - target: {fileID: 400046, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -145.985 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.8883985 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.459073 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 54.655 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.99824893 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.059152827 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.782 + objectReference: {fileID: 0} + - target: {fileID: 400052, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: -0.03379231 + objectReference: {fileID: 0} + - target: {fileID: 400052, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400052, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.99942887 + objectReference: {fileID: 0} + - target: {fileID: 400052, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 183.873 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9755381 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.21983048 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -25.398 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7097656 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.7044379 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 89.568 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: -0.36645278 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.9304366 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 222.994 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.976068 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.21746558 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -25.12 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.935054 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.35450545 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 41.526 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} +--- !u!1 &1627763796 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1627763800} + - component: {fileID: 1627763799} + - component: {fileID: 1627763798} + - component: {fileID: 1627763797} + - component: {fileID: 1627763801} + - component: {fileID: 1627763802} + - component: {fileID: 1627763803} + m_Layer: 0 + m_Name: Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1627763797 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!81 &1627763798 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + m_Enabled: 1 +--- !u!20 &1627763799 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 1, g: 1, b: 1, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1627763800 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1627763801 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73231aa468d81ea49bc3d914080de185, type: 3} + m_Name: + m_EditorClassIdentifier: + ImageComparisonSettings: + TargetWidth: 1280 + TargetHeight: 720 + TargetMSAASamples: 1 + PerPixelCorrectnessThreshold: 0.001 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 + RMSEThreshold: 0 + AverageCorrectnessThreshold: 0.005 + IncorrectPixelsThreshold: 0.0000038146973 + UseHDR: 0 + UseBackBuffer: 0 + ActiveImageTests: 1 + ActivePixelTests: 7 + WaitFrames: 1 + XRCompatible: 0 + gpuDrivenCompatible: 1 + CheckMemoryAllocation: 1 + renderBackendCompatibility: 2 + SetBackBufferResolution: 0 +--- !u!114 &1627763802 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 007a32e7afa277741b8310240d128a6e, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::GPUSkinningToggle + useGPUSkinning: 0 +--- !u!114 &1627763803 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 469ae0d1399b5e14dbaafc4c00d7ac0b, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::SRPBatcherToggle + useSRPBatcher: 0 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1627763800} + - {fileID: 1256847587} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_CPUSkinning.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_CPUSkinning.unity.meta new file mode 100644 index 00000000000..91413044256 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_CPUSkinning.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0fbd13eb47cf2074ebaa35dc562b86e7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_GPUSkinning.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_GPUSkinning.unity new file mode 100644 index 00000000000..8bf5ac44fdb --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_GPUSkinning.unity @@ -0,0 +1,814 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &1256847587 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 100000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_Name + value: Fei + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalScale.x + value: 0.4 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalScale.y + value: 0.4 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalScale.z + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.y + value: -4.5 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_ConstrainProportionsScale + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.x + value: 6.74 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.y + value: 11.48 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9790935 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.20341079 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -23.473 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7667069 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.6419974 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 79.882 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9993317 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.036553167 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 4.19 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.98464245 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.17458297 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 20.109 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9937981 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.11120053 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 12.769 + objectReference: {fileID: 0} + - target: {fileID: 400030, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.77518386 + objectReference: {fileID: 0} + - target: {fileID: 400030, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400030, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.63173574 + objectReference: {fileID: 0} + - target: {fileID: 400030, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 78.357 + objectReference: {fileID: 0} + - target: {fileID: 400032, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.98256385 + objectReference: {fileID: 0} + - target: {fileID: 400032, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400032, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400032, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.18592538 + objectReference: {fileID: 0} + - target: {fileID: 400032, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 21.43 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9974662 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.07114264 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.159 + objectReference: {fileID: 0} + - target: {fileID: 400036, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.5299309 + objectReference: {fileID: 0} + - target: {fileID: 400036, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400036, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.8480409 + objectReference: {fileID: 0} + - target: {fileID: 400036, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 115.998 + objectReference: {fileID: 0} + - target: {fileID: 400038, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9893572 + objectReference: {fileID: 0} + - target: {fileID: 400038, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400038, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400038, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.1455072 + objectReference: {fileID: 0} + - target: {fileID: 400038, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -16.733 + objectReference: {fileID: 0} + - target: {fileID: 400040, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.1779755 + objectReference: {fileID: 0} + - target: {fileID: 400040, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400040, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.98403496 + objectReference: {fileID: 0} + - target: {fileID: 400040, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 159.496 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.5173562 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.85577023 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 117.69 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.95292664 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.30320126 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 35.3 + objectReference: {fileID: 0} + - target: {fileID: 400046, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.29249913 + objectReference: {fileID: 0} + - target: {fileID: 400046, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400046, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.95626587 + objectReference: {fileID: 0} + - target: {fileID: 400046, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -145.985 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.8883985 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.459073 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 54.655 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.99824893 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.059152827 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.782 + objectReference: {fileID: 0} + - target: {fileID: 400052, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: -0.03379231 + objectReference: {fileID: 0} + - target: {fileID: 400052, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400052, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.99942887 + objectReference: {fileID: 0} + - target: {fileID: 400052, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 183.873 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9755381 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.21983048 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -25.398 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7097656 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.7044379 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 89.568 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: -0.36645278 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.9304366 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 222.994 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.976068 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.21746558 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -25.12 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.935054 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.35450545 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 41.526 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} +--- !u!1 &1627763796 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1627763800} + - component: {fileID: 1627763799} + - component: {fileID: 1627763798} + - component: {fileID: 1627763797} + - component: {fileID: 1627763801} + - component: {fileID: 1627763802} + - component: {fileID: 1627763803} + m_Layer: 0 + m_Name: Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1627763797 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!81 &1627763798 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + m_Enabled: 1 +--- !u!20 &1627763799 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 1, g: 1, b: 1, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1627763800 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1627763801 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73231aa468d81ea49bc3d914080de185, type: 3} + m_Name: + m_EditorClassIdentifier: + ImageComparisonSettings: + TargetWidth: 1280 + TargetHeight: 720 + TargetMSAASamples: 1 + PerPixelCorrectnessThreshold: 0.001 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 + RMSEThreshold: 0 + AverageCorrectnessThreshold: 0.005 + IncorrectPixelsThreshold: 0.0000038146973 + UseHDR: 0 + UseBackBuffer: 0 + ActiveImageTests: 1 + ActivePixelTests: 7 + WaitFrames: 1 + XRCompatible: 0 + gpuDrivenCompatible: 1 + CheckMemoryAllocation: 1 + renderBackendCompatibility: 2 + SetBackBufferResolution: 0 +--- !u!114 &1627763802 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 007a32e7afa277741b8310240d128a6e, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::GPUSkinningToggle + useGPUSkinning: 1 +--- !u!114 &1627763803 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1627763796} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 469ae0d1399b5e14dbaafc4c00d7ac0b, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::SRPBatcherToggle + useSRPBatcher: 1 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1627763800} + - {fileID: 1256847587} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_GPUSkinning.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_GPUSkinning.unity.meta new file mode 100644 index 00000000000..f97d74d7a70 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/120_SpriteSkin_GPUSkinning.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d49aa8bd09801a24d9e6df777bb9c5aa +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape.meta new file mode 100644 index 00000000000..9b092004704 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d134b1c4bad7f4746ac9822713b2cf33 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/BlendShapeTest.cs b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/BlendShapeTest.cs new file mode 100644 index 00000000000..05d177d2959 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/BlendShapeTest.cs @@ -0,0 +1,113 @@ +using System; +using System.Collections; +using Unity.Collections; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.U2D; + +public class BlendShapeTest : MonoBehaviour +{ + [Serializable] + public class SpriteRendererAndWeight + { + public SpriteRenderer spriteRenderer; + public int index; + public float weight; + } + + public Sprite sprite; + public SpriteRendererAndWeight[] spriteRenderersAndWeights; + + public float firstFrameWeight = 50f; + public float secondFrameWeight = 100f; + + void OnValidate() + { + if (sprite == null) + return; + + AddBlendShape(); + SetWeightToSpriteRenderers(); + } + + void OnEnable() + { + if (sprite == null) + return; + + AddBlendShape(); + SetWeightToSpriteRenderers(); + } + + public void AddBlendShape() + { + if (sprite == null) + return; + + Vector3[] positions = sprite.GetVertexAttribute(VertexAttribute.Position).ToArray(); + + // Clear all existing blend shapes. + sprite.ClearBlendShapes(); + + int index = sprite.AddBlendShape("Blend Shape"); + + { + // Add shrunk shape frame at firstFrameWeight. + NativeArray blendShapeVertices = new(positions.Length, Allocator.Temp); + for (int i = 0; i < positions.Length; i++) + { + Vector3 position = positions[i]; + Vector3 targetPosition = new(position.x * 1.5f, position.y * 0.5f, position.z); + + blendShapeVertices[i] = new SpriteBlendShapeVertex + { + index = (uint)i, + vertex = targetPosition - position, + normal = Vector3.zero, + tangent = Vector3.zero, + }; + } + + sprite.AddBlendShapeFrame(index, firstFrameWeight, blendShapeVertices); + blendShapeVertices.Dispose(); + } + + { + // Add round shape frame at secondFrameWeight + Bounds bounds = sprite.bounds; + float radius = Mathf.Max(bounds.size.x, bounds.size.y) / 2.0f; + + NativeArray blendShapeVertices = new(positions.Length, Allocator.Temp); + for (int i = 0; i < positions.Length; i++) + { + Vector3 position = positions[i]; + Vector3 targetPosition = position.magnitude > 0 + ? new Vector3(position.normalized.x * radius, position.normalized.y * radius, position.z) + : position; + + blendShapeVertices[i] = new SpriteBlendShapeVertex + { + index = (uint)i, + vertex = targetPosition - position, + normal = Vector3.zero, + tangent = Vector3.zero, + }; + } + + sprite.AddBlendShapeFrame(index, secondFrameWeight, blendShapeVertices); + blendShapeVertices.Dispose(); + } + } + + void SetWeightToSpriteRenderers() + { + foreach (var srAndWeight in spriteRenderersAndWeights) + { + if (srAndWeight.spriteRenderer != null) + { + srAndWeight.spriteRenderer.SetBlendShapeWeight(srAndWeight.index, srAndWeight.weight); + } + } + } + +} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/BlendShapeTest.cs.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/BlendShapeTest.cs.meta new file mode 100644 index 00000000000..1bdaef912e4 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/BlendShapeTest.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4ca59dfca5e7f5e4babec9402b44c271 \ No newline at end of file diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,0.png b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,0.png new file mode 100644 index 0000000000000000000000000000000000000000..3410c68252208bef952a5d8683a07a4a581aac8f GIT binary patch literal 2097 zcmeHI&5zSY6rb=>J_;2Q7vMCQ3l-QNJ6UHl!YoU&-9)Olt0hvG8D)-&SB4T(#SRR#Y57f>%nTmcDH{R=91&WE*IQNAu*uxxoe^PAs$?>Fx~|FXKW zeDv_C!w8|Ht!85lp%M&B=-?iBJw3MI!0S-byqY2O?eY96p*wd^AhiFKY_IF};77_; zWU)|ngf)s1KqGWvVU#ewAvErYo{W9tpWh!EScbmw^ISlJq%Qihxt)qD+beCpy}@gt zv2YPz7*QaIgl2dY4dRTBd}GW@VVqCf1|CE7hHot92Jw2Zit8#B*t3Yq32||?W;tG^ zGCzMFyTm0nsoD-PU6&G%&Xw`>GQe6IcIjH)c% z;@Ylj0>aF;V$DWooSm65G(^TznP{nEoHMeH+SI-Qo=!rDl7cqQrZRzG_J}36W05?h zF)-u>F4;^6W8)#W#Xv+N))`=(0-N-eR#{*D4|TD;%K%6l1ci-v`VvKjiA*oufH0~8Ibx?UTOxLl@lyP=RYA=B)G;E>a~|lFqHAU5PXB@86ZMqIxRn2feG!fFM#wt zc`<=ys;h@A6^lJk>mxGH2KVi}XeW`_{|$1ywxhsjaOfKOuxMBCQ8YXeLzhdTojw2U z^&5ot{LyMGwnumWe(IDEKJth>die4*Up~J7=63JJr9Yp2cPsb?KSuXX-m2{VwTqq{ oxpb%0EF<}K@~a?UJQ@BvaR1f5fA>Bno&2ZXT3Ts5xP0yQTl{2u)c^nh literal 0 HcmV?d00001 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,0.png.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,0.png.meta new file mode 100644 index 00000000000..7eca5271bc4 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,0.png.meta @@ -0,0 +1,712 @@ +fileFormatVersion: 2 +guid: df9805cc34bd6a84a871591791937f55 +TextureImporter: + internalIDToNameTable: + - first: + 213: 7482667652216324306 + second: Square + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 256 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: 0 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: iOS + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: GameCoreXboxOne + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: GameCoreScarlett + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Switch + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: + - serializedVersion: 2 + name: Weight -50,0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 256 + height: 256 + alignment: 0 + pivot: {x: 0.5, y: 0.5} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 2d009a6b596c7d760800000000000000 + internalID: 7482667652216324306 + vertices: + - {x: 256, y: 36.205} + - {x: 256, y: 72.409} + - {x: 256, y: 108.612} + - {x: 256, y: 144.815} + - {x: 256, y: 181.019} + - {x: 256, y: 217.222} + - {x: 256, y: 253.427} + - {x: 256, y: 256} + - {x: 219.795, y: 256} + - {x: 183.591, y: 256} + - {x: 147.388, y: 256} + - {x: 111.185, y: 256} + - {x: 74.981, y: 256} + - {x: 38.778, y: 256} + - {x: 2.572998, y: 256} + - {x: 0, y: 256} + - {x: 0, y: 219.795} + - {x: 0, y: 183.591} + - {x: 0, y: 147.388} + - {x: 0, y: 111.185} + - {x: 0, y: 74.981} + - {x: 0, y: 38.778} + - {x: 0, y: 2.572998} + - {x: 0, y: 0} + - {x: 36.205, y: 0} + - {x: 72.409, y: 0} + - {x: 108.612, y: 0} + - {x: 144.815, y: 0} + - {x: 181.019, y: 0} + - {x: 217.222, y: 0} + - {x: 253.427, y: 0} + - {x: 256, y: 0} + - {x: 112.05378, y: 127.981476} + - {x: 197.36983, y: 86.93534} + - {x: 210.09137, y: 45.274765} + - {x: 196.98991, y: 169.07687} + - {x: 213.85912, y: 128.20146} + - {x: 210.29947, y: 210.49887} + - {x: 140.93271, y: 168.9468} + - {x: 161.63359, y: 209.85225} + - {x: 41.831688, y: 169.1536} + - {x: 109.6799, y: 211.37784} + - {x: 55.365215, y: 211.36035} + - {x: 41.690968, y: 86.53497} + - {x: 57.192738, y: 127.91333} + - {x: 55.558475, y: 44.509842} + - {x: 140.99443, y: 87.0432} + - {x: 109.65989, y: 44.619545} + - {x: 161.5519, y: 46.25896} + - {x: 165.10484, y: 127.919525} + - {x: 89.009125, y: 169.51698} + - {x: 89.00016, y: 86.4656} + indices: 000000002200000001000000000000001e0000001d000000000000001f0000001e000000000000001d0000002200000001000000210000000200000001000000220000002100000002000000240000000300000002000000210000002400000003000000230000000400000003000000240000002300000004000000250000000500000004000000230000002500000005000000080000000600000005000000250000000800000006000000080000000700000008000000250000000900000009000000270000000a0000000900000025000000270000000a000000290000000b0000000a00000027000000290000000b000000290000000c0000000c0000002a0000000d0000000c000000290000002a0000000d000000100000000e0000000d0000002a000000100000000e000000100000000f000000100000002a00000011000000110000002800000012000000110000002a00000028000000120000002c0000001300000012000000280000002c000000130000002b00000014000000130000002c0000002b000000140000002d00000015000000140000002b0000002d000000150000001800000016000000150000002d00000018000000160000001800000017000000180000002d00000019000000190000002f0000001a000000190000002d0000002f0000001a0000002f0000001b0000001b000000300000001c0000001b0000002f000000300000001c000000220000001d0000001c000000300000002200000020000000320000002600000020000000330000002c00000020000000310000002e000000200000002600000031000000200000002c00000032000000200000002e0000003300000021000000310000002400000021000000300000002e000000210000002200000030000000210000002e0000003100000023000000270000002500000023000000310000002600000023000000260000002700000023000000240000003100000026000000290000002700000026000000320000002900000028000000320000002c000000280000002a0000003200000029000000320000002a0000002b000000330000002d0000002b0000002c000000330000002d000000330000002f0000002e000000300000002f0000002e0000002f00000033000000 + edges: + - {x: 0, y: 1} + - {x: 0, y: 31} + - {x: 1, y: 2} + - {x: 2, y: 3} + - {x: 3, y: 4} + - {x: 4, y: 5} + - {x: 5, y: 6} + - {x: 6, y: 7} + - {x: 7, y: 8} + - {x: 8, y: 9} + - {x: 9, y: 10} + - {x: 10, y: 11} + - {x: 11, y: 12} + - {x: 12, y: 13} + - {x: 13, y: 14} + - {x: 14, y: 15} + - {x: 15, y: 16} + - {x: 16, y: 17} + - {x: 17, y: 18} + - {x: 18, y: 19} + - {x: 19, y: 20} + - {x: 20, y: 21} + - {x: 21, y: 22} + - {x: 22, y: 23} + - {x: 23, y: 24} + - {x: 24, y: 25} + - {x: 25, y: 26} + - {x: 26, y: 27} + - {x: 27, y: 28} + - {x: 28, y: 29} + - {x: 29, y: 30} + - {x: 30, y: 31} + weights: + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + outline: [] + customData: + physicsShape: + - - {x: -128, y: 128} + - {x: -128, y: -128} + - {x: 128, y: -128} + - {x: 128, y: 128} + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: + Weight -50,0: 7482667652216324306 + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,50.png b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,50.png new file mode 100644 index 0000000000000000000000000000000000000000..3410c68252208bef952a5d8683a07a4a581aac8f GIT binary patch literal 2097 zcmeHI&5zSY6rb=>J_;2Q7vMCQ3l-QNJ6UHl!YoU&-9)Olt0hvG8D)-&SB4T(#SRR#Y57f>%nTmcDH{R=91&WE*IQNAu*uxxoe^PAs$?>Fx~|FXKW zeDv_C!w8|Ht!85lp%M&B=-?iBJw3MI!0S-byqY2O?eY96p*wd^AhiFKY_IF};77_; zWU)|ngf)s1KqGWvVU#ewAvErYo{W9tpWh!EScbmw^ISlJq%Qihxt)qD+beCpy}@gt zv2YPz7*QaIgl2dY4dRTBd}GW@VVqCf1|CE7hHot92Jw2Zit8#B*t3Yq32||?W;tG^ zGCzMFyTm0nsoD-PU6&G%&Xw`>GQe6IcIjH)c% z;@Ylj0>aF;V$DWooSm65G(^TznP{nEoHMeH+SI-Qo=!rDl7cqQrZRzG_J}36W05?h zF)-u>F4;^6W8)#W#Xv+N))`=(0-N-eR#{*D4|TD;%K%6l1ci-v`VvKjiA*oufH0~8Ibx?UTOxLl@lyP=RYA=B)G;E>a~|lFqHAU5PXB@86ZMqIxRn2feG!fFM#wt zc`<=ys;h@A6^lJk>mxGH2KVi}XeW`_{|$1ywxhsjaOfKOuxMBCQ8YXeLzhdTojw2U z^&5ot{LyMGwnumWe(IDEKJth>die4*Up~J7=63JJr9Yp2cPsb?KSuXX-m2{VwTqq{ oxpb%0EF<}K@~a?UJQ@BvaR1f5fA>Bno&2ZXT3Ts5xP0yQTl{2u)c^nh literal 0 HcmV?d00001 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,50.png.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,50.png.meta new file mode 100644 index 00000000000..e4d12a94813 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight -50,50.png.meta @@ -0,0 +1,712 @@ +fileFormatVersion: 2 +guid: f4401e11497b6df4383f84d2a1619735 +TextureImporter: + internalIDToNameTable: + - first: + 213: 7482667652216324306 + second: Square + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 256 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: 0 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: iOS + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: GameCoreXboxOne + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: GameCoreScarlett + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Switch + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: + - serializedVersion: 2 + name: Weight -50,50 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 256 + height: 256 + alignment: 0 + pivot: {x: 0.5, y: 0.5} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 2d009a6b596c7d760800000000000000 + internalID: 7482667652216324306 + vertices: + - {x: 256, y: 36.205} + - {x: 256, y: 72.409} + - {x: 256, y: 108.612} + - {x: 256, y: 144.815} + - {x: 256, y: 181.019} + - {x: 256, y: 217.222} + - {x: 256, y: 253.427} + - {x: 256, y: 256} + - {x: 219.795, y: 256} + - {x: 183.591, y: 256} + - {x: 147.388, y: 256} + - {x: 111.185, y: 256} + - {x: 74.981, y: 256} + - {x: 38.778, y: 256} + - {x: 2.572998, y: 256} + - {x: 0, y: 256} + - {x: 0, y: 219.795} + - {x: 0, y: 183.591} + - {x: 0, y: 147.388} + - {x: 0, y: 111.185} + - {x: 0, y: 74.981} + - {x: 0, y: 38.778} + - {x: 0, y: 2.572998} + - {x: 0, y: 0} + - {x: 36.205, y: 0} + - {x: 72.409, y: 0} + - {x: 108.612, y: 0} + - {x: 144.815, y: 0} + - {x: 181.019, y: 0} + - {x: 217.222, y: 0} + - {x: 253.427, y: 0} + - {x: 256, y: 0} + - {x: 112.05378, y: 127.981476} + - {x: 197.36983, y: 86.93534} + - {x: 210.09137, y: 45.274765} + - {x: 196.98991, y: 169.07687} + - {x: 213.85912, y: 128.20146} + - {x: 210.29947, y: 210.49887} + - {x: 140.93271, y: 168.9468} + - {x: 161.63359, y: 209.85225} + - {x: 41.831688, y: 169.1536} + - {x: 109.6799, y: 211.37784} + - {x: 55.365215, y: 211.36035} + - {x: 41.690968, y: 86.53497} + - {x: 57.192738, y: 127.91333} + - {x: 55.558475, y: 44.509842} + - {x: 140.99443, y: 87.0432} + - {x: 109.65989, y: 44.619545} + - {x: 161.5519, y: 46.25896} + - {x: 165.10484, y: 127.919525} + - {x: 89.009125, y: 169.51698} + - {x: 89.00016, y: 86.4656} + indices: 000000002200000001000000000000001e0000001d000000000000001f0000001e000000000000001d0000002200000001000000210000000200000001000000220000002100000002000000240000000300000002000000210000002400000003000000230000000400000003000000240000002300000004000000250000000500000004000000230000002500000005000000080000000600000005000000250000000800000006000000080000000700000008000000250000000900000009000000270000000a0000000900000025000000270000000a000000290000000b0000000a00000027000000290000000b000000290000000c0000000c0000002a0000000d0000000c000000290000002a0000000d000000100000000e0000000d0000002a000000100000000e000000100000000f000000100000002a00000011000000110000002800000012000000110000002a00000028000000120000002c0000001300000012000000280000002c000000130000002b00000014000000130000002c0000002b000000140000002d00000015000000140000002b0000002d000000150000001800000016000000150000002d00000018000000160000001800000017000000180000002d00000019000000190000002f0000001a000000190000002d0000002f0000001a0000002f0000001b0000001b000000300000001c0000001b0000002f000000300000001c000000220000001d0000001c000000300000002200000020000000320000002600000020000000330000002c00000020000000310000002e000000200000002600000031000000200000002c00000032000000200000002e0000003300000021000000310000002400000021000000300000002e000000210000002200000030000000210000002e0000003100000023000000270000002500000023000000310000002600000023000000260000002700000023000000240000003100000026000000290000002700000026000000320000002900000028000000320000002c000000280000002a0000003200000029000000320000002a0000002b000000330000002d0000002b0000002c000000330000002d000000330000002f0000002e000000300000002f0000002e0000002f00000033000000 + edges: + - {x: 0, y: 1} + - {x: 0, y: 31} + - {x: 1, y: 2} + - {x: 2, y: 3} + - {x: 3, y: 4} + - {x: 4, y: 5} + - {x: 5, y: 6} + - {x: 6, y: 7} + - {x: 7, y: 8} + - {x: 8, y: 9} + - {x: 9, y: 10} + - {x: 10, y: 11} + - {x: 11, y: 12} + - {x: 12, y: 13} + - {x: 13, y: 14} + - {x: 14, y: 15} + - {x: 15, y: 16} + - {x: 16, y: 17} + - {x: 17, y: 18} + - {x: 18, y: 19} + - {x: 19, y: 20} + - {x: 20, y: 21} + - {x: 21, y: 22} + - {x: 22, y: 23} + - {x: 23, y: 24} + - {x: 24, y: 25} + - {x: 25, y: 26} + - {x: 26, y: 27} + - {x: 27, y: 28} + - {x: 28, y: 29} + - {x: 29, y: 30} + - {x: 30, y: 31} + weights: + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + outline: [] + customData: + physicsShape: + - - {x: -128, y: 128} + - {x: -128, y: -128} + - {x: 128, y: -128} + - {x: 128, y: 128} + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: + Weight -50,50: 7482667652216324306 + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight 50,100.png b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight 50,100.png new file mode 100644 index 0000000000000000000000000000000000000000..3410c68252208bef952a5d8683a07a4a581aac8f GIT binary patch literal 2097 zcmeHI&5zSY6rb=>J_;2Q7vMCQ3l-QNJ6UHl!YoU&-9)Olt0hvG8D)-&SB4T(#SRR#Y57f>%nTmcDH{R=91&WE*IQNAu*uxxoe^PAs$?>Fx~|FXKW zeDv_C!w8|Ht!85lp%M&B=-?iBJw3MI!0S-byqY2O?eY96p*wd^AhiFKY_IF};77_; zWU)|ngf)s1KqGWvVU#ewAvErYo{W9tpWh!EScbmw^ISlJq%Qihxt)qD+beCpy}@gt zv2YPz7*QaIgl2dY4dRTBd}GW@VVqCf1|CE7hHot92Jw2Zit8#B*t3Yq32||?W;tG^ zGCzMFyTm0nsoD-PU6&G%&Xw`>GQe6IcIjH)c% z;@Ylj0>aF;V$DWooSm65G(^TznP{nEoHMeH+SI-Qo=!rDl7cqQrZRzG_J}36W05?h zF)-u>F4;^6W8)#W#Xv+N))`=(0-N-eR#{*D4|TD;%K%6l1ci-v`VvKjiA*oufH0~8Ibx?UTOxLl@lyP=RYA=B)G;E>a~|lFqHAU5PXB@86ZMqIxRn2feG!fFM#wt zc`<=ys;h@A6^lJk>mxGH2KVi}XeW`_{|$1ywxhsjaOfKOuxMBCQ8YXeLzhdTojw2U z^&5ot{LyMGwnumWe(IDEKJth>die4*Up~J7=63JJr9Yp2cPsb?KSuXX-m2{VwTqq{ oxpb%0EF<}K@~a?UJQ@BvaR1f5fA>Bno&2ZXT3Ts5xP0yQTl{2u)c^nh literal 0 HcmV?d00001 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight 50,100.png.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight 50,100.png.meta new file mode 100644 index 00000000000..5df518d1952 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape/Weight 50,100.png.meta @@ -0,0 +1,712 @@ +fileFormatVersion: 2 +guid: d847502045fa5094cbe7fb89df1d34c8 +TextureImporter: + internalIDToNameTable: + - first: + 213: 7482667652216324306 + second: Square + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 256 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: 0 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: iOS + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: GameCoreXboxOne + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: GameCoreScarlett + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Switch + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: + - serializedVersion: 2 + name: Weight 50,100 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 256 + height: 256 + alignment: 0 + pivot: {x: 0.5, y: 0.5} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 2d009a6b596c7d760800000000000000 + internalID: 7482667652216324306 + vertices: + - {x: 256, y: 36.205} + - {x: 256, y: 72.409} + - {x: 256, y: 108.612} + - {x: 256, y: 144.815} + - {x: 256, y: 181.019} + - {x: 256, y: 217.222} + - {x: 256, y: 253.427} + - {x: 256, y: 256} + - {x: 219.795, y: 256} + - {x: 183.591, y: 256} + - {x: 147.388, y: 256} + - {x: 111.185, y: 256} + - {x: 74.981, y: 256} + - {x: 38.778, y: 256} + - {x: 2.572998, y: 256} + - {x: 0, y: 256} + - {x: 0, y: 219.795} + - {x: 0, y: 183.591} + - {x: 0, y: 147.388} + - {x: 0, y: 111.185} + - {x: 0, y: 74.981} + - {x: 0, y: 38.778} + - {x: 0, y: 2.572998} + - {x: 0, y: 0} + - {x: 36.205, y: 0} + - {x: 72.409, y: 0} + - {x: 108.612, y: 0} + - {x: 144.815, y: 0} + - {x: 181.019, y: 0} + - {x: 217.222, y: 0} + - {x: 253.427, y: 0} + - {x: 256, y: 0} + - {x: 112.05378, y: 127.981476} + - {x: 197.36983, y: 86.93534} + - {x: 210.09137, y: 45.274765} + - {x: 196.98991, y: 169.07687} + - {x: 213.85912, y: 128.20146} + - {x: 210.29947, y: 210.49887} + - {x: 140.93271, y: 168.9468} + - {x: 161.63359, y: 209.85225} + - {x: 41.831688, y: 169.1536} + - {x: 109.6799, y: 211.37784} + - {x: 55.365215, y: 211.36035} + - {x: 41.690968, y: 86.53497} + - {x: 57.192738, y: 127.91333} + - {x: 55.558475, y: 44.509842} + - {x: 140.99443, y: 87.0432} + - {x: 109.65989, y: 44.619545} + - {x: 161.5519, y: 46.25896} + - {x: 165.10484, y: 127.919525} + - {x: 89.009125, y: 169.51698} + - {x: 89.00016, y: 86.4656} + indices: 000000002200000001000000000000001e0000001d000000000000001f0000001e000000000000001d0000002200000001000000210000000200000001000000220000002100000002000000240000000300000002000000210000002400000003000000230000000400000003000000240000002300000004000000250000000500000004000000230000002500000005000000080000000600000005000000250000000800000006000000080000000700000008000000250000000900000009000000270000000a0000000900000025000000270000000a000000290000000b0000000a00000027000000290000000b000000290000000c0000000c0000002a0000000d0000000c000000290000002a0000000d000000100000000e0000000d0000002a000000100000000e000000100000000f000000100000002a00000011000000110000002800000012000000110000002a00000028000000120000002c0000001300000012000000280000002c000000130000002b00000014000000130000002c0000002b000000140000002d00000015000000140000002b0000002d000000150000001800000016000000150000002d00000018000000160000001800000017000000180000002d00000019000000190000002f0000001a000000190000002d0000002f0000001a0000002f0000001b0000001b000000300000001c0000001b0000002f000000300000001c000000220000001d0000001c000000300000002200000020000000320000002600000020000000330000002c00000020000000310000002e000000200000002600000031000000200000002c00000032000000200000002e0000003300000021000000310000002400000021000000300000002e000000210000002200000030000000210000002e0000003100000023000000270000002500000023000000310000002600000023000000260000002700000023000000240000003100000026000000290000002700000026000000320000002900000028000000320000002c000000280000002a0000003200000029000000320000002a0000002b000000330000002d0000002b0000002c000000330000002d000000330000002f0000002e000000300000002f0000002e0000002f00000033000000 + edges: + - {x: 0, y: 1} + - {x: 0, y: 31} + - {x: 1, y: 2} + - {x: 2, y: 3} + - {x: 3, y: 4} + - {x: 4, y: 5} + - {x: 5, y: 6} + - {x: 6, y: 7} + - {x: 7, y: 8} + - {x: 8, y: 9} + - {x: 9, y: 10} + - {x: 10, y: 11} + - {x: 11, y: 12} + - {x: 12, y: 13} + - {x: 13, y: 14} + - {x: 14, y: 15} + - {x: 15, y: 16} + - {x: 16, y: 17} + - {x: 17, y: 18} + - {x: 18, y: 19} + - {x: 19, y: 20} + - {x: 20, y: 21} + - {x: 21, y: 22} + - {x: 22, y: 23} + - {x: 23, y: 24} + - {x: 24, y: 25} + - {x: 25, y: 26} + - {x: 26, y: 27} + - {x: 27, y: 28} + - {x: 28, y: 29} + - {x: 29, y: 30} + - {x: 30, y: 31} + weights: + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + outline: [] + customData: + physicsShape: + - - {x: -128, y: 128} + - {x: -128, y: -128} + - {x: 128, y: -128} + - {x: 128, y: 128} + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: + Weight 50,100: 7482667652216324306 + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_CPUSkinning.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_CPUSkinning.unity new file mode 100644 index 00000000000..2fce77564a1 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_CPUSkinning.unity @@ -0,0 +1,1353 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &379311072 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 379311073} + - component: {fileID: 379311074} + m_Layer: 0 + m_Name: Blendshape 0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &379311073 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 379311072} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1837088517} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &379311074 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 379311072} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: df9805cc34bd6a84a871591791937f55, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 0 +--- !u!1 &727874072 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 727874073} + - component: {fileID: 727874074} + m_Layer: 0 + m_Name: Blendshape 0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &727874073 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 727874072} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -22, y: 12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1248773244} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &727874074 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 727874072} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d847502045fa5094cbe7fb89df1d34c8, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 0 +--- !u!1 &727890940 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 727890941} + - component: {fileID: 727890942} + m_Layer: 0 + m_Name: Blendshape 50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &727890941 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 727890940} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 22, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1800111760} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &727890942 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 727890940} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: f4401e11497b6df4383f84d2a1619735, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 50 +--- !u!1 &1248773242 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1248773244} + - component: {fileID: 1248773243} + m_Layer: 0 + m_Name: Weight 50,100 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1248773243 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1248773242} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4ca59dfca5e7f5e4babec9402b44c271, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::BlendShapeTest + sprite: {fileID: 7482667652216324306, guid: d847502045fa5094cbe7fb89df1d34c8, type: 3} + spriteRenderersAndWeights: + - spriteRenderer: {fileID: 727874074} + index: 0 + weight: 0 + - spriteRenderer: {fileID: 1688123361} + index: 0 + weight: 50 + - spriteRenderer: {fileID: 1961700242} + index: 0 + weight: 100 + firstFrameWeight: 50 + secondFrameWeight: 100 +--- !u!4 &1248773244 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1248773242} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 727874073} + - {fileID: 1688123360} + - {fileID: 1961700241} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1672374691 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1672374692} + - component: {fileID: 1672374693} + m_Layer: 0 + m_Name: Blendshape 0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1672374692 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1672374691} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1800111760} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1672374693 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1672374691} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: f4401e11497b6df4383f84d2a1619735, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 0 +--- !u!1 &1688123359 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1688123360} + - component: {fileID: 1688123361} + m_Layer: 0 + m_Name: Blendshape 50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1688123360 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1688123359} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1248773244} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1688123361 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1688123359} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d847502045fa5094cbe7fb89df1d34c8, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 50 +--- !u!1 &1724181614 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1724181620} + - component: {fileID: 1724181619} + - component: {fileID: 1724181618} + - component: {fileID: 1724181617} + - component: {fileID: 1724181615} + - component: {fileID: 1724181622} + - component: {fileID: 1724181621} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1724181615 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73231aa468d81ea49bc3d914080de185, type: 3} + m_Name: + m_EditorClassIdentifier: + ImageComparisonSettings: + TargetWidth: 1280 + TargetHeight: 720 + TargetMSAASamples: 1 + PerPixelCorrectnessThreshold: 0.001 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 + RMSEThreshold: 0 + AverageCorrectnessThreshold: 0.005 + IncorrectPixelsThreshold: 0.0000038146973 + UseHDR: 0 + UseBackBuffer: 0 + ActiveImageTests: 1 + ActivePixelTests: 7 + WaitFrames: 1 + XRCompatible: 0 + gpuDrivenCompatible: 1 + CheckMemoryAllocation: 1 + renderBackendCompatibility: 2 + SetBackBufferResolution: 0 +--- !u!114 &1724181617 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!81 &1724181618 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 +--- !u!20 &1724181619 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 18 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1724181620 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1724181621 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 469ae0d1399b5e14dbaafc4c00d7ac0b, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::SRPBatcherToggle + useSRPBatcher: 1 +--- !u!114 &1724181622 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 007a32e7afa277741b8310240d128a6e, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::GPUSkinningToggle + useGPUSkinning: 0 +--- !u!1 &1800111758 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1800111760} + - component: {fileID: 1800111759} + m_Layer: 0 + m_Name: Weight -50,50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1800111759 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1800111758} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4ca59dfca5e7f5e4babec9402b44c271, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::BlendShapeTest + sprite: {fileID: 7482667652216324306, guid: f4401e11497b6df4383f84d2a1619735, type: 3} + spriteRenderersAndWeights: + - spriteRenderer: {fileID: 2108052152} + index: 0 + weight: -50 + - spriteRenderer: {fileID: 1672374693} + index: 0 + weight: 0 + - spriteRenderer: {fileID: 727890942} + index: 0 + weight: 50 + firstFrameWeight: -50 + secondFrameWeight: 50 +--- !u!4 &1800111760 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1800111758} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2108052151} + - {fileID: 1672374692} + - {fileID: 727890941} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1837088515 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1837088517} + - component: {fileID: 1837088516} + m_Layer: 0 + m_Name: Weight -50,0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1837088516 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1837088515} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4ca59dfca5e7f5e4babec9402b44c271, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::BlendShapeTest + sprite: {fileID: 7482667652216324306, guid: df9805cc34bd6a84a871591791937f55, type: 3} + spriteRenderersAndWeights: + - spriteRenderer: {fileID: 2078062931} + index: 0 + weight: -50 + - spriteRenderer: {fileID: 379311074} + index: 0 + weight: 0 + - spriteRenderer: {fileID: 2049399252} + index: 0 + weight: 50 + firstFrameWeight: -50 + secondFrameWeight: 0 +--- !u!4 &1837088517 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1837088515} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2078062930} + - {fileID: 379311073} + - {fileID: 2049399251} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1961700240 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1961700241} + - component: {fileID: 1961700242} + m_Layer: 0 + m_Name: Blendshape 100 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1961700241 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1961700240} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 22, y: 12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1248773244} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1961700242 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1961700240} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d847502045fa5094cbe7fb89df1d34c8, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 100 +--- !u!1 &2049399250 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2049399251} + - component: {fileID: 2049399252} + m_Layer: 0 + m_Name: Blendshape 50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2049399251 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2049399250} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 22, y: -12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1837088517} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2049399252 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2049399250} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: df9805cc34bd6a84a871591791937f55, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 50 +--- !u!1 &2078062929 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2078062930} + - component: {fileID: 2078062931} + m_Layer: 0 + m_Name: Blendshape -50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2078062930 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2078062929} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -22, y: -12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1837088517} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2078062931 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2078062929} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: df9805cc34bd6a84a871591791937f55, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - -50 +--- !u!1 &2108052150 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2108052151} + - component: {fileID: 2108052152} + m_Layer: 0 + m_Name: Blendshape -50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2108052151 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2108052150} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -22, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1800111760} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2108052152 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2108052150} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: f4401e11497b6df4383f84d2a1619735, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - -50 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1724181620} + - {fileID: 1248773244} + - {fileID: 1800111760} + - {fileID: 1837088517} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_CPUSkinning.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_CPUSkinning.unity.meta new file mode 100644 index 00000000000..20bc35af7e2 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_CPUSkinning.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e7dabca2059b84c49b621b5c3eda5989 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_GPUSkinning.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_GPUSkinning.unity new file mode 100644 index 00000000000..62b4a568a3d --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_GPUSkinning.unity @@ -0,0 +1,1353 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &379311072 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 379311073} + - component: {fileID: 379311074} + m_Layer: 0 + m_Name: Blendshape 0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &379311073 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 379311072} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1837088517} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &379311074 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 379311072} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: df9805cc34bd6a84a871591791937f55, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 0 +--- !u!1 &727874072 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 727874073} + - component: {fileID: 727874074} + m_Layer: 0 + m_Name: Blendshape 0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &727874073 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 727874072} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -22, y: 12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1248773244} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &727874074 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 727874072} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d847502045fa5094cbe7fb89df1d34c8, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 0 +--- !u!1 &727890940 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 727890941} + - component: {fileID: 727890942} + m_Layer: 0 + m_Name: Blendshape 50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &727890941 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 727890940} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 22, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1800111760} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &727890942 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 727890940} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: f4401e11497b6df4383f84d2a1619735, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 50 +--- !u!1 &1248773242 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1248773244} + - component: {fileID: 1248773243} + m_Layer: 0 + m_Name: Weight 50,100 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1248773243 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1248773242} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4ca59dfca5e7f5e4babec9402b44c271, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::BlendShapeTest + sprite: {fileID: 7482667652216324306, guid: d847502045fa5094cbe7fb89df1d34c8, type: 3} + spriteRenderersAndWeights: + - spriteRenderer: {fileID: 727874074} + index: 0 + weight: 0 + - spriteRenderer: {fileID: 1688123361} + index: 0 + weight: 50 + - spriteRenderer: {fileID: 1961700242} + index: 0 + weight: 100 + firstFrameWeight: 50 + secondFrameWeight: 100 +--- !u!4 &1248773244 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1248773242} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 727874073} + - {fileID: 1688123360} + - {fileID: 1961700241} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1672374691 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1672374692} + - component: {fileID: 1672374693} + m_Layer: 0 + m_Name: Blendshape 0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1672374692 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1672374691} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1800111760} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1672374693 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1672374691} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: f4401e11497b6df4383f84d2a1619735, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 0 +--- !u!1 &1688123359 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1688123360} + - component: {fileID: 1688123361} + m_Layer: 0 + m_Name: Blendshape 50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1688123360 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1688123359} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1248773244} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1688123361 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1688123359} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d847502045fa5094cbe7fb89df1d34c8, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 50 +--- !u!1 &1724181614 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1724181620} + - component: {fileID: 1724181619} + - component: {fileID: 1724181618} + - component: {fileID: 1724181617} + - component: {fileID: 1724181615} + - component: {fileID: 1724181622} + - component: {fileID: 1724181621} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1724181615 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73231aa468d81ea49bc3d914080de185, type: 3} + m_Name: + m_EditorClassIdentifier: + ImageComparisonSettings: + TargetWidth: 1280 + TargetHeight: 720 + TargetMSAASamples: 1 + PerPixelCorrectnessThreshold: 0.001 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 + RMSEThreshold: 0 + AverageCorrectnessThreshold: 0.005 + IncorrectPixelsThreshold: 0.0000038146973 + UseHDR: 0 + UseBackBuffer: 0 + ActiveImageTests: 1 + ActivePixelTests: 7 + WaitFrames: 1 + XRCompatible: 0 + gpuDrivenCompatible: 1 + CheckMemoryAllocation: 1 + renderBackendCompatibility: 2 + SetBackBufferResolution: 0 +--- !u!114 &1724181617 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!81 &1724181618 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 +--- !u!20 &1724181619 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 18 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1724181620 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1724181621 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 469ae0d1399b5e14dbaafc4c00d7ac0b, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::SRPBatcherToggle + useSRPBatcher: 1 +--- !u!114 &1724181622 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 007a32e7afa277741b8310240d128a6e, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::GPUSkinningToggle + useGPUSkinning: 1 +--- !u!1 &1800111758 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1800111760} + - component: {fileID: 1800111759} + m_Layer: 0 + m_Name: Weight -50,50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1800111759 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1800111758} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4ca59dfca5e7f5e4babec9402b44c271, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::BlendShapeTest + sprite: {fileID: 7482667652216324306, guid: f4401e11497b6df4383f84d2a1619735, type: 3} + spriteRenderersAndWeights: + - spriteRenderer: {fileID: 2108052152} + index: 0 + weight: -50 + - spriteRenderer: {fileID: 1672374693} + index: 0 + weight: 0 + - spriteRenderer: {fileID: 727890942} + index: 0 + weight: 50 + firstFrameWeight: -50 + secondFrameWeight: 50 +--- !u!4 &1800111760 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1800111758} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2108052151} + - {fileID: 1672374692} + - {fileID: 727890941} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1837088515 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1837088517} + - component: {fileID: 1837088516} + m_Layer: 0 + m_Name: Weight -50,0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1837088516 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1837088515} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4ca59dfca5e7f5e4babec9402b44c271, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::BlendShapeTest + sprite: {fileID: 7482667652216324306, guid: df9805cc34bd6a84a871591791937f55, type: 3} + spriteRenderersAndWeights: + - spriteRenderer: {fileID: 2078062931} + index: 0 + weight: -50 + - spriteRenderer: {fileID: 379311074} + index: 0 + weight: 0 + - spriteRenderer: {fileID: 2049399252} + index: 0 + weight: 50 + firstFrameWeight: -50 + secondFrameWeight: 0 +--- !u!4 &1837088517 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1837088515} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2078062930} + - {fileID: 379311073} + - {fileID: 2049399251} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1961700240 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1961700241} + - component: {fileID: 1961700242} + m_Layer: 0 + m_Name: Blendshape 100 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1961700241 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1961700240} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 22, y: 12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1248773244} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1961700242 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1961700240} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d847502045fa5094cbe7fb89df1d34c8, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 100 +--- !u!1 &2049399250 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2049399251} + - component: {fileID: 2049399252} + m_Layer: 0 + m_Name: Blendshape 50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2049399251 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2049399250} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 22, y: -12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1837088517} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2049399252 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2049399250} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: df9805cc34bd6a84a871591791937f55, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 50 +--- !u!1 &2078062929 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2078062930} + - component: {fileID: 2078062931} + m_Layer: 0 + m_Name: Blendshape -50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2078062930 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2078062929} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -22, y: -12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1837088517} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2078062931 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2078062929} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: df9805cc34bd6a84a871591791937f55, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - -50 +--- !u!1 &2108052150 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2108052151} + - component: {fileID: 2108052152} + m_Layer: 0 + m_Name: Blendshape -50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2108052151 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2108052150} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -22, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1800111760} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2108052152 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2108052150} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: f4401e11497b6df4383f84d2a1619735, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - -50 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1724181620} + - {fileID: 1248773244} + - {fileID: 1800111760} + - {fileID: 1837088517} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_GPUSkinning.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_GPUSkinning.unity.meta new file mode 100644 index 00000000000..0220f806236 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_GPUSkinning.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a6fcefe0217070649a2c1ac6b5ab5358 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple.meta new file mode 100644 index 00000000000..2ee6e991a20 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46db5549a4ccd5d4b9446c81fecdaea9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/BlendShapeMultipleTest.cs b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/BlendShapeMultipleTest.cs new file mode 100644 index 00000000000..b7b4d32f7c7 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/BlendShapeMultipleTest.cs @@ -0,0 +1,110 @@ +using System; +using Unity.Collections; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.U2D; + +public class BlendShapeMultipleTest : MonoBehaviour +{ + [Serializable] + public class SpriteRendererAndWeight + { + public SpriteRenderer spriteRenderer; + public int index; + public float weight; + } + + public Sprite sprite; + public SpriteRendererAndWeight[] spriteRenderersAndWeights; + + void OnValidate() + { + if (sprite == null) + return; + + AddBlendShape(); + SetWeightToSpriteRenderers(); + } + + void OnEnable() + { + if (sprite == null) + return; + + AddBlendShape(); + SetWeightToSpriteRenderers(); + } + + public void AddBlendShape() + { + if (sprite == null) + return; + + Vector3[] positions = sprite.GetVertexAttribute(VertexAttribute.Position).ToArray(); + + // Clear all existing blend shapes. + sprite.ClearBlendShapes(); + + int index1 = sprite.AddBlendShape("Blend Shape 1"); + + { + // Add shrunk shape frame at firstFrameWeight. + NativeArray blendShapeVertices = new(positions.Length, Allocator.Temp); + for (int i = 0; i < positions.Length; i++) + { + Vector3 position = positions[i]; + Vector3 targetPosition = new(position.x * 1.5f, position.y * 0.5f, position.z); + + blendShapeVertices[i] = new SpriteBlendShapeVertex + { + index = (uint)i, + vertex = targetPosition - position, + normal = Vector3.zero, + tangent = Vector3.zero, + }; + } + + sprite.AddBlendShapeFrame(index1, 100f, blendShapeVertices); + blendShapeVertices.Dispose(); + } + + int index2 = sprite.AddBlendShape("Blend Shape 2"); + + { + // Add round shape frame at secondFrameWeight + Bounds bounds = sprite.bounds; + float radius = Mathf.Max(bounds.size.x, bounds.size.y) / 2.0f; + + NativeArray blendShapeVertices = new(positions.Length, Allocator.Temp); + for (int i = 0; i < positions.Length; i++) + { + Vector3 position = positions[i]; + Vector3 targetPosition = position.magnitude > 0 + ? new Vector3(position.normalized.x * radius, position.normalized.y * radius, position.z) + : position; + + blendShapeVertices[i] = new SpriteBlendShapeVertex + { + index = (uint)i, + vertex = targetPosition - position, + normal = Vector3.zero, + tangent = Vector3.zero, + }; + } + + sprite.AddBlendShapeFrame(index2, 100f, blendShapeVertices); + blendShapeVertices.Dispose(); + } + } + + void SetWeightToSpriteRenderers() + { + foreach (var srAndWeight in spriteRenderersAndWeights) + { + if (srAndWeight.spriteRenderer != null) + { + srAndWeight.spriteRenderer.SetBlendShapeWeight(srAndWeight.index, srAndWeight.weight); + } + } + } +} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/BlendShapeMultipleTest.cs.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/BlendShapeMultipleTest.cs.meta new file mode 100644 index 00000000000..f412ac98386 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/BlendShapeMultipleTest.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 71f774e8c2985744fa66fca764a8200f diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/Multple.png b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/Multple.png new file mode 100644 index 0000000000000000000000000000000000000000..3410c68252208bef952a5d8683a07a4a581aac8f GIT binary patch literal 2097 zcmeHI&5zSY6rb=>J_;2Q7vMCQ3l-QNJ6UHl!YoU&-9)Olt0hvG8D)-&SB4T(#SRR#Y57f>%nTmcDH{R=91&WE*IQNAu*uxxoe^PAs$?>Fx~|FXKW zeDv_C!w8|Ht!85lp%M&B=-?iBJw3MI!0S-byqY2O?eY96p*wd^AhiFKY_IF};77_; zWU)|ngf)s1KqGWvVU#ewAvErYo{W9tpWh!EScbmw^ISlJq%Qihxt)qD+beCpy}@gt zv2YPz7*QaIgl2dY4dRTBd}GW@VVqCf1|CE7hHot92Jw2Zit8#B*t3Yq32||?W;tG^ zGCzMFyTm0nsoD-PU6&G%&Xw`>GQe6IcIjH)c% z;@Ylj0>aF;V$DWooSm65G(^TznP{nEoHMeH+SI-Qo=!rDl7cqQrZRzG_J}36W05?h zF)-u>F4;^6W8)#W#Xv+N))`=(0-N-eR#{*D4|TD;%K%6l1ci-v`VvKjiA*oufH0~8Ibx?UTOxLl@lyP=RYA=B)G;E>a~|lFqHAU5PXB@86ZMqIxRn2feG!fFM#wt zc`<=ys;h@A6^lJk>mxGH2KVi}XeW`_{|$1ywxhsjaOfKOuxMBCQ8YXeLzhdTojw2U z^&5ot{LyMGwnumWe(IDEKJth>die4*Up~J7=63JJr9Yp2cPsb?KSuXX-m2{VwTqq{ oxpb%0EF<}K@~a?UJQ@BvaR1f5fA>Bno&2ZXT3Ts5xP0yQTl{2u)c^nh literal 0 HcmV?d00001 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/Multple.png.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/Multple.png.meta new file mode 100644 index 00000000000..e5486ebb641 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple/Multple.png.meta @@ -0,0 +1,712 @@ +fileFormatVersion: 2 +guid: d66a20169e19c4c4cbb6b5fbf8cd90e1 +TextureImporter: + internalIDToNameTable: + - first: + 213: 7482667652216324306 + second: Square + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 256 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: 0 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: iOS + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: GameCoreXboxOne + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: GameCoreScarlett + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Switch + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: + - serializedVersion: 2 + name: Multiple + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 256 + height: 256 + alignment: 0 + pivot: {x: 0.5, y: 0.5} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 2d009a6b596c7d760800000000000000 + internalID: 7482667652216324306 + vertices: + - {x: 256, y: 36.205} + - {x: 256, y: 72.409} + - {x: 256, y: 108.612} + - {x: 256, y: 144.815} + - {x: 256, y: 181.019} + - {x: 256, y: 217.222} + - {x: 256, y: 253.427} + - {x: 256, y: 256} + - {x: 219.795, y: 256} + - {x: 183.591, y: 256} + - {x: 147.388, y: 256} + - {x: 111.185, y: 256} + - {x: 74.981, y: 256} + - {x: 38.778, y: 256} + - {x: 2.572998, y: 256} + - {x: 0, y: 256} + - {x: 0, y: 219.795} + - {x: 0, y: 183.591} + - {x: 0, y: 147.388} + - {x: 0, y: 111.185} + - {x: 0, y: 74.981} + - {x: 0, y: 38.778} + - {x: 0, y: 2.572998} + - {x: 0, y: 0} + - {x: 36.205, y: 0} + - {x: 72.409, y: 0} + - {x: 108.612, y: 0} + - {x: 144.815, y: 0} + - {x: 181.019, y: 0} + - {x: 217.222, y: 0} + - {x: 253.427, y: 0} + - {x: 256, y: 0} + - {x: 112.05378, y: 127.981476} + - {x: 197.36983, y: 86.93534} + - {x: 210.09137, y: 45.274765} + - {x: 196.98991, y: 169.07687} + - {x: 213.85912, y: 128.20146} + - {x: 210.29947, y: 210.49887} + - {x: 140.93271, y: 168.9468} + - {x: 161.63359, y: 209.85225} + - {x: 41.831688, y: 169.1536} + - {x: 109.6799, y: 211.37784} + - {x: 55.365215, y: 211.36035} + - {x: 41.690968, y: 86.53497} + - {x: 57.192738, y: 127.91333} + - {x: 55.558475, y: 44.509842} + - {x: 140.99443, y: 87.0432} + - {x: 109.65989, y: 44.619545} + - {x: 161.5519, y: 46.25896} + - {x: 165.10484, y: 127.919525} + - {x: 89.009125, y: 169.51698} + - {x: 89.00016, y: 86.4656} + indices: 000000002200000001000000000000001e0000001d000000000000001f0000001e000000000000001d0000002200000001000000210000000200000001000000220000002100000002000000240000000300000002000000210000002400000003000000230000000400000003000000240000002300000004000000250000000500000004000000230000002500000005000000080000000600000005000000250000000800000006000000080000000700000008000000250000000900000009000000270000000a0000000900000025000000270000000a000000290000000b0000000a00000027000000290000000b000000290000000c0000000c0000002a0000000d0000000c000000290000002a0000000d000000100000000e0000000d0000002a000000100000000e000000100000000f000000100000002a00000011000000110000002800000012000000110000002a00000028000000120000002c0000001300000012000000280000002c000000130000002b00000014000000130000002c0000002b000000140000002d00000015000000140000002b0000002d000000150000001800000016000000150000002d00000018000000160000001800000017000000180000002d00000019000000190000002f0000001a000000190000002d0000002f0000001a0000002f0000001b0000001b000000300000001c0000001b0000002f000000300000001c000000220000001d0000001c000000300000002200000020000000320000002600000020000000330000002c00000020000000310000002e000000200000002600000031000000200000002c00000032000000200000002e0000003300000021000000310000002400000021000000300000002e000000210000002200000030000000210000002e0000003100000023000000270000002500000023000000310000002600000023000000260000002700000023000000240000003100000026000000290000002700000026000000320000002900000028000000320000002c000000280000002a0000003200000029000000320000002a0000002b000000330000002d0000002b0000002c000000330000002d000000330000002f0000002e000000300000002f0000002e0000002f00000033000000 + edges: + - {x: 0, y: 1} + - {x: 0, y: 31} + - {x: 1, y: 2} + - {x: 2, y: 3} + - {x: 3, y: 4} + - {x: 4, y: 5} + - {x: 5, y: 6} + - {x: 6, y: 7} + - {x: 7, y: 8} + - {x: 8, y: 9} + - {x: 9, y: 10} + - {x: 10, y: 11} + - {x: 11, y: 12} + - {x: 12, y: 13} + - {x: 13, y: 14} + - {x: 14, y: 15} + - {x: 15, y: 16} + - {x: 16, y: 17} + - {x: 17, y: 18} + - {x: 18, y: 19} + - {x: 19, y: 20} + - {x: 20, y: 21} + - {x: 21, y: 22} + - {x: 22, y: 23} + - {x: 23, y: 24} + - {x: 24, y: 25} + - {x: 25, y: 26} + - {x: 26, y: 27} + - {x: 27, y: 28} + - {x: 28, y: 29} + - {x: 29, y: 30} + - {x: 30, y: 31} + weights: + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + - 'weight[0]': 1 + 'weight[1]': 0 + 'weight[2]': 0 + 'weight[3]': 0 + 'boneIndex[0]': 0 + 'boneIndex[1]': 0 + 'boneIndex[2]': 0 + 'boneIndex[3]': 0 + outline: [] + customData: + physicsShape: + - - {x: -128, y: 128} + - {x: -128, y: -128} + - {x: 128, y: -128} + - {x: 128, y: 128} + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: + Multiple: 7482667652216324306 + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_CPUSkinning.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_CPUSkinning.unity new file mode 100644 index 00000000000..7d86339dd06 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_CPUSkinning.unity @@ -0,0 +1,1289 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &373394927 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 373394929} + - component: {fileID: 373394928} + m_Layer: 0 + m_Name: Weight 50,0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &373394928 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 373394927} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 50 + - 0 +--- !u!4 &373394929 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 373394927} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &443973100 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 443973102} + - component: {fileID: 443973101} + m_Layer: 0 + m_Name: Weight 50,50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &443973101 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443973100} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 50 + - 50 +--- !u!4 &443973102 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443973100} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &668880115 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 668880117} + - component: {fileID: 668880116} + m_Layer: 0 + m_Name: Weight 0,50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &668880116 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 668880115} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 0 + - 50 +--- !u!4 &668880117 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 668880115} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -20, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &993558191 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 993558193} + - component: {fileID: 993558192} + m_Layer: 0 + m_Name: Weight 0,100 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &993558192 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 993558191} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 0 + - 100 +--- !u!4 &993558193 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 993558191} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -20, y: -12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1064377302 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1064377304} + - component: {fileID: 1064377303} + m_Layer: 0 + m_Name: Weight 0,0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1064377303 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1064377302} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 0 + - 0 +--- !u!4 &1064377304 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1064377302} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -20, y: 12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1192353349 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1192353351} + - component: {fileID: 1192353350} + m_Layer: 0 + m_Name: Weight 100,50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1192353350 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1192353349} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 100 + - 50 +--- !u!4 &1192353351 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1192353349} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 20, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1597002058 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1597002060} + - component: {fileID: 1597002059} + m_Layer: 0 + m_Name: Weight 100,100 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1597002059 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1597002058} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 100 + - 100 +--- !u!4 &1597002060 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1597002058} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 20, y: -12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1609270177 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1609270179} + - component: {fileID: 1609270178} + m_Layer: 0 + m_Name: Weight 100,0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1609270178 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1609270177} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 100 + - 0 +--- !u!4 &1609270179 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1609270177} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 20, y: 12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1724181614 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1724181620} + - component: {fileID: 1724181619} + - component: {fileID: 1724181618} + - component: {fileID: 1724181617} + - component: {fileID: 1724181615} + - component: {fileID: 1724181622} + - component: {fileID: 1724181621} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1724181615 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73231aa468d81ea49bc3d914080de185, type: 3} + m_Name: + m_EditorClassIdentifier: + ImageComparisonSettings: + TargetWidth: 1280 + TargetHeight: 720 + TargetMSAASamples: 1 + PerPixelCorrectnessThreshold: 0.001 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 + RMSEThreshold: 0 + AverageCorrectnessThreshold: 0.005 + IncorrectPixelsThreshold: 0.0000038146973 + UseHDR: 0 + UseBackBuffer: 0 + ActiveImageTests: 1 + ActivePixelTests: 7 + WaitFrames: 1 + XRCompatible: 0 + gpuDrivenCompatible: 1 + CheckMemoryAllocation: 1 + renderBackendCompatibility: 2 + SetBackBufferResolution: 0 +--- !u!114 &1724181617 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!81 &1724181618 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 +--- !u!20 &1724181619 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 18 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1724181620 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1724181621 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 469ae0d1399b5e14dbaafc4c00d7ac0b, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::SRPBatcherToggle + useSRPBatcher: 1 +--- !u!114 &1724181622 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 007a32e7afa277741b8310240d128a6e, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::GPUSkinningToggle + useGPUSkinning: 0 +--- !u!1 &1753385727 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1753385729} + - component: {fileID: 1753385728} + m_Layer: 0 + m_Name: BlendShapeMultipleTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1753385728 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1753385727} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 71f774e8c2985744fa66fca764a8200f, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::BlendShapeMultipleTest + sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, type: 3} + spriteRenderersAndWeights: + - spriteRenderer: {fileID: 1064377303} + index: 0 + weight: 0 + - spriteRenderer: {fileID: 1064377303} + index: 1 + weight: 0 + - spriteRenderer: {fileID: 373394928} + index: 0 + weight: 50 + - spriteRenderer: {fileID: 373394928} + index: 1 + weight: 0 + - spriteRenderer: {fileID: 1609270178} + index: 0 + weight: 100 + - spriteRenderer: {fileID: 1609270178} + index: 1 + weight: 0 + - spriteRenderer: {fileID: 668880116} + index: 0 + weight: 0 + - spriteRenderer: {fileID: 668880116} + index: 1 + weight: 50 + - spriteRenderer: {fileID: 443973101} + index: 0 + weight: 50 + - spriteRenderer: {fileID: 443973101} + index: 1 + weight: 50 + - spriteRenderer: {fileID: 1192353350} + index: 0 + weight: 100 + - spriteRenderer: {fileID: 1192353350} + index: 1 + weight: 50 + - spriteRenderer: {fileID: 993558192} + index: 0 + weight: 0 + - spriteRenderer: {fileID: 993558192} + index: 1 + weight: 100 + - spriteRenderer: {fileID: 1831475191} + index: 0 + weight: 50 + - spriteRenderer: {fileID: 1831475191} + index: 1 + weight: 100 + - spriteRenderer: {fileID: 1597002059} + index: 0 + weight: 100 + - spriteRenderer: {fileID: 1597002059} + index: 1 + weight: 100 +--- !u!4 &1753385729 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1753385727} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1064377304} + - {fileID: 373394929} + - {fileID: 1609270179} + - {fileID: 668880117} + - {fileID: 443973102} + - {fileID: 1192353351} + - {fileID: 993558193} + - {fileID: 1831475192} + - {fileID: 1597002060} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1831475190 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1831475192} + - component: {fileID: 1831475191} + m_Layer: 0 + m_Name: Weight 50,100 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1831475191 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1831475190} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 50 + - 100 +--- !u!4 &1831475192 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1831475190} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1724181620} + - {fileID: 1753385729} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_CPUSkinning.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_CPUSkinning.unity.meta new file mode 100644 index 00000000000..3116aa7b9cd --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_CPUSkinning.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fcb548e9b8a61f647ac0d12d7822f38c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_GPUSkinning.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_GPUSkinning.unity new file mode 100644 index 00000000000..63af2e7728e --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_GPUSkinning.unity @@ -0,0 +1,1289 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &373394927 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 373394929} + - component: {fileID: 373394928} + m_Layer: 0 + m_Name: Weight 50,0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &373394928 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 373394927} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 50 + - 0 +--- !u!4 &373394929 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 373394927} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &443973100 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 443973102} + - component: {fileID: 443973101} + m_Layer: 0 + m_Name: Weight 50,50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &443973101 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443973100} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 50 + - 50 +--- !u!4 &443973102 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443973100} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &668880115 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 668880117} + - component: {fileID: 668880116} + m_Layer: 0 + m_Name: Weight 0,50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &668880116 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 668880115} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 0 + - 50 +--- !u!4 &668880117 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 668880115} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -20, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &993558191 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 993558193} + - component: {fileID: 993558192} + m_Layer: 0 + m_Name: Weight 0,100 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &993558192 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 993558191} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 0 + - 100 +--- !u!4 &993558193 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 993558191} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -20, y: -12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1064377302 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1064377304} + - component: {fileID: 1064377303} + m_Layer: 0 + m_Name: Weight 0,0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1064377303 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1064377302} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 0 + - 0 +--- !u!4 &1064377304 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1064377302} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -20, y: 12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1192353349 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1192353351} + - component: {fileID: 1192353350} + m_Layer: 0 + m_Name: Weight 100,50 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1192353350 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1192353349} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 100 + - 50 +--- !u!4 &1192353351 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1192353349} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 20, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1597002058 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1597002060} + - component: {fileID: 1597002059} + m_Layer: 0 + m_Name: Weight 100,100 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1597002059 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1597002058} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 100 + - 100 +--- !u!4 &1597002060 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1597002058} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 20, y: -12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1609270177 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1609270179} + - component: {fileID: 1609270178} + m_Layer: 0 + m_Name: Weight 100,0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1609270178 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1609270177} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 100 + - 0 +--- !u!4 &1609270179 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1609270177} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 20, y: 12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1724181614 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1724181620} + - component: {fileID: 1724181619} + - component: {fileID: 1724181618} + - component: {fileID: 1724181617} + - component: {fileID: 1724181615} + - component: {fileID: 1724181622} + - component: {fileID: 1724181621} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1724181615 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73231aa468d81ea49bc3d914080de185, type: 3} + m_Name: + m_EditorClassIdentifier: + ImageComparisonSettings: + TargetWidth: 1280 + TargetHeight: 720 + TargetMSAASamples: 1 + PerPixelCorrectnessThreshold: 0.001 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 + RMSEThreshold: 0 + AverageCorrectnessThreshold: 0.005 + IncorrectPixelsThreshold: 0.0000038146973 + UseHDR: 0 + UseBackBuffer: 0 + ActiveImageTests: 1 + ActivePixelTests: 7 + WaitFrames: 1 + XRCompatible: 0 + gpuDrivenCompatible: 1 + CheckMemoryAllocation: 1 + renderBackendCompatibility: 2 + SetBackBufferResolution: 0 +--- !u!114 &1724181617 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!81 &1724181618 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 +--- !u!20 &1724181619 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 18 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1724181620 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1724181621 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 469ae0d1399b5e14dbaafc4c00d7ac0b, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::SRPBatcherToggle + useSRPBatcher: 1 +--- !u!114 &1724181622 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 007a32e7afa277741b8310240d128a6e, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::GPUSkinningToggle + useGPUSkinning: 1 +--- !u!1 &1753385727 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1753385729} + - component: {fileID: 1753385728} + m_Layer: 0 + m_Name: BlendShapeMultipleTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1753385728 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1753385727} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 71f774e8c2985744fa66fca764a8200f, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::BlendShapeMultipleTest + sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, type: 3} + spriteRenderersAndWeights: + - spriteRenderer: {fileID: 1064377303} + index: 0 + weight: 0 + - spriteRenderer: {fileID: 1064377303} + index: 1 + weight: 0 + - spriteRenderer: {fileID: 373394928} + index: 0 + weight: 50 + - spriteRenderer: {fileID: 373394928} + index: 1 + weight: 0 + - spriteRenderer: {fileID: 1609270178} + index: 0 + weight: 100 + - spriteRenderer: {fileID: 1609270178} + index: 1 + weight: 0 + - spriteRenderer: {fileID: 668880116} + index: 0 + weight: 0 + - spriteRenderer: {fileID: 668880116} + index: 1 + weight: 50 + - spriteRenderer: {fileID: 443973101} + index: 0 + weight: 50 + - spriteRenderer: {fileID: 443973101} + index: 1 + weight: 50 + - spriteRenderer: {fileID: 1192353350} + index: 0 + weight: 100 + - spriteRenderer: {fileID: 1192353350} + index: 1 + weight: 50 + - spriteRenderer: {fileID: 993558192} + index: 0 + weight: 0 + - spriteRenderer: {fileID: 993558192} + index: 1 + weight: 100 + - spriteRenderer: {fileID: 1831475191} + index: 0 + weight: 50 + - spriteRenderer: {fileID: 1831475191} + index: 1 + weight: 100 + - spriteRenderer: {fileID: 1597002059} + index: 0 + weight: 100 + - spriteRenderer: {fileID: 1597002059} + index: 1 + weight: 100 +--- !u!4 &1753385729 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1753385727} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1064377304} + - {fileID: 373394929} + - {fileID: 1609270179} + - {fileID: 668880117} + - {fileID: 443973102} + - {fileID: 1192353351} + - {fileID: 993558193} + - {fileID: 1831475192} + - {fileID: 1597002060} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1831475190 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1831475192} + - component: {fileID: 1831475191} + m_Layer: 0 + m_Name: Weight 50,100 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1831475191 +SpriteRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1831475190} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Sprite: {fileID: 7482667652216324306, guid: d66a20169e19c4c4cbb6b5fbf8cd90e1, + type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_SpriteSortPoint: 0 + m_BlendShapeWeights: + - 50 + - 100 +--- !u!4 &1831475192 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1831475190} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -12, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1753385729} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1724181620} + - {fileID: 1753385729} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_GPUSkinning.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_GPUSkinning.unity.meta new file mode 100644 index 00000000000..35d9a926577 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_Multiple_GPUSkinning.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: db4758dd4407d10498e9d72db1f823d5 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_SpriteSkin_GPUSkinning.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_SpriteSkin_GPUSkinning.unity new file mode 100644 index 00000000000..ee1ab07f348 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_SpriteSkin_GPUSkinning.unity @@ -0,0 +1,894 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &1073992522 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1073992525} + - component: {fileID: 1073992524} + - component: {fileID: 1073992523} + m_Layer: 0 + m_Name: BlendshapeTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1073992523 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073992522} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4ca59dfca5e7f5e4babec9402b44c271, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::BlendShapeTest + sprite: {fileID: 21300020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + spriteRenderersAndWeights: + - spriteRenderer: {fileID: 1539096649} + index: 0 + weight: 50 + firstFrameWeight: 50 + secondFrameWeight: 100 +--- !u!114 &1073992524 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073992522} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4ca59dfca5e7f5e4babec9402b44c271, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::BlendShapeTest + sprite: {fileID: 21300022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + spriteRenderersAndWeights: + - spriteRenderer: {fileID: 1539096650} + index: 0 + weight: 75 + firstFrameWeight: 50 + secondFrameWeight: 100 +--- !u!4 &1073992525 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073992522} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 5.87706, y: 2.00479, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1539096648 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 100000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_Name + value: Fei + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalScale.x + value: 1.5 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalScale.y + value: 1.5 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.x + value: -0.5 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.y + value: -15 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.x + value: 6.42 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.y + value: 8.96 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.95614266 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.29290158 + objectReference: {fileID: 0} + - target: {fileID: 400020, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -34.064 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7488442 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.66274613 + objectReference: {fileID: 0} + - target: {fileID: 400022, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 83.019 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.99818283 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.060259283 + objectReference: {fileID: 0} + - target: {fileID: 400024, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.909 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9652188 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.26144353 + objectReference: {fileID: 0} + - target: {fileID: 400026, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 30.311 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9687297 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.24811882 + objectReference: {fileID: 0} + - target: {fileID: 400028, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 28.732 + objectReference: {fileID: 0} + - target: {fileID: 400030, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7473895 + objectReference: {fileID: 0} + - target: {fileID: 400030, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400030, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.66438615 + objectReference: {fileID: 0} + - target: {fileID: 400030, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 83.27 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9792519 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.20264661 + objectReference: {fileID: 0} + - target: {fileID: 400034, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 23.384 + objectReference: {fileID: 0} + - target: {fileID: 400040, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.31220463 + objectReference: {fileID: 0} + - target: {fileID: 400040, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400040, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.95001495 + objectReference: {fileID: 0} + - target: {fileID: 400040, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 143.616 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.902301 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.43110663 + objectReference: {fileID: 0} + - target: {fileID: 400042, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 51.076 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9352505 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.35398638 + objectReference: {fileID: 0} + - target: {fileID: 400044, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 41.463 + objectReference: {fileID: 0} + - target: {fileID: 400046, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.2769917 + objectReference: {fileID: 0} + - target: {fileID: 400046, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400046, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.9608723 + objectReference: {fileID: 0} + - target: {fileID: 400046, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -147.838 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9563229 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.2923123 + objectReference: {fileID: 0} + - target: {fileID: 400048, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 33.993 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.968583 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.2486906 + objectReference: {fileID: 0} + - target: {fileID: 400050, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 28.8 + objectReference: {fileID: 0} + - target: {fileID: 400052, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: -0.17594002 + objectReference: {fileID: 0} + - target: {fileID: 400052, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400052, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.98440087 + objectReference: {fileID: 0} + - target: {fileID: 400052, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 200.267 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.8840466 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.46739882 + objectReference: {fileID: 0} + - target: {fileID: 400054, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -55.731 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.8654866 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.5009321 + objectReference: {fileID: 0} + - target: {fileID: 400056, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 60.123 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.y + value: -0.9192951 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: -0.29984382 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.9539883 + objectReference: {fileID: 0} + - target: {fileID: 400058, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 214.896 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.x + value: 2.2471604 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalPosition.y + value: -0.000013113022 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9198736 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: -0.39221492 + objectReference: {fileID: 0} + - target: {fileID: 400060, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -46.185 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.8514187 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalRotation.z + value: 0.5244867 + objectReference: {fileID: 0} + - target: {fileID: 400062, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 63.267 + objectReference: {fileID: 0} + - target: {fileID: 21200000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_BlendShapeWeights.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21200002, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_BlendShapeWeights.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21200004, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_BlendShapeWeights.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21200006, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_BlendShapeWeights.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21200006, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: 'm_BlendShapeWeights.Array.data[0]' + value: 75 + objectReference: {fileID: 0} + - target: {fileID: 21200008, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_BlendShapeWeights.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21200010, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_BlendShapeWeights.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21200012, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_BlendShapeWeights.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21200014, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_BlendShapeWeights.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21200016, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_BlendShapeWeights.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21200018, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: m_BlendShapeWeights.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 21200018, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} + propertyPath: 'm_BlendShapeWeights.Array.data[0]' + value: 50 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c704e6b90d2634f7e99d0510580a3ca2, type: 3} +--- !u!212 &1539096649 stripped +SpriteRenderer: + m_CorrespondingSourceObject: {fileID: 21200018, guid: c704e6b90d2634f7e99d0510580a3ca2, + type: 3} + m_PrefabInstance: {fileID: 1539096648} + m_PrefabAsset: {fileID: 0} +--- !u!212 &1539096650 stripped +SpriteRenderer: + m_CorrespondingSourceObject: {fileID: 21200006, guid: c704e6b90d2634f7e99d0510580a3ca2, + type: 3} + m_PrefabInstance: {fileID: 1539096648} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1724181614 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1724181620} + - component: {fileID: 1724181619} + - component: {fileID: 1724181618} + - component: {fileID: 1724181617} + - component: {fileID: 1724181615} + - component: {fileID: 1724181622} + - component: {fileID: 1724181621} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1724181615 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73231aa468d81ea49bc3d914080de185, type: 3} + m_Name: + m_EditorClassIdentifier: + ImageComparisonSettings: + TargetWidth: 1280 + TargetHeight: 720 + TargetMSAASamples: 1 + PerPixelCorrectnessThreshold: 0.001 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 + RMSEThreshold: 0 + AverageCorrectnessThreshold: 0.005 + IncorrectPixelsThreshold: 0.0000038146973 + UseHDR: 0 + UseBackBuffer: 0 + ActiveImageTests: 1 + ActivePixelTests: 7 + WaitFrames: 1 + XRCompatible: 0 + gpuDrivenCompatible: 1 + CheckMemoryAllocation: 1 + renderBackendCompatibility: 2 + SetBackBufferResolution: 0 +--- !u!114 &1724181617 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!81 &1724181618 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 +--- !u!20 &1724181619 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 1, g: 1, b: 1, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 18 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1724181620 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1724181621 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 469ae0d1399b5e14dbaafc4c00d7ac0b, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::SRPBatcherToggle + useSRPBatcher: 1 +--- !u!114 &1724181622 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724181614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 007a32e7afa277741b8310240d128a6e, type: 3} + m_Name: + m_EditorClassIdentifier: Universal2DGraphicsTests::GPUSkinningToggle + useGPUSkinning: 1 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1724181620} + - {fileID: 1539096648} + - {fileID: 1073992525} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_SpriteSkin_GPUSkinning.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_SpriteSkin_GPUSkinning.unity.meta new file mode 100644 index 00000000000..6f8c71194f7 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/130_Blendshape_SpriteSkin_GPUSkinning.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: df90f1b4d85c2884d930ff39bb49b4fd +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From de928d8f530d28561d8f61a6d03085209f697df2 Mon Sep 17 00:00:00 2001 From: Aljosha Demeulemeester Date: Mon, 2 Mar 2026 10:34:12 +0000 Subject: [PATCH 23/95] Improve UI/UX of On-Tile Renderer --- .../OnTileValidationLayer.cs | 19 +- ...UniversalRenderPipelineCameraUI.Drawers.cs | 44 ++-- ...enderPipelineCameraUI.Rendering.Drawers.cs | 32 +-- .../UniversalRenderPipelineCameraUI.Skin.cs | 4 +- .../OnTilePostProcessFeatureEditor.cs | 4 +- .../UniversalRenderPipelineAssetUI.Drawers.cs | 199 ++++++++---------- .../UniversalRenderPipelineAssetUI.Skin.cs | 10 +- .../Editor/UniversalRendererDataEditor.cs | 35 ++- .../OnTilePostProcessFeature.cs | 2 +- .../RendererFeatures/OnTilePostProcessPass.cs | 3 + .../Runtime/RenderingUtils.cs | 4 +- .../UniversalRenderPipelineRenderGraph.cs | 2 +- .../Runtime/UniversalRenderer.cs | 37 +++- .../Runtime/UniversalRendererData.cs | 15 +- .../Runtime/UniversalRendererRenderGraph.cs | 10 +- .../Runtime/ValidationHandler.cs | 24 ++- .../Runtime/RenderGraphConstraintsTests.cs | 10 +- 17 files changed, 234 insertions(+), 220 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime-PrivateShared/OnTileValidationLayer.cs b/Packages/com.unity.render-pipelines.core/Runtime-PrivateShared/OnTileValidationLayer.cs index 98e6512b086..d828b805b5f 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime-PrivateShared/OnTileValidationLayer.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime-PrivateShared/OnTileValidationLayer.cs @@ -75,9 +75,8 @@ public void Clear() // >0 = tracked, and used in a raster pass, with the the state being the number of the pass DynamicArray m_HandleStates; - const string m_ErrorMessageValidationIssue = "The On Tile Validation layer has detected an issue: "; - const string m_ErrorMessageHowToResolve = "The On Tile Validation layer is activated with the setting 'On Tile Validation' on the URP Renderer. When activated, it is not allowed to sample (RenderGraph.UseTexture) the cameraColor or cameraDepth (intermediate) textures or the GBuffers or any copies of those." + - "You need to disable any of the following that could cause the issue: a URP setting that would break the native render pass, a ScriptableRenderPass that is enqueued from script, or a ScriptableRenderFeature that is installed on your URP Renderer.\n"; + const string k_ErrorMessageValidationIssue = "The On-Tile Validation layer has detected an issue: "; + const string k_ErrorMessageHowToResolveDefault = "Disable the On-Tile Validation Layer or ensure that all render passes meet the constraints of this layer.\n"; public OnTileValidationLayer() { @@ -87,8 +86,12 @@ public OnTileValidationLayer() m_CurrentPass.Init(); Clear(); + + errorMessageHowToResolve = k_ErrorMessageHowToResolveDefault; } + public string errorMessageHowToResolve { get; set; } + //Assumes input is valid and tracked as on tile. [MethodImpl(MethodImplOptions.AggressiveInlining)] void ValidateNoNonRasterPassInbetween(in TextureHandle input) @@ -107,23 +110,23 @@ void ValidateNoNonRasterPassInbetween(in TextureHandle input) void ThrowNoNonRasterPassInBetween(in TextureHandle input) { var resourceName = renderGraph.GetTextureName(in input); - throw new InvalidOperationException($"{m_ErrorMessageValidationIssue} render pass '{m_CurrentPass.info.name}'" + + throw new InvalidOperationException($"{k_ErrorMessageValidationIssue} render pass '{m_CurrentPass.info.name}'" + $" results in a load action for resource '{resourceName}' due to a previous Unsafe or Compute render pass '{m_LastNonRasterPassInfo.name}'. " + - $"These can't be merged.\n{m_ErrorMessageHowToResolve}"); + $"These can't be merged.\n{errorMessageHowToResolve}"); } void ThrowTextureSamplingException(in TextureHandle input, string methodName) { var resourceName = renderGraph.GetTextureName(in input); - throw new InvalidOperationException($"{m_ErrorMessageValidationIssue} render pass '{m_CurrentPass.info.name}' calls '{methodName}' with resource '{resourceName}'.\n{m_ErrorMessageHowToResolve}"); + throw new InvalidOperationException($"{k_ErrorMessageValidationIssue} render pass '{m_CurrentPass.info.name}' calls '{methodName}' with resource '{resourceName}'.\n{errorMessageHowToResolve}"); } void ThrowNotRasterPassException(in TextureHandle input, string methodName) { var resourceName = renderGraph.GetTextureName(in input); - throw new InvalidOperationException($"{m_ErrorMessageValidationIssue} render pass '{m_CurrentPass.info.name}' calls '{methodName}' with resource '{resourceName}'. " + + throw new InvalidOperationException($"{k_ErrorMessageValidationIssue} render pass '{m_CurrentPass.info.name}' calls '{methodName}' with resource '{resourceName}'. " + $"Unsafe and Compute render passes can't be merged. Use a Raster render pass and ensure that no load/store action will be performed." + - $"\n{m_ErrorMessageHowToResolve}"); + $"\n{errorMessageHowToResolve}"); } const string k_UseTexture = "UseTexture"; diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.Drawers.cs b/Packages/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.Drawers.cs index 63daeb2c342..02d1a7aa5b9 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.Drawers.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.Drawers.cs @@ -57,7 +57,7 @@ public enum ExpandableAdditional public static readonly CED.IDrawer[] Inspector = { CED.Group( - PrepareOnTileValidationWarning, + PrepareTileOnlyModeWarning, DrawerCameraType ), SectionProjectionSettings, @@ -113,16 +113,16 @@ static void DrawerStackCameras(UniversalRenderPipelineSerializedCamera p, Editor if (owner is UniversalRenderPipelineCameraEditor cameraEditor) { cameraEditor.DrawStackSettings(); - DisplayOnTileValidationWarning(p.cameras, p => p.arraySize != 0, Styles.cameraStackLabelForOnTileValidation, p); + DisplayTileOnlyModeWarning(p.cameras, p => p.arraySize != 0, Styles.cameraStackLabelForTileOnlyMode, p); } } - struct OnTileValidationInfos + struct TileOnlyModeInfos { public readonly bool enabled; public readonly string rendererName; public readonly ScriptableRendererData assetToOpen; - public OnTileValidationInfos(string rendererName, ScriptableRendererData assetToOpen) + public TileOnlyModeInfos(string rendererName, ScriptableRendererData assetToOpen) { enabled = true; this.rendererName = rendererName; @@ -130,27 +130,27 @@ public OnTileValidationInfos(string rendererName, ScriptableRendererData assetTo } } - static OnTileValidationInfos lastOnTileValidationInfos; + static TileOnlyModeInfos lastTileOnlyModeInfos; - static void PrepareOnTileValidationWarning(UniversalRenderPipelineSerializedCamera serialized, Editor owner) + static void PrepareTileOnlyModeWarning(UniversalRenderPipelineSerializedCamera serialized, Editor owner) { // Rules: - // - mono selection: Display warning if RendererData's OnTileValidation is enabled (with 'Open' behaviour) + // - mono selection: Display warning if RendererData's Tile-Only Mode is enabled (with 'Open' behaviour) // - multi selection: - // - Display warning if all RendererData's OnTileValidation are enabled + // - Display warning if Tile-Only Mode is enabled on all RendererData's // - Only have 'Open' behaviour if all RendererData are the same - lastOnTileValidationInfos = default; + lastTileOnlyModeInfos = default; // Note: UniversalRenderPipeline.asset should not be null or this inspector would not be shown. // Just in case off though: if (UniversalRenderPipeline.asset == null) return; - bool HasOnTileValidationAtIndex(int index, out ScriptableRendererData rendererData) + bool HasTileOnlyModeAtIndex(int index, out ScriptableRendererData rendererData) => UniversalRenderPipeline.asset.TryGetRendererData(index, out rendererData) && rendererData is UniversalRendererData universalData - && universalData.onTileValidation; + && universalData.tileOnlyMode; // If impacted section are not opened, early exit if (!(k_ExpandedState[Expandable.Rendering] || k_ExpandedState[Expandable.Stack])) @@ -160,16 +160,16 @@ bool HasOnTileValidationAtIndex(int index, out ScriptableRendererData rendererDa if (!serialized.renderer.hasMultipleDifferentValues) { - if (!HasOnTileValidationAtIndex(serialized.renderer.intValue, out rendererData)) + if (!HasTileOnlyModeAtIndex(serialized.renderer.intValue, out rendererData)) return; - lastOnTileValidationInfos = new OnTileValidationInfos($"'{rendererData.name}'", assetToOpen: rendererData); + lastTileOnlyModeInfos = new TileOnlyModeInfos($"'{rendererData.name}'", assetToOpen: rendererData); return; } bool targetSameAsset = true; var firstAdditionalData = (UniversalAdditionalCameraData)serialized.serializedAdditionalDataObject.targetObjects[0]; - if (!HasOnTileValidationAtIndex(firstAdditionalData.rendererIndex, out rendererData)) + if (!HasTileOnlyModeAtIndex(firstAdditionalData.rendererIndex, out rendererData)) return; using var o = StringBuilderPool.Get(out var sb); @@ -179,7 +179,7 @@ bool HasOnTileValidationAtIndex(int index, out ScriptableRendererData rendererDa for (int i = 1; i < serialized.serializedAdditionalDataObject.targetObjects.Length; ++i) { var additionalCameraData = (UniversalAdditionalCameraData)serialized.serializedAdditionalDataObject.targetObjects[i]; - if (!HasOnTileValidationAtIndex(additionalCameraData.rendererIndex, out var otherRenderer)) + if (!HasTileOnlyModeAtIndex(additionalCameraData.rendererIndex, out var otherRenderer)) return; targetSameAsset &= rendererData == otherRenderer; @@ -188,27 +188,27 @@ bool HasOnTileValidationAtIndex(int index, out ScriptableRendererData rendererDa sb.Append("'"); } - lastOnTileValidationInfos = new OnTileValidationInfos(sb.ToString(), assetToOpen: targetSameAsset ? rendererData : null); + lastTileOnlyModeInfos = new TileOnlyModeInfos(sb.ToString(), assetToOpen: targetSameAsset ? rendererData : null); } - static void DisplayOnTileValidationWarning(SerializedProperty prop, Func shouldDisplayWarning, GUIContent label, UniversalRenderPipelineSerializedCamera serialized) + static void DisplayTileOnlyModeWarning(SerializedProperty prop, Func shouldDisplayWarning, GUIContent label, UniversalRenderPipelineSerializedCamera serialized) { - if (!lastOnTileValidationInfos.enabled + if (!lastTileOnlyModeInfos.enabled || prop == null || shouldDisplayWarning == null || prop.hasMultipleDifferentValues || !shouldDisplayWarning(prop)) return; - if (lastOnTileValidationInfos.assetToOpen != null) + if (lastTileOnlyModeInfos.assetToOpen != null) CoreEditorUtils.DrawFixMeBox( - string.Format(Styles.formaterOnTileValidation, label == null ? prop.displayName : label.text, lastOnTileValidationInfos.rendererName), + string.Format(Styles.formatterTileOnlyMode, label == null ? prop.displayName : label.text, lastTileOnlyModeInfos.rendererName), MessageType.Warning, "Open", - () => AssetDatabase.OpenAsset(lastOnTileValidationInfos.assetToOpen)); + () => AssetDatabase.OpenAsset(lastTileOnlyModeInfos.assetToOpen)); else EditorGUILayout.HelpBox( - string.Format(Styles.formaterOnTileValidation, label == null ? prop.displayName : label.text, lastOnTileValidationInfos.rendererName), + string.Format(Styles.formatterTileOnlyMode, label == null ? prop.displayName : label.text, lastTileOnlyModeInfos.rendererName), MessageType.Warning); } } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.Rendering.Drawers.cs b/Packages/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.Rendering.Drawers.cs index 0fa01096c9a..e05109dd04c 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.Rendering.Drawers.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.Rendering.Drawers.cs @@ -16,7 +16,16 @@ public partial class Rendering (serialized, owner) => IsAnyRendererHasPostProcessingEnabled(serialized, UniversalRenderPipeline.asset) && serialized.renderPostProcessing.boolValue, (serialized, owner) => { - EditorGUILayout.HelpBox(Styles.disabledPostprocessing, MessageType.Warning); + int selectedRendererOption = serialized.renderer.intValue; + + var rendererData = selectedRendererOption == -1 ? UniversalRenderPipeline.asset.scriptableRendererData : UniversalRenderPipeline.asset.m_RendererDataList[selectedRendererOption]; + + CoreEditorUtils.DrawFixMeBox( + string.Format(Styles.disabledPostprocessing), + MessageType.Warning, + "Open", + () => AssetDatabase.OpenAsset(rendererData)); + s_PostProcessingWarningShown = true; }); @@ -134,7 +143,7 @@ static Rendering() CED.Group( CameraUI.Rendering.Drawer_Rendering_CullingMask, CameraUI.Rendering.Drawer_Rendering_OcclusionCulling, - OcclusionCullingWithWarningOnTileValidation + OcclusionCullingWithWarningTileOnlyMode ) ), CED.noop, @@ -150,7 +159,7 @@ static Rendering() CED.Group( CameraUI.Rendering.Drawer_Rendering_CullingMask, CameraUI.Rendering.Drawer_Rendering_OcclusionCulling, - OcclusionCullingWithWarningOnTileValidation + OcclusionCullingWithWarningTileOnlyMode ) ); } @@ -197,7 +206,7 @@ static bool IsAnyRendererHasPostProcessingEnabled(UniversalRenderPipelineSeriali var rendererData = selectedRendererOption == -1 ? rpAsset.scriptableRendererData : rpAsset.m_RendererDataList[selectedRendererOption]; var forwardRendererData = rendererData as UniversalRendererData; - if (forwardRendererData != null && forwardRendererData.postProcessData == null) + if (forwardRendererData != null && !rpAsset.GetRenderer(selectedRendererOption).supportedRenderingFeatures.postProcessing) return true; var renderer2DData = rendererData as UnityEngine.Rendering.Universal.Renderer2DData; @@ -282,13 +291,6 @@ static void DrawerRenderingTAAQuality(UniversalRenderPipelineSerializedCamera p, static void DrawerRenderingRenderPostProcessing(UniversalRenderPipelineSerializedCamera serialized, Editor owner) { EditorGUILayout.PropertyField(serialized.renderPostProcessing, Styles.renderPostProcessing); - - // There is other issue displayed if one try to use PP while Renderer does not allow it - bool enabledInRenderer = serialized.renderer.hasMultipleDifferentValues - || (UniversalRenderPipeline.asset.TryGetRendererData(serialized.renderer.intValue, out var rendererData) - && rendererData is UniversalRendererData universalData - && universalData.postProcessData != null); - DisplayOnTileValidationWarning(serialized.renderPostProcessing, p => p.boolValue && enabledInRenderer, Styles.renderPostProcessing, serialized); } static void DrawerRenderingPriority(UniversalRenderPipelineSerializedCamera serialized, Editor owner) @@ -299,18 +301,18 @@ static void DrawerRenderingPriority(UniversalRenderPipelineSerializedCamera seri static void DrawerRenderingDepthTexture(UniversalRenderPipelineSerializedCamera serialized, Editor owner) { EditorGUILayout.PropertyField(serialized.renderDepth, Styles.requireDepthTexture); - DisplayOnTileValidationWarning(serialized.renderDepth, p => p.intValue == (int)CameraOverrideOption.On, Styles.requireDepthTexture, serialized); + DisplayTileOnlyModeWarning(serialized.renderDepth, p => p.intValue == (int)CameraOverrideOption.On, Styles.requireDepthTexture, serialized); } static void DrawerRenderingOpaqueTexture(UniversalRenderPipelineSerializedCamera serialized, Editor owner) { EditorGUILayout.PropertyField(serialized.renderOpaque, Styles.requireOpaqueTexture); - DisplayOnTileValidationWarning(serialized.renderOpaque, p => p.intValue == (int)CameraOverrideOption.On, Styles.requireOpaqueTexture, serialized); + DisplayTileOnlyModeWarning(serialized.renderOpaque, p => p.intValue == (int)CameraOverrideOption.On, Styles.requireOpaqueTexture, serialized); } - static void OcclusionCullingWithWarningOnTileValidation(UniversalRenderPipelineSerializedCamera serialized, Editor owner) + static void OcclusionCullingWithWarningTileOnlyMode(UniversalRenderPipelineSerializedCamera serialized, Editor owner) { - DisplayOnTileValidationWarning(serialized.baseCameraSettings.occlusionCulling, p => p.boolValue, CameraUI.Rendering.Styles.occlusionCulling, serialized); + DisplayTileOnlyModeWarning(serialized.baseCameraSettings.occlusionCulling, p => p.boolValue, CameraUI.Rendering.Styles.occlusionCulling, serialized); } } } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.Skin.cs b/Packages/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.Skin.cs index 5bd359b4ba3..2da0b52c47a 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.Skin.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.Skin.cs @@ -14,8 +14,8 @@ public class Styles public static readonly GUIContent cameras = EditorGUIUtility.TrTextContent("Cameras", "The list of overlay cameras assigned to this camera."); public static readonly string inspectorOverlayCameraText = L10n.Tr("Inspector Overlay Camera"); - public static readonly string formaterOnTileValidation = L10n.Tr("'{0}' will be skipped because it is incompatible with the enabled 'On-Tile Validation' on the assigned Renderer: {1}."); - public static readonly GUIContent cameraStackLabelForOnTileValidation = EditorGUIUtility.TrTextContent("Camera Stacking"); + public static readonly string formatterTileOnlyMode = L10n.Tr("'{0}' will be skipped because it is incompatible with the enabled 'Tile-Only Mode' on the assigned Renderer: {1}."); + public static readonly GUIContent cameraStackLabelForTileOnlyMode = EditorGUIUtility.TrTextContent("Camera Stacking"); } } } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/OnTilePostProcessFeatureEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/OnTilePostProcessFeatureEditor.cs index 34a81fb8963..8d22e63b6fb 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/OnTilePostProcessFeatureEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/OnTilePostProcessFeatureEditor.cs @@ -10,7 +10,7 @@ internal class OnTilePostProcessFeatureEditor : Editor static class Styles { public static readonly string k_NoSettingsHelpBox = L10n.Tr("This feature performs post-processing operation in tile memory. There are currently no available settings, they might be added later."); - public static readonly string k_NeedsOnTileValidation = L10n.Tr("On Tile PostProcessing feature needs the 'On Tile Validation' set on the Renderer. Otherwise, this render feature will fallback to texture sampling mode (slow off-tile rendering)"); + public static readonly string k_NeedsTileOnlyMode = L10n.Tr("On Tile PostProcessing feature needs 'Tile-Only Mode' set on the Renderer. Otherwise, this render feature will fallback to texture sampling mode (slow off-tile rendering)"); } private void OnEnable() @@ -19,7 +19,7 @@ private void OnEnable() public override void OnInspectorGUI() { - EditorGUILayout.HelpBox(Styles.k_NeedsOnTileValidation, MessageType.Info); + EditorGUILayout.HelpBox(Styles.k_NeedsTileOnlyMode, MessageType.Info); EditorGUILayout.HelpBox(Styles.k_NoSettingsHelpBox, MessageType.Info); } } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Drawers.cs b/Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Drawers.cs index cac806e7568..206a82fb1b5 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Drawers.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Drawers.cs @@ -132,7 +132,7 @@ internal static void Expand(Expandable expandable, bool state) } public static readonly CED.IDrawer Inspector = CED.Group( - CED.Group(PrepareOnTileValidationWarning), + CED.Group(PrepareTileOnlyModeWarning), CED.AdditionalPropertiesFoldoutGroup(Styles.renderingSettingsText, Expandable.Rendering, k_ExpandedState, ExpandableAdditional.Rendering, k_AdditionalPropertiesState, DrawRendering, DrawRenderingAdditional), CED.FoldoutGroup(Styles.qualitySettingsText, Expandable.Quality, k_ExpandedState, DrawQuality), CED.AdditionalPropertiesFoldoutGroup(Styles.lightingSettingsText, Expandable.Lighting, k_ExpandedState, ExpandableAdditional.Lighting, k_AdditionalPropertiesState, DrawLighting, DrawLightingAdditional), @@ -160,10 +160,10 @@ static void DrawRendering(SerializedUniversalRenderPipelineAsset serialized, Edi EditorGUILayout.HelpBox(Styles.rendererUnsupportedAPIMessage.text + unsupportedGraphicsApisMessage, MessageType.Warning, true); EditorGUILayout.PropertyField(serialized.requireDepthTextureProp, Styles.requireDepthTextureText); - DisplayOnTileValidationWarning(serialized.requireDepthTextureProp, p => p.boolValue, Styles.requireDepthTextureText); + DisplayTileOnlyHelpBox(serialized.requireDepthTextureProp, p => p.boolValue, Styles.requireDepthTextureText); EditorGUILayout.PropertyField(serialized.requireOpaqueTextureProp, Styles.requireOpaqueTextureText); - DisplayOnTileValidationWarning(serialized.requireOpaqueTextureProp, p => p.boolValue, Styles.requireOpaqueTextureText); + DisplayTileOnlyHelpBox(serialized.requireOpaqueTextureProp, p => p.boolValue, Styles.requireOpaqueTextureText); EditorGUI.BeginDisabledGroup(!serialized.requireOpaqueTextureProp.boolValue); EditorGUILayout.PropertyField(serialized.opaqueDownsamplingProp, Styles.opaqueDownsamplingText); @@ -181,7 +181,7 @@ static void DrawRendering(SerializedUniversalRenderPipelineAsset serialized, Edi ++EditorGUI.indentLevel; serialized.smallMeshScreenPercentage.floatValue = Mathf.Clamp(EditorGUILayout.FloatField(Styles.smallMeshScreenPercentage, serialized.smallMeshScreenPercentage.floatValue), 0.0f, 20.0f); EditorGUILayout.PropertyField(serialized.gpuResidentDrawerEnableOcclusionCullingInCameras, Styles.gpuResidentDrawerEnableOcclusionCullingInCameras); - DisplayOnTileValidationWarning(serialized.gpuResidentDrawerEnableOcclusionCullingInCameras, p => p.boolValue, Styles.gpuResidentDrawerEnableOcclusionCullingInCameras); + DisplayTileOnlyHelpBox(serialized.gpuResidentDrawerEnableOcclusionCullingInCameras, p => p.boolValue, Styles.gpuResidentDrawerEnableOcclusionCullingInCameras); --EditorGUI.indentLevel; if (brgStrippingError) @@ -193,7 +193,10 @@ static void DrawRendering(SerializedUniversalRenderPipelineAsset serialized, Edi } } if (lightingModeError) - EditorGUILayout.HelpBox(Styles.lightModeErrorMessage.text, MessageType.Warning, true); + { + var renderersToChange = GetRendererNamesWithoutCorrectLightingMode(serialized.asset); + EditorGUILayout.HelpBox(string.Format(Styles.lightModeErrorFormatter, renderersToChange), MessageType.Error, true); + } if (staticBatchingWarning) EditorGUILayout.HelpBox(Styles.staticBatchingInfoMessage.text, MessageType.Info, true); } @@ -215,6 +218,41 @@ private static bool HasCorrectLightingModes(UniversalRenderPipelineAsset asset) return true; } + /// Formats renderer names as "'Name1', 'Name2'" using pooled StringBuilder. Shared by Tile-Only Mode and lighting mode messages. + static string FormatRendererNames(IEnumerable collection, string suffix = "") + { + if (collection == null) + return string.Empty; + using var _ = StringBuilderPool.Get(out var sb); + var first = true; + foreach (var r in collection) + { + if (r == null) + continue; + if (!first) + sb.Append(", "); + sb.Append("'").Append(r.name).Append("'").Append(suffix); + first = false; + } + return sb.ToString(); + } + + private static IEnumerable GetRenderersWithoutCorrectLightingMode(UniversalRenderPipelineAsset asset) + { + if (asset?.m_RendererDataList == null) + yield break; + foreach (var rendererData in asset.m_RendererDataList) + { + if (rendererData == null) + continue; + if (rendererData is not UniversalRendererData universalRendererData || !universalRendererData.usesClusterLightLoop) + yield return rendererData; + } + } + + private static string GetRendererNamesWithoutCorrectLightingMode(UniversalRenderPipelineAsset asset) + => FormatRendererNames(GetRenderersWithoutCorrectLightingMode(asset)); + static void DrawRenderingAdditional(SerializedUniversalRenderPipelineAsset serialized, Editor ownerEditor) { EditorGUILayout.PropertyField(serialized.srpBatcher, Styles.srpBatcher); @@ -243,15 +281,15 @@ static void DrawQuality(SerializedUniversalRenderPipelineAsset serialized, Edito DrawHDR(serialized, ownerEditor); EditorGUILayout.PropertyField(serialized.msaa, Styles.msaaText); - DisplayOnTileValidationWarning( + DisplayTileOnlyHelpBox( serialized.msaa, p => p.intValue != (int)MsaaQuality.Disabled // This operation is actually ok on Quest && !IsAndroidXRTargetted(), - Styles.msaaText); + Styles.msaaText, MessageType.Info, Styles.msaaTileOnlyInfo); serialized.renderScale.floatValue = EditorGUILayout.Slider(Styles.renderScaleText, serialized.renderScale.floatValue, UniversalRenderPipeline.minRenderScale, UniversalRenderPipeline.maxRenderScale); - DisplayOnTileValidationWarning( + DisplayTileOnlyHelpBox( serialized.renderScale, p => { @@ -328,7 +366,7 @@ static void DrawUpscalingFilterDropdownAndOptions(SerializedUniversalRenderPipel serialized.selectedUpscalerName.stringValue = namesArray[selectedIndex]; } - DisplayOnTileValidationWarning(serialized.upscalingFilter, p => serialized.selectedUpscalerName.stringValue != UniversalRenderPipeline.k_UpscalerName_Auto, Styles.upscalingFilterText); + DisplayTileOnlyHelpBox(serialized.upscalingFilter, p => serialized.selectedUpscalerName.stringValue != UniversalRenderPipeline.k_UpscalerName_Auto, Styles.upscalingFilterText); // --- 5. Draw Options per upscaler --- string selectedName = namesArray[selectedIndex]; @@ -417,7 +455,7 @@ static void DrawUpscalingFilterDropdownAndOptions(SerializedUniversalRenderPipel serialized.upscalingFilter.enumValueIndex = Math.Min(selectedIndex, (int)UpscalingFilterSelection.STP); } - DisplayOnTileValidationWarning(serialized.upscalingFilter, p => p.intValue != (int)UpscalingFilterSelection.Auto, Styles.upscalingFilterText); + DisplayTileOnlyHelpBox(serialized.upscalingFilter, p => p.intValue != (int)UpscalingFilterSelection.Auto, Styles.upscalingFilterText); // draw upscaler options, if any switch (serialized.asset.upscalingFilter) @@ -451,10 +489,14 @@ static void DrawUpscalingFilterDropdownAndOptions(SerializedUniversalRenderPipel #endif } + public static readonly string disabledPostprocessing = L10n.Tr("HDR is not supported by one of the Universal Render Pipeline renderers."); + static void DrawHDR(SerializedUniversalRenderPipelineAsset serialized, Editor ownerEditor) { EditorGUILayout.PropertyField(serialized.hdr, Styles.hdrText); - DisplayOnTileValidationWarning(serialized.hdr, p => p.boolValue, Styles.hdrText); + + // A ScriptableRenderFeature can add HDR, for example the OnTilePostProcessing extension. + DisplayTileOnlyHelpBox(serialized.hdr, p => p.boolValue, Styles.hdrText, customMessage: Styles.tileOnlyModeMaybeMessage); // Nested and in-between additional property bool additionalProperties = k_ExpandedState[Expandable.Quality] && k_AdditionalPropertiesState[ExpandableAdditional.Quality]; @@ -859,8 +901,6 @@ static void DrawCascades(SerializedUniversalRenderPipelineAsset serialized, int static void DrawPostProcessing(SerializedUniversalRenderPipelineAsset serialized, Editor ownerEditor) { - DisplayOnTileValidationWarningForPostProcessingSection(Styles.postProcessingSettingsText); - EditorGUILayout.PropertyField(serialized.colorGradingMode, Styles.colorGradingMode); bool isHdrOn = serialized.hdr.boolValue; if (!isHdrOn && serialized.colorGradingMode.intValue == (int)ColorGradingMode.HighDynamicRange) @@ -942,36 +982,33 @@ static void DrawAdaptivePerformance(SerializedUniversalRenderPipelineAsset seria EditorGUILayout.PropertyField(serialized.useAdaptivePerformance, Styles.useAdaptivePerformance); } #endif - - struct OnTileValidationInfos + struct TileOnlyModeInfos { - public bool enabled => !string.IsNullOrEmpty(formatter); - public readonly string formatter; + public bool enabled => !string.IsNullOrEmpty(rendererNames); + public readonly bool isSingleRendererCase; public readonly string rendererNames; - public readonly string rendererNamesWithPostProcess; - public OnTileValidationInfos(string formatter, string rendererNames, string rendererNamesWithPostProcess) + public TileOnlyModeInfos(bool isSingleRendererCase, string rendererNames) { - this.formatter = formatter; + this.isSingleRendererCase = isSingleRendererCase; this.rendererNames = rendererNames; - this.rendererNamesWithPostProcess = rendererNamesWithPostProcess; } } - static OnTileValidationInfos lastOnTileValidationInfos; //prevent computing this multiple time for this ImGUI frame + static TileOnlyModeInfos lastTileOnlyModeInfos; //prevent computing this multiple time for this ImGUI frame - static void PrepareOnTileValidationWarning(SerializedUniversalRenderPipelineAsset serialized, Editor ownerEditor) + static void PrepareTileOnlyModeWarning(SerializedUniversalRenderPipelineAsset serialized, Editor ownerEditor) { // Rules: // - mono selection: - // - only 1 Renderer in the list: Display warning if RendererData's OnTileValidation is enabled - // - many Renderers in the list: Display warning with list of RendererData's where OnTileValidation is enabled + // - only 1 Renderer in the list: Display warning if RendererData's Tile-Only Mode is enabled + // - many Renderers in the list: Display warning with list of RendererData's where Tile-Only Mode is enabled // - multi selection: - // - compute the list interection of RendererDatas where OnTileValidation is enabled amongst all URPAsset in selection + // - compute the list interection of RendererDatas where Tile-Only Mode is enabled amongst all URPAsset in selection // - If list is not empty, display warning with this list. Additionaly specify for item iden due to being at different position // - Additionally for both, for Post Processing section: only show names where Post Processing is enabled - lastOnTileValidationInfos = default; + lastTileOnlyModeInfos = default; // If impacted section are not opened, early exit if (!(k_ExpandedState[Expandable.Rendering] || k_ExpandedState[Expandable.Quality] || k_ExpandedState[Expandable.PostProcessing])) @@ -997,7 +1034,7 @@ IEnumerable ArrayElementPropertyEnumerator(SerializedPropert } } - // Helper to filter the list and get only unique result of UniversalRendererData that have the OnTileValidation. + // Helper to filter the list and get only unique result of UniversalRendererData that have Tile-Only Mode. // The returned IDisposable is for being able to return the HashSet to the pool when Dispose is call like at end of Using. IDisposable SelectUniqueAndCast(IEnumerable properties, out HashSet uniques) { @@ -1006,51 +1043,16 @@ IDisposable SelectUniqueAndCast(IEnumerable properties, out while (e.MoveNext()) if (!e.Current.hasMultipleDifferentValues && e.Current.boxedValue is UniversalRendererData universalData - && universalData.onTileValidation) + && universalData.tileOnlyMode) uniques.Add(universalData); return disposer; } - - // Additional select to filter the one that have PostProcessing enabled. - IEnumerable WherePostProcessingEnabled(IEnumerable renderer) - { - var e = renderer.GetEnumerator(); - while (e.MoveNext()) - if (e.Current.postProcessData != null) - yield return e.Current; - } - - // Helper to draw the name in the collection as a string, between '' and with a coma separator - string ListElementNames(IEnumerable collection, string suffix = "") - { - var e = collection.GetEnumerator(); - if (!e.MoveNext()) - return string.Empty; - - string GetName(IEnumerator e) - => $"'{e.Current.name}'{suffix}"; - - string last = GetName(e); - if (!e.MoveNext()) - return last; - using var o = StringBuilderPool.Get(out var sb); - do - { - sb.Append(last); - last = $", {GetName(e)}"; - } - while (e.MoveNext()); - sb.Append(last); - - return sb.ToString(); - } - // Helper for multiple selection to distinguish element that remain at stable position (in the selection) from others string ConcatCollectionInName(IEnumerable rightlyPositioned, IEnumerable wronglyPositioned) { - var firstPart = ListElementNames(rightlyPositioned); - var secondPart = ListElementNames(wronglyPositioned, Styles.suffixWhenDifferentPositionOnTileValidation); + var firstPart = FormatRendererNames(rightlyPositioned); + var secondPart = FormatRendererNames(wronglyPositioned, Styles.suffixWhenDifferentPositionTileOnlyMode); if (string.IsNullOrEmpty(firstPart)) return secondPart; if (string.IsNullOrEmpty(secondPart)) @@ -1059,7 +1061,6 @@ string ConcatCollectionInName(IEnumerable rightlyPosition } string names = null; - string namesWithPostProcess = null; if (!serialized.rendererDatas.hasMultipleDifferentValues) { // Simple case: all element selected share the same list. @@ -1070,46 +1071,41 @@ string ConcatCollectionInName(IEnumerable rightlyPosition return; if (k_ExpandedState[Expandable.Rendering] || k_ExpandedState[Expandable.Quality]) - names = ListElementNames(renderers); - - if (k_ExpandedState[Expandable.PostProcessing]) - namesWithPostProcess = ListElementNames(WherePostProcessingEnabled(renderers)); - - lastOnTileValidationInfos = new OnTileValidationInfos( - serialized.rendererDatas.arraySize == 1 ? Styles.formatterOnTileValidationOneRenderer : Styles.formatterOnTileValidationMultipleRenderer, - names, - namesWithPostProcess); + names = FormatRendererNames(renderers); + + bool isSingleRendererCase = serialized.rendererDatas.arraySize == 1; + lastTileOnlyModeInfos = new TileOnlyModeInfos(isSingleRendererCase, names); return; } } // Complex case: the renderer list is different in some elements of the selection - // Let's compute the intersection of each RendererList where it is a UniversalRenderer with On-Tile Validation enabled. + // Let's compute the intersection of each RendererList where it is a UniversalRenderer with Tile-Only Mode enabled. // If the intersection is empty, it would means no RendererData validate the criteria so we early exit. // We can retrieve element at stable position by directly checking the serialization of the selection. // Elements in the intersection that are not in the stable positio list are elements shared in all list but with moving index. - // Helper to build the HashSet of UniversalRenderer that have OnTileValidation on one targeted asset. + // Helper to build the HashSet of UniversalRenderer that have Tile-Only Mode on one targeted asset. // The returned IDisposable is for being able to return the HashSet to the pool when Dispose is call like at end of Using. - IDisposable GetUniversalRendererWithOnTileValidationEnabled(UniversalRenderPipelineAsset asset, out HashSet set) + IDisposable GetUniversalRendererWithTileOnlyModeEnabled(UniversalRenderPipelineAsset asset, out HashSet set) { IDisposable disposer = HashSetPool.Get(out set); for (int rendererIndex = 0; rendererIndex < asset.rendererDataList.Length; ++rendererIndex) - if (asset.rendererDataList[rendererIndex] is UniversalRendererData universalData && universalData.onTileValidation) + if (asset.rendererDataList[rendererIndex] is UniversalRendererData universalData && universalData.tileOnlyMode) set.Add(universalData); return disposer; } - using (GetUniversalRendererWithOnTileValidationEnabled((UniversalRenderPipelineAsset)serialized.serializedObject.targetObjects[0], out var movingPositions)) + using (GetUniversalRendererWithTileOnlyModeEnabled((UniversalRenderPipelineAsset)serialized.serializedObject.targetObjects[0], out var movingPositions)) { if (movingPositions.Count == 0) return; for (int i = 1; i < serialized.serializedObject.targetObjects.Length; ++i) - using (GetUniversalRendererWithOnTileValidationEnabled((UniversalRenderPipelineAsset)serialized.serializedObject.targetObjects[i], out var otherIntersection)) + using (GetUniversalRendererWithTileOnlyModeEnabled((UniversalRenderPipelineAsset)serialized.serializedObject.targetObjects[i], out var otherIntersection)) { if (otherIntersection.Count == 0) return; @@ -1124,38 +1120,29 @@ IDisposable GetUniversalRendererWithOnTileValidationEnabled(UniversalRenderPipel movingPositions.Remove(stablePositionElement); if (k_ExpandedState[Expandable.Rendering] || k_ExpandedState[Expandable.Quality]) - names = ConcatCollectionInName(stablePositions, movingPositions); - - if (k_ExpandedState[Expandable.PostProcessing]) - namesWithPostProcess = ConcatCollectionInName(WherePostProcessingEnabled(stablePositions), WherePostProcessingEnabled(movingPositions)); + names = ConcatCollectionInName(stablePositions, movingPositions); } - lastOnTileValidationInfos = new OnTileValidationInfos(Styles.formatterOnTileValidationMultipleRenderer, names, namesWithPostProcess); + lastTileOnlyModeInfos = new TileOnlyModeInfos( + isSingleRendererCase: false, + rendererNames: names + ); } } - static void DisplayOnTileValidationWarning(SerializedProperty prop, Func shouldDisplayWarning, GUIContent label = null) + static void DisplayTileOnlyHelpBox(SerializedProperty prop, Func shouldDisplay, GUIContent label, MessageType messageType = MessageType.Warning, string customMessage = null) { - if (prop == null - || shouldDisplayWarning == null - || !lastOnTileValidationInfos.enabled - || !shouldDisplayWarning(prop)) + if (prop == null + || shouldDisplay == null + || !lastTileOnlyModeInfos.enabled + || !shouldDisplay(prop)) return; - EditorGUILayout.HelpBox( - string.Format(lastOnTileValidationInfos.formatter, label == null ? prop.displayName : label.text, lastOnTileValidationInfos.rendererNames), - MessageType.Warning); - } - - //variant for a whole section such as post processing - static void DisplayOnTileValidationWarningForPostProcessingSection(GUIContent label) - { - if (label == null || !lastOnTileValidationInfos.enabled || string.IsNullOrEmpty(lastOnTileValidationInfos.rendererNamesWithPostProcess)) - return; - - EditorGUILayout.HelpBox( - string.Format(lastOnTileValidationInfos.formatter, label.text, lastOnTileValidationInfos.rendererNamesWithPostProcess), - MessageType.Warning); + var fmt = !string.IsNullOrEmpty(customMessage) ? customMessage : Styles.formatterTileOnlyMode; + var labelText = label == null ? prop.displayName : label.text; + string message = string.Format(fmt, labelText, lastTileOnlyModeInfos.rendererNames); + + EditorGUILayout.HelpBox(message, messageType); } } } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs b/Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs index fbb1672aac1..72d028e36e1 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs @@ -145,16 +145,16 @@ internal static class Styles EditorGUIUtility.TrTextContent("\"BatchRendererGroup Variants\" setting must be \"Keep All\". To fix, modify Graphics settings and set \"BatchRendererGroup Variants\" to \"Keep All\"."); public static GUIContent staticBatchingInfoMessage = EditorGUIUtility.TrTextContent("Static Batching is not recommended when using GPU draw submission modes, performance may improve if Static Batching is disabled in Player Settings."); - public static GUIContent lightModeErrorMessage = - EditorGUIUtility.TrTextContent("Rendering Path must be set to Forward+ or Deferred+ for correct lighting and reflections. One or more entries in the RendererList are not set to this mode."); + public static readonly string lightModeErrorFormatter = L10n.Tr("Rendering Path must be set to Forward+ or Deferred+ for correct lighting and reflections. Renderers to change: {0}."); public static GUIContent renderGraphNotEnabledErrorMessage = EditorGUIUtility.TrTextContent("Render Graph must be enabled to use occlusion culling."); public static GUIContent stencilLodCrossFadeWarningMessage = EditorGUIUtility.TrTextContent("LOD Cross Fade with stencil dithering is not compatible with stencil override in Renderer."); - public static readonly string formatterOnTileValidationOneRenderer = L10n.Tr("'{0}' will be skipped because it is incompatible with the enabled 'On-Tile Validation' on the Renderer: {1}."); - public static readonly string formatterOnTileValidationMultipleRenderer = L10n.Tr("'{0}' will be skipped whenever an active renderer uses 'On-Tile Validation' setting, such as: {1}."); - public static readonly string suffixWhenDifferentPositionOnTileValidation = L10n.Tr(" (different position)"); + public static readonly string formatterTileOnlyMode = L10n.Tr("'{0}' will be skipped because it is incompatible with the enabled 'Tile-Only Mode'. Affected renderers: {1}."); + public static readonly string tileOnlyModeMaybeMessage = L10n.Tr("'{0}' might be skipped when 'Tile-Only Mode' is enabled. Renderer Features can provide this functionality, so behavior can vary. Affected renderers: {1}."); + public static readonly string msaaTileOnlyInfo = L10n.Tr("'{0}' is supported in 'Tile-Only Mode'. However, in the Editor and on platforms where the back buffer does not support MSAA, URP forces MSAA to None to keep data in Tile Memory. Affected renderers: {1}."); + public static readonly string suffixWhenDifferentPositionTileOnlyMode = L10n.Tr(" (different position)"); // Dropdown menu options public static string[] mainLightOptions = { "Disabled", "Per Pixel" }; diff --git a/Packages/com.unity.render-pipelines.universal/Editor/UniversalRendererDataEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/UniversalRendererDataEditor.cs index efff3a63dd5..a332b8e4567 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/UniversalRendererDataEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/UniversalRendererDataEditor.cs @@ -14,7 +14,6 @@ public class UniversalRendererDataEditor : ScriptableRendererDataEditor { private static class Styles { - public static readonly GUIContent RendererTitle = EditorGUIUtility.TrTextContent("Universal Renderer", "Custom Universal Renderer for Universal RP."); public static readonly GUIContent PostProcessIncluded = EditorGUIUtility.TrTextContent("Enabled", "Enables the use of post processing effects within the scene. If disabled, Unity excludes post processing renderer Passes, shaders and textures from the build."); public static readonly GUIContent PostProcessLabel = EditorGUIUtility.TrTextContent("Data", "The asset containing references to shaders and Textures that the Renderer uses for post-processing."); public static readonly GUIContent FilteringSectionLabel = EditorGUIUtility.TrTextContent("Filtering", "Settings that controls and define which layers the renderer draws."); @@ -30,9 +29,6 @@ private static class Styles public static readonly GUIContent CopyDepthModeLabel = EditorGUIUtility.TrTextContent("Depth Texture Mode", "Controls after which pass URP copies the scene depth. It has a significant impact on mobile devices bandwidth usage. It also allows to force a depth prepass to generate it."); public static readonly GUIContent DepthAttachmentFormat = EditorGUIUtility.TrTextContent("Depth Attachment Format", "Which format to use (if it is supported) when creating _CameraDepthAttachment."); public static readonly GUIContent DepthTextureFormat = EditorGUIUtility.TrTextContent("Depth Texture Format", "Which format to use (if it is supported) when creating _CameraDepthTexture."); - public static readonly GUIContent RenderPassLabel = EditorGUIUtility.TrTextContent("Native RenderPass", "Enables URP to use RenderPass API."); - - public static readonly GUIContent RenderPassSectionLabel = EditorGUIUtility.TrTextContent("RenderPass", "This section contains properties related to render passes."); public static readonly GUIContent ShadowsSectionLabel = EditorGUIUtility.TrTextContent("Shadows", "This section contains properties related to rendering shadows."); public static readonly GUIContent PostProcessingSectionLabel = EditorGUIUtility.TrTextContent("Post-processing", "This section contains properties related to rendering post-processing."); @@ -44,12 +40,11 @@ private static class Styles public static readonly GUIContent invalidStencilOverride = EditorGUIUtility.TrTextContent("Error: When using the deferred rendering path, the Renderer requires the control over the 4 highest bits of the stencil buffer to store Material types. The current combination of the stencil override options prevents the Renderer from controlling the required bits. Try changing one of the options to Replace."); public static readonly GUIContent intermediateTextureMode = EditorGUIUtility.TrTextContent("Intermediate Texture (Obsolete)", "Should be set to Auto. Controls when URP renders via an intermediate texture."); public static readonly GUIContent warningIntermediateTextureMode = EditorGUIUtility.TrTextContent("'Always' is Obsolete. Change it to Auto. This can improve performance. The setting will disappear once it is corrected to 'Auto'."); - public static readonly GUIContent deferredPlusIncompatibleWarning = EditorGUIUtility.TrTextContent("Deferred+ is only available with Render Graph. In compatibility mode, Deferred+ falls back to Forward+."); - public static readonly GUIContent onTileValidation = EditorGUIUtility.TrTextContent("On-Tile Validation", "Enables the feature validation to prevent going off tile. This is mainly useful for tile based architectures."); - public static readonly string onTileValidationWarning = L10n.Tr("On-Tile validation is enabled. ScriptableRendererFeatures and ScriptableRenderPasses that would trigger a GPU memory store/load action of the main render targets are not allowed."); - public static readonly string deferredOnTileValidationWarning = L10n.Tr("Deferred rendering path is incompatible with the enabled 'On-Tile Validation' and will fallback to Forward."); - public static readonly string deferredPlusOnTileValidationWarning = L10n.Tr("Deferred+ rendering path is incompatible with the enabled 'On-Tile Validation' and will fallback to Forward+."); - public static readonly string postProcessingOnTileValidationWarning = L10n.Tr("'Post-processing' will be skipped because it is incompatible with the enabled 'On-Tile Validation'."); + public static readonly GUIContent tileOnlyMode = EditorGUIUtility.TrTextContent("Tile-Only Mode", "Restricts render passes to avoid memory load/store of main camera targets, keeping them in on‑chip tile memory. This is a potential GPU performance optimization on Tile-Based GPU architectures. It activates additional RenderGaph validation. Some features may be disabled or fall back. See docs for details."); + public static readonly string tileOnlyModeWarning = L10n.Tr("Tile-Only mode will disable or block features, including Renderer Features and Render Passes, that would trigger GPU memory store/load actions."); + public static readonly string deferredTileOnlyModeWarning = L10n.Tr("Deferred rendering path is incompatible with the enabled 'Tile-Only Mode'. Change this to Forward."); + public static readonly string deferredPlusTileOnlyModeWarning = L10n.Tr("Deferred+ rendering path is incompatible with the enabled 'Tile-Only Mode'. Change this to Forward+."); + public static readonly string postProcessingTileOnlyModeWarning = L10n.Tr("'Post-processing' is incompatible with the enabled 'Tile-Only Mode'. Disable this setting. Renderer Features can add On-Tile Post Processing."); } SerializedProperty m_PrepassLayerMask; @@ -66,7 +61,7 @@ private static class Styles SerializedProperty m_Shaders; SerializedProperty m_ShadowTransparentReceiveProp; SerializedProperty m_IntermediateTextureMode; - SerializedProperty m_OnTileValidation; + SerializedProperty m_TileOnlyMode; List m_DepthFormatStrings = new List(); @@ -86,7 +81,7 @@ private void OnEnable() m_Shaders = serializedObject.FindProperty("shaders"); m_ShadowTransparentReceiveProp = serializedObject.FindProperty("m_ShadowTransparentReceive"); m_IntermediateTextureMode = serializedObject.FindProperty("m_IntermediateTextureMode"); - m_OnTileValidation = serializedObject.FindProperty("m_OnTileValidation"); + m_TileOnlyMode = serializedObject.FindProperty("m_TileOnlyMode"); } private void PopulateCompatibleDepthFormats(int renderingMode) @@ -189,15 +184,15 @@ public override void OnInspectorGUI() depthFormatIndex = GetDepthFormatIndex((DepthFormat)m_DepthAttachmentFormat.intValue, m_RenderingMode.intValue); } - if (m_OnTileValidation.boolValue) + if (m_TileOnlyMode.boolValue) { switch ((RenderingMode)m_RenderingMode.intValue) { case RenderingMode.Deferred: - EditorGUILayout.HelpBox(Styles.deferredOnTileValidationWarning, MessageType.Warning); + EditorGUILayout.HelpBox(Styles.deferredTileOnlyModeWarning, MessageType.Error); break; case RenderingMode.DeferredPlus: - EditorGUILayout.HelpBox(Styles.deferredPlusOnTileValidationWarning, MessageType.Warning); + EditorGUILayout.HelpBox(Styles.deferredPlusTileOnlyModeWarning, MessageType.Error); break; } } @@ -236,9 +231,9 @@ public override void OnInspectorGUI() EditorGUILayout.PropertyField(m_DepthTextureFormat, Styles.DepthTextureFormat); - EditorGUILayout.PropertyField(m_OnTileValidation, Styles.onTileValidation); - if (m_OnTileValidation.boolValue) - EditorGUILayout.HelpBox(Styles.onTileValidationWarning, MessageType.Warning); + EditorGUILayout.PropertyField(m_TileOnlyMode, Styles.tileOnlyMode); + if (m_TileOnlyMode.boolValue) + EditorGUILayout.HelpBox(Styles.tileOnlyModeWarning, MessageType.Info); EditorGUI.indentLevel--; EditorGUILayout.Space(); @@ -256,8 +251,8 @@ public override void OnInspectorGUI() { m_PostProcessData.objectReferenceValue = postProcessIncluded ? PostProcessData.GetDefaultPostProcessData() : null; } - if (postProcessIncluded && m_OnTileValidation.boolValue) - EditorGUILayout.HelpBox(Styles.postProcessingOnTileValidationWarning, MessageType.Warning); + if (postProcessIncluded && m_TileOnlyMode.boolValue) + EditorGUILayout.HelpBox(Styles.postProcessingTileOnlyModeWarning, MessageType.Error); EditorGUI.indentLevel++; EditorGUILayout.PropertyField(m_PostProcessData, Styles.PostProcessLabel); EditorGUI.indentLevel--; diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessFeature.cs index 6d53065509d..0f5f3434637 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessFeature.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessFeature.cs @@ -99,7 +99,7 @@ public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingD m_OnTilePostProcessPass.Setup(ref m_OnTilePostProcessMaterial); m_OnTilePostProcessPass.renderPassEvent = postProcessingEvent; - m_OnTilePostProcessPass.m_UseTextureReadFallback = !universalRenderer.onTileValidation; + m_OnTilePostProcessPass.m_UseTextureReadFallback = !universalRenderer.useTileOnlyMode; renderer.EnqueuePass(m_ColorGradingLutPass); renderer.EnqueuePass(m_OnTilePostProcessPass); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs index 4be6c781413..f238c9d5287 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs @@ -107,6 +107,9 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer // The code below can then also use resourceData.isActiveTargetBackBuffer correctly for robustness. resourceData.SwitchActiveTexturesToBackbuffer(); + // Reset keywords + m_OnTileUberMaterial.shaderKeywords = null; + SetupVignette(m_OnTileUberMaterial, cameraData.xr, srcDesc.width, srcDesc.height, vignette); SetupLut(m_OnTileUberMaterial, colorLookup, colorAdjustments, lutSize); SetupTonemapping(m_OnTileUberMaterial, tonemapping, isHdrGrading: postProcessingData.gradingMode == ColorGradingMode.HighDynamicRange); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs index 66cbf0ec0d3..89f7d252cd7 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs @@ -809,7 +809,9 @@ internal static Vector4 GetFinalBlitScaleBias(in RasterGraphContext renderGraphC { RTHandle srcRTHandle = source; Vector2 scale = srcRTHandle is { useScaling: true } ? new Vector2(srcRTHandle.rtHandleProperties.rtHandleScale.x, srcRTHandle.rtHandleProperties.rtHandleScale.y) : Vector2.one; + var yflip = renderGraphContext.GetTextureUVOrigin(in source) != renderGraphContext.GetTextureUVOrigin(in destination); + Vector4 scaleBias = yflip ? new Vector4(scale.x, -scale.y, 0, scale.y) : new Vector4(scale.x, scale.y, 0, 0); return scaleBias; @@ -845,7 +847,7 @@ internal static TextureUVOrigin GetBackBufferUVOrientation(UniversalCameraData c internal static TextureUVOrigin GetCameraTargetsUVOrientation(UniversalCameraData cameraData) { var universalRenderer = cameraData.renderer as UniversalRenderer; - bool onTileRenderer = (universalRenderer == null) ? false : universalRenderer.onTileValidation; + bool onTileRenderer = (universalRenderer == null) ? false : universalRenderer.useTileOnlyMode; if (onTileRenderer) { diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineRenderGraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineRenderGraph.cs index 352f4e86e15..9b0b625e3c6 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineRenderGraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineRenderGraph.cs @@ -8,7 +8,7 @@ public sealed partial class UniversalRenderPipeline static void RecordAndExecuteRenderGraph(RenderGraph renderGraph, ScriptableRenderContext context, ScriptableRenderer renderer, CommandBuffer cmd, Camera camera) { var universalRenderer = renderer as UniversalRenderer; - var renderTextureUVOriginStrategy = (universalRenderer != null && universalRenderer.onTileValidation) ? + var renderTextureUVOriginStrategy = (universalRenderer != null && universalRenderer.useTileOnlyMode) ? RenderTextureUVOriginStrategy.PropagateAttachmentOrientation : RenderTextureUVOriginStrategy.BottomLeft; RenderGraphParameters rgParams = new RenderGraphParameters diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs index 7ff575ed824..57d2ef3c5ab 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs @@ -204,7 +204,7 @@ internal RenderingMode renderingModeActual { // A Renderer cannot be switched from On-Tile to not On-Tile. // We make assumptions in the constructor to create the passes. - internal bool onTileValidation { get; } + internal bool useTileOnlyMode { get; } internal GraphicsFormat cameraDepthTextureFormat { get => (m_CameraDepthTextureFormat != DepthFormat.Default) ? (GraphicsFormat)m_CameraDepthTextureFormat : CoreUtils.GetDefaultDepthStencilFormat(); } internal GraphicsFormat cameraDepthAttachmentFormat { get => (m_CameraDepthAttachmentFormat != DepthFormat.Default) ? (GraphicsFormat)m_CameraDepthAttachmentFormat : CoreUtils.GetDefaultDepthStencilFormat(); } @@ -263,15 +263,15 @@ public UniversalRenderer(UniversalRendererData data) : base(data) transparentLayerMask = data.transparentLayerMask; shadowTransparentReceive = data.shadowTransparentReceive; - onTileValidation = data.onTileValidation; + useTileOnlyMode = data.tileOnlyMode; // The On-Tile Renderer does not support WebGL. - if (onTileValidation && IsWebGL()) + if (useTileOnlyMode && IsWebGL()) { - onTileValidation = false; + useTileOnlyMode = false; } - m_ValidationHandler = new ValidationHandler(); + m_ValidationHandler = new ValidationHandler(useTileOnlyMode); var asset = UniversalRenderPipeline.asset; if (asset != null && asset.supportsLightCookies) @@ -309,12 +309,27 @@ public UniversalRenderer(UniversalRendererData data) : base(data) UpdateSupportedRenderingFeatures(); - if (onTileValidation) + // We log warnings to nudge users towards fixing the settings. Although we automatically fix these, its bad for the user to keep + // incompatible settings. The reason is that this automatic fixing has downsides for the users: if they toggle the Tile-Only + // setting, they get a different mix of settings with different visual results. Also the URP asset can have incompabitle settings. + // However, because these can be shared between different renderers, we can't log warnings. We also have warnings in the + // Inspector UI but these can easily be missed by the user. + if (useTileOnlyMode) { - // We don't change the camera setting. Extensions like our own On-Tile Post Processing - // use this as well. We just make sure we disable the internal post processing on the - // renderer because this is not on-tile compatible currently. - postProcessEnabled = false; + if (postProcessEnabled) + { + Debug.LogWarning($"The built-in Post Processing on the URP Renderer '{data.name}' is not compatible with the enabled Tile-Only Mode setting. Disable the post processing on the renderer asset."); + + // We don't change the camera setting. Extensions like our own On-Tile Post Processing + // use this as well. We just make sure we disable the internal post processing on the + // renderer because this is not on-tile compatible currently. + postProcessEnabled = false; + } + + if (renderingModeRequested == RenderingMode.Deferred || renderingModeRequested == RenderingMode.DeferredPlus) + { + Debug.LogWarning($"Rendering path Deferred on the URP Renderer '{data.name}' is not compatible with the enabled Tile-Only Mode setting. Change this to Forward(+) on the renderer asset."); + } } // Note: Since all custom render passes inject first and we have stable sort, @@ -418,7 +433,7 @@ public UniversalRenderer(UniversalRendererData data) : base(data) internal override void UpdateSupportedRenderingFeatures() { - if (onTileValidation) + if (useTileOnlyMode) { supportedRenderingFeatures.supportsHDR = false; // We need a blit pass to support hdr. supportedRenderingFeatures.postProcessing = false; // Internal pp does not support on-tile. diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererData.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererData.cs index 8a13ae00419..26430b7dd94 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererData.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererData.cs @@ -154,7 +154,7 @@ static void CreateUniversalRendererData() bool m_AccurateGbufferNormals = false; [SerializeField] IntermediateTextureMode m_IntermediateTextureMode = IntermediateTextureMode.Always; - [SerializeField] bool m_OnTileValidation = false; + [SerializeField] bool m_TileOnlyMode = false; /// protected override ScriptableRenderer Create() @@ -348,19 +348,20 @@ public IntermediateTextureMode intermediateTextureMode } /// - /// On-Tile validation validates features to prevent going off tile. - /// This is mainly useful for tile based architectures. + /// Tile-Only Mode restricts render passes to avoid memory load/store of main camera targets, keeping them in on‑chip tile memory. + /// It activates additional RenderGaph validation. Some features may be disabled or fall back. See docs for details. + /// This is a potential GPU performance optimization on Tile-Based GPU architectures. /// - public bool onTileValidation + public bool tileOnlyMode { - get => m_OnTileValidation; + get => m_TileOnlyMode; set { - if (m_OnTileValidation == value) + if (m_TileOnlyMode == value) return; SetDirty(); - m_OnTileValidation = value; + m_TileOnlyMode = value; } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs index c083e4b9cb5..735807ba34c 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs @@ -589,7 +589,7 @@ public override void OnBeginRenderGraphFrame() { UniversalResourceData resourceData = frameData.Get(); resourceData.InitFrame(); - m_ValidationHandler.OnBeginRenderGraphFrame(onTileValidation); + m_ValidationHandler.OnBeginRenderGraphFrame(); } internal override void OnRecordRenderGraph(RenderGraph renderGraph, ScriptableRenderContext context) @@ -1421,7 +1421,7 @@ private void OnAfterRendering(RenderGraph renderGraph, bool applyPostProcessing) //Checking resourceData.isActiveTargetBackBuffer is a robust way to check if this has happened, by our own code or by the user. if (!resourceData.isActiveTargetBackBuffer && cameraData.resolveFinalTarget) { - Debug.Assert(!onTileValidation, "Adding the final blit pass when On-Tile Validation is on. This is not valid and will throw an exception. Likely, an On-Tile Feature has requested the intermediate textures but did not correctly copy the data to the backbuffer."); + Debug.Assert(!useTileOnlyMode, "Adding the final blit pass when Tile-Only Mode is on. This is not valid and will throw an exception. Likely, an On-Tile Feature has requested the intermediate textures but did not correctly copy the data to the backbuffer."); debugHandler?.UpdateShaderGlobalPropertiesForFinalValidationPass(renderGraph, cameraData, !resolveToDebugScreen); @@ -1462,7 +1462,7 @@ private void OnAfterRendering(RenderGraph renderGraph, bool applyPostProcessing) m_DrawOverlayUIPass.RenderOverlayUIToolkitAndUGUI(renderGraph, frameData, in color, in depth); // IMGUI uses an Unsafe pass and is therefore not supported by the on-tile renderer. - if(!(onTileValidation && cameraData.cameraType == CameraType.Game)) + if(!(useTileOnlyMode && cameraData.cameraType == CameraType.Game)) m_DrawOverlayUIPass.RenderOverlayIMGUI(renderGraph, frameData, in color, in depth); } @@ -1611,7 +1611,7 @@ void ImportBackBuffers(RenderGraph renderGraph, UniversalCameraData cameraData, // To target the BB directly, either we don't render to the intermediate textures, or we render with the on-tile renderer. // The on-tile renderer guarantees a single native render pass for the draw passes to the backbuffer, even though // it potentially uses the intermediate textures as temporary attachments inside of the NRP. - bool intermediateTexturesAreSampledAsTextures = s_RequiresIntermediateAttachments && !onTileValidation; + bool intermediateTexturesAreSampledAsTextures = s_RequiresIntermediateAttachments && !useTileOnlyMode; bool noStoreOnlyResolveBBColor = !intermediateTexturesAreSampledAsTextures && !isNativeRenderingAfterURP && (cameraData.cameraTargetDescriptor.msaaSamples > 1); TextureUVOrigin backbufferTextureUVOrigin = RenderingUtils.GetBackBufferUVOrientation(cameraData); @@ -1743,7 +1743,7 @@ void CreateIntermediateCameraColorAttachment(RenderGraph renderGraph, UniversalC desc.autoGenerateMips = false; desc.filterMode = FilterMode.Bilinear; desc.wrapMode = TextureWrapMode.Clamp; - desc.bindTextureMS = onTileValidation && desc.msaaSamples != MSAASamples.None; //Needed for GLES fallback + desc.bindTextureMS = useTileOnlyMode && desc.msaaSamples != MSAASamples.None; //Needed for GLES fallback // When there's a single camera setup, there's no need to do the double buffer technique with attachment A/B, in order to save memory allocation // and simplify the workflow by using a RenderGraph texture directly. diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/ValidationHandler.cs b/Packages/com.unity.render-pipelines.universal/Runtime/ValidationHandler.cs index 9ef3d2af4b4..fecc716d4c6 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/ValidationHandler.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/ValidationHandler.cs @@ -6,23 +6,29 @@ namespace UnityEngine.Rendering.Universal { internal class ValidationHandler { + string k_ErrorMesssageHowToResolve = "The On-Tile Validation layer is activated with the setting 'Tile-Only Mode' on the URP Renderer. " + + "When activated, it is not allowed to sample (RenderGraph.UseTexture) the cameraColor or cameraDepth (intermediate) textures or the GBuffers or any copies of those." + + "You need to disable any of the following that could cause the issue: a URP setting that would break the native render pass, a ScriptableRenderPass that is enqueued " + + "from script, or a ScriptableRenderFeature that is installed on your URP Renderer.\n"; + OnTileValidationLayer m_OnTileValidationLayer; public bool active { get; set; } - [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] - public void OnBeginRenderGraphFrame(bool onTileValidation) + public ValidationHandler(bool onTileValidation) { if (onTileValidation) - { - if (m_OnTileValidationLayer == null) - m_OnTileValidationLayer = new OnTileValidationLayer(); - } - else - { - m_OnTileValidationLayer = null; + { + m_OnTileValidationLayer = new OnTileValidationLayer(); + m_OnTileValidationLayer.errorMessageHowToResolve = k_ErrorMesssageHowToResolve; } } + [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] + public void OnBeginRenderGraphFrame() + { + + } + [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] public void OnBeforeRendering(RenderGraph renderGraph, UniversalResourceData resourceData) { diff --git a/Packages/com.unity.render-pipelines.universal/Tests/Runtime/RenderGraphConstraintsTests.cs b/Packages/com.unity.render-pipelines.universal/Tests/Runtime/RenderGraphConstraintsTests.cs index b25db4a6ca2..9060d114094 100644 --- a/Packages/com.unity.render-pipelines.universal/Tests/Runtime/RenderGraphConstraintsTests.cs +++ b/Packages/com.unity.render-pipelines.universal/Tests/Runtime/RenderGraphConstraintsTests.cs @@ -160,7 +160,7 @@ public class OnTileValidationConfiguration public bool occlusionCulling { get; set; } = false; public float renderScale { get; set; } = 1.0f; public bool postProcessingEnabled { get; set; } = false; - public bool onTileValidation { get; set; } = false; + public bool tileOnlyMode { get; set; } = false; public List rendererFeatures { get; set; } = new(); @@ -187,7 +187,7 @@ bool TryApplyToAssetAndRenderer(UniversalRenderPipelineAsset asset, UniversalRen } // Apply renderer settings - rendererData.onTileValidation = onTileValidation; + rendererData.tileOnlyMode = tileOnlyMode; if (renderingMode != RenderingMode.Forward && !s_RenderingModes.Contains(renderingMode)) return false; @@ -245,7 +245,7 @@ public IEnumerator URPSettingsShouldNotCauseNonMemorylessTargets(OnTileValidatio config.ApplyToAssetAndRenderer(m_UniversalRenderPipelineAsset, m_UniversalRendererData); // Act - m_UniversalRendererData.onTileValidation = true; + m_UniversalRendererData.tileOnlyMode = true; yield return null; @@ -274,10 +274,10 @@ public IEnumerator CameraStackingProduceWarning() LogAssert.Expect(LogType.Warning, new Regex("does not support Overlay cameras")); LogAssert.Expect(LogType.Warning, new Regex("camera overlay no longer exists")); - m_UniversalRendererData.onTileValidation = true; + m_UniversalRendererData.tileOnlyMode = true; yield return null; - m_UniversalRendererData.onTileValidation = false; + m_UniversalRendererData.tileOnlyMode = false; yield return null; From a604001108ce893dcb27d310e60b0d236368a28e Mon Sep 17 00:00:00 2001 From: Florian Penzkofer Date: Mon, 2 Mar 2026 10:34:13 +0000 Subject: [PATCH 24/95] Fix seems in terrain with instancing --- .../ShaderLibrary/Common.hlsl | 12 ++++++------ .../Shaders/Terrain/TerrainLitInput.hlsl | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl b/Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl index cd2a7d8d12b..fba8687030d 100644 --- a/Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl +++ b/Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl @@ -1510,13 +1510,13 @@ void ApplyDepthOffsetPositionInput(float3 V, float depthOffsetVS, float3 viewFor // For the built-in target this is already a defined symbol #ifndef BUILTIN_TARGET_API -real4 PackHeightmap(real height) +float4 PackHeightmap(float height) { uint a = (uint)(65535.0 * height); - return real4((a >> 0) & 0xFF, (a >> 8) & 0xFF, 0, 0) / 255.0; + return float4((a >> 0) & 0xFF, (a >> 8) & 0xFF, 0, 0) / 255.0; } -real UnpackHeightmap(real4 height) +float UnpackHeightmap(float4 height) { return (height.r + height.g * 256.0) / 257.0; // (255.0 * height.r + 255.0 * 256.0 * height.g) / 65535.0 } @@ -1526,12 +1526,12 @@ real UnpackHeightmap(real4 height) // For the built-in target this is already a defined symbol #ifndef BUILTIN_TARGET_API -real4 PackHeightmap(real height) +float4 PackHeightmap(float height) { - return real4(height, 0, 0, 0); + return float4(height, 0, 0, 0); } -real UnpackHeightmap(real4 height) +float UnpackHeightmap(float4 height) { return height.r; } diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitInput.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitInput.hlsl index 259b26a3876..c02c6a44bed 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitInput.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitInput.hlsl @@ -74,7 +74,7 @@ TEXTURE2D(_MetallicTex); SAMPLER(sampler_MetallicTex); #endif #ifdef UNITY_INSTANCING_ENABLED -TEXTURE2D(_TerrainHeightmapTexture); +TYPED_TEXTURE2D(float4, _TerrainHeightmapTexture); TEXTURE2D(_TerrainNormalmapTexture); SAMPLER(sampler_TerrainNormalmapTexture); #endif From d814d003d85cf56083963218f464befbfa356071 Mon Sep 17 00:00:00 2001 From: Adrien Moulin Date: Mon, 2 Mar 2026 22:09:02 +0000 Subject: [PATCH 25/95] 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 40c98cedd19..ba71f6de3fe 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 @@ -88,8 +88,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 994613b46b31533af75d63ae50f7ecd9831ef455 Mon Sep 17 00:00:00 2001 From: Angela Dematte Date: Mon, 2 Mar 2026 22:09:05 +0000 Subject: [PATCH 26/95] Revert "Disable several Material unstable tests" --- .../GraphicTests/Tests/HDRP_Graphics_Tests.cs | 80 ------------------- 1 file changed, 80 deletions(-) diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Tests/HDRP_Graphics_Tests.cs b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Tests/HDRP_Graphics_Tests.cs index 1dfcc72f25d..0760b8f8031 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Tests/HDRP_Graphics_Tests.cs +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Tests/HDRP_Graphics_Tests.cs @@ -214,107 +214,27 @@ public void SetUpContext() graphicsDeviceTypes: new[] { GraphicsDeviceType.Vulkan }, runtimePlatforms: new[] { RuntimePlatform.LinuxEditor } )] - [IgnoreGraphicsTest( - "4088_DRS-DLSS-Hardware", - "Unstable: https://jira.unity3d.com/browse/UUM-135194", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] - [IgnoreGraphicsTest( - "4089_DRS-DLSS-Software", - "Unstable: https://jira.unity3d.com/browse/UUM-135194", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] - [IgnoreGraphicsTest( - "4090_DRS-Hardware", - "Unstable: https://jira.unity3d.com/browse/UUM-135195", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] - [IgnoreGraphicsTest( - "4091_DRS-Software", - "Unstable: https://jira.unity3d.com/browse/UUM-135195", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] [IgnoreGraphicsTest( "4096_DRS-TAAU-Hardware$", "Very small fringing across edges. Maybe a sampling artifact?", graphicsDeviceTypes: new[] { GraphicsDeviceType.Metal } )] - [IgnoreGraphicsTest( - "4096_DRS-TAAU-Hardware", - "Unstable: https://jira.unity3d.com/browse/UUM-135200", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] - [IgnoreGraphicsTest( - "4097_DRS-TAAU-Software", - "Unstable: https://jira.unity3d.com/browse/UUM-135200", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] - [IgnoreGraphicsTest( - "4099_DRS-STP-Software", - "Unstable: https://jira.unity3d.com/browse/UUM-135197", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] - [IgnoreGraphicsTest( - "4100_DRS-STP-Hardware", - "Unstable: https://jira.unity3d.com/browse/UUM-135197", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] [IgnoreGraphicsTest( "4101_FP16Alpha$", "Outdated ref-image.", graphicsDeviceTypes: new[] { GraphicsDeviceType.Metal } )] - [IgnoreGraphicsTest( - "4102_DRS-CAS-AfterPost", - "Unstable: https://jira.unity3d.com/browse/UUM-135195", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] - [IgnoreGraphicsTest( - "4103_DRS-DLSS-AfterPost", - "Unstable: https://jira.unity3d.com/browse/UUM-135195", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] - [IgnoreGraphicsTest( - "4104_DRS-STP-AfterPost", - "Unstable: https://jira.unity3d.com/browse/UUM-135197", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] [IgnoreGraphicsTest( "4105_LensFlareScreenSpace$", "(Intel Mac) Lens-flare behaviour seems to be different from all the other platforms.", graphicsDeviceTypes: new[] { GraphicsDeviceType.Metal }, architectures: new[] { Architecture.X64 } )] - [IgnoreGraphicsTest( - "4106_DRS-TAAU-AfterPost", - "Unstable: https://jira.unity3d.com/browse/UUM-135200", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] [IgnoreGraphicsTest( "4106_DRS-TAAU-AfterPost$", "Very small fringing across edges. Maybe a sampling artifact?", graphicsDeviceTypes: new[] { GraphicsDeviceType.Metal } )] - [IgnoreGraphicsTest( - "4107_DRS-FSR2-Hardware", - "Unstable: https://jira.unity3d.com/browse/UUM-135188", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] - [IgnoreGraphicsTest( - "4108_DRS-FSR2-Software", - "Unstable: https://jira.unity3d.com/browse/UUM-135188", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] - [IgnoreGraphicsTest( - "4109_DRS-FSR2-AfterPost", - "Unstable: https://jira.unity3d.com/browse/UUM-135188", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] - [IgnoreGraphicsTest( - "4111_DRS-DLSS-With-CustomPass", - "Unstable: https://jira.unity3d.com/browse/UUM-135188", - runtimePlatforms: new[] { RuntimePlatform.WindowsEditor } - )] [IgnoreGraphicsTest( "5006_Pbr_Sky_Low_Altitude$", "Differences in banding around the horizon.", From 68cce8d0fdd256c631afa80a6e306c09c289d758 Mon Sep 17 00:00:00 2001 From: Paul Melamed Date: Tue, 3 Mar 2026 03:04:03 +0000 Subject: [PATCH 27/95] Remove _SurfaceType --- .../Shaders/BakedLitForwardPass.hlsl | 5 +- .../Shaders/BakedLitInput.hlsl | 6 +-- .../Shaders/LitForwardPass.hlsl | 3 +- .../Shaders/LitInput.hlsl | 6 +-- .../Particles/ParticlesLitForwardPass.hlsl | 3 +- .../Shaders/Particles/ParticlesLitInput.hlsl | 2 +- .../ParticlesSimpleLitForwardPass.hlsl | 3 +- .../Particles/ParticlesSimpleLitInput.hlsl | 2 +- .../Particles/ParticlesUnlitForwardPass.hlsl | 3 +- .../Particles/ParticlesUnlitInput.hlsl | 2 +- .../Shaders/SimpleLitForwardPass.hlsl | 3 +- .../Shaders/SimpleLitInput.hlsl | 6 +-- .../Shaders/UnlitForwardPass.hlsl | 3 +- .../Shaders/UnlitInput.hlsl | 6 +-- .../Shaders/Utils/SurfaceType.hlsl | 47 +++++++++++++++++++ .../Shaders/Utils/SurfaceType.hlsl.meta | 3 ++ 16 files changed, 72 insertions(+), 31 deletions(-) create mode 100644 Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl create mode 100644 Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl.meta diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/BakedLitForwardPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/BakedLitForwardPass.hlsl index 3e40f5c0132..5e3452c7934 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/BakedLitForwardPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/BakedLitForwardPass.hlsl @@ -1,6 +1,7 @@ #ifndef UNIVERSAL_BAKEDLIT_FORWARD_PASS_INCLUDED #define UNIVERSAL_BAKEDLIT_FORWARD_PASS_INCLUDED +#include "BakedLitInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #if defined(LOD_FADE_CROSSFADE) #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" @@ -174,7 +175,7 @@ void BakedLitForwardPassFragment( half4 finalColor = UniversalFragmentBakedLit(inputData, color, alpha, normalTS); - finalColor.a = OutputAlpha(finalColor.a, _Surface); + finalColor.a = OutputAlpha(finalColor.a, IsSurfaceTypeTransparent()); outColor = finalColor; #ifdef _WRITE_RENDERING_LAYERS @@ -182,4 +183,4 @@ void BakedLitForwardPassFragment( #endif } -#endif \ No newline at end of file +#endif diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl index 735e3d27493..984d549d9f0 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl @@ -3,6 +3,7 @@ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceInput.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" +#include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl" CBUFFER_START(UnityPerMaterial) float4 _BaseMap_ST; @@ -11,7 +12,6 @@ CBUFFER_START(UnityPerMaterial) half _Cutoff; half _Glossiness; half _Metallic; - half _Surface; UNITY_TEXTURE_STREAMING_DEBUG_VARS; CBUFFER_END @@ -22,14 +22,12 @@ UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata) UNITY_DOTS_INSTANCED_PROP(float , _Cutoff) UNITY_DOTS_INSTANCED_PROP(float , _Glossiness) UNITY_DOTS_INSTANCED_PROP(float , _Metallic) - UNITY_DOTS_INSTANCED_PROP(float , _Surface) UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata) static float4 unity_DOTS_Sampled_BaseColor; static float unity_DOTS_Sampled_Cutoff; static float unity_DOTS_Sampled_Glossiness; static float unity_DOTS_Sampled_Metallic; -static float unity_DOTS_Sampled_Surface; void SetupDOTSBakedLitMaterialPropertyCaches() { @@ -37,7 +35,6 @@ void SetupDOTSBakedLitMaterialPropertyCaches() unity_DOTS_Sampled_Cutoff = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Cutoff); unity_DOTS_Sampled_Glossiness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Glossiness); unity_DOTS_Sampled_Metallic = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Metallic); - unity_DOTS_Sampled_Surface = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Surface); } #undef UNITY_SETUP_DOTS_MATERIAL_PROPERTY_CACHES @@ -47,7 +44,6 @@ void SetupDOTSBakedLitMaterialPropertyCaches() #define _Cutoff unity_DOTS_Sampled_Cutoff #define _Glossiness unity_DOTS_Sampled_Glossiness #define _Metallic unity_DOTS_Sampled_Metallic -#define _Surface unity_DOTS_Sampled_Surface #endif diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/LitForwardPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/LitForwardPass.hlsl index 57e17c3f09a..1764c2a7f21 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/LitForwardPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/LitForwardPass.hlsl @@ -1,6 +1,7 @@ #ifndef UNIVERSAL_FORWARD_LIT_PASS_INCLUDED #define UNIVERSAL_FORWARD_LIT_PASS_INCLUDED +#include "LitInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" @@ -273,7 +274,7 @@ void LitPassFragment( half4 color = UniversalFragmentPBR(inputData, surfaceData); color.rgb = MixFog(color.rgb, inputData.fogCoord); - color.a = OutputAlpha(color.a, IsSurfaceTypeTransparent(_Surface)); + color.a = OutputAlpha(color.a, IsSurfaceTypeTransparent()); outColor = color; diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl index f5032e24fe1..badb5448dca 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl @@ -7,6 +7,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ParallaxMapping.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" +#include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl" #if defined(_DETAIL_MULX2) || defined(_DETAIL_SCALED) #define _DETAIL @@ -30,7 +31,6 @@ half _ClearCoatMask; half _ClearCoatSmoothness; half _DetailAlbedoMapScale; half _DetailNormalMapScale; -half _Surface; UNITY_TEXTURE_STREAMING_DEBUG_VARS; CBUFFER_END @@ -53,7 +53,6 @@ UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata) UNITY_DOTS_INSTANCED_PROP(float , _ClearCoatSmoothness) UNITY_DOTS_INSTANCED_PROP(float , _DetailAlbedoMapScale) UNITY_DOTS_INSTANCED_PROP(float , _DetailNormalMapScale) - UNITY_DOTS_INSTANCED_PROP(float , _Surface) UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata) // Here, we want to avoid overriding a property like e.g. _BaseColor with something like this: @@ -79,7 +78,6 @@ static float unity_DOTS_Sampled_ClearCoatMask; static float unity_DOTS_Sampled_ClearCoatSmoothness; static float unity_DOTS_Sampled_DetailAlbedoMapScale; static float unity_DOTS_Sampled_DetailNormalMapScale; -static float unity_DOTS_Sampled_Surface; void SetupDOTSLitMaterialPropertyCaches() { @@ -96,7 +94,6 @@ void SetupDOTSLitMaterialPropertyCaches() unity_DOTS_Sampled_ClearCoatSmoothness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _ClearCoatSmoothness); unity_DOTS_Sampled_DetailAlbedoMapScale = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _DetailAlbedoMapScale); unity_DOTS_Sampled_DetailNormalMapScale = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _DetailNormalMapScale); - unity_DOTS_Sampled_Surface = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Surface); } #undef UNITY_SETUP_DOTS_MATERIAL_PROPERTY_CACHES @@ -115,7 +112,6 @@ void SetupDOTSLitMaterialPropertyCaches() #define _ClearCoatSmoothness unity_DOTS_Sampled_ClearCoatSmoothness #define _DetailAlbedoMapScale unity_DOTS_Sampled_DetailAlbedoMapScale #define _DetailNormalMapScale unity_DOTS_Sampled_DetailNormalMapScale -#define _Surface unity_DOTS_Sampled_Surface #endif diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLitForwardPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLitForwardPass.hlsl index 7245d5f826a..55e73a79198 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLitForwardPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLitForwardPass.hlsl @@ -1,6 +1,7 @@ #ifndef UNIVERSAL_PARTICLES_FORWARD_LIT_PASS_INCLUDED #define UNIVERSAL_PARTICLES_FORWARD_LIT_PASS_INCLUDED +#include "ParticlesLitInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Particles.hlsl" @@ -135,7 +136,7 @@ half4 ParticlesLitFragment(VaryingsParticle input) : SV_Target half4 color = UniversalFragmentPBR(inputData, surfaceData); color.rgb = MixFog(color.rgb, inputData.fogCoord); - color.a = OutputAlpha(color.a, IsSurfaceTypeTransparent(_Surface)); + color.a = OutputAlpha(color.a, IsSurfaceTypeTransparent()); return color; } diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLitInput.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLitInput.hlsl index 30d54e1a1c3..60f4fd34e82 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLitInput.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLitInput.hlsl @@ -3,6 +3,7 @@ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesInput.hlsl" +#include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl" // NOTE: Do not ifdef the properties here as SRP batcher can not handle different layouts. CBUFFER_START(UnityPerMaterial) @@ -19,7 +20,6 @@ half _Smoothness; half _BumpScale; half _DistortionStrengthScaled; half _DistortionBlend; -half _Surface; CBUFFER_END #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Particles.hlsl" diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesSimpleLitForwardPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesSimpleLitForwardPass.hlsl index 6de33666093..e3bc6da587e 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesSimpleLitForwardPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesSimpleLitForwardPass.hlsl @@ -1,6 +1,7 @@ #ifndef UNIVERSAL_PARTICLES_FORWARD_SIMPLE_LIT_PASS_INCLUDED #define UNIVERSAL_PARTICLES_FORWARD_SIMPLE_LIT_PASS_INCLUDED +#include "ParticlesSimpleLitInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Particles.hlsl" @@ -145,7 +146,7 @@ half4 ParticlesLitFragment(VaryingsParticle input) : SV_Target half4 color = UniversalFragmentBlinnPhong(inputData, diffuse, specularGloss, specularGloss.a, emission, alpha, normalTS); color.rgb = MixFog(color.rgb, inputData.fogCoord); - color.a = OutputAlpha(color.a, IsSurfaceTypeTransparent(_Surface)); + color.a = OutputAlpha(color.a, IsSurfaceTypeTransparent()); return color; } diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesSimpleLitInput.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesSimpleLitInput.hlsl index c1486ecb939..7316b695dd7 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesSimpleLitInput.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesSimpleLitInput.hlsl @@ -3,6 +3,7 @@ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesInput.hlsl" +#include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl" // NOTE: Do not ifdef the properties here as SRP batcher can not handle different layouts. CBUFFER_START(UnityPerMaterial) @@ -18,7 +19,6 @@ CBUFFER_START(UnityPerMaterial) half _Smoothness; half _DistortionStrengthScaled; half _DistortionBlend; - half _Surface; CBUFFER_END #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Particles.hlsl" diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlitForwardPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlitForwardPass.hlsl index ed99e7d5006..d04ca7534b5 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlitForwardPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlitForwardPass.hlsl @@ -1,6 +1,7 @@ #ifndef UNIVERSAL_PARTICLES_UNLIT_FORWARD_PASS_INCLUDED #define UNIVERSAL_PARTICLES_UNLIT_FORWARD_PASS_INCLUDED +#include "ParticlesUnlitInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Unlit.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Particles.hlsl" @@ -158,7 +159,7 @@ half4 fragParticleUnlit(VaryingsParticle input) : SV_Target #endif finalColor.rgb = MixFog(finalColor.rgb, inputData.fogCoord); - finalColor.a = OutputAlpha(finalColor.a, IsSurfaceTypeTransparent(_Surface)); + finalColor.a = OutputAlpha(finalColor.a, IsSurfaceTypeTransparent()); return finalColor; } diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlitInput.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlitInput.hlsl index b1766f2d10d..b98cfe0701f 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlitInput.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlitInput.hlsl @@ -3,6 +3,7 @@ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesInput.hlsl" +#include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl" // NOTE: Do not ifdef the properties here as SRP batcher can not handle different layouts. CBUFFER_START(UnityPerMaterial) @@ -16,7 +17,6 @@ CBUFFER_START(UnityPerMaterial) half _Cutoff; half _DistortionStrengthScaled; half _DistortionBlend; - half _Surface; CBUFFER_END #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Particles.hlsl" diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitForwardPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitForwardPass.hlsl index 6890659ef65..bbfb99e5bee 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitForwardPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitForwardPass.hlsl @@ -1,6 +1,7 @@ #ifndef UNIVERSAL_SIMPLE_LIT_PASS_INCLUDED #define UNIVERSAL_SIMPLE_LIT_PASS_INCLUDED +#include "SimpleLitInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #if defined(LOD_FADE_CROSSFADE) #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" @@ -219,7 +220,7 @@ void LitPassFragmentSimple( half4 color = UniversalFragmentBlinnPhong(inputData, surfaceData); color.rgb = MixFog(color.rgb, inputData.fogCoord); - color.a = OutputAlpha(color.a, IsSurfaceTypeTransparent(_Surface)); + color.a = OutputAlpha(color.a, IsSurfaceTypeTransparent()); outColor = color; diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl index 56b869627fa..bd2d29658b1 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl @@ -4,6 +4,7 @@ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceInput.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" +#include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl" CBUFFER_START(UnityPerMaterial) float4 _BaseMap_ST; @@ -12,7 +13,6 @@ CBUFFER_START(UnityPerMaterial) half4 _SpecColor; half4 _EmissionColor; half _Cutoff; - half _Surface; UNITY_TEXTURE_STREAMING_DEBUG_VARS; CBUFFER_END @@ -22,14 +22,12 @@ UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata) UNITY_DOTS_INSTANCED_PROP(float4, _SpecColor) UNITY_DOTS_INSTANCED_PROP(float4, _EmissionColor) UNITY_DOTS_INSTANCED_PROP(float , _Cutoff) - UNITY_DOTS_INSTANCED_PROP(float , _Surface) UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata) static float4 unity_DOTS_Sampled_BaseColor; static float4 unity_DOTS_Sampled_SpecColor; static float4 unity_DOTS_Sampled_EmissionColor; static float unity_DOTS_Sampled_Cutoff; -static float unity_DOTS_Sampled_Surface; void SetupDOTSSimpleLitMaterialPropertyCaches() { @@ -37,7 +35,6 @@ void SetupDOTSSimpleLitMaterialPropertyCaches() unity_DOTS_Sampled_SpecColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4 , _SpecColor); unity_DOTS_Sampled_EmissionColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4 , _EmissionColor); unity_DOTS_Sampled_Cutoff = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Cutoff); - unity_DOTS_Sampled_Surface = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Surface); } #undef UNITY_SETUP_DOTS_MATERIAL_PROPERTY_CACHES @@ -47,7 +44,6 @@ void SetupDOTSSimpleLitMaterialPropertyCaches() #define _SpecColor unity_DOTS_Sampled_SpecColor #define _EmissionColor unity_DOTS_Sampled_EmissionColor #define _Cutoff unity_DOTS_Sampled_Cutoff -#define _Surface unity_DOTS_Sampled_Surface #endif diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/UnlitForwardPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/UnlitForwardPass.hlsl index fa449987687..6101c6c5626 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/UnlitForwardPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/UnlitForwardPass.hlsl @@ -2,6 +2,7 @@ #ifndef URP_UNLIT_FORWARD_PASS_INCLUDED #define URP_UNLIT_FORWARD_PASS_INCLUDED +#include "UnlitInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Unlit.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #if defined(LOD_FADE_CROSSFADE) @@ -161,7 +162,7 @@ void UnlitPassFragment( fogFactor = input.fogCoord; #endif // #if defined(_FOG_FRAGMENT) finalColor.rgb = MixFog(finalColor.rgb, fogFactor); - finalColor.a = OutputAlpha(finalColor.a, IsSurfaceTypeTransparent(_Surface)); + finalColor.a = OutputAlpha(finalColor.a, IsSurfaceTypeTransparent()); outColor = finalColor; diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/UnlitInput.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/UnlitInput.hlsl index 04939d7b162..c5d67b53877 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/UnlitInput.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/UnlitInput.hlsl @@ -3,13 +3,13 @@ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceInput.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" +#include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl" CBUFFER_START(UnityPerMaterial) float4 _BaseMap_ST; float4 _BaseMap_TexelSize; half4 _BaseColor; half _Cutoff; - half _Surface; UNITY_TEXTURE_STREAMING_DEBUG_VARS; CBUFFER_END @@ -17,18 +17,15 @@ CBUFFER_END UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata) UNITY_DOTS_INSTANCED_PROP(float4, _BaseColor) UNITY_DOTS_INSTANCED_PROP(float , _Cutoff) - UNITY_DOTS_INSTANCED_PROP(float , _Surface) UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata) static float4 unity_DOTS_Sampled_BaseColor; static float unity_DOTS_Sampled_Cutoff; -static float unity_DOTS_Sampled_Surface; void SetupDOTSUnlitMaterialPropertyCaches() { unity_DOTS_Sampled_BaseColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _BaseColor); unity_DOTS_Sampled_Cutoff = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Cutoff); - unity_DOTS_Sampled_Surface = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Surface); } #undef UNITY_SETUP_DOTS_MATERIAL_PROPERTY_CACHES @@ -36,7 +33,6 @@ void SetupDOTSUnlitMaterialPropertyCaches() #define _BaseColor unity_DOTS_Sampled_BaseColor #define _Cutoff unity_DOTS_Sampled_Cutoff -#define _Surface unity_DOTS_Sampled_Surface #endif diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl new file mode 100644 index 00000000000..beee86c14f2 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl @@ -0,0 +1,47 @@ +#ifndef UNIVERSAL_SURFACE_TYPE_TRANSPARENT_INCLUDED +#define UNIVERSAL_SURFACE_TYPE_TRANSPARENT_INCLUDED +// Utility functionality for Universal RP materials that has the _SURFACE_TYPE_TRANSPARENT shader feature. + +// The _Surface property has been removed, but we add this is a fallback. +#if defined(_SURFACE_TYPE_TRANSPARENT_KEYWORD_DECLARED) || defined(_SURFACE_TYPE_TRANSPARENT) +#if defined(_Surface) +#undef _Surface +#endif +// This property is deprecated. Use parameterless IsSurfaceTypeTransparent() instead. +#define _Surface _SURFACE_TYPE_TRANSPARENT +#elif defined(_Surface) // Some shaders hardcode the _Surface property +// Use IsSurfaceTypeTransparent() instead of checking this keyword directly. +#define _SURFACE_TYPE_TRANSPARENT (_Surface > 0) +#define _SURFACE_TYPE_TRANSPARENT_DEFINED_LOCALLY 1 +#else +// Use IsSurfaceTypeTransparent() instead of checking this keyword directly. +#define _SURFACE_TYPE_TRANSPARENT 0 +#define _SURFACE_TYPE_TRANSPARENT_DEFINED_LOCALLY 1 +// This property is deprecated. Use parameterless IsSurfaceTypeTransparent() instead. +static const half _Surface = 0; +#endif + +// Returns 'True' if the materials Surface Type is set to 'Transparent'. +inline bool IsSurfaceTypeTransparent() +{ + #if defined(_SURFACE_TYPE_TRANSPARENT_KEYWORD_DECLARED) || defined(_SURFACE_TYPE_TRANSPARENT) + return _SURFACE_TYPE_TRANSPARENT; + #else + return false; + #endif +} + +// Returns 'True' if the materials Surface Type is set to 'Opaque'. +inline bool IsSurfaceTypeOpaque() +{ + return !IsSurfaceTypeTransparent(); +} + +// Prevents leaking _SURFACE_TYPE_TRANSPARENT fallback definition. +// This makes sure #if defined(_SURFACE_TYPE_TRANSPARENT) doesn't suddenly return true for shaders that include this file. +#if defined(_SURFACE_TYPE_TRANSPARENT_DEFINED_LOCALLY) +#undef _SURFACE_TYPE_TRANSPARENT_DEFINED_LOCALLY +#undef _SURFACE_TYPE_TRANSPARENT +#endif + +#endif diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl.meta b/Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl.meta new file mode 100644 index 00000000000..0c65f0d30c0 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3d17dfbc1c864f5b993c279862bf9a0f +timeCreated: 1771332447 \ No newline at end of file From b008ab2177556828a68a6fd49c49a62a1d413c56 Mon Sep 17 00:00:00 2001 From: Esmeralda Salamone Date: Tue, 3 Mar 2026 03:04:05 +0000 Subject: [PATCH 28/95] [ShaderGraph] Strong Hints - improved feedback and conflict detection --- .../Editor/Drawing/SearchWindowProvider.cs | 2 +- .../CommonShaderObjects.cs.meta | 2 - .../ProviderSystem/Model/ExpressionNode.cs | 3 - .../Model/ExpressionProvider.cs.meta | 2 - .../ProviderSystem/Model/FunctionHeader.cs | 80 ------ .../Model/FunctionHeader.cs.meta | 2 - .../Editor/ProviderSystem/Model/Header.meta | 8 + .../Model/Header/CommonHints.cs | 56 ++++ .../Model/Header/CommonHints.cs.meta | 2 + .../Model/Header/FunctionHeader.cs | 61 +++++ .../Model/Header/FunctionHeader.cs.meta | 2 + .../Model/Header/FunctionHints.cs | 101 +++++++ .../Model/Header/FunctionHints.cs.meta | 2 + .../Model/{ => Header}/HeaderUtils.cs | 60 ----- .../Model/Header/HeaderUtils.cs.meta | 2 + .../Model/Header/ParameterHeader.cs | 125 +++++++++ .../Model/Header/ParameterHeader.cs.meta | 2 + .../Model/Header/ParameterHints.cs | 239 +++++++++++++++++ .../Model/Header/ParameterHints.cs.meta | 2 + .../ProviderSystem/Model/HeaderUtils.cs.meta | 2 - .../ProviderSystem/Model/ParameterHeader.cs | 220 ---------------- .../Model/ParameterHeader.cs.meta | 2 - .../Model/ProviderAttribute.cs.meta | 2 - .../ProviderSystem/Model/ProviderNode.cs | 35 +-- .../Model/ProviderNodePropertyDrawer.cs | 64 +++-- .../Editor/ProviderSystem/Provider.meta | 8 + .../{Model => Provider}/ExpressionProvider.cs | 2 +- .../Provider/ExpressionProvider.cs.meta | 2 + .../{Model => Provider}/ProviderAttribute.cs | 21 +- .../Provider/ProviderAttribute.cs.meta | 2 + .../ReflectedFunctionProvider.cs | 1 - .../ReflectedFunctionProvider.cs.meta | 2 + .../ReflectedFunctionProvider.cs.meta | 2 - .../Reflection/ShaderReflectionUtils.cs | 2 - .../ProviderSystem/ShaderObjectUtils.cs.meta | 2 - .../Editor/ProviderSystem/ShaderObjects.meta | 8 + .../CommonShaderObjects.cs | 1 - .../ShaderObjects/CommonShaderObjects.cs.meta | 2 + .../{ => ShaderObjects}/ShaderObjectUtils.cs | 1 - .../ShaderObjects/ShaderObjectUtils.cs.meta | 2 + .../ShaderObjects/StrongHeader.cs | 44 ++++ .../ShaderObjects/StrongHeader.cs.meta | 2 + .../ShaderObjects/StrongHint.cs | 116 +++++++++ .../ShaderObjects/StrongHint.cs.meta | 2 + .../Editor/ProviderTests/StrongHintTests.cs | 246 ++++++++++++++++++ .../ProviderTests/StrongHintTests.cs.meta | 2 + 46 files changed, 1116 insertions(+), 432 deletions(-) delete mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/CommonShaderObjects.cs.meta delete mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ExpressionProvider.cs.meta delete mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/FunctionHeader.cs delete mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/FunctionHeader.cs.meta create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header.meta create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/CommonHints.cs create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/CommonHints.cs.meta create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHeader.cs create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHeader.cs.meta create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHints.cs create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHints.cs.meta rename Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/{ => Header}/HeaderUtils.cs (81%) create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/HeaderUtils.cs.meta create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHeader.cs create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHeader.cs.meta create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHints.cs create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHints.cs.meta delete mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/HeaderUtils.cs.meta delete mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ParameterHeader.cs delete mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ParameterHeader.cs.meta delete mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderAttribute.cs.meta create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider.meta rename Packages/com.unity.shadergraph/Editor/ProviderSystem/{Model => Provider}/ExpressionProvider.cs (98%) create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ExpressionProvider.cs.meta rename Packages/com.unity.shadergraph/Editor/ProviderSystem/{Model => Provider}/ProviderAttribute.cs (63%) create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ProviderAttribute.cs.meta rename Packages/com.unity.shadergraph/Editor/ProviderSystem/{Reflection => Provider}/ReflectedFunctionProvider.cs (99%) create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ReflectedFunctionProvider.cs.meta delete mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/Reflection/ReflectedFunctionProvider.cs.meta delete mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjectUtils.cs.meta create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects.meta rename Packages/com.unity.shadergraph/Editor/ProviderSystem/{ => ShaderObjects}/CommonShaderObjects.cs (99%) create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/CommonShaderObjects.cs.meta rename Packages/com.unity.shadergraph/Editor/ProviderSystem/{ => ShaderObjects}/ShaderObjectUtils.cs (99%) create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/ShaderObjectUtils.cs.meta create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHeader.cs create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHeader.cs.meta create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHint.cs create mode 100644 Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHint.cs.meta create mode 100644 Packages/com.unity.shadergraph/Tests/Editor/ProviderTests/StrongHintTests.cs create mode 100644 Packages/com.unity.shadergraph/Tests/Editor/ProviderTests/StrongHintTests.cs.meta diff --git a/Packages/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs b/Packages/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs index cdcff291fb8..e0f07a5adf3 100644 --- a/Packages/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs +++ b/Packages/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs @@ -214,7 +214,7 @@ public void GenerateNodeEntries() node.InitializeFromProvider(provider); var header = node.Header; - string rawTitle = $"{header.category}/{header.uniqueName}"; + string rawTitle = $"{header.searchCategory}/{header.searchName}"; int orderFound = 0; while (providerCollisions.Contains(rawTitle)) diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/CommonShaderObjects.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/CommonShaderObjects.cs.meta deleted file mode 100644 index 32e5ef34f63..00000000000 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/CommonShaderObjects.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 6c992aa7356b6d242ad431b5ab535c19 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ExpressionNode.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ExpressionNode.cs index de978ed7b1e..e84944c0719 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ExpressionNode.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ExpressionNode.cs @@ -1,8 +1,5 @@ - using System; using UnityEditor.ShaderGraph.Drawing.Controls; -using UnityEditor.ShaderGraph.Internal; -using UnityEngine; namespace UnityEditor.ShaderGraph.ProviderSystem { diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ExpressionProvider.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ExpressionProvider.cs.meta deleted file mode 100644 index 425f937b003..00000000000 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ExpressionProvider.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 854d9d5b7499b4de8b33efe89dc97d2e \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/FunctionHeader.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/FunctionHeader.cs deleted file mode 100644 index 999c0c495aa..00000000000 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/FunctionHeader.cs +++ /dev/null @@ -1,80 +0,0 @@ - -namespace UnityEditor.ShaderGraph.ProviderSystem -{ - // A "Header" object is an abstraction layer that interprets domain/context-free - // information from a ShaderObject (in this case a function) and translates it into - // domain specific information-- in this case, the Shader Graph tooling and conventions. - internal struct FunctionHeader - { - readonly internal bool isValid; - - readonly internal string referenceName; - readonly internal string displayName; - readonly internal string uniqueName; - readonly internal string tooltip; - - readonly internal IShaderType returnType; - internal bool hasReturnType => returnType.Name != "void"; - readonly internal string returnDisplayName; - - readonly internal string category; - - readonly internal string[] searchTerms; - - internal FunctionHeader(IProvider provider) - { - referenceName = null; - returnType = null; - displayName = null; - category = null; - searchTerms = null; - returnDisplayName = null; - uniqueName = null; - tooltip = null; - - isValid = provider != null && provider.Definition != null; - - if (!isValid) - return; - - var func = provider.Definition; - var path = AssetDatabase.GUIDToAssetPath(provider.AssetID); - - referenceName = func.Name; - returnType = func.ReturnType; - - if (!func.Hints.TryGetValue(Hints.Common.kDisplayName, out displayName)) - displayName = ObjectNames.NicifyVariableName(referenceName); - - if (!func.Hints.TryGetValue(Hints.Func.kSearchName, out uniqueName)) - uniqueName = ShaderObjectUtils.QualifySignature(func, false, true); - - - if (!func.Hints.TryGetValue(Hints.Func.kCategory, out category)) - { - // try to use a namespace if a user didn't provide a category. - bool hasNamespace = false; - foreach (var name in func.Namespace) - { - if (!hasNamespace) - category = "Reflected by Namespace"; - hasNamespace = true; - category += $"/{name}"; - } - // if there was no namespace, use the file path instead. - if (!hasNamespace) - { - category = $"Reflected by Path/{path}"; - } - - } - - if (func.Hints.TryGetValue(Hints.Func.kSearchName, out var terms)) - searchTerms = HeaderUtils.LazyTokenString(terms); - else searchTerms = new[] { referenceName }; - - if (!func.Hints.TryGetValue(Hints.Func.kReturnDisplayName, out returnDisplayName)) - returnDisplayName = "Out"; - } - } -} diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/FunctionHeader.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/FunctionHeader.cs.meta deleted file mode 100644 index 6546dea4fda..00000000000 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/FunctionHeader.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: a49239ad21003d64db1f49d00da3f871 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header.meta new file mode 100644 index 00000000000..b1022beeb0f --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9181c578b5a41418bbb0056172a05e4f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/CommonHints.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/CommonHints.cs new file mode 100644 index 00000000000..4ea5d386988 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/CommonHints.cs @@ -0,0 +1,56 @@ +using System.Collections.Generic; + +namespace UnityEditor.ShaderGraph.ProviderSystem.Hints +{ + internal static class Common + { + internal const string kDisplayName = "sg:DisplayName"; + internal const string kTooltip = "sg:Tooltip"; + } + + internal class DisplayName : IStrongHint where T : IShaderObject + { + public string Key { get; private set; } + public IReadOnlyCollection Synonyms { get; } = new string[] { "Label", "Title" }; + string fallback; + internal DisplayName(string name = Common.kDisplayName, string fallback = null) { Key = name; this.fallback = fallback; } + public bool Process(bool found, string rawValue, T obj, IProvider provider, out object value, out string msg) + { + msg = null; + value = found ? rawValue : fallback ?? obj.Name; + return true; // We always resolve a display name. + } + } + + internal class Tooltip : IStrongHint where T : IShaderObject + { + public string Key { get; private set; } + public IReadOnlyCollection Synonyms { get; } = new [] { "summary" }; + internal Tooltip(string name = Common.kTooltip) { Key = name; } + public bool Process(bool found, string rawValue, T obj, IProvider provider, out object value, out string msg) + { + msg = null; + value = rawValue; + return found; + } + } + + internal class Flag : IStrongHint where T : IShaderObject + { + public string Key { get; private set; } + public IReadOnlyCollection Conflicts { get; private set; } + + internal Flag(string name) { Key = name; Conflicts = null; } + internal Flag(string name, string conflict) { Key = name; Conflicts = new[] { conflict }; } + internal Flag(string name, string[] conflicts) { Key = name; Conflicts = conflicts; } + + public bool Process(bool found, string rawValue, T obj, IProvider provider, out object value, out string msg) + { + msg = null; + value = rawValue; + if (!string.IsNullOrWhiteSpace(rawValue)) + msg = $"Expects an empty argument string."; + return found; + } + } +} diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/CommonHints.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/CommonHints.cs.meta new file mode 100644 index 00000000000..9c0e2346cd7 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/CommonHints.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 243f79ed5c3a949dea27a2c712baeebd \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHeader.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHeader.cs new file mode 100644 index 00000000000..4601233d9d7 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHeader.cs @@ -0,0 +1,61 @@ +namespace UnityEditor.ShaderGraph.ProviderSystem +{ + internal class FunctionHeader : StrongHeader + { + internal string referenceName { get; private set; } + + internal string displayName { get; private set; } + internal string tooltip { get; private set; } + + internal string returnDisplayName { get; private set; } + internal string returnTooltip { get; private set; } + internal IShaderType returnType { get; private set; } + internal bool hasReturnValueType => returnType.Name != "void"; + + internal string searchName { get; private set; } + internal string[] searchTerms { get; private set; } + internal string searchCategory { get; private set; } + + internal ParameterHeader returnHeader { get; private set; } + + private static HintRegistry s_HintRegistry; + protected override HintRegistry GetHintRegistry() + { + if (s_HintRegistry == null) + { + s_HintRegistry = new(); + s_HintRegistry.RegisterStrongHint(new Hints.ProviderKey()); + + s_HintRegistry.RegisterStrongHint(new Hints.DisplayName()); + s_HintRegistry.RegisterStrongHint(new Hints.Tooltip()); + + s_HintRegistry.RegisterStrongHint(new Hints.DisplayName(Hints.Func.kReturnDisplayName, "Out")); + s_HintRegistry.RegisterStrongHint(new Hints.Tooltip(Hints.Func.kReturnTooltip)); + + s_HintRegistry.RegisterStrongHint(new Hints.SearchName()); + s_HintRegistry.RegisterStrongHint(new Hints.SearchTerms()); + s_HintRegistry.RegisterStrongHint(new Hints.SearchCategory()); + } + return s_HintRegistry; + } + + // Read processed data and make it more accessible to work with. + protected override void OnProcess(IShaderFunction func, IProvider provider) + { + referenceName = func.Name; + returnType = func.ReturnType; + + displayName = Get(Hints.Common.kDisplayName); + tooltip = Get(Hints.Common.kTooltip); + + returnDisplayName = Get(Hints.Func.kReturnDisplayName); + returnTooltip = Get(Hints.Func.kReturnTooltip); + + searchName = Get(Hints.Func.kSearchName); + searchTerms = Get(Hints.Func.kSearchTerms); + searchCategory = Get(Hints.Func.kSearchCategory); + + returnHeader = new ParameterHeader(returnDisplayName, func.ReturnType, returnTooltip, provider); + } + } +} diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHeader.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHeader.cs.meta new file mode 100644 index 00000000000..9a87e42d068 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHeader.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 58b9d763af91544dc85fbb161b64d9c0 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHints.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHints.cs new file mode 100644 index 00000000000..b6164c30cc4 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHints.cs @@ -0,0 +1,101 @@ +using System.Text; +using System.Collections.Generic; + +namespace UnityEditor.ShaderGraph.ProviderSystem.Hints +{ + internal static class Func + { + internal const string kProviderKey = "sg:ProviderKey"; + + internal const string kReturnDisplayName = "sg:ReturnDisplayName"; + + internal const string kSearchTerms = "sg:SearchTerms"; + internal const string kSearchName = "sg:SearchName"; + internal const string kSearchCategory = "sg:SearchCategory"; + + // Not yet implemented. + internal const string kGroupKey = "sg:GroupKey"; + internal const string kReturnTooltip = "sg:ReturnTooltip"; + internal const string kDocumentationLink = "sg:HelpURL"; + + // ProviderKey associated hints, Not yet implemented. + internal const string kDeprecated = "sg:Deprecated"; + internal const string kObsolete = "sg:Obsolete"; + internal const string kVersion = "sg:Version"; + } + + class ProviderKey : IStrongHint + { + public string Key => Func.kProviderKey; + public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider provider, out object value, out string msg) + { + string sourcePath = AssetDatabase.GUIDToAssetPath(provider.AssetID); + + value = provider.ProviderKey; + msg = !found // The defaulted ProviderKey is the fully qualified signature. + ? $"Expected; but none found for '{provider.ProviderKey}' in '{sourcePath}'." + : null; + + return true; + } + } + + class SearchName : IStrongHint + { + public string Key => Func.kSearchName; + public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider provider, out object value, out string msg) + { + msg = null; + value = found ? rawValue : ShaderObjectUtils.QualifySignature(obj, false, true); + return true; + } + } + + class SearchTerms : IStrongHint + { + public string Key => Func.kSearchTerms; + public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider provider, out object value, out string msg) + { + msg = null; + value = found ? HeaderUtils.LazyTokenString(rawValue) : new string[] { obj.Name }; + return true; + } + } + + class SearchCategory : IStrongHint + { + public string Key => Func.kSearchCategory; + public IReadOnlyCollection Synonyms { get; } = new[] { "Category" }; + public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider provider, out object value, out string msg) + { + msg = null; + if (found) + { + value = rawValue; + } + else + { + StringBuilder catsb = new(); + foreach(var name in obj.Namespace) + { + catsb.Append($"/{name}"); + } + var category = catsb.ToString(); + if (!string.IsNullOrWhiteSpace(category)) + { + value = $"Reflected by Namespace{category}"; + } + else if (provider.AssetID != default) + { + var path = AssetDatabase.GUIDToAssetPath(provider.AssetID); + value = $"Reflected by Path/{path}"; + } + else + { + value = "Uncategorized"; + } + } + return true; + } + } +} diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHints.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHints.cs.meta new file mode 100644 index 00000000000..d5246227c38 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHints.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f51d58a379852433783c60d784f44626 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/HeaderUtils.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/HeaderUtils.cs similarity index 81% rename from Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/HeaderUtils.cs rename to Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/HeaderUtils.cs index 61d8e620104..1fa81eb54ac 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/HeaderUtils.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/HeaderUtils.cs @@ -4,66 +4,6 @@ namespace UnityEditor.ShaderGraph.ProviderSystem { - internal static class Hints - { - internal static class Common - { - internal const string kDisplayName = "sg:DisplayName"; - - // Not yet implemented. - internal const string kTooltip = "sg:Tooltip"; // SG doesn't have tooltips - } - internal static class Func - { - internal const string kProviderKey = "sg:ProviderKey"; - - internal const string kReturnDisplayName = "sg:ReturnDisplayName"; - - internal const string kSearchTerms = "sg:SearchTerms"; - internal const string kSearchName = "sg:SearchName"; - internal const string kCategory = "sg:SearchCategory"; - - // Not yet implemented. - internal const string kGroupKey = "sg:GroupKey"; - internal const string kReturnTooltip = "sg:ReturnTooltip"; - internal const string kDocumentationLink = "sg:HelpURL"; - - // ProviderKey associated hints, Not yet implemented. - internal const string kDeprecated = "sg:Deprecated"; - internal const string kObsolete = "sg:Obsolete"; - internal const string kVersion = "sg:Version"; - } - - internal static class Param - { - internal const string kStatic = "sg:Static"; - internal const string kLocal = "sg:Local"; - internal const string kLiteral = "sg:Literal"; - internal const string kColor = "sg:Color"; - internal const string kRange = "sg:Range"; - internal const string kDropdown = "sg:Dropdown"; - internal const string kDefault = "sg:Default"; - - // Not yet implemented. - internal const string kSetting = "sg:Setting"; - internal const string kLinkage = "sg:Linkage"; - internal const string kPrecision = "sg:Precision"; - internal const string kDynamic = "sg:Dynamic"; - internal const string kReferable = "sg:Referable"; - internal const string kExternal = "sg:External"; - - // Hard coded referables, not yet implemented. - internal const string kUV = "sg:ref:UV"; - internal const string kPosition = "sg:ref:Position"; - internal const string kNormal = "sg:ref:Normal"; - internal const string kBitangent = "sg:ref:Bitangent"; - internal const string kTangent = "sg:ref:Tangent"; - internal const string kViewDirection = "sg:ref:ViewDirection"; - internal const string kScreenPosition = "sg:ref:ScreenPosition"; - internal const string kVertexColor = "sg:VertexColor"; - } - } - internal static class HeaderUtils { internal static string ToShaderType(this MaterialSlot slot) diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/HeaderUtils.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/HeaderUtils.cs.meta new file mode 100644 index 00000000000..ff259a48cc5 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/HeaderUtils.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9fe94b29e1463438e8bc28a5e7905e1d \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHeader.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHeader.cs new file mode 100644 index 00000000000..a4019880265 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHeader.cs @@ -0,0 +1,125 @@ +using System.Collections.Generic; + +namespace UnityEditor.ShaderGraph.ProviderSystem +{ + internal class ParameterHeader : StrongHeader + { + internal string referenceName { get; private set; } + internal IShaderType shaderType { get; private set; } + internal string typeName => shaderType.Name; + + internal string displayName { get; private set; } + internal string tooltip { get; private set; } + + internal bool isInput { get; private set; } + internal bool isOutput { get; private set; } + + internal bool isColor { get; private set; } + + internal bool isStatic { get; private set; } + internal bool isLocal { get; private set; } + + internal bool isDropdown { get; private set; } + internal string[] options { get; private set; } + + internal bool isSlider { get; private set; } + internal float sliderMin { get; private set; } + internal float sliderMax { get; private set; } + + internal float[] defaultValue { get; private set; } + internal string defaultString { get; private set; } + + internal string externalQualifiedTypeName { get; private set; } + + internal bool isLiteral { get; private set; } + + internal bool isBareResource { get; private set; } + + private static HintRegistry s_HintRegistry; + protected override HintRegistry GetHintRegistry() + { + if (s_HintRegistry == null) + { + s_HintRegistry = new(); + s_HintRegistry.RegisterStrongHint(new Hints.DisplayName()); + s_HintRegistry.RegisterStrongHint(new Hints.Tooltip()); + + s_HintRegistry.RegisterStrongHint(new Hints.Flag(Hints.Param.kLocal, new string[] { Hints.Param.kAccessModifier, Hints.Param.kCustomEditor })); + + s_HintRegistry.RegisterStrongHint(new Hints.Literal()); + s_HintRegistry.RegisterStrongHint(new Hints.Static()); + s_HintRegistry.RegisterStrongHint(new Hints.Color()); + s_HintRegistry.RegisterStrongHint(new Hints.Range()); + s_HintRegistry.RegisterStrongHint(new Hints.Dropdown()); + s_HintRegistry.RegisterStrongHint(new Hints.Default()); + s_HintRegistry.RegisterStrongHint(new Hints.External()); + } + return s_HintRegistry; + } + + // Read processed data and make it more accessible to work with. + protected override void OnProcess(IShaderField param, IProvider provider) + { + referenceName = param.Name; + + isInput = param.IsInput; + isOutput = param.IsOutput; + shaderType = param.ShaderType; + + // TODO: improve type handling. + string typeTest = shaderType.Name.ToLowerInvariant(); + bool isSampler = typeTest.Contains("sampler"); + bool isTexture = typeTest.Contains("texture"); + isBareResource = !typeTest.Contains("unity") && (isSampler || isTexture); + + displayName = Get(Hints.Common.kDisplayName); + tooltip = Get(Hints.Common.kTooltip); + + isStatic = this.Has(Hints.Param.kStatic); + isLocal = this.Has(Hints.Param.kLocal); + + if (isDropdown = this.Has(Hints.Param.kDropdown)) + options = this.Get(Hints.Param.kDropdown); + + isColor = this.Has(Hints.Param.kColor); + + if (isSlider = this.Has(Hints.Param.kRange)) + { + var range = this.Get(Hints.Param.kRange); + sliderMin = range[0]; + sliderMax = range[1]; + } + + if (this.Has(Hints.Param.kDefault)) + { + defaultString = this.Get(Hints.Param.kDefault); + defaultValue = HeaderUtils.LazyTokenFloat(defaultString); + } + + externalQualifiedTypeName = typeName; + var externalNamespace = Get(Hints.Param.kExternal); + if (!string.IsNullOrWhiteSpace(externalNamespace)) + externalQualifiedTypeName = $"{externalNamespace}::{typeName}"; + + isLiteral = Has(Hints.Param.kLiteral); + } + + internal ParameterHeader(IShaderField param, IProvider provider) + { + Process(param, provider); + } + + // For returns. + internal ParameterHeader(string displayName, IShaderType shaderType, string tooltip, IProvider provider) + { + var hints = new Dictionary() { + { Hints.Common.kDisplayName, displayName }, + { Hints.Common.kTooltip, tooltip }, + }; + + var field = new ShaderField("__UNITY_SHADERGRAPH_UNUSED", false, true, shaderType, hints); + + Process(field, provider); + } + } +} diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHeader.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHeader.cs.meta new file mode 100644 index 00000000000..6da3b5b9ceb --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHeader.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 73f8700d5e86e4ec397ed9c8ef0ffe90 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHints.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHints.cs new file mode 100644 index 00000000000..212d2616a12 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHints.cs @@ -0,0 +1,239 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace UnityEditor.ShaderGraph.ProviderSystem.Hints +{ + internal static class Param + { + internal const string kAccessModifier = "AccessModifier"; + internal const string kCustomEditor = "CustomEditor"; + + internal const string kStatic = "sg:Static"; + internal const string kLocal = "sg:Local"; + internal const string kLiteral = "sg:Literal"; + internal const string kColor = "sg:Color"; + internal const string kRange = "sg:Range"; + internal const string kDropdown = "sg:Dropdown"; + internal const string kDefault = "sg:Default"; + internal const string kExternal = "sg:External"; + + // Not yet implemented. + internal const string kSetting = "sg:Setting"; + internal const string kLinkage = "sg:Linkage"; + internal const string kPrecision = "sg:Precision"; + internal const string kDynamic = "sg:Dynamic"; + internal const string kReferable = "sg:Referable"; + + // Hard coded referables, not yet implemented. + internal const string kUV = "sg:ref:UV"; + internal const string kPosition = "sg:ref:Position"; + internal const string kNormal = "sg:ref:Normal"; + internal const string kBitangent = "sg:ref:Bitangent"; + internal const string kTangent = "sg:ref:Tangent"; + internal const string kViewDirection = "sg:ref:ViewDirection"; + internal const string kScreenPosition = "sg:ref:ScreenPosition"; + internal const string kVertexColor = "sg:ref:VertexColor"; + } + + internal class Range : IStrongHint + { + public string Key => Param.kRange; + public IReadOnlyCollection Conflicts { get; } = new string[] { Param.kCustomEditor }; + public IReadOnlyCollection Synonyms { get; } = new string[] { "Slider" }; + + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + { + msg = null; + value = rawValue; + if (!found) + return false; + + if (obj.ShaderType.Name != "half" && obj.ShaderType.Name != "float") + { + msg = $"Expected floating point scalar, but found '{obj.ShaderType.Name}'."; + return false; + + } + + float min = 0; + float max = 1; + + if (string.IsNullOrWhiteSpace(rawValue)) + { + value = new float[] { min, max }; + return true; + } + + float[] values = HeaderUtils.LazyTokenFloat(rawValue); + + if (values.Length > 2 || !string.IsNullOrEmpty(rawValue) && values.Length == 0) + { + msg = $"Expected 0, 1, or 2 floating point values, but found '{values.Length}'."; + value = new float[] { min, max }; + return false; + } + + if (values.Length == 1) + { + if (values[0] < 0) + { + min = values[0]; + max = 0; + } + else max = values[0]; + } + else if (values.Length >= 2) + { + min = Mathf.Min(values); + max = Mathf.Max(values); + } + + if (min == max) + { + msg = $"Expected min and max to be different values, but both are '{min}'."; + } + + value = new float[2] { min, max }; + return true; + } + } + + internal class Dropdown : IStrongHint + { + public string Key => Param.kDropdown; + public IReadOnlyCollection Conflicts { get; } = new string[] { Param.kCustomEditor }; + public IReadOnlyCollection Synonyms { get; } = new string[] { "Enum" }; + + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + { + msg = null; + value = rawValue; + if (!found) + { + return false; + } + + switch(obj.ShaderType.Name) + { + case "int": case "uint": case "float": case "half": break; + default: + msg = $"Expected numeric scalar, but found '{obj.ShaderType.Name}'."; + return false; + } + + string[] options = HeaderUtils.LazyTokenString(rawValue); + + if (options.Length == 0) + { + msg = $"Expected at least 1 comma separated option, but found none."; + return false; + } + + value = options; + return true; + } + } + + internal class Color : IStrongHint + { + public string Key => Param.kColor; + public IReadOnlyCollection Conflicts { get; } = new string[] { Param.kCustomEditor }; + + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + { + msg = null; + value = rawValue; + if (found) + { + switch(obj.ShaderType.Name) + { + case "float3": case "float4": case "half3": case "half4": return true; + default: + msg = $"Expected floating point vector of length 3 or 4, but found '{obj.ShaderType.Name}'."; + return false; + } + } + return false; + } + } + + internal class Literal : IStrongHint + { + public string Key => Param.kLiteral; + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + { + msg = null; + value = rawValue; + + if (found) + { + switch (obj.ShaderType.Name) + { + case "float": case "half": case "int": case "uint": return true; + default: + msg = $"Expected numeric scalar, but found '{obj.ShaderType.Name}'."; + return false; + } + } + return found; + } + } + + internal class Static : IStrongHint + { + public string Key => Param.kStatic; + public IReadOnlyCollection Conflicts { get; } = new string[] { Param.kAccessModifier }; + + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + { + msg = null; + value = rawValue; + if (!found) + return false; + + switch(obj.ShaderType.Name) + { + case "float": case "half": case "int": case "uint": case "bool": + return true; + + case "float3": case "float4": case "half3": case "half4": + if (obj.Hints.ContainsKey(Param.kColor)) + return true; + + msg = $"Requires '{Param.kColor}' to support '{obj.ShaderType.Name}'."; + return false; + + default: + msg = $"Expected '{Param.kColor}' or scalar, but found '{obj.ShaderType.Name}'."; + return false; + } + } + } + + internal class External : IStrongHint + { + public string Key => Param.kExternal; + public IReadOnlyCollection Synonyms { get; } = new string[] { "ExternalNamespace" }; + + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + { + msg = null; + value = rawValue; + return true; + } + } + + internal class Default : IStrongHint + { + public string Key => Param.kDefault; + + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + { + // TODO(SVFXG-868): This is tricky because there are multiple formats we need to support. + // for now, we can pass along the raw value and allow the header to process it. + msg = null; + value = rawValue; + return found; + } + } +} diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHints.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHints.cs.meta new file mode 100644 index 00000000000..cc5496eadae --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHints.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bc36eaef20dcb49c592cc866efc63f59 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/HeaderUtils.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/HeaderUtils.cs.meta deleted file mode 100644 index 832c0d858df..00000000000 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/HeaderUtils.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 03da3bc1b8aa9064ea9e97a5eec5f074 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ParameterHeader.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ParameterHeader.cs deleted file mode 100644 index dfaab6b39fc..00000000000 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ParameterHeader.cs +++ /dev/null @@ -1,220 +0,0 @@ - -using System.Collections.Generic; -using System.Text; - -namespace UnityEditor.ShaderGraph.ProviderSystem -{ - internal struct ParameterHeader - { - readonly internal bool isValid; - - readonly internal string referenceName; - readonly internal IShaderType shaderType; - readonly internal string typeName => shaderType.Name; - - readonly internal string displayName; - readonly internal string tooltip; - - readonly internal bool isInput; - readonly internal bool isOutput; - - readonly internal bool isColor; - - readonly internal bool isStatic; - readonly internal bool isLocal; - - readonly internal bool isDropdown; - readonly internal string[] options; - - readonly internal bool isSlider; - readonly internal float sliderMin; - readonly internal float sliderMax; - - readonly internal float[] defaultValue; - readonly internal string defaultString; - - readonly internal string externalQualifiedTypeName; - - readonly internal bool isNumeric; - readonly internal bool isTexture; - readonly internal bool isSampler; - readonly internal bool isStruct; - readonly internal bool isReference; - readonly internal bool isLiteral; - - readonly internal string referable; - - readonly internal bool isBareResource; - - readonly internal string knownIssue; - - private ParameterHeader(int a) - { - referenceName = null; - displayName = null; - shaderType = null; - tooltip = null; - isOutput = true; - isInput = false; - isColor = false; - defaultValue = null; - isStatic = false; - isDropdown = false; - options = null; - isSlider = false; - sliderMin = 0; - sliderMax = 1; - isBareResource = false; - isLocal = false; - isReference = false; - isLiteral = false; - isTexture = false; - isSampler = false; - isNumeric = false; - isStruct = false; - referable = null; - defaultString = null; - knownIssue = null; - externalQualifiedTypeName = null; - - isValid = false; - } - - // this is for return types. - internal ParameterHeader(string referenceName, IShaderType shaderType, string tooltip = null) : this(0) - { - if (string.IsNullOrWhiteSpace(referenceName) || string.IsNullOrWhiteSpace(shaderType.Name)) - { - isValid = false; - return; - } - - this.shaderType = shaderType; - this.externalQualifiedTypeName = shaderType.Name; - this.referenceName = referenceName; - this.displayName = referenceName; - this.tooltip = tooltip; - - string typeTest = shaderType.Name.ToLowerInvariant(); - - isNumeric = HeaderUtils.TryParseTypeInfo(typeName, out _, out _, out _, out _, out _, out _, out _); - isSampler = typeTest.Contains("sampler"); - isTexture = typeTest.Contains("texture"); - isBareResource = !typeTest.Contains("unity") && (isSampler || isTexture); // special handling case. - isStruct = !isTexture && !isSampler && !isNumeric; - isValid = true; - } - - internal ParameterHeader(IShaderField param, IShaderFunction owner) : this(param?.Name, param?.ShaderType) - { - if (!isValid || param == null) - return; - - isOutput = isInput = false; - isInput = param.IsInput; - isOutput = param.IsOutput; - - if (!param.Hints.TryGetValue(Hints.Common.kDisplayName, out displayName)) - displayName = ObjectNames.NicifyVariableName(referenceName); - - HeaderUtils.TryParseTypeInfo(typeName, out string prim, out bool isScalar, out bool isVector, out bool isMatrix, out int rows, out int cols, out _); - List editorHintsUsed = new(); - - - isLiteral = param.Hints.TryGetValue(Hints.Param.kLiteral, out _); // TODO: Only relevant for int, float, half, uint - - if (param.Hints.TryGetValue(Hints.Param.kExternal, out externalQualifiedTypeName)) - externalQualifiedTypeName += $"::{typeName}"; - else externalQualifiedTypeName = typeName; - - if (param.Hints.TryGetValue(Hints.Param.kColor, out _)) - { - editorHintsUsed.Add(Hints.Param.kColor); - if (rows != 3 && rows != 4 && !isVector) - { - knownIssue = $"'Color' hint on '{referenceName}' is not supported for '{typeName}'."; - } - else isColor = true; - } - - if (param.Hints.TryGetValue(Hints.Param.kStatic, out _)) - { - if (isOutput) - { - knownIssue = $"'Static' hint on '{referenceName}' is not supported for 'out' parameters."; - } - else if (!isScalar && !isColor) - { - knownIssue = $"'Static' hint on '{referenceName}' is not supported for '{typeName}'."; - } - else isStatic = true; - } - - if (param.Hints.TryGetValue(Hints.Param.kLocal, out _)) - { - editorHintsUsed.Add(Hints.Param.kLocal); - if (isStatic) // All Access Modifier style hints would conflict with each other, but we currently only have Local and Static - { - knownIssue = $"'Local' hint on '{referenceName}' conflicts with found 'Static' hint."; - } - else isLocal = true; - } - - if (param.Hints.TryGetValue(Hints.Param.kDropdown, out var dropdownString)) - { - editorHintsUsed.Add(Hints.Param.kDropdown); - options = HeaderUtils.LazyTokenString(dropdownString); - if (!isScalar || prim == "bool") - { - knownIssue = $"'Dropdown' hint on '{referenceName}' is not supported for '{typeName}'."; - } - else if (options.Length == 0) - { - knownIssue = $"'Dropdown' hint on '{referenceName}' has no options."; - } - else isDropdown = true; - } - - if (param.Hints.TryGetValue(Hints.Param.kRange, out var rangeValues)) - { - editorHintsUsed.Add(Hints.Param.kRange); - var values = HeaderUtils.LazyTokenFloat(rangeValues); - - if (!isScalar || prim == "bool") - { - knownIssue = $"'Range' hint on '{referenceName}' is not supported for '{typeName}'."; - } - else if (values.Length != 2 || values[0] == values[1]) - { - knownIssue = $"'Range' hint on '{referenceName}' expects two arguments of different values."; - } - else - { - sliderMin = values[0] < values[1] ? values[0] : values[1]; - sliderMax = values[0] > values[1] ? values[0] : values[1]; - isSlider = true; - } - } - - if (param.Hints.TryGetValue(Hints.Param.kDefault, out defaultString)) - { - defaultValue = HeaderUtils.LazyTokenFloat(defaultString); - } - - if(editorHintsUsed.Count > 1) - { - StringBuilder sb = new(); - bool first = true; - foreach(var hintName in editorHintsUsed) - { - if (!first) - sb.Append(", "); - first = false; - sb.Append($"{hintName}"); - } - - knownIssue = $"Found multiple conflicting editor hints on '{referenceName}': '{sb.ToString()}'."; - } - } - } -} diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ParameterHeader.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ParameterHeader.cs.meta deleted file mode 100644 index 1b207f7b1b7..00000000000 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ParameterHeader.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: df1b66f5ce54910438e02c0d87921c4f \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderAttribute.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderAttribute.cs.meta deleted file mode 100644 index 93ecad7ef00..00000000000 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderAttribute.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 83c57d0908748409ba9167606f577a92 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNode.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNode.cs index 3c93e82c8cf..ad2d5b3a1ad 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNode.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNode.cs @@ -34,6 +34,8 @@ public void GetSourceAssetDependencies(AssetCollection assetCollection) internal FunctionHeader Header { get; private set; } + internal List ParamHeaders { get; private set; } + internal IProvider Provider => m_provider; const int kReservedOutputSlot = 0; @@ -49,6 +51,7 @@ public void GetSourceAssetDependencies(AssetCollection assetCollection) public ProviderNode() { name = "Provider Based Node"; + Header = new(); } internal void InitializeFromProvider(IProvider provider) @@ -89,10 +92,11 @@ protected void Refresh() internal void UpdateModel() { - if (Provider == null || Provider.Definition == null) + if (Provider == null || Provider.Definition == null || !Provider.IsValid) return; - Header = new FunctionHeader(Provider); + Header.Process(Provider.Definition, Provider); + var header = Header; this.name = header.displayName; this.synonyms = header.searchTerms; @@ -116,23 +120,22 @@ internal void UpdateModel() oldSlotMap[oldSlot.shaderOutputName] = idTuple; } - List paramHeaders = new(); + ParamHeaders = new(); List desiredSlotOrder = new(); // return type is a special case, because it has no parameter but still needs a slot // we reserve the 0 slotId for this and always make sure it's added first/at the top. - if (header.hasReturnType) + if (header.hasReturnValueType) { - var returnParam = new ParameterHeader(header.returnDisplayName, header.returnType, header.tooltip); usedSlotIds.Add(kReservedOutputSlot); desiredSlotOrder.Add(kReservedOutputSlot); - AddSlotFromParameter(returnParam, kReservedOutputSlot, SlotType.Output); + AddSlotFromParameter(header.returnHeader, kReservedOutputSlot, SlotType.Output); } // build the header data for our parameters and mark which slot ids are being reused. foreach(var param in parameters) { - paramHeaders.Add(new ParameterHeader(param, Provider.Definition)); + ParamHeaders.Add(new ParameterHeader(param, Provider)); if (oldSlotMap.TryGetValue(param.Name, out var idTuple)) { if (idTuple.inputId > -1) usedSlotIds.Add(idTuple.inputId); @@ -142,7 +145,7 @@ internal void UpdateModel() // walk through our header data and build the actual slots. int nextSlot = kReservedOutputSlot; - foreach (var paramHeader in paramHeaders) + foreach (var paramHeader in ParamHeaders) { if (!oldSlotMap.TryGetValue(paramHeader.referenceName, out var idTuple)) idTuple = (-1, -1); @@ -275,24 +278,26 @@ public override void ValidateNode() base.ValidateNode(); if (Provider == null) { - owner.AddSetupError(this.objectId, "Node is in an invalid state and cannot recover."); + owner?.AddSetupError(this.objectId, "Node is in an invalid state and cannot recover."); return; } else if (Provider.AssetID != default && (Provider.Definition == null || !Provider.Definition.IsValid)) { var path = AssetDatabase.GUIDToAssetPath(Provider.AssetID); - owner.AddSetupError(this.objectId, $"Data for '{Provider.ProviderKey}' expected in '{path}'."); + owner?.AddSetupError(this.objectId, $"Data for '{Provider.ProviderKey}' expected in '{path}'."); return; } else { - foreach(var param in Provider.Definition.Parameters) + foreach(var msg in Header.Messages) + { + owner?.AddValidationError(this.objectId, msg, Rendering.ShaderCompilerMessageSeverity.Warning); + } + foreach(var param in ParamHeaders) { - var header = new ParameterHeader(param, Provider.Definition); - if (!string.IsNullOrWhiteSpace(header.knownIssue)) + foreach(var msg in param.Messages) { - owner.AddValidationError(this.objectId, header.knownIssue, Rendering.ShaderCompilerMessageSeverity.Warning); - break; // We can only show one error badge at a time. + owner?.AddValidationError(this.objectId, msg, Rendering.ShaderCompilerMessageSeverity.Warning); } } } diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNodePropertyDrawer.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNodePropertyDrawer.cs index 1fe1ef32bdf..f765eb937d8 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNodePropertyDrawer.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNodePropertyDrawer.cs @@ -1,7 +1,7 @@ using System; using UnityEngine.UIElements; using UnityEditor.ShaderGraph.ProviderSystem; -using UnityEngine; +using System.Text; namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers { @@ -14,37 +14,65 @@ internal override void AddCustomNodeProperties(VisualElement parentElement, Abst { node = nodeBase as ProviderNode; var provider = node.Provider; - var definition = node.Provider.Definition; string sourcePath = AssetDatabase.GUIDToAssetPath(node.Provider.AssetID); - string providerKey = provider.ProviderKey; - string qualifiedSignature = ShaderObjectUtils.QualifySignature(node.Provider.Definition, true, true); - bool hasProviderKey = definition?.Hints?.ContainsKey(Hints.Func.kProviderKey) ?? false; - if (provider == null) + if (!provider.IsValid) { - parentElement.Add(new HelpBoxRow("Provider node is in an invalid and irrecoverable state.", MessageType.Error)); + parentElement.Add(new HelpBoxRow($"Could not find '{providerKey}' in '{sourcePath}'.", MessageType.Error)); + // TODO: When this happens, we should offer to update the AssetID if it's found elsewhere in the provider library. + // This should be a consideration for API Management Hints (SVFXG-865). return; } - bool isAnAsset = provider.AssetID != default; + // TODO: We could show this for all ProviderNodes, but the inspector isn't currently refreshed on topological changes. + if (provider.AssetID != default) + { + parentElement.Add(new Label("Provider Key")); + parentElement.Add(new HelpBoxRow(providerKey, MessageType.None)); - if (!isAnAsset) - return; + parentElement.Add(new Label("Source Path")); + parentElement.Add(new HelpBoxRow(sourcePath, MessageType.None)); + + string qualifiedSignature = ShaderObjectUtils.QualifySignature(node.Provider.Definition, true, true); + parentElement.Add(new Label("Qualified Signature")); + parentElement.Add(new HelpBoxRow(qualifiedSignature, MessageType.None)); - else if (!provider.IsValid) + string code = ShaderObjectUtils.GenerateCode(provider.Definition, false, false, false); + parentElement.Add(new Label("Expected Definition")); + parentElement.Add(new HelpBoxRow(code, MessageType.None)); + } + + StringBuilder sb = new(); + bool hasMsg = false; + + // Function + foreach (var msg in node.Header.Messages) { - parentElement.Add(new HelpBoxRow($"Could not find '{providerKey}' in '{sourcePath}'.", MessageType.Error)); + hasMsg = true; + sb.AppendLine(msg); } - else if (!hasProviderKey) + if (hasMsg) { - parentElement.Add(new HelpBoxRow($"'{providerKey}' in '{sourcePath}' does not have a 'ProviderKey' hint. If the namespace, name, or parameter list changes- this node instance will become invalidated.", MessageType.Warning)); + parentElement.Add(new Label("Function Hint Messages")); + parentElement.Add(new HelpBoxRow(sb.ToString(), MessageType.Warning)); } - else + + // Parameters + foreach (var paramHeader in node.ParamHeaders) { - parentElement.Add(new HelpBoxRow($"Provider Key '{providerKey}' for \n" + - $"Function Signature '{qualifiedSignature}' found in \n" + - $"File Path '{sourcePath}'.", MessageType.Info)); + hasMsg = false; + sb.Clear(); + foreach(var msg in paramHeader.Messages) + { + hasMsg = true; + sb.AppendLine(msg); + } + if (hasMsg) + { + parentElement.Add(new Label($"Parameter '{paramHeader.referenceName}' Hint Messages")); + parentElement.Add(new HelpBoxRow(sb.ToString(), MessageType.Warning)); + } } } } diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider.meta new file mode 100644 index 00000000000..89f33e7526d --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d21febea789d748cb9d2cd29153e7b1b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ExpressionProvider.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ExpressionProvider.cs similarity index 98% rename from Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ExpressionProvider.cs rename to Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ExpressionProvider.cs index 2a284bd23fe..84b2f68e8df 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ExpressionProvider.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ExpressionProvider.cs @@ -60,7 +60,7 @@ public void Reload() { Hints.Common.kDisplayName, "Expression" }, { Hints.Func.kProviderKey, kExpressionProviderKey }, { Hints.Func.kSearchName, "Expression" }, - { Hints.Func.kCategory, "Utility" }, + { Hints.Func.kSearchCategory, "Utility" }, { Hints.Func.kSearchTerms, "equation, calculation, inline, code" } }; diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ExpressionProvider.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ExpressionProvider.cs.meta new file mode 100644 index 00000000000..65765f16ba2 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ExpressionProvider.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8905563cd559b4cceac8102dba04bc1a \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderAttribute.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ProviderAttribute.cs similarity index 63% rename from Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderAttribute.cs rename to Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ProviderAttribute.cs index 2885493f1fa..5ed162c6a18 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderAttribute.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ProviderAttribute.cs @@ -1,4 +1,3 @@ - using System; using System.Collections.Generic; using System.Reflection; @@ -13,7 +12,6 @@ internal class ProviderModelAttribute : Attribute public ProviderModelAttribute(string providerKey) { ProviderKey = providerKey; } } - // This marks a provider to be included in the ProviderLibrary internal class ScriptedProviderAttribute : Attribute { } internal static class ProviderTypeCache @@ -28,19 +26,16 @@ private static void BuildCache() s_providerModels = new(); s_scriptedProviders = new(); - foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) + foreach(var type in TypeCache.GetTypesWithAttribute()) { - foreach (Type type in assembly.GetTypes()) - { - var providerKey = type.GetCustomAttribute()?.ProviderKey ?? null; - if (providerKey != null) - if (!s_providerModels.TryAdd(providerKey, type)) - Debug.LogError($"Attempted to register '{type.Name}' with provider key '{providerKey}', but key is already registered to '{s_providerModels[providerKey]}'."); - - if (type.GetCustomAttribute() != null) - s_scriptedProviders.Add(type); - } + var providerKey = type.GetCustomAttribute()?.ProviderKey ?? null; + if (providerKey != null) + if (!s_providerModels.TryAdd(providerKey, type)) + Debug.LogError($"Attempted to register '{type.Name}' with provider key '{providerKey}', but key is already registered to '{s_providerModels[providerKey]}'."); } + + foreach (var type in TypeCache.GetTypesWithAttribute()) + s_scriptedProviders.Add(type); } } diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ProviderAttribute.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ProviderAttribute.cs.meta new file mode 100644 index 00000000000..26ad735c011 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ProviderAttribute.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: fe9988d529a2c48c092ade760150cd71 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Reflection/ReflectedFunctionProvider.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ReflectedFunctionProvider.cs similarity index 99% rename from Packages/com.unity.shadergraph/Editor/ProviderSystem/Reflection/ReflectedFunctionProvider.cs rename to Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ReflectedFunctionProvider.cs index fad32e29bc5..a3c63f5b550 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Reflection/ReflectedFunctionProvider.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ReflectedFunctionProvider.cs @@ -1,4 +1,3 @@ - using System; using UnityEditor.ShaderApiReflection; using UnityEngine; diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ReflectedFunctionProvider.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ReflectedFunctionProvider.cs.meta new file mode 100644 index 00000000000..f4d9807ba4b --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ReflectedFunctionProvider.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 323995a5201d24acfbf34e49a52da528 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Reflection/ReflectedFunctionProvider.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Reflection/ReflectedFunctionProvider.cs.meta deleted file mode 100644 index 51e22478b3d..00000000000 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Reflection/ReflectedFunctionProvider.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 038ab7ce009192243b6d1d84f54a250b \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Reflection/ShaderReflectionUtils.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Reflection/ShaderReflectionUtils.cs index b3352e9f647..896b872f9c5 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Reflection/ShaderReflectionUtils.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Reflection/ShaderReflectionUtils.cs @@ -1,6 +1,4 @@ - using System.Collections.Generic; -using System.Text; using UnityEditor.ShaderApiReflection; using UnityEngine; diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjectUtils.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjectUtils.cs.meta deleted file mode 100644 index 7c7e3b238e3..00000000000 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjectUtils.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 3567c810dd85b9b4a9c617ae8e5310e4 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects.meta new file mode 100644 index 00000000000..5e1aa42e5f7 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b35cb9aeb54d2447bb4c0735964a7fca +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/CommonShaderObjects.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/CommonShaderObjects.cs similarity index 99% rename from Packages/com.unity.shadergraph/Editor/ProviderSystem/CommonShaderObjects.cs rename to Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/CommonShaderObjects.cs index a5bc838e3cf..f6d727418e9 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/CommonShaderObjects.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/CommonShaderObjects.cs @@ -1,4 +1,3 @@ - using System.Collections.Immutable; using System.Collections.Generic; diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/CommonShaderObjects.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/CommonShaderObjects.cs.meta new file mode 100644 index 00000000000..4c7d71c5bbf --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/CommonShaderObjects.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c0b02fca1cdef4cc186295b20e831bba \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjectUtils.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/ShaderObjectUtils.cs similarity index 99% rename from Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjectUtils.cs rename to Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/ShaderObjectUtils.cs index ff2fce58b8e..0cdf9984bd3 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjectUtils.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/ShaderObjectUtils.cs @@ -1,4 +1,3 @@ - using System.Collections.Generic; using System.Text; diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/ShaderObjectUtils.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/ShaderObjectUtils.cs.meta new file mode 100644 index 00000000000..045b29d03da --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/ShaderObjectUtils.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 072c6e9b7b3794539a6f638e7584621a \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHeader.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHeader.cs new file mode 100644 index 00000000000..78cb928abc6 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHeader.cs @@ -0,0 +1,44 @@ +using System.Collections.Generic; + +namespace UnityEditor.ShaderGraph.ProviderSystem +{ + // A "Header" object is an abstraction layer that interprets domain/context-free + // information from a ShaderObject (in this case a function) and translates it into + // domain specific information. + abstract class StrongHeader where T : IShaderObject + { + internal bool isValid { get; private set; } + + protected HintRegistry HintRegistry => GetHintRegistry(); + + Dictionary m_values; + List m_msgs; + + internal IEnumerable Messages => m_msgs; + + protected bool Has(string key) => m_values.ContainsKey(key); + + protected V Get(string key) + { + m_values.TryGetValue(key, out object value); + return value is V ? (V)value : default; + } + + abstract protected HintRegistry GetHintRegistry(); + + // Runs once per Process call, which should be run whenever the ShaderOject and subsequent model are updated. + // Get/Has should be used here to populate the Header with meaningful information. + abstract protected void OnProcess(T obj, IProvider provider); + + internal void Process(T obj, IProvider provider) + { + isValid = obj != null && obj.IsValid && provider != null && provider.IsValid; + + if (!isValid) + return; + + HintRegistry.ProcessObject(obj, provider, out m_values, out m_msgs); + OnProcess(obj, provider); + } + } +} diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHeader.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHeader.cs.meta new file mode 100644 index 00000000000..d53de8ab9c2 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHeader.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f8dbcdb5f80df4f758fb8d5911ff5c85 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHint.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHint.cs new file mode 100644 index 00000000000..7f645907103 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHint.cs @@ -0,0 +1,116 @@ +using System.Collections.Generic; +using System.Text; + +namespace UnityEditor.ShaderGraph.ProviderSystem +{ + interface IStrongHint where T : IShaderObject + { + string Key { get; } + IReadOnlyCollection Synonyms => null; + IReadOnlyCollection Conflicts => null; + + bool Process(bool found, string rawValue, T obj, IProvider provider, out object value, out string msg); + } + + internal class HintRegistry where T : IShaderObject + { + List> m_hints = new(); + Dictionary> m_alternates = new(); + + internal void RegisterStrongHint(IStrongHint hint) + { + m_hints.Add(hint); + var alternates = new List(DisqualifyKey(hint.Key)); + + if (hint.Synonyms != null) + foreach(var synonym in hint.Synonyms) + alternates.AddRange(DisqualifyKey(synonym, true)); + + if (alternates.Count > 0) + m_alternates.Add(hint.Key, alternates); + } + + // eg. (unity:engine:sg:HintKey) => engine:sg:HintKey, sg:HintKey, HintKey + private static IEnumerable DisqualifyKey(string key, bool inclusive = false) + { + if (inclusive) + yield return key; + + for (int i = 0; i < key.Length - 1; ++i) + { + if (key[i] == ':') + { + int j; + // find next non ':' index. + for (j = i + 1; j < key.Length && key[j] == ':'; ++j); + + string candidate = key[j..]; + if (!string.IsNullOrEmpty(candidate)) + yield return candidate; + } + } + } + + internal void ProcessObject(T obj, IProvider provider, out Dictionary values, out List msgs) + { + values = new(); + msgs = new(); + Dictionary> conflictCases = new(); + + // this is run per the registered hint types and not the hints on the object. + foreach (var hint in m_hints) + { + // assess whether the object has the hint. + bool hintFound = obj.Hints.TryGetValue(hint.Key, out var hintRawValue); + bool hintValid = false; + + // try the alternate keys. It isn't strictly erroneous to have alternates also be present. + if (!hintFound && m_alternates.ContainsKey(hint.Key)) + foreach (var alternateKey in m_alternates[hint.Key]) + if (hintFound = obj.Hints.TryGetValue(alternateKey, out hintRawValue)) + break; + + // some hints may have default values and need to be processed whether they are found or not. + if (hintValid = hint.Process(hintFound, hintRawValue, obj, provider, out var value, out var msg)) + { + values.Add(hint.Key, value); + } + + if (!string.IsNullOrWhiteSpace(msg)) + msgs.Add($"{hint.Key}: {msg}"); + + // if they were processed or existed previously, we need to consider their conflict classes. + if ((hintFound || hintValid) && hint.Conflicts != null && hint.Conflicts.Count > 0) + { + foreach(var conflict in hint.Conflicts) + { + conflictCases.TryAdd(conflict, new()); + conflictCases[conflict].Add(hint.Key); + } + } + } + + foreach(var caseKV in conflictCases) + { + // if there is only one hint in a conflict case, it isn't conflicted. + if (caseKV.Value.Count <= 1) + continue; + + // otherwise it'll need a message and for the conflicting hints to be removed from the values. + StringBuilder sb = new(); + bool first = true; + sb.Append($"Conflicting hints of class '{caseKV.Key}' found, ignoring: "); + foreach (var conflictKey in caseKV.Value) + { + // Any key in conflict is removed and ignored. + values.Remove(conflictKey); + if (!first) + sb.Append(", "); + sb.Append($"{conflictKey}"); + first = false; + } + msgs.Add(sb.ToString()); + } + } + } +} diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHint.cs.meta b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHint.cs.meta new file mode 100644 index 00000000000..ea1d3e83f1f --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/StrongHint.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 39d187709fcb149e182cd6c69ce13ed4 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Tests/Editor/ProviderTests/StrongHintTests.cs b/Packages/com.unity.shadergraph/Tests/Editor/ProviderTests/StrongHintTests.cs new file mode 100644 index 00000000000..0d30514ba7f --- /dev/null +++ b/Packages/com.unity.shadergraph/Tests/Editor/ProviderTests/StrongHintTests.cs @@ -0,0 +1,246 @@ +using System; +using System.Collections.Generic; +using NUnit.Framework; +using UnityEngine; +using UnityEngine.TestTools; + +namespace UnityEditor.ShaderGraph.ProviderSystem.Tests +{ + class TestProvider : IProvider + { + public string ProviderKey { get; private set; } + public GUID AssetID { get; private set; } + public IShaderFunction Definition { get; private set; } + + internal TestProvider(string testName, string path = null, IEnumerable namespaces = null) + { + ProviderKey = testName; + AssetID = path == null ? default : AssetDatabase.GUIDFromAssetPath(path); + Definition = new ShaderFunction(testName, namespaces, null, new ShaderType("void"), null, null); + } + + internal TestProvider(string testName, string hintKey, string hintValue, string path = null, IEnumerable namespaces = null) + { + ProviderKey = testName; + AssetID = path == null ? default : AssetDatabase.GUIDFromAssetPath(path); + Definition = new ShaderFunction(testName, namespaces, null, new ShaderType("void"), null, new Dictionary { { hintKey, hintValue } }); + } + + public IProvider Clone() + { + throw new NotImplementedException(); + } + } + + [TestFixture] + class StrongHintTests + { + private static void DoConflictTest(HintRegistry reg, string testName, IEnumerable hintSet, int expectSuccess, bool expectMessage, Dictionary values, List messages) + { + values.Clear(); + messages.Clear(); + + var obj = new TestObject(testName, hintSet); + + reg.ProcessObject(obj, null, out values, out messages); + + Assert.AreEqual(expectSuccess, values.Count, $"{testName} successes expected"); + Assert.AreEqual(expectMessage, messages.Count > 0, $"{testName} conflicts expected"); + } + + private static void DoDisplayNameTest(HintRegistry reg, string referenceName, string displayName, Dictionary values, List messages) + { + + + if (displayName == null) + displayName = referenceName; + + var hints = new Dictionary(); + if (displayName != null) + hints.Add(Hints.Common.kDisplayName, displayName); + + var obj = new TestObject(referenceName, hints); + + DoOneHintTest(reg, obj, true, displayName, false, values, messages, Hints.Common.kDisplayName); + } + + private static IShaderField Param(string testName, IShaderType shaderType, string hintKey, string hintValueRaw) + { + var hints = new Dictionary() { { hintKey, hintValueRaw } }; + return new ShaderField(testName, false, false, shaderType, hints); + } + + private static void DoOneHintTest(HintRegistry reg, IProvider provider, bool expectsValue, V expectedValue, bool expectsMessage, Dictionary values, List messages, string hintKey = null) where T : IShaderObject + { + DoOneHintTest(reg, provider.Definition, expectsValue, expectedValue, expectsMessage, values, messages, hintKey, provider); + } + + private static void DoOneHintTest(HintRegistry reg, T obj, bool expectsValue, V expectedValue, bool expectsMessage, Dictionary values, List messages, string hintKey = null, IProvider provider = null) where T : IShaderObject + { + values.Clear(); + messages.Clear(); + + string testName = obj.Name; + if (hintKey == null) + foreach (var hint in obj.Hints.Keys) + hintKey = hint; + + Assert.NotNull(hintKey, $"ShaderObject {obj.Name} must have a hint to test."); + + reg.ProcessObject((T)obj, provider, out values, out messages); + + Assert.AreEqual(expectsValue, values.Count > 0, $"{testName} for {hintKey}, value expected"); + Assert.AreEqual(expectsMessage, messages.Count > 0, $"{testName} for {hintKey}, message expected"); + if (expectsValue) + Assert.AreEqual(expectedValue, values[hintKey], $"{testName} for {hintKey}, expected value"); + } + + struct TestObject : IShaderObject + { + public string Name { get; private set; } + public IReadOnlyDictionary Hints { get; private set; } + public bool IsValid => true; + + internal TestObject(string name, IEnumerable flagHints) + { + Name = name; + Dictionary hints = new(); + foreach (var hint in flagHints) + hints.Add(hint, ""); + Hints = hints; + } + + internal TestObject(string name, Dictionary hints) + { + Name = name; + Hints = hints; + } + } + + [Test] + public void ConflictClasses() + { + HintRegistry reg = new(); + + var ha = new Hints.Flag("hA", "cA"); + var hb = new Hints.Flag("hB", "cA"); + var hc = new Hints.Flag("hC", "cB"); + var hd = new Hints.Flag("hD", "cB"); + + reg.RegisterStrongHint(ha); + reg.RegisterStrongHint(hb); + reg.RegisterStrongHint(hc); + reg.RegisterStrongHint(hd); + + Dictionary values = new(); + List messages = new(); + + DoConflictTest(reg, "BaseNoResults", new string[] { }, 0, false, values, messages); + DoConflictTest(reg, "OneConflict", new string[] { "hA", "hB" }, 0, true, values, messages); + DoConflictTest(reg, "TwoConflicts", new string[] { "hA", "hB", "hC", "hD" }, 0, true, values, messages); + DoConflictTest(reg, "OneConflictOneSafe", new string[] { "hA", "hC", "hD" }, 1, true, values, messages); + DoConflictTest(reg, "Safe2Results", new string[] { "hA", "hC" }, 2, false, values, messages); + } + + [Test] + public void DisplayName() + { + HintRegistry reg = new(); + reg.RegisterStrongHint(new Hints.DisplayName()); + + Dictionary values = new(); + List messages = new(); + + DoDisplayNameTest(reg, "TestObject", null, values, messages); // default to reference name + DoDisplayNameTest(reg, "TestObject", "Test Object DisplayName", values, messages); + } + + + [Test] + public void TestRange() + { + // Most hints are _very simple_. + HintRegistry reg = new(); + reg.RegisterStrongHint(new Hints.Range()); + + Dictionary values = new(); + List messages = new(); + + var floatType = new ShaderType("float"); + var halfType = new ShaderType("half"); + var float2Type = new ShaderType("float2"); + + // regularly supported use-cases + DoOneHintTest(reg, Param("RangeNone", floatType, Hints.Param.kRange, null), true, new float[2] { 0, 1 }, false, values, messages); + DoOneHintTest(reg, Param("RangeMin", floatType, Hints.Param.kRange, "-5"), true, new float[2] { -5, 0 }, false, values, messages); + DoOneHintTest(reg, Param("RangeMax", floatType, Hints.Param.kRange, "5"), true, new float[2] { 0, 5 }, false, values, messages); + DoOneHintTest(reg, Param("RangeMinMax", floatType, Hints.Param.kRange, "-5, 5"), true, new float[2] { -5, 5 }, false, values, messages); + DoOneHintTest(reg, Param("RangeMaxMin", floatType, Hints.Param.kRange, "5, -5"), true, new float[2] { -5, 5 }, false, values, messages); + DoOneHintTest(reg, Param("RangeHalfType", halfType, Hints.Param.kRange, null), true, new float[2] { 0, 1 }, false, values, messages); + + // invalid cases + DoOneHintTest(reg, Param("RangeTooManyArgs", floatType, Hints.Param.kRange, "5, -10, 10, -5"), false, new float[2] { 0, 0 }, true, values, messages); + DoOneHintTest(reg, Param("RangeTypeUnsupported", float2Type, Hints.Param.kRange, "-5, 5"), false, new float[2] { 0, 0 }, true, values, messages); + DoOneHintTest(reg, Param("RangeInvalidString", floatType, Hints.Param.kRange, "blah blah blah"), false, new float[2] { 0, 1 }, true, values, messages); + } + + [Test] + public void TestCategory() + { + var reg = new HintRegistry(); + reg.RegisterStrongHint(new Hints.SearchCategory()); + + Dictionary values = new(); + List messages = new(); + + var searchBase = new TestProvider("base", Hints.Func.kSearchCategory, "This/Is/A/Category"); + DoOneHintTest(reg, searchBase, true, "This/Is/A/Category", false, values, messages, Hints.Func.kSearchCategory); + + // Doesn't work on Mac; probably due to ADB warmup issues; TODO: determine why and correct this. + //var searchPath = new TestProvider("path", kAllHintsPath, null); + //DoOneHintTest(reg, searchPath, true, $"Reflected by Path/{kAllHintsPath}", false, values, messages, Hints.Func.kSearchCategory); + + // namespace should trump the file path fallback + var searchNamespace = new TestProvider("namespace", kAllHintsPath, new string[] { "NamespaceA", "NamespaceB" }); + DoOneHintTest(reg, searchNamespace, true, "Reflected by Namespace/NamespaceA/NamespaceB", false, values, messages, Hints.Func.kSearchCategory); + + var searchUncategorized = new TestProvider("nocategory"); + DoOneHintTest(reg, searchUncategorized, true, "Uncategorized", false, values, messages, Hints.Func.kSearchCategory); + } + + [Test] + public void SummaryAndSynonyms() + { + // Most hints are _very simple_. + HintRegistry reg = new(); + reg.RegisterStrongHint(new Hints.Tooltip()); + + Dictionary values = new(); + List messages = new(); + + string tooltipValue = "this is a tooltip"; + var noHint = new TestObject("NoHint", new Dictionary()); + var matchHint = new TestObject("WithCorrectHintName", new Dictionary() { { Hints.Common.kTooltip, tooltipValue } }); + var disqHint = new TestObject("WithDisqualifiedName", new Dictionary() { { "Tooltip", tooltipValue } }); + var altHint = new TestObject("WithAlternateSynonym", new Dictionary() { { "summary", tooltipValue } }); + + DoOneHintTest(reg, noHint, false, "", false, values, messages, Hints.Common.kTooltip); + DoOneHintTest(reg, matchHint, true, tooltipValue, false, values, messages, Hints.Common.kTooltip); + DoOneHintTest(reg, disqHint, true, tooltipValue, false, values, messages, Hints.Common.kTooltip); + DoOneHintTest(reg, altHint, true, tooltipValue, false, values, messages, Hints.Common.kTooltip); + } + + readonly string kAllHintsPath = "Assets/Testing/IntegrationTests/Graphs/ProviderSystem/AllHints.hlsl"; + readonly string kAllHintsGraphPath = "Assets/Testing/IntegrationTests/Graphs/ProviderSystem/ShouldCompileProperlyOnImport.shadergraph"; + + [Test] + public void CheckAllHints() + { + // 'AllHints.hlsl' is used by 'ShouldCompileOnImport.shadergraph' + // This reflected function covers most of our expected hint usage, so as a broad coverage integration test we can + // ask it to reimport, which will populate error messages and fail the test if anything is awry. + AssetDatabase.ImportAsset(kAllHintsPath, ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate); + AssetDatabase.ImportAsset(kAllHintsGraphPath, ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate); + } + } +} diff --git a/Packages/com.unity.shadergraph/Tests/Editor/ProviderTests/StrongHintTests.cs.meta b/Packages/com.unity.shadergraph/Tests/Editor/ProviderTests/StrongHintTests.cs.meta new file mode 100644 index 00000000000..ade4327b2b0 --- /dev/null +++ b/Packages/com.unity.shadergraph/Tests/Editor/ProviderTests/StrongHintTests.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: db6a00897eebf2349af1c113d527b270 \ No newline at end of file From ee036c4bcc110a0982e143d1eeee54254f0e65fe Mon Sep 17 00:00:00 2001 From: Raquel Peces Date: Tue, 3 Mar 2026 03:04:06 +0000 Subject: [PATCH 29/95] Change UIDocument to PanelRenderer for Rendering Debugger --- .../Runtime/Debugging/RuntimeDebugWindow.cs | 70 ++++++++++++++----- 1 file changed, 51 insertions(+), 19 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Debugging/RuntimeDebugWindow.cs b/Packages/com.unity.render-pipelines.core/Runtime/Debugging/RuntimeDebugWindow.cs index fd7d4c934ab..fa2eb2ea482 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Debugging/RuntimeDebugWindow.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Debugging/RuntimeDebugWindow.cs @@ -11,7 +11,8 @@ namespace UnityEngine.Rendering [AddComponentMenu("")] // Hide from Add Component menu class RuntimeDebugWindow : MonoBehaviour { - UIDocument m_Document; + PanelRenderer m_PanelRenderer; + VisualElement m_RootVisualElement; VisualElement m_PanelRootElement; TabView m_TabViewElement; @@ -24,29 +25,47 @@ void Awake() DebugManager.instance.onSetDirty -= RequestRecreateGUI; DebugManager.instance.onSetDirty += RequestRecreateGUI; - RecreateGUI(); + if (m_PanelRenderer == null) + { + m_PanelRenderer = gameObject.AddComponent(); + if (GraphicsSettings.TryGetRenderPipelineSettings(out var resources)) + { + m_PanelRenderer.panelSettings = resources.panelSettings; + m_PanelRenderer.visualTreeAsset = resources.visualTreeAsset; + } + } + + m_PanelRenderer.RegisterUIReloadCallback(OnUIReload); } - internal void RecreateGUI() + internal void OnUIReload(PanelRenderer renderer, VisualElement rootElement) { - var resources = GraphicsSettings.GetRenderPipelineSettings(); - if (m_Document == null) - m_Document = gameObject.AddComponent(); - m_Document.panelSettings = resources.panelSettings; - m_Document.visualTreeAsset = resources.visualTreeAsset; + // Called on initial load AND on any asset change + if (rootElement == null || rootElement.childCount == 0) + return; + + m_PanelRootElement = rootElement; + m_RootVisualElement = rootElement[0]; - var rootVisualElement = m_Document.rootVisualElement; - m_PanelRootElement = rootVisualElement.panel.visualTree; + var resources = GraphicsSettings.GetRenderPipelineSettings(); var styleSheets = resources.styleSheets; foreach (var uss in styleSheets) m_PanelRootElement.styleSheets.Add(uss); + BuildDebugUI(); + } + + void BuildDebugUI() + { + if (m_RootVisualElement == null) + return; + UpdateOrientation(forceUpdate: true); - m_TabViewElement = rootVisualElement.Q(name: "debug-window-tabview"); + m_TabViewElement = m_RootVisualElement.Q(name: "debug-window-tabview"); m_TabViewElement.Clear(); - var resetButton = rootVisualElement.Q public BoolParameter enable = new BoolParameter(false, BoolParameter.DisplayType.EnumPopup); /// + /// When enabled, contact shadows are only evaluated for the main directional light with shadows in the scene. + /// + public BoolParameter directionalOnly = new BoolParameter(false, BoolParameter.DisplayType.Checkbox); + /// + /// When enabled, contact shadows are evaluated at half resolution. + /// + public BoolParameter halfResolution = new BoolParameter(false, BoolParameter.DisplayType.Checkbox); + /// /// Controls the length of the rays HDRP uses to calculate Contact Shadows. It is in meters, but it gets scaled by a factor depending on Distance Scale Factor /// and the depth of the point from where the contact shadow ray is traced. /// diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.cs index 03a86f4047a..6bd98cc55c7 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.cs @@ -389,6 +389,7 @@ internal static HDShadowAtlasInitParams GetDefault() directionalShadowFilteringQuality = HDShadowFilteringQuality.Medium, areaShadowFilteringQuality = HDAreaShadowFilteringQuality.Medium, supportScreenSpaceShadows = false, + supportContactShadows = true, maxScreenSpaceShadowSlots = 4, screenSpaceShadowBufferFormat = ScreenSpaceShadowFormat.R16G16B16A16, maxDirectionalShadowMapResolution = 2048, @@ -459,6 +460,8 @@ internal static HDShadowAtlasInitParams GetDefault() // [ShaderKeywordFilter.RemoveIf(false, keywordNames: "SCREEN_SPACE_SHADOWS_ON")] #endif public bool supportScreenSpaceShadows; + /// Enable support for contact shadows. + public bool supportContactShadows; /// Maximum number of screen space shadows. public int maxScreenSpaceShadowSlots; /// Format for screen space shadows. diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader index f73538de569..3c3c4634103 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader @@ -519,6 +519,7 @@ Shader "HDRP/AxF" #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK #pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 #pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile_fragment _ CONTACT_SHADOWS_OFF // Setup DECALS_OFF so the shader stripper can remove variants #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader index c732a87acba..c7bbfc8d92b 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader @@ -1071,6 +1071,7 @@ Shader "HDRP/LayeredLit" #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK #pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 #pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile_fragment _ CONTACT_SHADOWS_OFF // Setup DECALS_OFF so the shader stripper can remove variants #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader index 67504f64e6e..6f5d6f92b38 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader @@ -1124,6 +1124,7 @@ Shader "HDRP/LayeredLitTessellation" #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK #pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 #pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile_fragment _ CONTACT_SHADOWS_OFF // Setup DECALS_OFF so the shader stripper can remove variants #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader index 9f8401e815a..62f0f55824a 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader @@ -869,6 +869,7 @@ Shader "HDRP/Lit" #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK #pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 #pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile_fragment _ CONTACT_SHADOWS_OFF // Setup DECALS_OFF so the shader stripper can remove variants #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT @@ -999,6 +1000,7 @@ Shader "HDRP/Lit" #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK #pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 #pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile_fragment _ CONTACT_SHADOWS_OFF // Setup DECALS_OFF so the shader stripper can remove variants #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader index c8c56fd60e0..179db4d9b79 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader @@ -896,6 +896,7 @@ Shader "HDRP/LitTessellation" #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK #pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 #pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile_fragment _ CONTACT_SHADOWS_OFF // Setup DECALS_OFF so the shader stripper can remove variants #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT @@ -1024,6 +1025,7 @@ Shader "HDRP/LitTessellation" #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK #pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 #pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile_fragment _ CONTACT_SHADOWS_OFF // Setup DECALS_OFF so the shader stripper can remove variants #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit.shader b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit.shader index bdb2892316f..c4f97198bf2 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit.shader +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit.shader @@ -295,6 +295,7 @@ Shader "HDRP/TerrainLit" #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK #pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 #pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile_fragment _ CONTACT_SHADOWS_OFF // Setup DECALS_OFF so the shader stripper can remove variants #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_Basemap.shader b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_Basemap.shader index 04e6633db21..2caec41dff4 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_Basemap.shader +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_Basemap.shader @@ -234,6 +234,7 @@ Shader "Hidden/HDRP/TerrainLit_Basemap" #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK #pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 #pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile_fragment _ CONTACT_SHADOWS_OFF // Setup DECALS_OFF so the shader stripper can remove variants #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs index 8b379232b18..4909219fe7f 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs @@ -481,7 +481,7 @@ unsafe void PrepareBuildGPULightListPassData( passData.clearLightLists = true; tileAndClusterData.listsAreInitialized = true; } - + // Always build the light list in XR mode to avoid issues with multi-pass if (hdCamera.xr.enabled) { @@ -1469,11 +1469,19 @@ class RenderContactShadowPassData public int actualWidth; public int actualHeight; public int depthTextureParameterName; + public int numTilesFPTL; + public int numTilesFPTLX; + public int numTilesFPTLY; + public bool directionalOnly; + public bool halfResolution; + public bool msaa; public LightLoopLightData lightLoopLightData; public TextureHandle depthTexture; public TextureHandle contactShadowsTexture; public BufferHandle lightList; + public ComputeBuffer depthPyramidMipLevelOffsets; + public BufferHandle tileFeatureFlags; } TextureHandle RenderContactShadows(RenderGraph renderGraph, HDCamera hdCamera, in TextureHandle depthTexture, in BuildGPULightListOutput lightLists, int firstMipOffsetY) @@ -1488,14 +1496,31 @@ TextureHandle RenderContactShadows(RenderGraph renderGraph, HDCamera hdCamera, i // Avoid garbage when visualizing contact shadows. bool clearBuffer = m_CurrentDebugDisplaySettings.data.fullScreenDebugMode == FullScreenDebugMode.ContactShadows; - bool msaa = hdCamera.msaaEnabled; + passData.directionalOnly = m_ContactShadows.directionalOnly.value; + passData.halfResolution = m_ContactShadows.halfResolution.value; passData.contactShadowsCS = contactShadowComputeShader; + passData.msaa = hdCamera.msaaEnabled; + passData.contactShadowsCS.shaderKeywords = null; - if (msaa) - { + if (passData.directionalOnly) + passData.contactShadowsCS.EnableKeyword("DIRECTIONAL_ONLY"); + if (passData.halfResolution) + passData.contactShadowsCS.EnableKeyword("HALF_RESOLUTION"); + if (passData.msaa) passData.contactShadowsCS.EnableKeyword("ENABLE_MSAA"); - } + if (GetFeatureVariantsEnabled(hdCamera.frameSettings)) + passData.contactShadowsCS.EnableKeyword("USE_FEATURE_FLAGS"); + + passData.numTilesFPTLX = GetNumTileFtplX(hdCamera); + passData.numTilesFPTLY = GetNumTileFtplY(hdCamera); + passData.numTilesFPTL = passData.numTilesFPTLX * passData.numTilesFPTLY; + + passData.tileFeatureFlags = lightLists.tileFeatureFlags; + builder.UseBuffer(passData.tileFeatureFlags); + + int width = passData.halfResolution ? Mathf.CeilToInt(hdCamera.actualWidth * 0.5f) : hdCamera.actualWidth; + int height = passData.halfResolution ? Mathf.CeilToInt(hdCamera.actualHeight * 0.5f) : hdCamera.actualHeight; passData.rayTracingEnabled = RayTracedContactShadowsRequired() && GetRayTracingState(); if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.RayTracing)) @@ -1503,8 +1528,8 @@ TextureHandle RenderContactShadows(RenderGraph renderGraph, HDCamera hdCamera, i passData.contactShadowsRTS = rayTracingResources.contactShadowRayTracingRT; passData.accelerationStructure = RequestAccelerationStructure(hdCamera); - passData.actualWidth = hdCamera.actualWidth; - passData.actualHeight = hdCamera.actualHeight; + passData.actualWidth = width; + passData.actualHeight = height; } passData.kernel = s_deferredContactShadowKernel; @@ -1520,20 +1545,25 @@ TextureHandle RenderContactShadows(RenderGraph renderGraph, HDCamera hdCamera, i passData.params2 = new Vector4(firstMipOffsetY, contactShadowMinDist, contactShadowFadeIn, m_ContactShadows.rayBias.value * 0.01f); passData.params3 = new Vector4(m_ContactShadows.sampleCount, m_ContactShadows.thicknessScale.value * 10.0f, 0.0f, 0.0f); - int deferredShadowTileSize = 8; // Must match ContactShadows.compute - passData.numTilesX = (hdCamera.actualWidth + (deferredShadowTileSize - 1)) / deferredShadowTileSize; - passData.numTilesY = (hdCamera.actualHeight + (deferredShadowTileSize - 1)) / deferredShadowTileSize; + const int kDeferredShadowTileSize = 8; // Must match ContactShadows.compute + passData.numTilesX = HDUtils.DivRoundUp(width, kDeferredShadowTileSize); + passData.numTilesY = HDUtils.DivRoundUp(height, kDeferredShadowTileSize); passData.viewCount = hdCamera.viewCount; - passData.depthTextureParameterName = msaa ? HDShaderIDs._CameraDepthValuesTexture : HDShaderIDs._CameraDepthTexture; + passData.depthTextureParameterName = passData.msaa ? HDShaderIDs._CameraDepthValuesTexture : HDShaderIDs._CameraDepthTexture; passData.lightLoopLightData = m_LightLoopLightData; passData.lightList = lightLists.lightList; builder.UseBuffer(passData.lightList, AccessFlags.Read); + passData.depthTexture = depthTexture; + passData.depthPyramidMipLevelOffsets = hdCamera.depthBufferMipChainInfo.GetOffsetBufferData(m_DepthPyramidMipLevelOffsetsBuffer); builder.UseTexture(passData.depthTexture, AccessFlags.Read); - passData.contactShadowsTexture = renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { format = GraphicsFormat.R32_UInt, enableRandomWrite = true, clearBuffer = clearBuffer, clearColor = Color.clear, name = "ContactShadowsBuffer" }); + + GraphicsFormat contactShadowFormat = passData.directionalOnly ? GraphicsFormat.R8_UInt : GraphicsFormat.R32_UInt; + Vector2 resolution = passData.halfResolution ? Vector2.one * 0.5f : Vector2.one; + passData.contactShadowsTexture = renderGraph.CreateTexture(new TextureDesc(resolution, true, true) + { format = contactShadowFormat, enableRandomWrite = true, clearBuffer = clearBuffer, clearColor = Color.clear, name = "ContactShadowsBuffer" }); builder.UseTexture(passData.contactShadowsTexture, AccessFlags.Write); result = passData.contactShadowsTexture; @@ -1541,6 +1571,10 @@ TextureHandle RenderContactShadows(RenderGraph renderGraph, HDCamera hdCamera, i builder.SetRenderFunc( static (RenderContactShadowPassData data, ComputeGraphContext ctx) => { + ctx.cmd.SetComputeBufferParam(data.contactShadowsCS, s_BuildIndirectKernel, HDShaderIDs.g_TileFeatureFlags, data.tileFeatureFlags); + ctx.cmd.SetComputeIntParam(data.contactShadowsCS, HDShaderIDs.g_NumTiles, data.numTilesFPTL); + ctx.cmd.SetComputeIntParam(data.contactShadowsCS, HDShaderIDs.g_NumTilesX, data.numTilesFPTLX); + ctx.cmd.SetComputeVectorParam(data.contactShadowsCS, HDShaderIDs._ContactShadowParamsParameters, data.params1); ctx.cmd.SetComputeVectorParam(data.contactShadowsCS, HDShaderIDs._ContactShadowParamsParameters2, data.params2); ctx.cmd.SetComputeVectorParam(data.contactShadowsCS, HDShaderIDs._ContactShadowParamsParameters3, data.params3); @@ -1552,6 +1586,7 @@ TextureHandle RenderContactShadows(RenderGraph renderGraph, HDCamera hdCamera, i ctx.cmd.SetComputeTextureParam(data.contactShadowsCS, data.kernel, data.depthTextureParameterName, data.depthTexture); ctx.cmd.SetComputeTextureParam(data.contactShadowsCS, data.kernel, HDShaderIDs._ContactShadowTextureUAV, data.contactShadowsTexture); + ctx.cmd.SetComputeBufferParam(data.contactShadowsCS, data.kernel, HDShaderIDs._DepthPyramidMipLevelOffsets, data.depthPyramidMipLevelOffsets); ctx.cmd.DispatchCompute(data.contactShadowsCS, data.kernel, data.numTilesX, data.numTilesY, data.viewCount); 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 0a3781261d6..fafc60df30d 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 @@ -1227,6 +1227,8 @@ void UpdateShaderVariablesGlobalCB(HDCamera hdCamera, CommandBuffer cmd) m_ShaderVariablesGlobalCB._ColorPyramidUvScaleAndLimitCurrentFrame = HDUtils.ComputeViewportScaleAndLimit(hdCamera.historyRTHandleProperties.currentViewportSize, hdCamera.historyRTHandleProperties.currentRenderTargetSize); m_ShaderVariablesGlobalCB._ColorPyramidUvScaleAndLimitPrevFrame = HDUtils.ComputeViewportScaleAndLimit(hdCamera.historyRTHandleProperties.previousViewportSize, hdCamera.historyRTHandleProperties.previousRenderTargetSize); + m_ShaderVariablesGlobalCB._ContactShadowDirectionalOnly = m_ContactShadows.directionalOnly.value ? 1u : 0u; + m_ShaderVariablesGlobalCB._ContactShadowHalfResolution = m_ContactShadows.halfResolution.value ? 1u : 0u; ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal); } diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs index fe9d845477e..4c25830bbe7 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs @@ -684,7 +684,7 @@ internal static void Sanitize(ref FrameSettings sanitizedFrameSettings, Camera c sanitizedFrameSettings.bitDatas[(uint)FrameSettingsField.ShadowMaps] &= notPreview; sanitizedFrameSettings.bitDatas[(uint)FrameSettingsField.Shadowmask] &= renderPipelineSettings.supportShadowMask && notPreview; - sanitizedFrameSettings.bitDatas[(uint)FrameSettingsField.ContactShadows] &= notPreview; + sanitizedFrameSettings.bitDatas[(uint)FrameSettingsField.ContactShadows] &= renderPipelineSettings.hdShadowInitParams.supportContactShadows && notPreview; bool pipelineSupportsRayTracing = HDRenderPipeline.PipelineSupportsRayTracing(renderPipelineSettings); // Ray tracing effects are not allowed on reflection probes due to the accumulation process. bool rayTracingActive = sanitizedFrameSettings.bitDatas[(uint)FrameSettingsField.RayTracing] &= pipelineSupportsRayTracing && notPreview && temporalAccumulationAllowed; diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl b/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl index f099f5e35a4..3132c959d69 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl @@ -134,6 +134,8 @@ SAMPLER(sampler_CameraDepthTexture); // Color pyramid (width, height, lodcount, Unused) TEXTURE2D_X(_ColorPyramidTexture); +TEXTURE2D_X(_DeferredDirectionalShadow); + // Custom pass buffer TEXTURE2D_X(_CustomDepthTexture); TEXTURE2D_X(_CustomColorTexture); diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs index 0efb213d50f..84ee39b23f4 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs @@ -305,5 +305,10 @@ unsafe struct ShaderVariablesGlobal public Vector4 _VolumetricCloudsShadowOriginToggle; public Vector4 _ColorPyramidUvScaleAndLimitCurrentFrame; public Vector4 _ColorPyramidUvScaleAndLimitPrevFrame; + + public uint _ContactShadowDirectionalOnly; + public uint _ContactShadowHalfResolution; + public uint _GlobalPadding0; + public uint _GlobalPadding1; } } diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs.hlsl b/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs.hlsl index dad5dfaa792..06bfb853bbd 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs.hlsl +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs.hlsl @@ -182,6 +182,10 @@ GLOBAL_CBUFFER_START(ShaderVariablesGlobal, b0) float4 _VolumetricCloudsShadowOriginToggle; float4 _ColorPyramidUvScaleAndLimitCurrentFrame; float4 _ColorPyramidUvScaleAndLimitPrevFrame; + uint _ContactShadowDirectionalOnly; + uint _ContactShadowHalfResolution; + uint _GlobalPadding0; + uint _GlobalPadding1; CBUFFER_END diff --git a/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDAnalyticsTests_Defaults.txt b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDAnalyticsTests_Defaults.txt index ecdf475babb..bffd0676150 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDAnalyticsTests_Defaults.txt +++ b/Packages/com.unity.render-pipelines.high-definition/Tests/Editor/HDAnalyticsTests_Defaults.txt @@ -108,6 +108,7 @@ {"hdShadowInitParams.maxPunctualShadowMapResolution":"2048"}, {"hdShadowInitParams.maxAreaShadowMapResolution":"2048"}, {"hdShadowInitParams.supportScreenSpaceShadows":"False"}, +{"hdShadowInitParams.supportContactShadows":"True"}, {"hdShadowInitParams.maxScreenSpaceShadowSlots":"4"}, {"hdShadowInitParams.screenSpaceShadowBufferFormat":"R16G16B16A16"}, {"decalSettings.drawDistance":"1000"}, diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes.meta b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes.meta new file mode 100644 index 00000000000..73a616b4938 --- /dev/null +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 88759e861ebf6354c900400df43bd9ba +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes.unity b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes.unity new file mode 100644 index 00000000000..61bb9da827f --- /dev/null +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes.unity @@ -0,0 +1,1306 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 4890085278179872738, guid: fe490f51971cada4aacf8a318d9b33f6, + type: 2} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &351037083 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 351037086} + - component: {fileID: 351037085} + - component: {fileID: 351037084} + m_Layer: 0 + m_Name: Scene Settings + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &351037084 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 351037083} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 441482e8936e35048a1dffac814e3ef8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Profile: {fileID: 11400000, guid: ea87feeda9e135c4fb0873cb0be2356e, type: 2} + m_StaticLightingSkyUniqueID: 0 + m_StaticLightingCloudsUniqueID: 0 + m_StaticLightingVolumetricClouds: 0 + bounces: 1 +--- !u!114 &351037085 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 351037083} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: 7dc8ba468743e704882075f30ae27071, type: 2} +--- !u!4 &351037086 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 351037083} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &799278374 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 799278375} + - component: {fileID: 799278378} + - component: {fileID: 799278377} + - component: {fileID: 799278376} + m_Layer: 0 + m_Name: New Text (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &799278375 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 799278374} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -1, z: -0, w: 0} + m_LocalPosition: {x: 0.469, y: 0.1473, z: -0.024999999} + m_LocalScale: {x: 0.19234164, y: 0.19234164, z: 0.19234164} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1231307734} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &799278376 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 799278374} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1843972f86a70ad4f9ac115809638244, type: 3} + m_Name: + m_EditorClassIdentifier: + pixelSize: 8 + testSettings: {fileID: 1619667378} + targetCamera: {fileID: 0} + forceTargetDimensions: {x: 200, y: 150} + overrideTestSettings: 0 + textMesh: {fileID: 799278377} +--- !u!102 &799278377 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 799278374} + m_Text: Transparent + m_OffsetZ: 0 + m_CharacterSize: 0.13513578 + m_LineSpacing: 1 + m_Anchor: 7 + m_Alignment: 1 + m_TabSize: 4 + m_FontSize: 0 + m_FontStyle: 0 + m_RichText: 0 + m_Font: {fileID: 12800000, guid: 306d620c715872046bf76568b7f382d4, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &799278378 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 799278374} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: d76269c34e0fa6d438942a0eba5acac8, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1231307733 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1231307734} + m_Layer: 0 + m_Name: Transparent + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1231307734 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1231307733} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: 1, z: -0, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 799278375} + - {fileID: 1780012261} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1399039631 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1399039632} + m_Layer: 0 + m_Name: Transmission + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1399039632 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1399039631} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: 1, z: -0, w: 0} + m_LocalPosition: {x: 7.3, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1934991149} + - {fileID: 1415425359} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1415425358 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1399039632} + m_Modifications: + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalScale.x + value: 0.38169697 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalScale.y + value: 0.38169697 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalScale.z + value: 0.38169697 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0.237 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.256 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3779317459225844349, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + propertyPath: m_Name + value: Candle_02 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, type: 3} +--- !u!4 &1415425359 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3779317459225478749, guid: 253cecc547a4cef4fbbc2fe4c1221e1e, + type: 3} + m_PrefabInstance: {fileID: 1415425358} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1619667377 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalPosition.y + value: -0.05 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalPosition.z + value: -7.88 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_AllowMSAA + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: orthographic + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: field of view + value: 28 + objectReference: {fileID: 0} + - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: far clip plane + value: 200 + objectReference: {fileID: 0} + - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: orthographic size + value: 7.27 + objectReference: {fileID: 0} + - target: {fileID: 114270329781043846, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: width + value: 853 + objectReference: {fileID: 0} + - target: {fileID: 114270329781043846, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: height + value: 480 + objectReference: {fileID: 0} + - target: {fileID: 114733060649624252, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: width + value: 853 + objectReference: {fileID: 0} + - target: {fileID: 114733060649624252, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: height + value: 480 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_Version + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: ImageComparisonSettings.TargetWidth + value: 1280 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: ImageComparisonSettings.TargetHeight + value: 300 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: ImageComparisonSettings.AverageCorrectnessThreshold + value: 0.001 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} +--- !u!114 &1619667378 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + m_PrefabInstance: {fileID: 1619667377} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9459100e7946cb84eb53a26a14473032, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1752151920 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1752151923} + - component: {fileID: 1752151922} + - component: {fileID: 1752151921} + m_Layer: 0 + m_Name: Head + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &1752151921 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1752151920} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 73c176f402d2c2f4d929aa5da7585d17, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1752151922 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1752151920} + m_Mesh: {fileID: 4300000, guid: 003b412a0b1ef1e4c9038104f29ee2d4, type: 3} +--- !u!4 &1752151923 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1752151920} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.742, y: 0, z: 0.001} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1881533628} + m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} +--- !u!1 &1780012260 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1780012261} + - component: {fileID: 1780012263} + - component: {fileID: 1780012262} + m_Layer: 0 + m_Name: Head + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1780012261 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1780012260} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.496, y: 0, z: 0.001} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1231307734} + m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} +--- !u!23 &1780012262 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1780012260} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 2505e1d9c7a8c654487d6a2dcae04242, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1780012263 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1780012260} + m_Mesh: {fileID: 4300000, guid: 003b412a0b1ef1e4c9038104f29ee2d4, type: 3} +--- !u!1 &1881533627 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1881533628} + m_Layer: 0 + m_Name: Opaque + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1881533628 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1881533627} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: 1, z: -0, w: 0} + m_LocalPosition: {x: -7.3, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2024496927} + - {fileID: 1752151923} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1934991148 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1934991149} + - component: {fileID: 1934991152} + - component: {fileID: 1934991151} + - component: {fileID: 1934991150} + m_Layer: 0 + m_Name: New Text (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1934991149 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934991148} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -1, z: -0, w: 0} + m_LocalPosition: {x: 0.257, y: 0.1473, z: -0.024999999} + m_LocalScale: {x: 0.19234164, y: 0.19234164, z: 0.19234164} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1399039632} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1934991150 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934991148} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1843972f86a70ad4f9ac115809638244, type: 3} + m_Name: + m_EditorClassIdentifier: + pixelSize: 8 + testSettings: {fileID: 1619667378} + targetCamera: {fileID: 0} + forceTargetDimensions: {x: 200, y: 150} + overrideTestSettings: 0 + textMesh: {fileID: 1934991151} +--- !u!102 &1934991151 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934991148} + m_Text: Transmission + m_OffsetZ: 0 + m_CharacterSize: 0.13513578 + m_LineSpacing: 1 + m_Anchor: 7 + m_Alignment: 1 + m_TabSize: 4 + m_FontSize: 0 + m_FontStyle: 0 + m_RichText: 0 + m_Font: {fileID: 12800000, guid: 306d620c715872046bf76568b7f382d4, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1934991152 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934991148} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: d76269c34e0fa6d438942a0eba5acac8, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &2024496926 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2024496927} + - component: {fileID: 2024496929} + - component: {fileID: 2024496928} + - component: {fileID: 2024496930} + m_Layer: 0 + m_Name: New Text (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2024496927 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2024496926} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -1, z: -0, w: 0} + m_LocalPosition: {x: -0.729, y: 0.1473, z: -0.024999999} + m_LocalScale: {x: 0.19234164, y: 0.19234164, z: 0.19234164} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1881533628} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &2024496928 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2024496926} + m_Text: Opaque + m_OffsetZ: 0 + m_CharacterSize: 0.13513578 + m_LineSpacing: 1 + m_Anchor: 7 + m_Alignment: 1 + m_TabSize: 4 + m_FontSize: 0 + m_FontStyle: 0 + m_RichText: 0 + m_Font: {fileID: 12800000, guid: 306d620c715872046bf76568b7f382d4, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &2024496929 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2024496926} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: d76269c34e0fa6d438942a0eba5acac8, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &2024496930 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2024496926} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1843972f86a70ad4f9ac115809638244, type: 3} + m_Name: + m_EditorClassIdentifier: + pixelSize: 8 + testSettings: {fileID: 1619667378} + targetCamera: {fileID: 0} + forceTargetDimensions: {x: 200, y: 150} + overrideTestSettings: 0 + textMesh: {fileID: 2024496928} +--- !u!1 &2042173772 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2042173776} + - component: {fileID: 2042173775} + - component: {fileID: 2042173774} + m_Layer: 0 + m_Name: Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2042173774 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2042173772} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} + m_Name: + m_EditorClassIdentifier: + m_PointlightHDType: 0 + m_SpotLightShape: 0 + m_AreaLightShape: 0 + m_EnableSpotReflector: 0 + m_LightUnit: 2 + m_LuxAtDistance: 1 + m_Intensity: 3.44 + m_InnerSpotPercent: -1 + m_ShapeWidth: -1 + m_ShapeHeight: -1 + m_AspectRatio: 1 + m_ShapeRadius: -1 + m_SpotIESCutoffPercent: 100 + m_LightDimmer: 1 + m_VolumetricDimmer: 1 + m_FadeDistance: 10000 + m_VolumetricFadeDistance: 10000 + m_AffectDiffuse: 1 + m_AffectSpecular: 1 + m_NonLightmappedOnly: 0 + m_SoftnessScale: 1 + m_UseCustomSpotLightShadowCone: 0 + m_CustomSpotLightShadowCone: 30 + m_MaxSmoothness: 1 + m_ApplyRangeAttenuation: 1 + m_DisplayAreaLightEmissiveMesh: 0 + m_AreaLightCookie: {fileID: 0} + m_IESPoint: {fileID: 0} + m_IESSpot: {fileID: 0} + m_IncludeForRayTracing: 1 + m_IncludeForPathTracing: 1 + m_AreaLightShadowCone: 120 + m_UseScreenSpaceShadows: 0 + m_InteractsWithSky: 1 + m_AngularDiameter: 0.5 + diameterMultiplerMode: 0 + diameterMultiplier: 1 + diameterOverride: 0.5 + celestialBodyShadingSource: 1 + sunLightOverride: {fileID: 0} + sunColor: {r: 1, g: 1, b: 1, a: 1} + sunIntensity: 130000 + moonPhase: 0.2 + moonPhaseRotation: 0 + earthshine: 1 + flareSize: 2 + flareTint: {r: 1, g: 1, b: 1, a: 1} + flareFalloff: 4 + flareMultiplier: 1 + surfaceTexture: {fileID: 0} + surfaceTint: {r: 1, g: 1, b: 1, a: 1} + m_Distance: 1.5e+11 + m_UseRayTracedShadows: 0 + m_NumRayTracingSamples: 4 + m_FilterTracedShadow: 1 + m_FilterSizeTraced: 16 + m_SunLightConeAngle: 0.5 + m_SemiTransparentShadow: 0 + m_ColorShadow: 1 + m_DistanceBasedFiltering: 0 + m_EvsmExponent: 15 + m_EvsmLightLeakBias: 0 + m_EvsmVarianceBias: 0.00001 + m_EvsmBlurPasses: 0 + m_LightlayersMask: 1 + m_LinkShadowLayers: 1 + m_ShadowNearPlane: 0.1 + m_BlockerSampleCount: 24 + m_FilterSampleCount: 32 + m_MinFilterSize: 1 + m_DirLightPCSSBlockerSampleCount: 24 + m_DirLightPCSSFilterSampleCount: 16 + m_DirLightPCSSMaxPenumbraSize: 0.56 + m_DirLightPCSSMaxSamplingDistance: 0.5 + m_DirLightPCSSMinFilterSizeTexels: 1.5 + m_DirLightPCSSMinFilterMaxAngularDiameter: 10 + m_DirLightPCSSBlockerSearchAngularDiameter: 12 + m_DirLightPCSSBlockerSamplingClumpExponent: 2 + m_KernelSize: 5 + m_LightAngle: 1 + m_MaxDepthBias: 0.001 + m_ShadowResolution: + m_Override: 32 + m_UseOverride: 1 + m_Level: 1 + m_ShadowDimmer: 1 + m_VolumetricShadowDimmer: 1 + m_ShadowFadeDistance: 10000 + m_UseContactShadow: + m_Override: 1 + m_UseOverride: 1 + m_Level: 0 + m_RayTracedContactShadow: 0 + m_ShadowTint: {r: 0, g: 0, b: 0, a: 1} + m_PenumbraTint: 0 + m_NormalBias: 0.75 + m_SlopeBias: 0.5 + m_ShadowUpdateMode: 0 + m_AlwaysDrawDynamicShadows: 0 + m_UpdateShadowOnLightMovement: 0 + m_CachedShadowTranslationThreshold: 0.01 + m_CachedShadowAngularThreshold: 0.5 + m_BarnDoorAngle: 90 + m_BarnDoorLength: 0.05 + m_preserveCachedShadow: 0 + m_OnDemandShadowRenderOnPlacement: 1 + m_ShadowCascadeRatios: + - 0.05 + - 0.15 + - 0.3 + m_ShadowCascadeBorders: + - 0.2 + - 0 + - 0 + - 0 + m_ShadowAlgorithm: 0 + m_ShadowVariant: 3 + m_ShadowPrecision: 0 + useOldInspector: 0 + useVolumetric: 1 + featuresFoldout: 1 + m_AreaLightEmissiveMeshShadowCastingMode: 0 + m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 + m_AreaLightEmissiveMeshLayer: -1 + m_Version: 15 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 32 + m_ObsoleteContactShadows: 1 +--- !u!108 &2042173775 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2042173772} + m_Enabled: 1 + serializedVersion: 13 + m_Type: 1 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 3.44 + m_Range: 46.91758 + m_SpotAngle: 30 + m_InnerSpotAngle: 0 + m_CookieSize2D: {x: 0.5, y: 0.5} + m_Shadows: + m_Type: 1 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 2 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 + m_ShapeRadius: 0 + m_ShadowAngle: 0 + m_LightUnit: 2 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 0 +--- !u!4 &2042173776 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2042173772} + serializedVersion: 2 + m_LocalRotation: {x: -0.2345203, y: -0.24841745, z: 0.46044192, w: 0.8193182} + m_LocalPosition: {x: 6.19, y: 0, z: -3.9} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: -8.948, y: -39.102, z: 61.854004} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 351037086} + - {fileID: 2042173776} + - {fileID: 1881533628} + - {fileID: 1231307734} + - {fileID: 1399039632} + - {fileID: 1619667377} diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes.unity.meta b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes.unity.meta new file mode 100644 index 00000000000..32ac03eaa50 --- /dev/null +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9811871457a2db540b796c5f5342fcc2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes/ContactShadowsProfile.asset b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes/ContactShadowsProfile.asset new file mode 100644 index 00000000000..8727512e4ab --- /dev/null +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes/ContactShadowsProfile.asset @@ -0,0 +1,179 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-2807132652243175846 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a7ff42a8c5be6646ad3975f3a54c1eb, type: 3} + m_Name: DiffusionProfileOverride + m_EditorClassIdentifier: + active: 1 + diffusionProfiles: + m_OverrideState: 1 + m_Value: + - {fileID: 11400000, guid: 768484f758b6f7b4daf53a7d9949f5af, type: 2} +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: ContactShadowsProfile + m_EditorClassIdentifier: + components: + - {fileID: 114413969882337080} + - {fileID: 114128838703966474} + - {fileID: 114902556638068904} + - {fileID: -2807132652243175846} +--- !u!114 &114128838703966474 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d7593b3a9277ac4696b20006c21dde2, type: 3} + m_Name: + m_EditorClassIdentifier: + active: 1 + skyType: + m_OverrideState: 1 + m_Value: 0 + cloudType: + m_OverrideState: 0 + m_Value: 0 + skyAmbientMode: + m_OverrideState: 0 + m_Value: 1 + planetRadius: + m_OverrideState: 0 + m_Value: 6378.1 + renderingSpace: + m_OverrideState: 0 + m_Value: 1 + centerMode: + m_OverrideState: 0 + m_Value: 0 + planetCenter: + m_OverrideState: 0 + m_Value: {x: 0, y: -6378.1, z: 0} + windOrientation: + m_OverrideState: 0 + m_Value: 0 + windSpeed: + m_OverrideState: 0 + m_Value: 0 + fogType: + m_OverrideState: 1 + m_Value: 0 + m_Version: 1 +--- !u!114 &114413969882337080 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7ddcec8a8eb2d684d833ac8f5d26aebd, type: 3} + m_Name: + m_EditorClassIdentifier: + active: 1 + interCascadeBorders: 1 + maxShadowDistance: + m_OverrideState: 1 + m_Value: 50 + directionalTransmissionMultiplier: + m_OverrideState: 0 + m_Value: 1 + cascadeShadowSplitCount: + m_OverrideState: 1 + m_Value: 1 + cascadeShadowSplit0: + m_OverrideState: 1 + m_Value: 0.05 + cascadeShadowSplit1: + m_OverrideState: 1 + m_Value: 0.15 + cascadeShadowSplit2: + m_OverrideState: 1 + m_Value: 0.3 + cascadeShadowBorder0: + m_OverrideState: 1 + m_Value: 0 + cascadeShadowBorder1: + m_OverrideState: 1 + m_Value: 0 + cascadeShadowBorder2: + m_OverrideState: 1 + m_Value: 0 + cascadeShadowBorder3: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &114902556638068904 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56b145d2b9ee1ac4f846968484e7485a, type: 3} + m_Name: ContactShadows + m_EditorClassIdentifier: + active: 1 + quality: + m_OverrideState: 0 + m_Value: 1 + enable: + m_OverrideState: 1 + m_Value: 1 + directionalOnly: + m_OverrideState: 1 + m_Value: 1 + halfResolution: + m_OverrideState: 1 + m_Value: 1 + length: + m_OverrideState: 1 + m_Value: 0.131 + opacity: + m_OverrideState: 1 + m_Value: 1 + distanceScaleFactor: + m_OverrideState: 1 + m_Value: 1 + maxDistance: + m_OverrideState: 1 + m_Value: 50 + minDistance: + m_OverrideState: 0 + m_Value: 0 + fadeDistance: + m_OverrideState: 1 + m_Value: 0.01 + fadeInDistance: + m_OverrideState: 0 + m_Value: 0 + rayBias: + m_OverrideState: 0 + m_Value: 0.2 + thicknessScale: + m_OverrideState: 0 + m_Value: 0.15 + m_SampleCount: + m_OverrideState: 0 + m_Value: 10 diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes/ContactShadowsProfile.asset.meta b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes/ContactShadowsProfile.asset.meta new file mode 100644 index 00000000000..1bb98786de4 --- /dev/null +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes/ContactShadowsProfile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7dc8ba468743e704882075f30ae27071 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset b/Tests/SRPTests/Projects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset index c18b41f939e..0bd9ea8bebb 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset +++ b/Tests/SRPTests/Projects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset @@ -470,6 +470,9 @@ EditorBuildSettings: - enabled: 1 path: Assets/GraphicTests/Scenes/2x_Lighting/2324_Shadow_Mask_Directional_Blending.unity guid: f24d300b30af57d49b18a301c0ff2e1c + - enabled: 1 + path: Assets/GraphicTests/Scenes/2x_Lighting/2325_Contact_Shadow_HalfRes.unity + guid: 9811871457a2db540b796c5f5342fcc2 - enabled: 1 path: Assets/GraphicTests/Scenes/2x_Lighting/2401_Area_Light_Meshes.unity guid: 359ded33a047fd540b5e19a98547f5e2 From 153d985a62bd25da4aa89f1ebd7198d0310efa03 Mon Sep 17 00:00:00 2001 From: Raquel Peces Date: Wed, 4 Mar 2026 18:51:59 +0000 Subject: [PATCH 33/95] Regression Rendering Debugger UITK --- .../Runtime/Settings/RenderingDebuggerRuntimeResources.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Settings/RenderingDebuggerRuntimeResources.cs b/Packages/com.unity.render-pipelines.core/Runtime/Settings/RenderingDebuggerRuntimeResources.cs index 2abd9d5672b..ab84b521a5d 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Settings/RenderingDebuggerRuntimeResources.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Settings/RenderingDebuggerRuntimeResources.cs @@ -30,12 +30,12 @@ enum Version #if ENABLE_RENDERING_DEBUGGER_UI [SerializeField, ResourcePath("Runtime/Debugging/Runtime UI Resources/RuntimeDebugWindow_PanelSettings.asset")] - private PanelSettings m_PanelSettings; + private LazyLoadReference m_PanelSettings; /// StyleSheet for the Rendering Debugger Runtime UI public PanelSettings panelSettings { - get => m_PanelSettings; + get => m_PanelSettings.asset; set => this.SetValueAndNotify(ref m_PanelSettings, value, nameof(m_PanelSettings)); } @@ -54,12 +54,12 @@ public StyleSheet[] styleSheets } [SerializeField, ResourcePath("Runtime/Debugging/Runtime UI Resources/RuntimeDebugWindow.uxml")] - private VisualTreeAsset m_VisualTreeAsset; + private LazyLoadReference m_VisualTreeAsset; /// Visual Tree Asset for the Rendering Debugger Runtime UI public VisualTreeAsset visualTreeAsset { - get => m_VisualTreeAsset; + get => m_VisualTreeAsset.asset; set => this.SetValueAndNotify(ref m_VisualTreeAsset, value, nameof(m_VisualTreeAsset)); } #endif From 6a66b1175c78dd9d4f98c8f51f3bedb28cb7b1db Mon Sep 17 00:00:00 2001 From: Pema Malling Date: Wed, 4 Mar 2026 18:51:59 +0000 Subject: [PATCH 34/95] Add internal settings for light sampling in unified baker. --- .../PathTracing/BakeInputSerialization.cs | 22 ++++++++++++- .../PathTracing/BakeInputToWorldConversion.cs | 8 +++-- .../Editor/PathTracing/LightBakerStrangler.cs | 22 +++++++++++-- .../Runtime/PathTracing/BakeLightmapDriver.cs | 16 +++++++--- .../PathTracing/LightmapIntegration.cs | 15 ++++++++- .../Runtime/PathTracing/PathTracingUtil.cs | 13 ++++++++ .../Runtime/PathTracing/ProbeIntegrator.cs | 13 +++++--- .../PathTracing/Shaders/LightSampling.hlsl | 32 ++++++++++++------- .../LightmapDirectIntegration.urtshader | 10 +++--- .../LightmapIndirectIntegration.urtshader | 9 +++++- .../Shaders/PathTracingCommon.hlsl | 12 +++---- .../Shaders/ProbeIntegrationDirect.urtshader | 6 ++-- .../ProbeIntegrationIndirect.urtshader | 9 +++++- .../UnityComputeProbeIntegrator.cs | 20 ++++++++++++ .../Runtime/PathTracing/World.cs | 4 ++- .../Common/Utilities/GraphicsHelpers.cs | 17 ++++++++++ .../Compute/ComputeRayTracingShader.cs | 10 ++++++ .../Hardware/HardwareRayTracingShader.cs | 9 ++++++ .../Tests/Editor/PathTracing/WorldTests.cs | 14 ++++---- .../Runtime/PathTracing/PathIteratorTests.cs | 4 +-- 20 files changed, 210 insertions(+), 55 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputSerialization.cs b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputSerialization.cs index 5a8301d8a9b..0d0adc7a101 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputSerialization.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputSerialization.cs @@ -5,6 +5,8 @@ using Unity.Mathematics; using UnityEngine; using Unity.Collections.LowLevel.Unsafe; +using UnityEditor.LightBaking; +using MixedLightingMode = UnityEngine.MixedLightingMode; // The types defined in this file should match the types defined in BakeInput.h. namespace UnityEditor.PathTracing.LightBakerBridge @@ -252,6 +254,15 @@ internal struct LightingSettings : IBakeInputVisitable public float aoDistance; public bool useHardwareRayTracing; + public LightSamplingMode directLightSamplingMode; + public uint directRISCandidateCount; + public LightSamplingMode indirectLightSamplingMode; + public UInt32 indirectRISCandidateCount; + public LightAccelerationStructure lightAccelerationStructure; + public uint lightGridMaxCells; + public EmissiveSamplingMode directEmissiveSamplingMode; + public EmissiveSamplingMode indirectEmissiveSamplingMode; + public void Transfer(IBakeInputVisitor visitor) { visitor.Transfer(ref lightmapSampleCounts); @@ -263,6 +274,15 @@ public void Transfer(IBakeInputVisitor visitor) visitor.TransferBoolean(ref aoEnabled); visitor.TransferBlittable(ref aoDistance); visitor.TransferBoolean(ref useHardwareRayTracing); + + visitor.TransferBlittable(ref directLightSamplingMode); + visitor.TransferBlittable(ref directRISCandidateCount); + visitor.TransferBlittable(ref indirectLightSamplingMode); + visitor.TransferBlittable(ref indirectRISCandidateCount); + visitor.TransferBlittable(ref lightAccelerationStructure); + visitor.TransferBlittable(ref lightGridMaxCells); + visitor.TransferBlittable(ref directEmissiveSamplingMode); + visitor.TransferBlittable(ref indirectEmissiveSamplingMode); } } @@ -927,7 +947,7 @@ internal static class BakeInputSerialization { // Should match BakeInputSerialization::kCurrentFileVersion in BakeInputSerialization.h. // If these are out of sync, the implementation in this file probably needs to be updated. - const UInt64 CurrentFileVersion = 202601191; + const UInt64 CurrentFileVersion = 202601301; public static bool Deserialize(string path, out BakeInput bakeInput) { diff --git a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs index af5158ef66d..a3c4ecffb0d 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs @@ -2,13 +2,15 @@ using System.Collections.Generic; using UnityEngine.PathTracing.Core; using UnityEngine.Rendering; -using UnityEngine.LightTransport; using Unity.Mathematics; +using UnityEditor.LightBaking; using UnityEngine; using UnityEngine.PathTracing.Lightmapping; using UnityEngine.PathTracing.Integration; using UnityEngine.Rendering.Sampling; using UnityEngine.Rendering.UnifiedRayTracing; +using InputExtraction = UnityEngine.LightTransport.InputExtraction; +using Material = UnityEngine.Material; namespace UnityEditor.PathTracing.LightBakerBridge { @@ -208,7 +210,7 @@ internal static void InjectAnalyticalLights( lights[i] = lightDescriptor; } - world.lightPickingMethod = LightPickingMethod.LightGrid; + world.lightPickingMethod = bakeInput.lightingSettings.lightAccelerationStructure == LightAccelerationStructure.LightGrid ? LightPickingMethod.LightGrid : LightPickingMethod.Uniform; lightHandles = world.AddLights(lights, false, autoEstimateLUTRange, bakeInput.lightingSettings.mixedLightingMode); } @@ -537,7 +539,7 @@ internal static void PopulateWorld(InputExtraction.BakeInput input, UnityCompute Dictionary> lodInstances; Dictionary> lodgroupToContributorInstances; WorldHelpers.AddContributingInstancesToWorld(world.PathTracingWorld, in fatInstances, out lodInstances, out lodgroupToContributorInstances); - world.PathTracingWorld.Build(sceneBounds, cmd, ref world.ScratchBuffer, samplingResources, true, 1024); + world.PathTracingWorld.Build(sceneBounds, cmd, ref world.ScratchBuffer, samplingResources, true, 1024, (int)input.bakeInput.GetLightingSettings().lightGridMaxCells); } internal static void DeserializeAndInjectBakeInputData( diff --git a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/LightBakerStrangler.cs b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/LightBakerStrangler.cs index 948a2c17da5..e41900588e9 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/LightBakerStrangler.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/LightBakerStrangler.cs @@ -356,7 +356,7 @@ internal static bool Bake(string bakeInputPath, string lightmapRequestsPath, str // Build world with extracted data const bool emissiveSampling = true; - world.PathTracingWorld.Build(sceneBounds, deviceContext.GetCommandBuffer(), ref world.ScratchBuffer, samplingResources, emissiveSampling, 1024); + world.PathTracingWorld.Build(sceneBounds, deviceContext.GetCommandBuffer(), ref world.ScratchBuffer, samplingResources, emissiveSampling, 1024, (int)bakeInput.lightingSettings.lightGridMaxCells); LightmapBakeSettings lightmapBakeSettings = GetLightmapBakeSettings(bakeInput); // Build array of lightmap descriptors based on the atlassing data and instances. @@ -479,7 +479,13 @@ internal static LightmapBakeSettings GetLightmapBakeSettings(in BakeInput bakeIn DirectSampleCount = math.max(0, bakeInput.lightingSettings.lightmapSampleCounts.directSampleCount), IndirectSampleCount = math.max(0, bakeInput.lightingSettings.lightmapSampleCounts.indirectSampleCount), BounceCount = math.max(0, bakeInput.lightingSettings.maxBounces), - AOMaxDistance = math.max(0.0f, bakeInput.lightingSettings.aoDistance) + AOMaxDistance = math.max(0.0f, bakeInput.lightingSettings.aoDistance), + DirectLightSamplingMode = bakeInput.lightingSettings.directLightSamplingMode, + DirectRISCandidateCount = bakeInput.lightingSettings.directRISCandidateCount, + IndirectLightSamplingMode = bakeInput.lightingSettings.indirectLightSamplingMode, + IndirectRISCandidateCount = bakeInput.lightingSettings.indirectRISCandidateCount, + DirectEmissiveSamplingMode = bakeInput.lightingSettings.directEmissiveSamplingMode, + IndirectEmissiveSamplingMode = bakeInput.lightingSettings.indirectEmissiveSamplingMode, }; lightmapBakeSettings.ValiditySampleCount = lightmapBakeSettings.IndirectSampleCount; return lightmapBakeSettings; @@ -898,8 +904,13 @@ internal static Result ExecuteLightmapRequests( if (!lightmappingContext.Initialize(deviceContext, initialLightmapResolution, initialLightmapResolution, world, maxIndexCount, maxVertexCount, lightmapResourceLib)) return Result.InitializeFailure; + CommandBuffer cmd = lightmappingContext.GetCommandBuffer(); lightmappingContext.IntegratorContext.Initialize(samplingResources, lightmapResourceLib, !useLegacyBakingBehavior); + // Setup keywords only once before accumulation. + lightmappingContext.IntegratorContext.LightmapDirectIntegrator.SetupLightSamplingKeywords(cmd, lightmapBakeSettings.DirectLightSamplingMode, lightmapBakeSettings.DirectEmissiveSamplingMode); + lightmappingContext.IntegratorContext.LightmapIndirectIntegrator.SetupLightSamplingKeywords(cmd, lightmapBakeSettings.IndirectLightSamplingMode, lightmapBakeSettings.IndirectEmissiveSamplingMode); + // Chart identification happens in multithreaded fashion on the CPU. We start it immediately so it can run in tandem with other work. bool usesChartIdentification = AnyLightmapRequestHasOutput(lightmapRequestData.requests, LightmapRequestOutputType.ChartIndex) || AnyLightmapRequestHasOutput(lightmapRequestData.requests, LightmapRequestOutputType.OverlapPixelIndex); @@ -918,7 +929,6 @@ internal static Result ExecuteLightmapRequests( } } - CommandBuffer cmd = lightmappingContext.GetCommandBuffer(); using LightmapIntegrationHelpers.GPUSync gpuSync = new(); // used for sync points in debug mode gpuSync.Create(); @@ -1458,6 +1468,12 @@ internal static bool ExecuteProbeRequests(in BakeInput bakeInput, in ProbeReques (uint directSampleCount, uint effectiveIndirectSampleCount) = GetProbeSampleCounts(request.sampleCount); probeIntegrator.Prepare(deviceContext, world, positionsBuffer.Slice(), pushoff, (int)bounceCount); + probeIntegrator.SetLightSamplingSettings( + bakeInput.lightingSettings.directLightSamplingMode, + bakeInput.lightingSettings.directRISCandidateCount, + bakeInput.lightingSettings.indirectLightSamplingMode, + bakeInput.lightingSettings.indirectRISCandidateCount, + bakeInput.lightingSettings.indirectEmissiveSamplingMode); List eventsToWaitFor = new(); List buffersToDestroy = new(); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/BakeLightmapDriver.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/BakeLightmapDriver.cs index ed23964ed80..f644d15bf3e 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/BakeLightmapDriver.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/BakeLightmapDriver.cs @@ -1,5 +1,6 @@ using System; using Unity.Mathematics; +using UnityEngine.PathTracing.Core; using UnityEngine.PathTracing.Integration; using UnityEngine.Rendering; using UnityEngine.Rendering.UnifiedRayTracing; @@ -69,11 +70,17 @@ public class LightmapBakeSettings public AntiAliasingType ValidityAntiAliasingType = AntiAliasingType.Stochastic; public uint BounceCount = 4; - public uint DirectLightingEvaluationCount = 4; - public uint IndirectLightingEvaluationCount = 1; public float AOMaxDistance = 1.0f; public float PushOff = 0.00001f; public UInt64 ExpandedBufferSize = 262144; + + public LightSamplingMode DirectLightSamplingMode; + public uint DirectRISCandidateCount; + public LightSamplingMode IndirectLightSamplingMode; + public uint IndirectRISCandidateCount; + public EmissiveSamplingMode DirectEmissiveSamplingMode; + public EmissiveSamplingMode IndirectEmissiveSamplingMode; + public uint GetSampleCount(IntegratedOutputType integratedOutputType) { switch (integratedOutputType) @@ -331,7 +338,8 @@ internal static uint AccumulateLightmapInstance( lightmappingContext.IntegratorContext.CompactedGBufferLength, instance.ReceiveShadows, lightmapBakeSettings.PushOff, - lightmapBakeSettings.DirectLightingEvaluationCount, + lightmapBakeSettings.DirectRISCandidateCount, + lightmapBakeSettings.DirectLightSamplingMode, (uint)lightmappingContext.World.PathTracingWorld.MaxLightsInAnyCell, newChunkStarted ); @@ -359,7 +367,7 @@ internal static uint AccumulateLightmapInstance( lightmappingContext.CompactedTexelIndices, lightmappingContext.IntegratorContext.CompactedGBufferLength, lightmapBakeSettings.PushOff, - lightmapBakeSettings.IndirectLightingEvaluationCount, + lightmapBakeSettings.IndirectRISCandidateCount, newChunkStarted ); break; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/LightmapIntegration.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/LightmapIntegration.cs index 4fe13bde428..326944730be 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/LightmapIntegration.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/LightmapIntegration.cs @@ -117,6 +117,12 @@ public LightmapDirectIntegrator() { } + public void SetupLightSamplingKeywords(CommandBuffer cmd, LightSamplingMode lightSamplingMode, EmissiveSamplingMode emissiveSamplingMode) + { + Util.SetLightSamplingKeyword(cmd, _accumulationShader, lightSamplingMode); + Util.SetEmissiveSamplingKeyword(cmd, _accumulationShader, emissiveSamplingMode); + } + public void Prepare(IRayTracingShader accumulationShader, ComputeShader normalizationShader, ComputeShader expansionHelpers, SamplingResources samplingResources, RTHandle emptyExposureTexture) { _accumulationShader = accumulationShader; @@ -155,6 +161,7 @@ public void Accumulate( bool receiveShadows, float pushOff, uint risCandidateCount, + LightSamplingMode lightSamplingMode, uint maxLightsInAnyCell, bool newChunkStarted) { @@ -208,7 +215,7 @@ public void Accumulate( _accumulationShader.SetIntParam(cmd, LightmapIntegratorShaderIDs.SampleOffset, (int)currentSampleCountPerTexel); _accumulationShader.SetIntParam(cmd, LightmapIntegratorShaderIDs.MaxLocalSampleCount, (int)sampleCountToTakePerTexel); - uint loopCount = maxLightsInAnyCell; + uint loopCount = lightSamplingMode == LightSamplingMode.RoundRobin ? maxLightsInAnyCell : 1; for (int lightIndexInCell = 0; lightIndexInCell < loopCount; ++lightIndexInCell) { _accumulationShader.SetIntParam(cmd, LightmapIntegratorShaderIDs.LightIndexInCell, lightIndexInCell); @@ -264,6 +271,12 @@ public LightmapIndirectIntegrator(bool countNEERayAsPathSegment) _countNEERayAsPathSegment = countNEERayAsPathSegment; } + public void SetupLightSamplingKeywords(CommandBuffer cmd, LightSamplingMode lightSamplingMode, EmissiveSamplingMode emissiveSamplingMode) + { + Util.SetLightSamplingKeyword(cmd, _accumulationShader, lightSamplingMode); + Util.SetEmissiveSamplingKeyword(cmd, _accumulationShader, emissiveSamplingMode); + } + public void Prepare(IRayTracingShader accumulationShader, ComputeShader normalizationShader, ComputeShader expansionHelpers, SamplingResources samplingResources, RTHandle emptyExposureTexture) { _accumulationShader = accumulationShader; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingUtil.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingUtil.cs index 5ca6692bc0c..dc22106879a 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingUtil.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingUtil.cs @@ -158,6 +158,19 @@ static internal void BindPathTracingInputs( } } + internal static void SetLightSamplingKeyword(CommandBuffer cmd, IRayTracingShader shader, LightSamplingMode lightSamplingMode) + { + shader.SetKeyword(cmd, shader.CreateKeyword("LIGHT_SAMPLING_UNIFORM"), lightSamplingMode == LightSamplingMode.Uniform); + shader.SetKeyword(cmd, shader.CreateKeyword("LIGHT_SAMPLING_RIS"), lightSamplingMode == LightSamplingMode.RIS); + shader.SetKeyword(cmd, shader.CreateKeyword("LIGHT_SAMPLING_ROUND_ROBIN"), lightSamplingMode == LightSamplingMode.RoundRobin); + } + + internal static void SetEmissiveSamplingKeyword(CommandBuffer cmd, IRayTracingShader shader, EmissiveSamplingMode lightSamplingMode) + { + shader.SetKeyword(cmd, shader.CreateKeyword("EMISSIVE_SAMPLING_LIGHT"), lightSamplingMode == EmissiveSamplingMode.LightSampling); + shader.SetKeyword(cmd, shader.CreateKeyword("EMISSIVE_SAMPLING_BRDF"), lightSamplingMode == EmissiveSamplingMode.BRDFSampling); + shader.SetKeyword(cmd, shader.CreateKeyword("EMISSIVE_SAMPLING_MIS"), lightSamplingMode == EmissiveSamplingMode.MIS); + } internal static RayTracingResources LoadOrCreateRayTracingResources() { diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/ProbeIntegrator.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/ProbeIntegrator.cs index 6c23fde3359..19292ffb0d6 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/ProbeIntegrator.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/ProbeIntegrator.cs @@ -105,9 +105,9 @@ private void DispatchRadianceEstimationKernel( uint bounceCount, uint sampleOffset, uint sampleCount, + LightSamplingMode lightSamplingMode, uint risCandidateCount, uint maxLightsInAnyCell, - bool roundRobin, float environmentIntensityMultiplier, GraphicsBuffer radianceShl2, uint radianceOffset, @@ -117,6 +117,7 @@ private void DispatchRadianceEstimationKernel( Debug.Assert(world.GetAccelerationStructure() != null); // General path tracing parameters + Util.SetLightSamplingKeyword(cmd, shader, lightSamplingMode); bool preExpose = false; Util.BindPathTracingInputs(cmd, shader, _countNEERayAsPathSegment, risCandidateCount, preExpose, (int)bounceCount, environmentIntensityMultiplier, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyExposureTexture); Util.BindWorld(cmd, shader, world); @@ -126,7 +127,7 @@ private void DispatchRadianceEstimationKernel( cmd.SetBufferData(radianceShl2, new float[positionCount * floatsPerSH]); DispatchProbeKernel(cmd, shader, positionOffset, positionCount, sampleOffset, sampleCount, floatsPerSH, ShaderProperties.RadianceShl2, radianceShl2, radianceOffset, expansionBuffer, reductionBuffer, - bounceCount, roundRobin, maxLightsInAnyCell); + bounceCount, lightSamplingMode == LightSamplingMode.RoundRobin, maxLightsInAnyCell); } private void DispatchProbeKernel( @@ -212,8 +213,10 @@ internal void EstimateIndirectRadianceShl2( uint bounceCount, uint sampleOffset, uint sampleCount, + LightSamplingMode lightSamplingMode, uint risCandidateCount, uint maxLightsInAnyCell, + EmissiveSamplingMode emissiveSamplingMode, bool ignoreEnvironment, GraphicsBuffer radianceShl2, uint radianceOffset, @@ -221,7 +224,8 @@ internal void EstimateIndirectRadianceShl2( GraphicsBuffer reductionBuffer) { float environmentIntensityMultiplier = ignoreEnvironment ? 0.0f : 1.0f; - DispatchRadianceEstimationKernel(cmd, _resourceLibrary.IndirectShader, world, positionOffset, positionCount, bounceCount, sampleOffset, sampleCount, risCandidateCount, maxLightsInAnyCell, false, environmentIntensityMultiplier, radianceShl2, radianceOffset, expansionBuffer, reductionBuffer); + Util.SetEmissiveSamplingKeyword(cmd, _resourceLibrary.IndirectShader, emissiveSamplingMode); + DispatchRadianceEstimationKernel(cmd, _resourceLibrary.IndirectShader, world, positionOffset, positionCount, bounceCount, sampleOffset, sampleCount, lightSamplingMode, risCandidateCount, maxLightsInAnyCell, environmentIntensityMultiplier, radianceShl2, radianceOffset, expansionBuffer, reductionBuffer); } internal void EstimateDirectRadianceShl2( @@ -231,6 +235,7 @@ internal void EstimateDirectRadianceShl2( uint positionCount, uint sampleOffset, uint sampleCount, + LightSamplingMode lightSamplingMode, uint risCandidateCount, uint maxLightsInAnyCell, bool ignoreEnvironment, @@ -240,7 +245,7 @@ internal void EstimateDirectRadianceShl2( GraphicsBuffer reductionBuffer) { float environmentIntensityMultiplier = ignoreEnvironment ? 0.0f : 1.0f; - DispatchRadianceEstimationKernel(cmd, _resourceLibrary.DirectShader, world, positionOffset, positionCount, 0, sampleOffset, sampleCount, risCandidateCount, maxLightsInAnyCell, true, environmentIntensityMultiplier, radianceShl2, radianceOffset, expansionBuffer, reductionBuffer); + DispatchRadianceEstimationKernel(cmd, _resourceLibrary.DirectShader, world, positionOffset, positionCount, 0, sampleOffset, sampleCount, lightSamplingMode, risCandidateCount, maxLightsInAnyCell, environmentIntensityMultiplier, radianceShl2, radianceOffset, expansionBuffer, reductionBuffer); } internal void EstimateValidity( diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightSampling.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightSampling.hlsl index 9ba5446dc29..01150c50a32 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightSampling.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightSampling.hlsl @@ -15,6 +15,14 @@ #define TRANSMISSION_IN_SHADOW_RAYS #define USE_DISTANCE_ATTENUATION_LUT +#if !defined(LIGHT_SAMPLING_UNIFORM_KEYWORD_DECLARED) && !defined(LIGHT_SAMPLING_RIS_KEYWORD_DECLARED) && !defined(LIGHT_SAMPLING_ROUND_ROBIN_KEYWORD_DECLARED) +#define LIGHT_SAMPLING_RIS +#endif + +#if !defined(EMISSIVE_SAMPLING_LIGHT_KEYWORD_DECLARED) && !defined(EMISSIVE_SAMPLING_BRDF_KEYWORD_DECLARED) && !defined(EMISSIVE_SAMPLING_MIS_KEYWORD_DECLARED) +#define EMISSIVE_SAMPLING_BRDF +#endif + TextureCube g_EnvTex; SamplerState sampler_g_EnvTex; float g_EnvIntensityMultiplier; @@ -827,12 +835,13 @@ float EmissiveMISWeightForLightRay(int lightType, float3 lightDirection, float l { float cosTheta = dot(worldNormal, lightDirection); float brdfPdf = cosTheta / PI; -#if (EMISSIVE_SAMPLING == LIGHT_SAMPLING) float misWeight = 1; -#elif (EMISSIVE_SAMPLING == BRDF_SAMPLING) - float misWeight = 0; -#else - float misWeight = PowerHeuristic(lightPdf, brdfPdf); +#if defined(EMISSIVE_SAMPLING_LIGHT) + misWeight = 1; +#elif defined(EMISSIVE_SAMPLING_BRDF) + misWeight = 0; +#elif defined(EMISSIVE_SAMPLING_MIS) + misWeight = PowerHeuristic(lightPdf, brdfPdf); #endif return misWeight; } @@ -841,15 +850,16 @@ float EmissiveMISWeightForLightRay(int lightType, float3 lightDirection, float l float EmissiveMISWeightForBrdfRay(float lightPdf, float brdfPdf){ -#if (EMISSIVE_SAMPLING == LIGHT_SAMPLING) - float misWeight = 0; -#elif (EMISSIVE_SAMPLING == BRDF_SAMPLING) float misWeight = 1; -#else +#if defined(EMISSIVE_SAMPLING_LIGHT) + misWeight = 0; +#elif defined(EMISSIVE_SAMPLING_BRDF) + misWeight = 1; +#elif defined(EMISSIVE_SAMPLING_MIS) // brdfPdf > 0 condition is here to be able to disable MIS for LiveGI's primary rays. // When the primary camera ray directly hits an emissive surface, we should not do MIS at all. // We did not have a bounce yet and we therefore set iterator.lastScatterProbabilityDensityto (brdfPdf) to 0. - float misWeight = brdfPdf > 0 ? PowerHeuristic(brdfPdf, lightPdf) : 1.0; + misWeight = brdfPdf > 0 ? PowerHeuristic(brdfPdf, lightPdf) : 1.0; #endif return misWeight; } @@ -1123,7 +1133,7 @@ bool SampleLightsRadiance( UnifiedRT::DispatchInfo dispatchInfo, UnifiedRT::RayTracingAccelStruct accelStruct, StructuredBuffer instanceList, float3 receiverOrigin, float3 receiverNormal, SampleLightsOptions options, inout PathTracingSampler rngState, out LightSample resLightSample) { -#ifdef RESAMPLED_IMPORTANCE_SAMPLING +#if defined(LIGHT_SAMPLING_RIS) return SampleLightsRadianceRIS(dispatchInfo, accelStruct, instanceList, receiverOrigin, receiverNormal, options, rngState, resLightSample); #else return SampleLightsRadianceMC(dispatchInfo, accelStruct, instanceList, receiverOrigin, receiverNormal, options, rngState, resLightSample); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapDirectIntegration.urtshader b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapDirectIntegration.urtshader index d2ecbae128f..2cc29cc2980 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapDirectIntegration.urtshader +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapDirectIntegration.urtshader @@ -1,12 +1,12 @@ #pragma only_renderers d3d11 vulkan metal glcore + +#pragma multi_compile _ LIGHT_SAMPLING_UNIFORM LIGHT_SAMPLING_RIS LIGHT_SAMPLING_ROUND_ROBIN +#pragma multi_compile _ EMISSIVE_SAMPLING_LIGHT EMISSIVE_SAMPLING_BRDF EMISSIVE_SAMPLING_MIS + #define UNIFIED_RT_GROUP_SIZE_X 64 #define UNIFIED_RT_GROUP_SIZE_Y 1 #define UNIFIED_RT_RAYGEN_FUNC AccumulateInternal -#define RESAMPLED_IMPORTANCE_SAMPLING -#define EMISSIVE_SAMPLING MIS -#define LIGHT_SAMPLING_ROUND_ROBIN - #include "PathTracing.hlsl" #include "LightmapIntegrationHelpers.hlsl" @@ -205,7 +205,7 @@ void AccumulateInternal(UnifiedRT::DispatchInfo dispatchInfo) // TODO: Decouple BRDF samples from direct light samples in a separate kernel (https://jira.unity3d.com/browse/GFXLIGHT-2107) // Sample a light with BRDF sampling, weight with MIS. - #if (EMISSIVE_SAMPLING != LIGHT_SAMPLING) + #ifndef EMISSIVE_SAMPLING_LIGHT EstimateMISWeightedIrradianceUsingCosineSampling(dispatchInfo, accelStruct, g_AccelStructInstanceList, origin, worldNormal, rngState, irradianceBrdf, directionalBrdf); #endif diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapIndirectIntegration.urtshader b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapIndirectIntegration.urtshader index d2bf2ccae53..49845e63336 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapIndirectIntegration.urtshader +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapIndirectIntegration.urtshader @@ -1,4 +1,8 @@ #pragma only_renderers d3d11 vulkan metal glcore + +#pragma multi_compile _ LIGHT_SAMPLING_UNIFORM LIGHT_SAMPLING_RIS LIGHT_SAMPLING_ROUND_ROBIN +#pragma multi_compile _ EMISSIVE_SAMPLING_LIGHT EMISSIVE_SAMPLING_BRDF EMISSIVE_SAMPLING_MIS + #define UNIFIED_RT_GROUP_SIZE_X 64 #define UNIFIED_RT_GROUP_SIZE_Y 1 #define UNIFIED_RT_RAYGEN_FUNC AccumulateInternal @@ -57,7 +61,10 @@ float3 EstimateLightmapRadiance(UnifiedRT::DispatchInfo dispatchInfo, UnifiedRT: uint shadowRayMask = ShadowRayMask() | shadowRayLightmapLodMask; if (!isFirstPathSegment) AddEmissionRadiance(pathIter, accelStruct, g_AccelStructInstanceList, false); - AddRadianceFromDirectIllumination(pathIter, shadowRayMask, dispatchInfo, accelStruct, g_AccelStructInstanceList, rngState, false); + + // Check if we should do NEE, respecting the max bounce count + if (!g_CountNEERayAsPathSegment || bounceIndex < g_BounceCount) + AddRadianceFromDirectIllumination(pathIter, shadowRayMask, dispatchInfo, accelStruct, g_AccelStructInstanceList, rngState, false); } if (traceResult == TRACE_MISS) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracingCommon.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracingCommon.hlsl index 9b5428bd068..353bea518a1 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracingCommon.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracingCommon.hlsl @@ -8,17 +8,13 @@ #include "Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/CommonStructs.hlsl" #include "Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/FetchGeometry.hlsl" -#define LIGHT_SAMPLING 0 -#define BRDF_SAMPLING 1 -#define MIS 2 - // Force uniform sampling of the skybox for debugging / ground truth generation //#define UNIFORM_ENVSAMPLING -// Emissive mesh sampling: we combine explicit light and brdf sampling using MIS. -// We can disable MIS and use exclusively one of the two sampling techniques with the EMISSIVE_SAMPLING define. -#ifndef EMISSIVE_SAMPLING -#define EMISSIVE_SAMPLING BRDF_SAMPLING +// Emissive mesh sampling: By default we use pure BRDF sampling. +// This can be overriden with a keyword. +#ifndef EMISSIVE_SAMPLING_BRDF_KEYWORD_DECLARED +#define EMISSIVE_SAMPLING_BRDF #endif #define SPOT_LIGHT 0 diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationDirect.urtshader b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationDirect.urtshader index 5d5123c1133..ce758098299 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationDirect.urtshader +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationDirect.urtshader @@ -1,13 +1,13 @@ #pragma only_renderers d3d11 vulkan metal glcore + +#pragma multi_compile _ LIGHT_SAMPLING_UNIFORM LIGHT_SAMPLING_RIS LIGHT_SAMPLING_ROUND_ROBIN + #define UNIFIED_RT_GROUP_SIZE_X 128 #define UNIFIED_RT_GROUP_SIZE_Y 1 #define UNIFIED_RT_RAYGEN_FUNC IntegrateDirectRadiance #include "Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/FetchGeometry.hlsl" -#define RESAMPLED_IMPORTANCE_SAMPLING -#define LIGHT_SAMPLING_ROUND_ROBIN - #include "PathTracing.hlsl" #include "SphericalHarmonicsUtils.hlsl" diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationIndirect.urtshader b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationIndirect.urtshader index 8be61dcf8b9..00098408d82 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationIndirect.urtshader +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationIndirect.urtshader @@ -1,4 +1,8 @@ #pragma only_renderers d3d11 vulkan metal glcore + +#pragma multi_compile _ LIGHT_SAMPLING_UNIFORM LIGHT_SAMPLING_RIS LIGHT_SAMPLING_ROUND_ROBIN +#pragma multi_compile _ EMISSIVE_SAMPLING_LIGHT EMISSIVE_SAMPLING_BRDF EMISSIVE_SAMPLING_MIS + #define UNIFIED_RT_GROUP_SIZE_X 128 #define UNIFIED_RT_GROUP_SIZE_Y 1 #define UNIFIED_RT_RAYGEN_FUNC IntegrateIndirectRadiance @@ -38,7 +42,10 @@ float3 EstimateProbeRadiance(UnifiedRT::DispatchInfo dispatchInfo, UnifiedRT::Ra { if (!isFirstPathSegment) AddEmissionRadiance(pathIter, accelStruct, g_AccelStructInstanceList, false); - AddRadianceFromDirectIllumination(pathIter, shadowRayMask, dispatchInfo, accelStruct, g_AccelStructInstanceList, rngState, false); + + // Check if we should do NEE, respecting the max bounce count + if (!g_CountNEERayAsPathSegment || bounceIndex < g_BounceCount) + AddRadianceFromDirectIllumination(pathIter, shadowRayMask, dispatchInfo, accelStruct, g_AccelStructInstanceList, rngState, false); } if (traceResult == TRACE_MISS) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/UnityComputeProbeIntegrator.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/UnityComputeProbeIntegrator.cs index 412ea7b72ac..2308dc32a15 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/UnityComputeProbeIntegrator.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/UnityComputeProbeIntegrator.cs @@ -15,7 +15,10 @@ internal class UnityComputeProbeIntegrator : IProbeIntegrator private readonly ProbeIntegrator _probeIntegrator; private UnityComputeWorld _world; private uint _bounceCount; + private LightSamplingMode _directLightSamplingMode = LightSamplingMode.RoundRobin; private uint _directRISCandidateCount = 4; + private LightSamplingMode _indirectLightSamplingMode = LightSamplingMode.Uniform; + private EmissiveSamplingMode _indirectEmissiveSamplingMode = EmissiveSamplingMode.BRDFSampling; private uint _indirectRISCandidateCount = 1; private uint _basePositionsOffset; @@ -66,6 +69,7 @@ public IProbeIntegrator.Result IntegrateDirectRadiance(IDeviceContext context, i (uint)positionCount, sampleOffset, (uint)sampleCount, + _directLightSamplingMode, _directRISCandidateCount, (uint)_world.PathTracingWorld.MaxLightsInAnyCell, ignoreEnvironment, @@ -97,8 +101,10 @@ public IProbeIntegrator.Result IntegrateIndirectRadiance(IDeviceContext context, _bounceCount, sampleOffset, (uint)sampleCount, + _indirectLightSamplingMode, _indirectRISCandidateCount, (uint)_world.PathTracingWorld.MaxLightsInAnyCell, + _indirectEmissiveSamplingMode, ignoreEnvironment, unifiedContext.GetComputeBuffer(radianceEstimateOut.Id), (uint)radianceEstimateOut.Offset, @@ -193,6 +199,20 @@ public IProbeIntegrator.Result IntegrateOcclusion(IDeviceContext context, int po return new IProbeIntegrator.Result(IProbeIntegrator.ResultType.Success, string.Empty); } + public void SetLightSamplingSettings( + LightSamplingMode directLightSamplingMode, + uint directRISCandidateCount, + LightSamplingMode indirectLightSamplingMode, + uint indirectRISCandidateCount, + EmissiveSamplingMode indirectEmissiveSamplingMode) + { + _directLightSamplingMode = directLightSamplingMode; + _directRISCandidateCount = directRISCandidateCount; + _indirectLightSamplingMode = indirectLightSamplingMode; + _indirectRISCandidateCount = indirectRISCandidateCount; + _indirectEmissiveSamplingMode = indirectEmissiveSamplingMode; + } + public void Prepare( IDeviceContext context, IWorld world, diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/World.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/World.cs index e9fcb15d344..8e20d6f92f5 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/World.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/World.cs @@ -922,17 +922,19 @@ public void RemoveLights(Span lights) } } - public void Build(Bounds sceneBounds, CommandBuffer cmdBuf, ref GraphicsBuffer scratchBuffer, Rendering.Sampling.SamplingResources samplingResources, bool emissiveSampling, int envCubemapResolution) + public void Build(Bounds sceneBounds, CommandBuffer cmdBuf, ref GraphicsBuffer scratchBuffer, Rendering.Sampling.SamplingResources samplingResources, bool emissiveSampling, int envCubemapResolution, int maxLightGridCellCount) { Debug.Assert(_rayTracingAccelerationStructure != null); _lightState.Build(sceneBounds, cmdBuf, emissiveSampling && _cubemapRender.GetMaterial() != null); if (_lightState.lightPickingMethod == LightPickingMethod.Regir) { + _reservoirGrid.LightGridCellCount = maxLightGridCellCount; _reservoirGrid.Build(cmdBuf, _lightState, sceneBounds, samplingResources); } else if (_lightState.lightPickingMethod == LightPickingMethod.LightGrid) { + _conservativeLightGrid.LightGridCellCount = maxLightGridCellCount; _conservativeLightGrid.Build(cmdBuf, _lightState, sceneBounds, samplingResources); } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Common/Utilities/GraphicsHelpers.cs b/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Common/Utilities/GraphicsHelpers.cs index 3842360cbbd..c40dbdd9a1f 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Common/Utilities/GraphicsHelpers.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Common/Utilities/GraphicsHelpers.cs @@ -70,5 +70,22 @@ static public void Flush(CommandBuffer cmd) cmd.Clear(); GL.Flush(); } + + public static void SetKeyword(this IRayTracingShader shader, CommandBuffer cmd, in LocalKeyword keyword, bool value) + { + if (shader is ComputeRayTracingShader cs) + cs.SetKeyword(cmd, in keyword, value); + else if (shader is HardwareRayTracingShader rs) + rs.SetKeyword(cmd, in keyword, value); + } + + public static LocalKeyword CreateKeyword(this IRayTracingShader shader, string name) + { + if (shader is ComputeRayTracingShader cs) + return cs.CreateKeyword(name); + else if (shader is HardwareRayTracingShader rs) + return rs.CreateKeyword(name); + throw new System.NotImplementedException(); + } } } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Compute/ComputeRayTracingShader.cs b/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Compute/ComputeRayTracingShader.cs index acf0ff8d9d5..f5ab378488c 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Compute/ComputeRayTracingShader.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Compute/ComputeRayTracingShader.cs @@ -159,6 +159,16 @@ public ulong GetTraceScratchBufferRequiredSizeInBytes(uint width, uint height, u uint rayCount = width * height * depth; return (RadeonRays.RadeonRaysAPI.GetTraceMemoryRequirements(rayCount) * 4); } + + public void SetKeyword(CommandBuffer cmd, in LocalKeyword keyword, bool value) + { + cmd.SetKeyword(m_Shader, keyword, value); + } + + public LocalKeyword CreateKeyword(string name) + { + return new LocalKeyword(m_Shader, name); + } } } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Hardware/HardwareRayTracingShader.cs b/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Hardware/HardwareRayTracingShader.cs index 19492291460..2036f40cb6f 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Hardware/HardwareRayTracingShader.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Hardware/HardwareRayTracingShader.cs @@ -120,6 +120,15 @@ public ulong GetTraceScratchBufferRequiredSizeInBytes(uint width, uint height, u return 0; } + public void SetKeyword(CommandBuffer cmd, in LocalKeyword keyword, bool value) + { + cmd.SetKeyword(m_Shader, keyword, value); + } + + public LocalKeyword CreateKeyword(string name) + { + return new LocalKeyword(m_Shader, name); + } } } diff --git a/Packages/com.unity.render-pipelines.core/Tests/Editor/PathTracing/WorldTests.cs b/Packages/com.unity.render-pipelines.core/Tests/Editor/PathTracing/WorldTests.cs index a5262872310..267e7e426db 100644 --- a/Packages/com.unity.render-pipelines.core/Tests/Editor/PathTracing/WorldTests.cs +++ b/Packages/com.unity.render-pipelines.core/Tests/Editor/PathTracing/WorldTests.cs @@ -94,7 +94,7 @@ public void World_AddLight_IncreaseLightCount(int lightCount) var lights = CreateLights(lightCount); _world.AddLights(lights, _respectLightLayers, _autoEstimateLUTRange, MixedLightingMode.IndirectOnly); _world.lightPickingMethod = LightPickingMethod.LightGrid; - _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, false, cubemapResolution); + _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, false, cubemapResolution, 64 * 64 * 64); Graphics.ExecuteCommandBuffer(_cmd); Assert.AreEqual(lightCount, _world.LightCount); } @@ -154,7 +154,7 @@ public void World_AddInstance_IncreasesInstanceCount(int instanceCount) AddInstanceToWorld(mesh, localToWorld, _defaultMaterial); } - _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, false, cubemapResolution); + _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, false, cubemapResolution, 64 * 64 * 64); Graphics.ExecuteCommandBuffer(_cmd); var instances = GetAccelStructInstancesFromWorld(_world); @@ -185,7 +185,7 @@ public void World_AddInstances_UploadedVertexDataMatches() } // Build world - _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, false, cubemapResolution); + _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, false, cubemapResolution, 64 * 64 * 64); Graphics.ExecuteCommandBuffer(_cmd); // Readback vertex buffer data from geo pool @@ -227,7 +227,7 @@ public void World_AddAndRemoveInstances_CountIsCorrect() _world.RemoveInstance(handles[0]); // Build world - _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, false, cubemapResolution); + _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, false, cubemapResolution, 64 * 64 * 64); Graphics.ExecuteCommandBuffer(_cmd); // Count should be 2 @@ -255,7 +255,7 @@ public void World_AddInstance_IncreasesMeshLightCountIfEmissive(bool isEmissive) AddInstanceToWorld(mesh, localToWorld, material); // Build world - _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, true, cubemapResolution); + _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, true, cubemapResolution, 64 * 64 * 64); Graphics.ExecuteCommandBuffer(_cmd); // Check that mesh light count increased @@ -281,7 +281,7 @@ public void World_AddAndRemoveEmissiveInstance_MeshLightCountIsZero() _world.RemoveInstance(instance); // Build world - _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, true, cubemapResolution); + _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, true, cubemapResolution, 64 * 64 * 64); Graphics.ExecuteCommandBuffer(_cmd); // Check that mesh light count is 0 @@ -308,7 +308,7 @@ public void World_UpdateInstanceTransform_UploadsCorrectData() _world.UpdateInstanceTransform(instance, newLocalToWorld); // Build world - _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, false, cubemapResolution); + _world.Build(new Bounds(), _cmd, ref _buildScratchBuffer, _samplingResources, false, cubemapResolution, 64 * 64 * 64); Graphics.ExecuteCommandBuffer(_cmd); // Readback instance buffer diff --git a/Packages/com.unity.render-pipelines.core/Tests/Runtime/PathTracing/PathIteratorTests.cs b/Packages/com.unity.render-pipelines.core/Tests/Runtime/PathTracing/PathIteratorTests.cs index 6a3ba0a4e15..30c9f930c7b 100644 --- a/Packages/com.unity.render-pipelines.core/Tests/Runtime/PathTracing/PathIteratorTests.cs +++ b/Packages/com.unity.render-pipelines.core/Tests/Runtime/PathTracing/PathIteratorTests.cs @@ -134,7 +134,7 @@ public void EmptyWorldWithEnvironmentLight_ShouldOutputEnvironmentLight(float en cubemapMat.SetVector("_Radiance", new Vector4(envRed, envGreen, envBlue, 1.0f)); _world.SetEnvironmentMaterial(cubemapMat); GraphicsBuffer buildScratchBuffer = null; - _world.Build(new Bounds(), _cmd, ref buildScratchBuffer, _samplingResources, true, 8); + _world.Build(new Bounds(), _cmd, ref buildScratchBuffer, _samplingResources, true, 8, 64 * 64 * 64); var shader = _rayTracingContext.LoadRayTracingShader("Packages/com.unity.render-pipelines.core/Tests/Runtime/PathTracing/PathIteratorTest.urtshader"); Util.BindWorld(_cmd, shader, _world); @@ -205,7 +205,7 @@ public void RayHittingPlaneLitByWhiteEnvironmentLight_ShouldMatchAnalyticDerivat true, RenderedGameObjectsFilter.OnlyStatic, true); - _world.Build(new Bounds(), _cmd, ref buildScratchBuffer, _samplingResources, true, 8); + _world.Build(new Bounds(), _cmd, ref buildScratchBuffer, _samplingResources, true, 8, 64 * 64 * 64); var shader = _rayTracingContext.LoadRayTracingShader("Packages/com.unity.render-pipelines.core/Tests/Runtime/PathTracing/PathIteratorTest.urtshader"); From 87170dfe8a6e19c58260ed7d59d45c59b83eafb9 Mon Sep 17 00:00:00 2001 From: Cian Noonan Date: Wed, 4 Mar 2026 18:52:00 +0000 Subject: [PATCH 35/95] Use UnityEngine.Pools in ShaderGraph --- .../Editor/Data/Graphs/GraphData.cs | 31 ++++++------ .../Editor/Data/Graphs/GraphDataUtils.cs | 8 +-- .../Editor/Data/Implementation/NodeUtils.cs | 4 +- .../Editor/Data/Nodes/AbstractMaterialNode.cs | 10 ++-- .../Editor/Data/Nodes/CodeFunctionNode.cs | 29 +++++------ .../CalculateLevelOfDetailTexture2DNode.cs | 2 +- .../Input/Texture/GatherTexture2DNode.cs | 2 +- .../Input/Texture/SampleTexture2DArrayNode.cs | 2 +- .../Input/Texture/SampleTexture2DLODNode.cs | 2 +- .../Input/Texture/SampleTexture2DNode.cs | 3 +- .../Input/Texture/SampleVirtualTextureNode.cs | 2 +- .../Nodes/Input/Texture/TextureStackNode.cs | 10 ++-- .../Procedural/Noise/GradientNoiseNode.cs | 2 +- .../Nodes/Procedural/Noise/SimpleNoiseNode.cs | 2 +- .../Nodes/Procedural/Noise/VoronoiNode.cs | 2 +- .../Editor/Data/Nodes/UV/FlipbookNode.cs | 2 +- .../Data/Nodes/UV/ParallaxMappingNode.cs | 2 +- .../Nodes/UV/ParallaxOcclusionMappingNode.cs | 2 +- .../Data/Nodes/Utility/CustomFunctionNode.cs | 16 +++--- .../Editor/Data/Nodes/Utility/KeywordNode.cs | 21 ++++---- .../Data/Nodes/Utility/Logic/SwitchNode.cs | 8 +-- .../Editor/Data/Util/PooledHashSet.cs | 49 ------------------- .../Editor/Data/Util/PooledHashSet.cs.meta | 3 -- .../Editor/Data/Util/PooledList.cs | 49 ------------------- .../Editor/Data/Util/PooledList.cs.meta | 3 -- .../Editor/Drawing/PreviewManager.cs | 28 +++++------ .../Editor/Drawing/Views/GraphEditorView.cs | 7 +-- .../Drawing/Views/ReorderableSlotListView.cs | 2 +- .../Editor/Generation/Processors/Generator.cs | 7 +-- .../Importers/ShaderSubGraphImporter.cs | 7 ++- .../ProviderSystem/Model/ProviderNode.cs | 2 +- 31 files changed, 109 insertions(+), 210 deletions(-) delete mode 100644 Packages/com.unity.shadergraph/Editor/Data/Util/PooledHashSet.cs delete mode 100644 Packages/com.unity.shadergraph/Editor/Data/Util/PooledHashSet.cs.meta delete mode 100644 Packages/com.unity.shadergraph/Editor/Data/Util/PooledList.cs delete mode 100644 Packages/com.unity.shadergraph/Editor/Data/Util/PooledList.cs.meta diff --git a/Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs b/Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs index 9dad1c3c532..213e6003680 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs @@ -2059,7 +2059,7 @@ public void ReplaceWith(GraphData other) m_MovedContexts = true; } - using (var inputsToRemove = PooledList.Get()) + using (ListPool.Get(out var inputsToRemove)) { foreach (var property in m_Properties.SelectValue()) inputsToRemove.Add(property); @@ -2114,7 +2114,7 @@ public void ReplaceWith(GraphData other) RemoveEdgeNoValidate(edge, false); } - using (var nodesToRemove = PooledList.Get()) + using (ListPool.Get(out var nodesToRemove)) { nodesToRemove.AddRange(m_Nodes.SelectValue()); foreach (var node in nodesToRemove) @@ -2754,23 +2754,24 @@ void UpgradeFromBlockMap(Dictionary blockMap) ChangeVersion(latestVersion); } - PooledList<(LegacyUnknownTypeNode, AbstractMaterialNode)> updatedNodes = PooledList<(LegacyUnknownTypeNode, AbstractMaterialNode)>.Get(); - foreach (var node in m_Nodes.SelectValue()) + using (ListPool<(LegacyUnknownTypeNode, AbstractMaterialNode)>.Get(out var updatedNodes)) { - if (node is LegacyUnknownTypeNode lNode && lNode.foundType != null) + foreach (var node in m_Nodes.SelectValue()) { - AbstractMaterialNode legacyNode = (AbstractMaterialNode)Activator.CreateInstance(lNode.foundType); - JsonUtility.FromJsonOverwrite(lNode.serializedData, legacyNode); - legacyNode.group = lNode.group; - updatedNodes.Add((lNode, legacyNode)); + if (node is LegacyUnknownTypeNode lNode && lNode.foundType != null) + { + AbstractMaterialNode legacyNode = (AbstractMaterialNode)Activator.CreateInstance(lNode.foundType); + JsonUtility.FromJsonOverwrite(lNode.serializedData, legacyNode); + legacyNode.group = lNode.group; + updatedNodes.Add((lNode, legacyNode)); + } + } + foreach (var nodePair in updatedNodes) + { + m_Nodes.Add(nodePair.Item2); + ReplaceNodeWithNode(nodePair.Item1, nodePair.Item2); } } - foreach (var nodePair in updatedNodes) - { - m_Nodes.Add(nodePair.Item2); - ReplaceNodeWithNode(nodePair.Item1, nodePair.Item2); - } - updatedNodes.Dispose(); m_NodeDictionary = new Dictionary(m_Nodes.Count); diff --git a/Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphDataUtils.cs b/Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphDataUtils.cs index 662f277f083..591cea0e10d 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphDataUtils.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphDataUtils.cs @@ -11,8 +11,8 @@ public static class GraphDataUtils { public static void ApplyActionLeafFirst(GraphData graph, Action action) { - var temporaryMarks = PooledHashSet.Get(); - var permanentMarks = PooledHashSet.Get(); + var temporaryMarks = HashSetPool.Get(); + var permanentMarks = HashSetPool.Get(); var slots = ListPool.Get(); // Make sure we process a node's children before the node itself. @@ -58,8 +58,8 @@ public static void ApplyActionLeafFirst(GraphData graph, Action.Release(stack); ListPool.Release(slots); - temporaryMarks.Dispose(); - permanentMarks.Dispose(); + HashSetPool.Release(temporaryMarks); + HashSetPool.Release(permanentMarks); } } } diff --git a/Packages/com.unity.shadergraph/Editor/Data/Implementation/NodeUtils.cs b/Packages/com.unity.shadergraph/Editor/Data/Implementation/NodeUtils.cs index 79dabe57d86..76d95aedd8f 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Implementation/NodeUtils.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Implementation/NodeUtils.cs @@ -263,13 +263,13 @@ private static void ActiveTreeExists(AbstractMaterialNode node, out bool activeL // NOTE: I cannot think if there is any case where the entirety of the connected graph would need to change, but if there are bugs // on certain nodes farther away from the node not updating correctly, a possible solution may be to get the entirety of the connected // graph instead of just what I have declared as the "local" connected graph - public static void ReevaluateActivityOfConnectedNodes(AbstractMaterialNode node, PooledHashSet changedNodes = null) + public static void ReevaluateActivityOfConnectedNodes(AbstractMaterialNode node, HashSet changedNodes = null) { var forest = GetForest(node); ReevaluateActivityOfNodeList(forest, changedNodes); } - public static void ReevaluateActivityOfNodeList(IEnumerable nodes, PooledHashSet changedNodes = null) + public static void ReevaluateActivityOfNodeList(IEnumerable nodes, HashSet changedNodes = null) { bool getChangedNodes = changedNodes != null; foreach (AbstractMaterialNode n in nodes) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs index 557850adac1..89ef46ec708 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs @@ -797,8 +797,8 @@ public virtual void Concretize() hasError = false; owner?.ClearErrorsForNode(this); - using (var inputSlots = PooledList.Get()) - using (var outputSlots = PooledList.Get()) + using (ListPool.Get(out var inputSlots)) + using (ListPool.Get(out var outputSlots)) { GetInputSlots(inputSlots); GetOutputSlots(outputSlots); @@ -847,9 +847,9 @@ protected string GetRayTracingError() => $@" public virtual void CollectPreviewMaterialProperties(List properties) { - using (var tempSlots = PooledList.Get()) - using (var tempPreviewProperties = PooledList.Get()) - using (var tempEdges = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) + using (ListPool.Get(out var tempPreviewProperties)) + using (ListPool.Get(out var tempEdges)) { GetInputSlots(tempSlots); foreach (var s in tempSlots) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/CodeFunctionNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/CodeFunctionNode.cs index fe1d07fda2d..eb08971407b 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/CodeFunctionNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/CodeFunctionNode.cs @@ -6,6 +6,7 @@ using UnityEngine; using UnityEditor.Graphing; using UnityEditor.ShaderGraph.Internal; +using UnityEngine.Pool; namespace UnityEditor.ShaderGraph { @@ -366,7 +367,7 @@ private static MaterialSlot CreateBoundSlot(Binding attributeBinding, int slotId public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetOutputSlots(tempSlots); foreach (var outSlot in tempSlots) @@ -410,7 +411,7 @@ private string GetFunctionHeader() { string header = "void " + GetFunctionName() + "("; - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetSlots(tempSlots); tempSlots.Sort((slot1, slot2) => slot1.id.CompareTo(slot2.id)); @@ -454,7 +455,7 @@ private string GetFunctionBody(MethodInfo info) // stomp any newline differences that might try to sneak in via this path result = result.Replace("\r\n", "\n"); - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetSlots(tempSlots); foreach (var slot in tempSlots) @@ -488,7 +489,7 @@ private static SlotAttribute GetSlotAttribute([NotNull] ParameterInfo info) public NeededCoordinateSpace RequiresNormal(ShaderStageCapability stageCapability) { var binding = NeededCoordinateSpace.None; - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); foreach (var slot in tempSlots) @@ -500,7 +501,7 @@ public NeededCoordinateSpace RequiresNormal(ShaderStageCapability stageCapabilit public NeededCoordinateSpace RequiresViewDirection(ShaderStageCapability stageCapability) { var binding = NeededCoordinateSpace.None; - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); foreach (var slot in tempSlots) @@ -511,7 +512,7 @@ public NeededCoordinateSpace RequiresViewDirection(ShaderStageCapability stageCa public NeededCoordinateSpace RequiresPosition(ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var binding = NeededCoordinateSpace.None; @@ -523,7 +524,7 @@ public NeededCoordinateSpace RequiresPosition(ShaderStageCapability stageCapabil public NeededCoordinateSpace RequiresPositionPredisplacement(ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var binding = NeededCoordinateSpace.None; @@ -535,7 +536,7 @@ public NeededCoordinateSpace RequiresPositionPredisplacement(ShaderStageCapabili public NeededCoordinateSpace RequiresTangent(ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var binding = NeededCoordinateSpace.None; @@ -547,7 +548,7 @@ public NeededCoordinateSpace RequiresTangent(ShaderStageCapability stageCapabili public NeededCoordinateSpace RequiresBitangent(ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var binding = NeededCoordinateSpace.None; @@ -559,7 +560,7 @@ public NeededCoordinateSpace RequiresBitangent(ShaderStageCapability stageCapabi public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); foreach (var slot in tempSlots) @@ -574,7 +575,7 @@ public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapabil public bool RequiresScreenPosition(ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); foreach (var slot in tempSlots) @@ -588,7 +589,7 @@ public bool RequiresScreenPosition(ShaderStageCapability stageCapability) public bool RequiresNDCPosition(ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); foreach (var slot in tempSlots) @@ -602,7 +603,7 @@ public bool RequiresNDCPosition(ShaderStageCapability stageCapability) public bool RequiresPixelPosition(ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); foreach (var slot in tempSlots) @@ -616,7 +617,7 @@ public bool RequiresPixelPosition(ShaderStageCapability stageCapability) public bool RequiresVertexColor(ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); foreach (var slot in tempSlots) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CalculateLevelOfDetailTexture2DNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CalculateLevelOfDetailTexture2DNode.cs index 3530a123a24..dba0804bb68 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CalculateLevelOfDetailTexture2DNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CalculateLevelOfDetailTexture2DNode.cs @@ -99,7 +99,7 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var result = false; diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/GatherTexture2DNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/GatherTexture2DNode.cs index d43552bde59..dbb86737199 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/GatherTexture2DNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/GatherTexture2DNode.cs @@ -110,7 +110,7 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var result = false; diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs index f5cdb655d64..972edc540ce 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs @@ -116,7 +116,7 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var result = false; diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs index f45c55579de..c73bde70350 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs @@ -136,7 +136,7 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) { var result = false; - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); foreach (var slot in tempSlots) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs index 8ef013af9fe..74f4637952e 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs @@ -3,6 +3,7 @@ using UnityEditor.Graphing; using UnityEditor.ShaderGraph.Drawing.Controls; using UnityEditor.ShaderGraph.Internal; +using UnityEngine.Pool; namespace UnityEditor.ShaderGraph { @@ -185,7 +186,7 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var result = false; diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleVirtualTextureNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleVirtualTextureNode.cs index 870f4914c63..be999b69a96 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleVirtualTextureNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleVirtualTextureNode.cs @@ -540,7 +540,7 @@ public override void CollectShaderProperties(PropertyCollector properties, Gener public bool RequiresMeshUV(Internal.UVChannel channel, ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); foreach (var slot in tempSlots) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/TextureStackNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/TextureStackNode.cs index bd1a751d16f..6e1b69183b3 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/TextureStackNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/TextureStackNode.cs @@ -27,20 +27,20 @@ public static void GenerateVirtualTextureFeedback( // so per permutation we gather variables contribution to feedback and we generate // feedback gathering for each permutation individually. - var feedbackVariablesPerPermutation = PooledList>.Get(); + var feedbackVariablesPerPermutation = UnityEngine.Pool.ListPool>.Get(); try { if (shaderKeywords.permutations.Count >= 1) { for (int i = 0; i < shaderKeywords.permutations.Count; i++) { - feedbackVariablesPerPermutation.Add(PooledList.Get()); + feedbackVariablesPerPermutation.Add(UnityEngine.Pool.ListPool.Get()); } } else { // Create a dummy single permutation - feedbackVariablesPerPermutation.Add(PooledList.Get()); + feedbackVariablesPerPermutation.Add(UnityEngine.Pool.ListPool.Get()); } int index = 0; //for keywordPermutationsPerNode @@ -138,9 +138,9 @@ public static void GenerateVirtualTextureFeedback( { foreach (var list in feedbackVariablesPerPermutation) { - list.Dispose(); + UnityEngine.Pool.ListPool.Release(list); } - feedbackVariablesPerPermutation.Dispose(); + UnityEngine.Pool.ListPool>.Release(feedbackVariablesPerPermutation); } } diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Noise/GradientNoiseNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Noise/GradientNoiseNode.cs index 3b9cfa63f13..5b8f38803fc 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Noise/GradientNoiseNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Noise/GradientNoiseNode.cs @@ -123,7 +123,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var result = false; diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Noise/SimpleNoiseNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Noise/SimpleNoiseNode.cs index 95ec9622fbb..8c412bd3a37 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Noise/SimpleNoiseNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Noise/SimpleNoiseNode.cs @@ -136,7 +136,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var result = false; diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Noise/VoronoiNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Noise/VoronoiNode.cs index fc96c33e860..557857e0886 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Noise/VoronoiNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Noise/VoronoiNode.cs @@ -146,7 +146,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var result = false; diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/FlipbookNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/FlipbookNode.cs index 57aeea08e69..150a4838e76 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/FlipbookNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/FlipbookNode.cs @@ -178,7 +178,7 @@ private void AppendInvertSpecificLines(ShaderStringBuilder stringBuilder) public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var result = false; diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs index 89322221acb..85087a75183 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs @@ -114,7 +114,7 @@ public NeededCoordinateSpace RequiresViewDirection(ShaderStageCapability stageCa public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var result = false; diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs index d9a49c56168..0dca94468d8 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs @@ -229,7 +229,7 @@ public NeededCoordinateSpace RequiresViewDirection(ShaderStageCapability stageCa public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) { - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { GetInputSlots(tempSlots); var result = false; diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs index 77236515a48..38001f0de7b 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs @@ -150,8 +150,8 @@ public string functionBody public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { - using (var inputSlots = PooledList.Get()) - using (var outputSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var inputSlots)) + using (UnityEngine.Pool.ListPool.Get(out var outputSlots)) { GetInputSlots(inputSlots); GetOutputSlots(outputSlots); @@ -301,8 +301,8 @@ public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode gener void GetFunctionHeader(ShaderStringBuilder sb) { - using (var inputSlots = PooledList.Get()) - using (var outputSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var inputSlots)) + using (UnityEngine.Pool.ListPool.Get(out var outputSlots)) { GetInputSlots(inputSlots); GetOutputSlots(outputSlots); @@ -380,7 +380,7 @@ static bool IsValidFunction(HlslSourceType sourceType, string functionName, stri void ValidateSlotName() { - using (var slots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var slots)) { GetSlots(slots); foreach (var slot in slots) @@ -398,10 +398,10 @@ void ValidateSlotName() void ValidateBareTextureSlots() { - using (var outputSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var slots)) { - GetOutputSlots(outputSlots); - foreach (var slot in outputSlots) + GetOutputSlots(slots); + foreach (var slot in slots) { if (slot.bareResource) { diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Utility/KeywordNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Utility/KeywordNode.cs index f3810ccf737..dbd19e58051 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Utility/KeywordNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Utility/KeywordNode.cs @@ -77,26 +77,25 @@ void UpdatePorts() case KeywordType.Boolean: { // Boolean type has preset slots - PooledList temp = PooledList.Get(); - GetInputSlots(temp); - if (temp.Any()) + using (UnityEngine.Pool.ListPool.Get(out var temp)) { - temp.Dispose(); - break; - } - else - { - temp.Dispose(); + GetInputSlots(temp); + if (temp.Count > 0) + { + break; + } } + AddSlot(new DynamicVectorMaterialSlot(OutputSlotId, "Out", "Out", SlotType.Output, Vector4.zero)); AddSlot(new DynamicVectorMaterialSlot(1, "On", "On", SlotType.Input, Vector4.zero)); AddSlot(new DynamicVectorMaterialSlot(2, "Off", "Off", SlotType.Input, Vector4.zero)); RemoveSlotsNameNotMatching(new int[] { 0, 1, 2 }); break; + } case KeywordType.Enum: - using (var inputSlots = PooledList.Get()) - using (var slotIDs = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var inputSlots)) + using (UnityEngine.Pool.ListPool.Get(out var slotIDs)) { // Get slots GetInputSlots(inputSlots); diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Utility/Logic/SwitchNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Utility/Logic/SwitchNode.cs index 55f46e12363..15ec7c7db28 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Utility/Logic/SwitchNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Utility/Logic/SwitchNode.cs @@ -114,8 +114,8 @@ public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode gener public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { - using (var inputSlots = PooledList.Get()) - using (var outputSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var inputSlots)) + using (UnityEngine.Pool.ListPool.Get(out var outputSlots)) { GetInputSlots(inputSlots); GetOutputSlots(outputSlots); @@ -172,8 +172,8 @@ static string Op(ComparisonType op) void GetFunctionDefinition(ShaderStringBuilder sb) { - using (var inputSlots = PooledList.Get()) - using (var outputSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var inputSlots)) + using (UnityEngine.Pool.ListPool.Get(out var outputSlots)) { ShaderStringBuilder body = new(); body.AppendLine("Out = Fallback;"); diff --git a/Packages/com.unity.shadergraph/Editor/Data/Util/PooledHashSet.cs b/Packages/com.unity.shadergraph/Editor/Data/Util/PooledHashSet.cs deleted file mode 100644 index 6aab0b5c297..00000000000 --- a/Packages/com.unity.shadergraph/Editor/Data/Util/PooledHashSet.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine.Assertions; - -namespace UnityEditor.ShaderGraph -{ - class PooledHashSet : HashSet, IDisposable - { - static Stack> s_Pool = new Stack>(); - bool m_Active; - - PooledHashSet() { } - - public static PooledHashSet Get() - { - if (s_Pool.Count == 0) - { - return new PooledHashSet { m_Active = true }; - } - - var list = s_Pool.Pop(); - list.m_Active = true; -#if DEBUG - GC.ReRegisterForFinalize(list); -#endif - return list; - } - - public void Dispose() - { - Assert.IsTrue(m_Active); - m_Active = false; - Clear(); - s_Pool.Push(this); -#if DEBUG - GC.SuppressFinalize(this); -#endif - } - - // Destructor causes some GC alloc so only do this sanity check in debug build -#if DEBUG - ~PooledHashSet() - { - throw new InvalidOperationException($"{nameof(PooledHashSet)} must be disposed manually."); - } - -#endif - } -} diff --git a/Packages/com.unity.shadergraph/Editor/Data/Util/PooledHashSet.cs.meta b/Packages/com.unity.shadergraph/Editor/Data/Util/PooledHashSet.cs.meta deleted file mode 100644 index 9bf72638e9b..00000000000 --- a/Packages/com.unity.shadergraph/Editor/Data/Util/PooledHashSet.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 11c00f8215374c368941cd4c06242ed7 -timeCreated: 1582812009 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/Data/Util/PooledList.cs b/Packages/com.unity.shadergraph/Editor/Data/Util/PooledList.cs deleted file mode 100644 index 2b0be80b0d5..00000000000 --- a/Packages/com.unity.shadergraph/Editor/Data/Util/PooledList.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine.Assertions; - -namespace UnityEditor.ShaderGraph -{ - class PooledList : List, IDisposable - { - static Stack> s_Pool = new Stack>(); - bool m_Active; - - PooledList() { } - - public static PooledList Get() - { - if (s_Pool.Count == 0) - { - return new PooledList { m_Active = true }; - } - - var list = s_Pool.Pop(); - list.m_Active = true; -#if DEBUG - GC.ReRegisterForFinalize(list); -#endif - return list; - } - - public void Dispose() - { - Assert.IsTrue(m_Active); - m_Active = false; - Clear(); - s_Pool.Push(this); -#if DEBUG - GC.SuppressFinalize(this); -#endif - } - - // Destructor causes some GC alloc so only do this sanity check in debug build -#if DEBUG - ~PooledList() - { - throw new InvalidOperationException($"{nameof(PooledList)} must be disposed manually."); - } - -#endif - } -} diff --git a/Packages/com.unity.shadergraph/Editor/Data/Util/PooledList.cs.meta b/Packages/com.unity.shadergraph/Editor/Data/Util/PooledList.cs.meta deleted file mode 100644 index bbf2fbfe95b..00000000000 --- a/Packages/com.unity.shadergraph/Editor/Data/Util/PooledList.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 9f3065ccf1f64e219d8039d355a788a1 -timeCreated: 1579171175 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs b/Packages/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs index 19780d548b0..c27307bd2bd 100644 --- a/Packages/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs +++ b/Packages/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs @@ -335,8 +335,8 @@ internal static void PropagateNodes(HashSet sources, Propa static void ForeachConnectedNode(AbstractMaterialNode node, PropagationDirection dir, Action action) { - using (var tempEdges = PooledList.Get()) - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempEdges)) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { // Loop through all nodes that the node feeds into. if (dir == PropagationDirection.Downstream) @@ -470,10 +470,10 @@ public void HandleGraphChanges() } private static readonly ProfilerMarker CollectPreviewPropertiesMarker = new ProfilerMarker("CollectPreviewProperties"); - void CollectPreviewProperties(IEnumerable nodesToCollect, PooledList perMaterialPreviewProperties) + void CollectPreviewProperties(IEnumerable nodesToCollect, List perMaterialPreviewProperties) { using (CollectPreviewPropertiesMarker.Auto()) - using (var tempPreviewProps = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempPreviewProps)) { // collect from all of the changed nodes foreach (var propNode in nodesToCollect) @@ -639,10 +639,10 @@ bool TimedNodesShouldUpdate(EditorWindow editorWindow) public void RenderPreviews(EditorWindow editorWindow, bool requestShaders = true) { using (RenderPreviewsMarker.Auto()) - using (var renderList2D = PooledList.Get()) - using (var renderList3D = PooledList.Get()) - using (var nodesToDraw = PooledHashSet.Get()) - using (var perMaterialPreviewProperties = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var renderList2D)) + using (UnityEngine.Pool.ListPool.Get(out var renderList3D)) + using (UnityEngine.Pool.HashSetPool.Get(out var nodesToDraw)) + using (UnityEngine.Pool.ListPool.Get(out var perMaterialPreviewProperties)) { // update topology cached data // including list of time-dependent previews, and the preview mode (2d/3d) @@ -830,7 +830,7 @@ void ProcessCompletedShaderCompilations() { // Check for shaders that finished compiling and set them to redraw using (ProcessCompletedShaderCompilationsMarker.Auto()) - using (var previewsCompiled = PooledHashSet.Get()) + using (UnityEngine.Pool.HashSetPool.Get(out var previewsCompiled)) { foreach (var preview in m_PreviewsCompiling) { @@ -905,7 +905,7 @@ void KickOffShaderCompilations() { // Start compilation for nodes that need to recompile using (KickOffShaderCompilationsMarker.Auto()) - using (var previewsToCompile = PooledHashSet.Get()) + using (UnityEngine.Pool.HashSetPool.Get(out var previewsToCompile)) { // master node compile is first in the priority list, as it takes longer than the other previews if (m_PreviewsCompiling.Count + previewsToCompile.Count < m_MaxPreviewsCompiling) @@ -940,7 +940,7 @@ void KickOffShaderCompilations() } if (previewsToCompile.Count >= 0) - using (var nodesToCompile = PooledHashSet.Get()) + using (UnityEngine.Pool.HashSetPool.Get(out var nodesToCompile)) { // remove the selected nodes from the recompile list m_PreviewsNeedsRecompile.ExceptWith(previewsToCompile); @@ -989,7 +989,7 @@ void UpdateShaders() { // nodes with shader changes cause all downstream nodes to need recompilation // (since they presumably include the code for these nodes) - using (var nodesToRecompile = PooledHashSet.Get()) + using (UnityEngine.Pool.HashSetPool.Get(out var nodesToRecompile)) { PropagateNodes(m_NodesShaderChanged, PropagationDirection.Downstream, nodesToRecompile); ForEachNodesPreview(nodesToRecompile, p => m_PreviewsNeedsRecompile.Add(p)); @@ -1255,7 +1255,7 @@ void UpdateTopology() return; using (UpdateTopologyMarker.Auto()) - using (var timedNodes = PooledHashSet.Get()) + using (UnityEngine.Pool.HashSetPool.Get(out var timedNodes)) { timedNodes.UnionWith(m_Graph.GetNodes().Where(n => n.RequiresTime())); @@ -1291,7 +1291,7 @@ void UpdateTopology() } private static readonly ProfilerMarker RenderPreviewMarker = new ProfilerMarker("RenderPreview"); - void RenderPreview(PreviewRenderData renderData, Mesh mesh, Matrix4x4 transform, PooledList perMaterialPreviewProperties) + void RenderPreview(PreviewRenderData renderData, Mesh mesh, Matrix4x4 transform, List perMaterialPreviewProperties) { using (RenderPreviewMarker.Auto()) { diff --git a/Packages/com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs b/Packages/com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs index 3aa71e400b2..f91d63a1f63 100644 --- a/Packages/com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs +++ b/Packages/com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs @@ -19,6 +19,7 @@ using UnityEditor.ShaderGraph.Internal; using UnityEditor.Experimental; using UnityEditor.PackageManager.UI; +using UnityEngine.Pool; namespace UnityEditor.ShaderGraph.Drawing { @@ -253,7 +254,7 @@ public GraphEditorView(EditorWindow editorWindow, GraphData graph, MessageManage GUILayout.Label("Color Mode"); var newColorIndex = EditorGUILayout.Popup(m_ColorManager.activeIndex, colorProviders, GUILayout.Width(100f)); GUILayout.Space(4); - + m_UserViewSettings.isBlackboardVisible = GUILayout.Toggle(m_UserViewSettings.isBlackboardVisible, BlackboardIcon, EditorStyles.toolbarButton); GUILayout.Space(6); @@ -1397,7 +1398,7 @@ void UpdateEdgeColors(HashSet nodeViews) nodeStack.Clear(); foreach (var nodeView in nodeViews) nodeStack.Push((Node)nodeView); - PooledList edgesToUpdate = PooledList.Get(); + var edgesToUpdate = ListPool.Get(); while (nodeStack.Any()) { var nodeView = nodeStack.Pop(); @@ -1456,7 +1457,7 @@ void UpdateEdgeColors(HashSet nodeViews) } } var edges = edgesToUpdate.ToArray(); - edgesToUpdate.Dispose(); + ListPool.Release(edgesToUpdate); schedule.Execute(() => { foreach (Edge e in edges) diff --git a/Packages/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs b/Packages/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs index 94c410e8206..49e5c7b04ae 100644 --- a/Packages/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs +++ b/Packages/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs @@ -134,7 +134,7 @@ private void AddCallbacks() if (displayName != oldSlot.RawDisplayName()) { - using (var tempSlots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var tempSlots)) { m_Node.GetSlots(tempSlots); diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs b/Packages/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs index e797a5c0c94..9a0cba250ae 100644 --- a/Packages/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs +++ b/Packages/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs @@ -457,7 +457,8 @@ static PropertyCollector GetSubShaderPropertiesForTarget(Target target, GraphDat PropertyCollector subshaderProperties = new PropertyCollector(); // Collect shader properties declared by active nodes - using (var activeNodes = PooledHashSet.Get()) + + using (Pool.HashSetPool.Get(out var activeNodes)) { if (outputNode == null) { @@ -916,7 +917,7 @@ void ProcessStackForPass(ContextData contextData, BlockFieldDescriptor[] passBlo spliceCommands.Add("InterpolatorPack", interpolatorBuilder.ToCodeBlock()); } - // Generated String Builders for all struct types + // Generated String Builders for all struct types var passStructBuilder = new ShaderStringBuilder(humanReadable: m_HumanReadable); // using (s_profileStructTypes.Auto()) { @@ -1086,7 +1087,7 @@ void ProcessStackForPass(ContextData contextData, BlockFieldDescriptor[] passBlo if (propertyBuilder.length == 0) propertyBuilder.AppendLine("// GraphProperties: "); spliceCommands.Add("GraphProperties", propertyBuilder.ToCodeBlock()); - } + } // -------------------------------------------------- // Graph Defines diff --git a/Packages/com.unity.shadergraph/Editor/Importers/ShaderSubGraphImporter.cs b/Packages/com.unity.shadergraph/Editor/Importers/ShaderSubGraphImporter.cs index bc4907b071a..dcf4f63e281 100644 --- a/Packages/com.unity.shadergraph/Editor/Importers/ShaderSubGraphImporter.cs +++ b/Packages/com.unity.shadergraph/Editor/Importers/ShaderSubGraphImporter.cs @@ -194,8 +194,7 @@ static void ProcessSubGraph(SubGraphAsset asset, GraphData graph, ShaderGraphImp asset.documentationPath = documentationPath; var outputNode = graph.outputNode; - - var outputSlots = PooledList.Get(); + var outputSlots = UnityEngine.Pool.ListPool.Get(); outputNode.GetInputSlots(outputSlots); List nodes = new List(); @@ -287,7 +286,7 @@ static void ProcessSubGraph(SubGraphAsset asset, GraphData graph, ShaderGraphImp { asset.isValid = false; registry.ProvideFunction(asset.functionName, sb => { }); - outputSlots.Dispose(); + UnityEngine.Pool.ListPool.Release(outputSlots); return; } @@ -446,7 +445,7 @@ static void ProcessSubGraph(SubGraphAsset asset, GraphData graph, ShaderGraphImp } asset.WriteData(orderedProperties, keywordCollector.keywords, graph.dropdowns, collector.properties, outputSlots, graph.unsupportedTargets); - outputSlots.Dispose(); + UnityEngine.Pool.ListPool.Release(outputSlots); } static void GatherDescendentsFromGraph(GUID rootAssetGuid, out bool containsCircularDependency, out HashSet descendentGuids) diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNode.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNode.cs index ad2d5b3a1ad..841810f7c5a 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNode.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNode.cs @@ -183,7 +183,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo if (this.Provider == null || this.Provider.Definition == null) return; - using (var slots = PooledList.Get()) + using (UnityEngine.Pool.ListPool.Get(out var slots)) { GetSlots(slots); Dictionary paramSlotMap = new(); From da88a7244fa2aff743985ff448ed68bee19f25f3 Mon Sep 17 00:00:00 2001 From: Kenny Tan Date: Wed, 4 Mar 2026 18:52:03 +0000 Subject: [PATCH 36/95] [UUM-135640][6000.6][URP 2D] Fix shadow caster 2d culling --- .../Runtime/2D/Shadows/ShadowCaster2D.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowCaster2D.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowCaster2D.cs index 4e74a9d288b..395b4b72db4 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowCaster2D.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowCaster2D.cs @@ -279,9 +279,9 @@ internal bool IsLit(Light2D light) { // Oddly adding and subtracting vectors is expensive here because of the new structures created... Vector3 deltaPos; - deltaPos.x = light.m_CachedPosition.x - boundingSphere.position.x; - deltaPos.y = light.m_CachedPosition.y - boundingSphere.position.y; - deltaPos.z = light.m_CachedPosition.z - boundingSphere.position.z; + deltaPos.x = light.boundingSphere.position.x - boundingSphere.position.x; + deltaPos.y = light.boundingSphere.position.y - boundingSphere.position.y; + deltaPos.z = light.boundingSphere.position.z - boundingSphere.position.z; float distanceSq = Vector3.SqrMagnitude(deltaPos); From 7c358a0d3feb85f71b83b30bf36dfdcc1d88ed9d Mon Sep 17 00:00:00 2001 From: Pema Malling Date: Wed, 4 Mar 2026 21:06:12 +0000 Subject: [PATCH 37/95] Screen Space Reflections in URP --- .../ScreenSpaceReflectionStripper.cs | 36 + .../ScreenSpaceReflectionStripper.cs.meta | 2 + .../Overrides/ScreenSpaceReflectionEditor.cs | 269 ++++ .../ScreenSpaceReflectionEditor.cs.meta | 2 + ...eenSpaceReflectionRendererFeatureEditor.cs | 32 + ...aceReflectionRendererFeatureEditor.cs.meta | 11 + .../Editor/ShaderBuildPreprocessor.cs | 51 +- .../Editor/ShaderGUI/Shaders/LitShader.cs | 5 + .../Editor/ShaderGUI/ShadingModels/LitGUI.cs | 24 + .../Includes/DepthNormalsOnlyPass.hlsl | 4 + .../ShaderGraph/Includes/PBRGBufferPass.hlsl | 4 +- .../Terrain/DepthNormalsOnlyPass.hlsl | 15 +- .../Includes/Terrain/PBRGBufferPass.hlsl | 4 +- .../Targets/UniversalLitSubTarget.cs | 6 +- .../ShaderGraph/Targets/UniversalTarget.cs | 20 + .../Targets/UniversalTerrainLitSubTarget.cs | 4 +- .../Editor/ShaderScriptableStripper.cs | 32 + ...niversalRenderPipelineAssetPrefiltering.cs | 18 + .../FrameData/UniversalRenderingData.cs | 11 + .../History/BeforeTransparentsColorHistory.cs | 20 + .../BeforeTransparentsColorHistory.cs.meta | 2 + .../Runtime/History/ColorHistory.cs | 128 ++ .../Runtime/History/ColorHistory.cs.meta | 2 + .../Runtime/History/RawColorHistory.cs | 105 +- .../Runtime/MipGen.meta | 8 + .../MipGenRenderPipelineRuntimeResources.cs | 46 + ...pGenRenderPipelineRuntimeResources.cs.meta | 2 + .../Runtime/MipGen/MipGenerator.cs | 509 ++++++++ .../Runtime/MipGen/MipGenerator.cs.meta | 11 + .../Runtime/MipGen/Shaders.meta | 8 + .../MipGen/Shaders/ColorPyramid.compute | 188 +++ .../MipGen/Shaders/ColorPyramid.compute.meta | 9 + .../MipGen/Shaders/ColorPyramidPS.hlsl | 57 + .../MipGen/Shaders/ColorPyramidPS.hlsl.meta | 9 + .../MipGen/Shaders/ColorPyramidPS.shader | 23 + .../MipGen/Shaders/ColorPyramidPS.shader.meta | 9 + .../MipGen/Shaders/DepthPyramid.compute | 130 ++ .../MipGen/Shaders/DepthPyramid.compute.meta | 10 + .../MipGen/Shaders/DepthPyramidConstants.cs | 27 + .../Shaders/DepthPyramidConstants.cs.hlsl | 29 + .../DepthPyramidConstants.cs.hlsl.meta | 7 + .../Shaders/DepthPyramidConstants.cs.meta | 11 + .../Runtime/Passes/DepthNormalOnlyPass.cs | 32 +- .../ScreenSpaceReflectionRendererFeature.meta | 8 + .../.001-screen-space-reflection-decisions.md | 146 +++ ...eflectionDepthNormalOnlyTransparentPass.cs | 84 ++ ...tionDepthNormalOnlyTransparentPass.cs.meta | 2 + .../ScreenSpaceReflectionPass.cs | 637 ++++++++++ .../ScreenSpaceReflectionPass.cs.meta | 2 + ...creenSpaceReflectionPersistentResources.cs | 28 + ...SpaceReflectionPersistentResources.cs.meta | 2 + .../ScreenSpaceReflectionRendererFeature.cs | 109 ++ ...reenSpaceReflectionRendererFeature.cs.meta | 2 + .../ScreenSpaceReflectionVolumeSettings.cs | 130 ++ ...creenSpaceReflectionVolumeSettings.cs.meta | 2 + .../Runtime/ScriptableRenderer.cs | 3 + .../Runtime/UniversalRenderPipeline.cs | 15 +- .../Runtime/UniversalRenderPipelineCore.cs | 11 + .../Runtime/UniversalRenderer.cs | 2 + .../Runtime/UniversalRendererRenderGraph.cs | 38 +- .../ComputeScreenSpaceReflection.hlsl | 670 ++++++++++ .../ComputeScreenSpaceReflection.hlsl.meta | 7 + .../ShaderLibrary/GlobalIllumination.hlsl | 68 +- .../ShaderLibrary/Input.hlsl | 6 + .../SampleScreenSpaceReflection.hlsl | 37 + .../SampleScreenSpaceReflection.hlsl.meta | 7 + .../Shaders/ComplexLit.shader | 8 + .../Shaders/Lit.shader | 9 + .../Shaders/LitDepthNormalsPass.hlsl | 12 +- .../Shaders/Nature/SpeedTree8.shader | 4 + .../Shaders/Nature/SpeedTree8Passes.hlsl | 14 +- .../Particles/ParticlesDepthNormalsPass.hlsl | 15 +- .../Shaders/Particles/ParticlesInput.hlsl | 2 +- .../Shaders/Particles/ParticlesLit.shader | 8 + .../Shaders/Terrain/TerrainLit.shader | 4 + .../Shaders/Terrain/TerrainLitAdd.shader | 1 + .../Shaders/Terrain/TerrainLitBase.shader | 2 + .../Terrain/TerrainLitDepthNormalsPass.hlsl | 26 +- .../Shaders/Terrain/TerrainLitPasses.hlsl | 12 +- .../Utils/ComputeScreenSpaceReflection.shader | 137 ++ .../ComputeScreenSpaceReflection.shader.meta | 9 + .../Editor/ShaderBuildPreprocessorTests.cs | 29 +- .../Tests/Editor/ShaderPrefilteringTests.cs | 51 +- .../Editor/ShaderScriptableStripperTests.cs | 48 + .../CommonAssets/URPAssets/250_SSR.asset | 146 +++ .../CommonAssets/URPAssets/250_SSR.asset.meta | 8 + .../Assets/Scenes/250_Assets.meta | 8 + .../Scenes/250_Assets/SSRDeferred.asset | 73 ++ .../Scenes/250_Assets/SSRDeferred.asset.meta | 8 + .../Assets/Scenes/250_Assets/SSRForward.asset | 73 ++ .../Scenes/250_Assets/SSRForward.asset.meta | 8 + .../Assets/Scenes/250_Assets/SSRMirror.mat | 137 ++ .../Scenes/250_Assets/SSRMirror.mat.meta | 8 + .../Scenes/250_Assets/SSRRoughMirror.mat | 137 ++ .../Scenes/250_Assets/SSRRoughMirror.mat.meta | 8 + .../Assets/Scenes/250_Assets/SSRVolume.asset | 80 ++ .../Scenes/250_Assets/SSRVolume.asset.meta | 8 + .../250_Assets/SSRVolumeLinearMarching.asset | 80 ++ .../SSRVolumeLinearMarching.asset.meta | 8 + .../Assets/Scenes/250_SSR_Deferred.unity | 1098 +++++++++++++++++ .../Assets/Scenes/250_SSR_Deferred.unity.meta | 7 + .../Assets/Scenes/250_SSR_Forward.unity | 1098 +++++++++++++++++ .../Assets/Scenes/250_SSR_Forward.unity.meta | 7 + .../250_SSR_ForwardLinearMarching.unity | 1098 +++++++++++++++++ .../250_SSR_ForwardLinearMarching.unity.meta | 7 + .../ProjectSettings/GraphicsSettings.asset | 10 +- .../ProjectSettings/ProjectSettings.asset | 22 +- .../ProjectSettings/QualitySettings.asset | 57 + 108 files changed, 8357 insertions(+), 176 deletions(-) create mode 100644 Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/ScreenSpaceReflectionStripper.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/ScreenSpaceReflectionStripper.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Editor/Overrides/ScreenSpaceReflectionEditor.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Editor/Overrides/ScreenSpaceReflectionEditor.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/ScreenSpaceReflectionRendererFeatureEditor.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/ScreenSpaceReflectionRendererFeatureEditor.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/History/BeforeTransparentsColorHistory.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/History/BeforeTransparentsColorHistory.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/History/ColorHistory.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/History/ColorHistory.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenRenderPipelineRuntimeResources.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenRenderPipelineRuntimeResources.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenerator.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenerator.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramid.compute create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramid.compute.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.hlsl create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.hlsl.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.shader create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.shader.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramid.compute create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramid.compute.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.hlsl create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.hlsl.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/.001-screen-space-reflection-decisions.md create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionDepthNormalOnlyTransparentPass.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionDepthNormalOnlyTransparentPass.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPass.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPass.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPersistentResources.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPersistentResources.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionRendererFeature.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionRendererFeature.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionVolumeSettings.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionVolumeSettings.cs.meta create mode 100644 Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl create mode 100644 Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl.meta create mode 100644 Packages/com.unity.render-pipelines.universal/ShaderLibrary/SampleScreenSpaceReflection.hlsl create mode 100644 Packages/com.unity.render-pipelines.universal/ShaderLibrary/SampleScreenSpaceReflection.hlsl.meta create mode 100644 Packages/com.unity.render-pipelines.universal/Shaders/Utils/ComputeScreenSpaceReflection.shader create mode 100644 Packages/com.unity.render-pipelines.universal/Shaders/Utils/ComputeScreenSpaceReflection.shader.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/CommonAssets/URPAssets/250_SSR.asset create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/CommonAssets/URPAssets/250_SSR.asset.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRDeferred.asset create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRDeferred.asset.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRForward.asset create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRForward.asset.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRMirror.mat create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRMirror.mat.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRRoughMirror.mat create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRRoughMirror.mat.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolume.asset create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolume.asset.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolumeLinearMarching.asset create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolumeLinearMarching.asset.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Deferred.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Deferred.unity.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Forward.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Forward.unity.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_ForwardLinearMarching.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_ForwardLinearMarching.unity.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/ScreenSpaceReflectionStripper.cs b/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/ScreenSpaceReflectionStripper.cs new file mode 100644 index 00000000000..1559af8f1c3 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/ScreenSpaceReflectionStripper.cs @@ -0,0 +1,36 @@ +#if URP_SCREEN_SPACE_REFLECTION +using UnityEditor.Rendering.Universal; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +namespace UnityEditor.Rendering +{ + class ScreenSpaceReflectionPersistentResourcesStripper : IRenderPipelineGraphicsSettingsStripper + { + public bool active => URPBuildData.instance.buildingPlayerForUniversalRenderPipeline; + + public bool CanRemoveSettings(ScreenSpaceReflectionPersistentResources resources) + { + if (GraphicsSettings.TryGetRenderPipelineSettings(out var urpShaderStrippingSettings) && !urpShaderStrippingSettings.stripUnusedVariants) + return false; + + foreach (var urpAssetForBuild in URPBuildData.instance.renderPipelineAssets) + { + foreach (var rendererData in urpAssetForBuild.m_RendererDataList) + { + if (rendererData is not UniversalRendererData) + continue; + + foreach (var rendererFeature in rendererData.rendererFeatures) + { + if (rendererFeature is ScreenSpaceReflectionRendererFeature { isActive: true }) + return false; + } + } + } + + return true; + } + } +} +#endif diff --git a/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/ScreenSpaceReflectionStripper.cs.meta b/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/ScreenSpaceReflectionStripper.cs.meta new file mode 100644 index 00000000000..9038bb71596 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/ScreenSpaceReflectionStripper.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9ba2ca86094729044b1838b251b579b2 \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Overrides/ScreenSpaceReflectionEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/Overrides/ScreenSpaceReflectionEditor.cs new file mode 100644 index 00000000000..7c75307f06a --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Editor/Overrides/ScreenSpaceReflectionEditor.cs @@ -0,0 +1,269 @@ +#if URP_SCREEN_SPACE_REFLECTION +using System; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +namespace UnityEditor.Rendering.Universal +{ + [CustomEditor(typeof(ScreenSpaceReflectionVolumeSettings))] + class ScreenSpaceReflectionEditor : VolumeComponentEditor + { + enum PerformancePreset + { + Fast, + Balanced, + HighQuality, + BestQuality, + Custom + } + + // Serialized properties, performance settings + SerializedDataParameter m_Resolution; + SerializedDataParameter m_UpscalingMethod; + SerializedDataParameter m_LinearMarching; + SerializedDataParameter m_HitRefinementSteps; + SerializedDataParameter m_FinalThicknessMultiplier; + SerializedDataParameter m_MaxRayLength; + SerializedDataParameter m_RayLengthFade; + SerializedDataParameter m_MaxRaySteps; + SerializedDataParameter m_ObjectThickness; + + // Serialized properties, authoring settings + SerializedDataParameter m_Mode; + SerializedDataParameter m_AfterOpaque; + SerializedDataParameter m_RoughReflections; + SerializedDataParameter m_MinimumSmoothness; + SerializedDataParameter m_SmoothnessFadeStart; + SerializedDataParameter m_NormalFade; + SerializedDataParameter m_ScreenEdgeFade; + SerializedDataParameter m_ReflectSky; + + PerformancePreset m_CurrentPreset = PerformancePreset.Custom; + bool m_IgnorePresetChange = false; + bool m_PresetDirty = false; + + struct QualitySettings + { + public ScreenSpaceReflectionVolumeSettings.Resolution resolution; + public ScreenSpaceReflectionVolumeSettings.UpscalingMethod upscalingMethod; + public int hitRefinementSteps; + public float finalThicknessMultiplier; + public float maxRayLength; + public int maxRaySteps; + public float objectThickness; + public bool linearMarching; + } + + // Quality preset definitions + static readonly QualitySettings[] k_QualityPresets = + { + // Fastest + new QualitySettings + { + resolution = ScreenSpaceReflectionVolumeSettings.Resolution.Quarter, + upscalingMethod = ScreenSpaceReflectionVolumeSettings.UpscalingMethod.Kawase, + linearMarching = true, + hitRefinementSteps = 3, + finalThicknessMultiplier = 0.15f, + maxRayLength = 10f, + maxRaySteps = 16, + objectThickness = 0.325f + }, + // Balanced + new QualitySettings + { + resolution = ScreenSpaceReflectionVolumeSettings.Resolution.Half, + upscalingMethod = ScreenSpaceReflectionVolumeSettings.UpscalingMethod.Gaussian, + linearMarching = true, + hitRefinementSteps = 5, + finalThicknessMultiplier = 0.05f, + maxRayLength = 10f, + maxRaySteps = 32, + objectThickness = 0.325f + }, + // High Quality + new QualitySettings + { + resolution = ScreenSpaceReflectionVolumeSettings.Resolution.Half, + upscalingMethod = ScreenSpaceReflectionVolumeSettings.UpscalingMethod.Bilateral, + linearMarching = false, + hitRefinementSteps = 5, + finalThicknessMultiplier = 0.16f, + maxRayLength = 20f, + maxRaySteps = 64, + objectThickness = 0.018f + }, + // Best Quality + new QualitySettings + { + resolution = ScreenSpaceReflectionVolumeSettings.Resolution.Full, + upscalingMethod = ScreenSpaceReflectionVolumeSettings.UpscalingMethod.Bilateral, + linearMarching = false, + hitRefinementSteps = 5, + finalThicknessMultiplier = 0.16f, + maxRayLength = 30f, + maxRaySteps = 64, + objectThickness = 0.015f + } + }; + + public override void OnEnable() + { + var o = new PropertyFetcher(serializedObject); + + m_Mode = Unpack(o.Find(x => x.mode)); + m_Resolution = Unpack(o.Find(x => x.resolution)); + m_UpscalingMethod = Unpack(o.Find(x => x.upscalingMethod)); + m_LinearMarching = Unpack(o.Find(x => x.linearMarching)); + m_HitRefinementSteps = Unpack(o.Find(x => x.hitRefinementSteps)); + m_FinalThicknessMultiplier = Unpack(o.Find(x => x.finalThicknessMultiplier)); + m_RoughReflections = Unpack(o.Find(x => x.roughReflections)); + m_MinimumSmoothness = Unpack(o.Find(x => x.minimumSmoothness)); + m_SmoothnessFadeStart = Unpack(o.Find(x => x.smoothnessFadeStart)); + m_NormalFade = Unpack(o.Find(x => x.normalFade)); + m_ScreenEdgeFade = Unpack(o.Find(x => x.screenEdgeFadeDistance)); + m_ReflectSky = Unpack(o.Find(x => x.reflectSky)); + m_MaxRayLength = Unpack(o.Find(x => x.maxRayLength)); + m_RayLengthFade = Unpack(o.Find(x => x.rayLengthFade)); + m_MaxRaySteps = Unpack(o.Find(x => x.maxRaySteps)); + m_ObjectThickness = Unpack(o.Find(x => x.objectThickness)); + + // Determine current preset + DetectCurrentPreset(); + + // Re-detect preset when property changed + ((ScreenSpaceReflectionVolumeSettings)target).propertyChanged += MarkPresetDirty; + } + + public override void OnDisable() + { + ((ScreenSpaceReflectionVolumeSettings)target).propertyChanged -= MarkPresetDirty; + } + + private void MarkPresetDirty() + { + if (!m_IgnorePresetChange) + m_PresetDirty = true; + } + + public override void OnInspectorGUI() + { +#if UNITY_WEBGL + GraphicsDeviceType[] graphicsApis = PlayerSettings.GetGraphicsAPIs(BuildTarget.WebGL); + if (Array.FindIndex(graphicsApis, x => x == GraphicsDeviceType.WebGPU) == -1) + EditorGUILayout.HelpBox("WebGL is not supported for Screen Space Reflection.", MessageType.Warning); +#endif + if (m_PresetDirty) + { + DetectCurrentPreset(); + m_PresetDirty = false; + } + + // Quality Preset Selection + EditorGUI.BeginChangeCheck(); + var qualityTextContent = EditorGUIUtility.TrTextContent("Performance Preset", "Select the quality vs. performance preset or use Custom for manual settings"); + var newPreset = (PerformancePreset)EditorGUILayout.EnumPopup(qualityTextContent, m_CurrentPreset); + if (EditorGUI.EndChangeCheck() && newPreset != m_CurrentPreset) + { + ApplyQualityPreset(newPreset); + m_CurrentPreset = newPreset; + } + + // Performance Settings + DrawHeader("Performance"); + PropertyField(m_Resolution); + PropertyField(m_UpscalingMethod); + PropertyField(m_MaxRaySteps); + PropertyField(m_ObjectThickness); + PropertyField(m_LinearMarching); + if (m_LinearMarching.value.boolValue) + { + using (new EditorGUI.DisabledScope(!m_LinearMarching.overrideState.boolValue)) + { + using (new IndentLevelScope()) + { + PropertyField(m_MaxRayLength); + PropertyField(m_HitRefinementSteps); + PropertyField(m_FinalThicknessMultiplier); + } + } + } + + // Authoring related settings (not part of preset). + DrawHeader("Visual Quality"); + PropertyField(m_Mode); + PropertyField(m_RoughReflections); + PropertyField(m_MinimumSmoothness); + PropertyField(m_SmoothnessFadeStart); + m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinimumSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue); + PropertyField(m_ScreenEdgeFade); + PropertyField(m_NormalFade); + if (m_LinearMarching.value.boolValue) + { + using (new EditorGUI.DisabledScope(!m_LinearMarching.overrideState.boolValue)) + { + PropertyField(m_RayLengthFade); + m_RayLengthFade.value.floatValue = Mathf.Min(m_MaxRayLength.value.floatValue, m_RayLengthFade.value.floatValue); + } + } + PropertyField(m_ReflectSky); + } + + void DetectCurrentPreset() + { + for (int i = 0; i < k_QualityPresets.Length; i++) + { + if (MatchesPreset(k_QualityPresets[i])) + { + m_CurrentPreset = (PerformancePreset)i; + return; + } + } + m_CurrentPreset = PerformancePreset.Custom; + } + + // Ignores authoring and debugging settings. + bool MatchesPreset(QualitySettings preset) + { + return m_Resolution.value.enumValueFlag == (int)preset.resolution && + m_UpscalingMethod.value.enumValueFlag == (int)preset.upscalingMethod && + m_LinearMarching.value.boolValue == preset.linearMarching && + m_HitRefinementSteps.value.intValue == preset.hitRefinementSteps && + Mathf.Approximately(m_FinalThicknessMultiplier.value.floatValue, preset.finalThicknessMultiplier) && + Mathf.Approximately(m_MaxRayLength.value.floatValue, preset.maxRayLength) && + m_MaxRaySteps.value.intValue == preset.maxRaySteps && + Mathf.Approximately(m_ObjectThickness.value.floatValue, preset.objectThickness); + } + + void ApplyQualityPreset(PerformancePreset preset) + { + if (preset == PerformancePreset.Custom) + return; + + m_IgnorePresetChange = true; + + var settings = k_QualityPresets[(int)preset]; + + m_Resolution.overrideState.boolValue = true; + m_Resolution.value.intValue = (int)settings.resolution; + m_UpscalingMethod.value.enumValueIndex = (int)settings.upscalingMethod; + m_UpscalingMethod.overrideState.boolValue = true; + m_LinearMarching.value.boolValue = settings.linearMarching; + m_LinearMarching.overrideState.boolValue = true; + m_HitRefinementSteps.value.intValue = settings.hitRefinementSteps; + m_HitRefinementSteps.overrideState.boolValue = true; + m_FinalThicknessMultiplier.value.floatValue = settings.finalThicknessMultiplier; + m_FinalThicknessMultiplier.overrideState.boolValue = true; + m_MaxRayLength.value.floatValue = settings.maxRayLength; + m_MaxRayLength.overrideState.boolValue = true; + m_MaxRaySteps.value.intValue = settings.maxRaySteps; + m_MaxRaySteps.overrideState.boolValue = true; + m_ObjectThickness.value.floatValue = settings.objectThickness; + m_ObjectThickness.overrideState.boolValue = true; + + m_IgnorePresetChange = false; + } + } +} +#endif diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Overrides/ScreenSpaceReflectionEditor.cs.meta b/Packages/com.unity.render-pipelines.universal/Editor/Overrides/ScreenSpaceReflectionEditor.cs.meta new file mode 100644 index 00000000000..b8d2c011ee2 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Editor/Overrides/ScreenSpaceReflectionEditor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 99f99811fc0d0174d8b58a72ab13f8c0 \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/ScreenSpaceReflectionRendererFeatureEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/ScreenSpaceReflectionRendererFeatureEditor.cs new file mode 100644 index 00000000000..2e21ad434c9 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/ScreenSpaceReflectionRendererFeatureEditor.cs @@ -0,0 +1,32 @@ +#if URP_SCREEN_SPACE_REFLECTION +using System; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +namespace UnityEditor.Rendering.Universal +{ + [CustomEditor(typeof(ScreenSpaceReflectionRendererFeature))] + internal class ScreenSpaceReflectionRendererFeatureEditor : Editor + { + SerializedProperty m_AfterOpaque; + + public void OnEnable() + { + m_AfterOpaque = serializedObject.FindProperty(nameof(ScreenSpaceReflectionRendererFeature.afterOpaque)); + } + + public override void OnInspectorGUI() + { +#if UNITY_WEBGL + GraphicsDeviceType[] graphicsApis = PlayerSettings.GetGraphicsAPIs(BuildTarget.WebGL); + if (Array.FindIndex(graphicsApis, x => x == GraphicsDeviceType.WebGPU) == -1) + EditorGUILayout.HelpBox("WebGL is not supported for Screen Space Reflection.", MessageType.Warning); +#endif + EditorGUILayout.PropertyField(m_AfterOpaque); + + EditorGUILayout.Space(); + EditorGUILayout.HelpBox("Additional settings for Screen Space Reflection can be found in the Screen Space Reflection volume override on your Volume Profile.", MessageType.Info); + } + } +} +#endif diff --git a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/ScreenSpaceReflectionRendererFeatureEditor.cs.meta b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/ScreenSpaceReflectionRendererFeatureEditor.cs.meta new file mode 100644 index 00000000000..b2d5855f77a --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/ScreenSpaceReflectionRendererFeatureEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 76586561fc958cb488c6bbede8bf83c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderBuildPreprocessor.cs b/Packages/com.unity.render-pipelines.universal/Editor/ShaderBuildPreprocessor.cs index 294b8f8a9c7..74a2c409afd 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderBuildPreprocessor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderBuildPreprocessor.cs @@ -75,6 +75,9 @@ enum ShaderFeatures : long ReflectionProbeAtlas = (1L << 52), #if SURFACE_CACHE SurfaceCache = (1L << 53), +#endif +#if URP_SCREEN_SPACE_REFLECTION + ScreenSpaceReflection = (1L << 54), #endif All = ~0 } @@ -464,7 +467,8 @@ private static void GetSupportedShaderFeaturesFromAssets(ref List ssaoRendererFeatures #else spd.stripScreenSpaceIrradiance = true; #endif +#if URP_SCREEN_SPACE_REFLECTION + spd.stripWriteSmoothness = !IsFeatureEnabled(shaderFeatures, ShaderFeatures.ScreenSpaceReflection); +#else + spd.stripWriteSmoothness = true; +#endif // Rendering Modes // Check if only Deferred is being used @@ -1114,6 +1144,19 @@ ref List ssaoRendererFeatures spd.screenSpaceOcclusionPrefilteringMode = PrefilteringMode.Select; } + spd.screenSpaceReflectionPrefilteringMode = PrefilteringMode.Remove; +#if URP_SCREEN_SPACE_REFLECTION + if (IsFeatureEnabled(shaderFeatures, ShaderFeatures.ScreenSpaceReflection)) + { + // Remove the SSR's OFF variant if Global Settings allow it and every renderer uses it. + if (stripUnusedVariants && everyRendererHasSSR) + spd.screenSpaceReflectionPrefilteringMode = PrefilteringMode.SelectOnly; + // Otherwise we keep both + else + spd.screenSpaceReflectionPrefilteringMode = PrefilteringMode.Select; + } +#endif + // SSAO shader keywords spd.stripSSAODepthNormals = true; spd.stripSSAOSourceDepthLow = true; diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/Shaders/LitShader.cs b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/Shaders/LitShader.cs index ed2b43326dd..bb3b55c0ba9 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/Shaders/LitShader.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/Shaders/LitShader.cs @@ -60,6 +60,11 @@ public override void DrawAdvancedOptions(Material material) materialEditor.ShaderProperty(litProperties.reflections, LitGUI.Styles.reflectionsText); } +#if URP_SCREEN_SPACE_REFLECTION + if (litProperties.screenSpaceReflections != null) + materialEditor.ShaderProperty(litProperties.screenSpaceReflections, LitGUI.Styles.screenSpaceReflectionsText); +#endif + base.DrawAdvancedOptions(material); } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/LitGUI.cs b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/LitGUI.cs index 1a140de2b8b..2a1c8f73405 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/LitGUI.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/LitGUI.cs @@ -89,6 +89,15 @@ public static class Styles EditorGUIUtility.TrTextContent("Environment Reflections", "When enabled, the Material samples reflections from the nearest Reflection Probes or Lighting Probe."); +#if URP_SCREEN_SPACE_REFLECTION + /// + /// The text and tooltip for the screen space reflections GUI. + /// + public static GUIContent screenSpaceReflectionsText = + EditorGUIUtility.TrTextContent("Screen Space Reflections", + "When enabled, the Material samples screen space reflections."); +#endif + /// /// The text and tooltip for the height map GUI. /// @@ -222,6 +231,13 @@ public struct LitProperties /// public MaterialProperty reflections; +#if URP_SCREEN_SPACE_REFLECTION + /// + /// The MaterialProperty for screen space reflections. + /// + public MaterialProperty screenSpaceReflections; +#endif + /// /// The MaterialProperty for enabling/disabling clear coat. /// @@ -266,6 +282,9 @@ public LitProperties(MaterialProperty[] properties) // Advanced Props highlights = BaseShaderGUI.FindProperty("_SpecularHighlights", properties, false); reflections = BaseShaderGUI.FindProperty("_EnvironmentReflections", properties, false); +#if URP_SCREEN_SPACE_REFLECTION + screenSpaceReflections = BaseShaderGUI.FindProperty("_ScreenSpaceReflections", properties, false); +#endif clearCoat = BaseShaderGUI.FindProperty("_ClearCoat", properties, false); clearCoatMap = BaseShaderGUI.FindProperty("_ClearCoatMap", properties, false); @@ -470,6 +489,11 @@ public static void SetMaterialKeywords(Material material) if (material.HasProperty("_EnvironmentReflections")) CoreUtils.SetKeyword(material, "_ENVIRONMENTREFLECTIONS_OFF", material.GetFloat("_EnvironmentReflections") == 0.0f); +#if URP_SCREEN_SPACE_REFLECTION + if (material.HasProperty("_ScreenSpaceReflections")) + CoreUtils.SetKeyword(material, "_SCREENSPACEREFLECTIONS_OFF", + material.GetFloat("_ScreenSpaceReflections") == 0.0f); +#endif if (material.HasProperty("_OcclusionMap")) CoreUtils.SetKeyword(material, "_OCCLUSIONMAP", material.GetTexture("_OcclusionMap")); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/DepthNormalsOnlyPass.hlsl b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/DepthNormalsOnlyPass.hlsl index 034743f2b48..a54f26e4a9f 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/DepthNormalsOnlyPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/DepthNormalsOnlyPass.hlsl @@ -57,6 +57,10 @@ void frag( outNormalWS = half4(NormalizeNormalPerPixel(normalWS), 0.0); #endif + #if defined(_WRITE_SMOOTHNESS) + outNormalWS.a = surfaceDescription.Smoothness; + #endif + #ifdef _WRITE_RENDERING_LAYERS outRenderingLayers = EncodeMeshRenderingLayer(); #endif diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRGBufferPass.hlsl b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRGBufferPass.hlsl index f0169f4ef20..83e8ca7df59 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRGBufferPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRGBufferPass.hlsl @@ -136,7 +136,9 @@ GBufferFragOutput frag(PackedVaryings packedInput) Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - half3 color = GlobalIllumination(brdfData, inputData.bakedGI, surfaceDescription.Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); + half3 color = GlobalIllumination(brdfData, (BRDFData)0, 0, + inputData.bakedGI, surfaceDescription.Occlusion, inputData.positionWS, + inputData.normalWS, inputData.viewDirectionWS, inputData.normalizedScreenSpaceUV); return PackGBuffersBRDFData(brdfData, inputData, surfaceDescription.Smoothness, surfaceDescription.Emission + color, surfaceDescription.Occlusion); } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Terrain/DepthNormalsOnlyPass.hlsl b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Terrain/DepthNormalsOnlyPass.hlsl index 222e3d2fb19..92db032351d 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Terrain/DepthNormalsOnlyPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Terrain/DepthNormalsOnlyPass.hlsl @@ -27,11 +27,24 @@ void frag(PackedVaryings packedInput, half alpha = AlphaDiscard(surfaceDescription.Alpha, surfaceDescription.AlphaClipThreshold); #endif - half3 normalWS = GetTerrainNormalWS(unpacked, surfaceDescription); #ifdef _WRITE_RENDERING_LAYERS outRenderingLayers = EncodeMeshRenderingLayer(); #endif + + half3 normalWS = GetTerrainNormalWS(unpacked, surfaceDescription); +#if defined(_GBUFFER_NORMALS_OCT) + normalWS = normalize(normalWS); + float2 octNormalWS = PackNormalOctQuadEncode(normalWS); // values between [-1, +1], must use fp32 on some platforms + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); // values between [ 0, 1] + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); // values between [ 0, 1] + color = half4(packedNormalWS, 0.0); +#else color = half4(NormalizeNormalPerPixel(normalWS), 0.0); +#endif + +#if defined(_WRITE_SMOOTHNESS) + color.a = surfaceDescription.Smoothness; +#endif } #endif diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Terrain/PBRGBufferPass.hlsl b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Terrain/PBRGBufferPass.hlsl index 8d6f188373b..8cc1fd2b91b 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Terrain/PBRGBufferPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Terrain/PBRGBufferPass.hlsl @@ -107,7 +107,9 @@ GBufferFragOutput frag(PackedVaryings packedInput) half4 color; Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, surfaceDescription.Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); + color.rgb = GlobalIllumination(brdfData, (BRDFData)0, 0, + inputData.bakedGI, surfaceDescription.Occlusion, inputData.positionWS, + inputData.normalWS, inputData.viewDirectionWS, inputData.normalizedScreenSpaceUV); color.a = alpha; SplatmapFinalColor(color, inputData.fogCoord); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs index e2eaebe08cd..58526a93485 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs @@ -655,7 +655,7 @@ public static PassDescriptor DepthNormal(UniversalTarget target) renderStates = CoreRenderStates.DepthNormalsOnly(target), pragmas = CorePragmas.Instanced, defines = new DefineCollection(), - keywords = new KeywordCollection(), + keywords = new KeywordCollection { CoreKeywordDescriptors.WriteSmoothness, CoreKeywordDescriptors.GBufferNormalsOct }, includes = new IncludeCollection { CoreIncludes.DepthNormalsOnly }, // Custom Interpolator Support @@ -695,7 +695,7 @@ public static PassDescriptor DepthNormalOnly(UniversalTarget target) renderStates = CoreRenderStates.DepthNormalsOnly(target), pragmas = CorePragmas.Instanced, defines = new DefineCollection(), - keywords = new KeywordCollection(), + keywords = new KeywordCollection { CoreKeywordDescriptors.WriteSmoothness }, includes = new IncludeCollection { CoreIncludes.DepthNormalsOnly }, // Custom Interpolator Support @@ -844,6 +844,7 @@ static class LitKeywords public static readonly KeywordCollection Forward = new KeywordCollection { { CoreKeywordDescriptors.ScreenSpaceAmbientOcclusion }, + { CoreKeywordDescriptors.ScreenSpaceReflection }, { CoreKeywordDescriptors.ScreenSpaceIrradiance }, { CoreKeywordDescriptors.StaticLightmap }, { CoreKeywordDescriptors.DynamicLightmap }, @@ -870,6 +871,7 @@ static class LitKeywords public static readonly KeywordCollection GBuffer = new KeywordCollection { + { CoreKeywordDescriptors.ScreenSpaceReflection }, { CoreKeywordDescriptors.ScreenSpaceIrradiance }, { CoreKeywordDescriptors.StaticLightmap }, { CoreKeywordDescriptors.DynamicLightmap }, diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs index 2566168cdd1..a4422735e5e 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs @@ -1421,6 +1421,7 @@ class CoreBlockMasks public static readonly BlockFieldDescriptor[] FragmentDepthNormals = new BlockFieldDescriptor[] { + BlockFields.SurfaceDescription.Smoothness, BlockFields.SurfaceDescription.NormalOS, BlockFields.SurfaceDescription.NormalTS, BlockFields.SurfaceDescription.NormalWS, @@ -2395,6 +2396,25 @@ static class CoreKeywordDescriptors stages = KeywordShaderStage.Fragment, }; + public static readonly KeywordDescriptor ScreenSpaceReflection = new KeywordDescriptor() + { + displayName = "Screen Space Reflection", + referenceName = "_SCREEN_SPACE_REFLECTION", + type = KeywordType.Boolean, + definition = KeywordDefinition.MultiCompile, + scope = KeywordScope.Global, + stages = KeywordShaderStage.Fragment, + }; + + public static readonly KeywordDescriptor WriteSmoothness = new KeywordDescriptor() + { + displayName = "Write Smoothness", + referenceName = "_WRITE_SMOOTHNESS", + type = KeywordType.Boolean, + definition = KeywordDefinition.MultiCompile, + scope = KeywordScope.Global, + }; + public static readonly KeywordDescriptor UseLegacyLightmaps = new KeywordDescriptor() { displayName = "Use Legacy Lightmaps", diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTerrainLitSubTarget.cs b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTerrainLitSubTarget.cs index b385663ea79..2d3d217f03d 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTerrainLitSubTarget.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTerrainLitSubTarget.cs @@ -1056,7 +1056,7 @@ public static PassDescriptor DepthNormal(UniversalTarget target) renderStates = CoreRenderStates.DepthNormalsOnly(target), pragmas = TerrainCorePragmas.Instanced, defines = new DefineCollection(), - keywords = new KeywordCollection() { TerrainSubShaders.AlphaTestOn, }, + keywords = new KeywordCollection() { TerrainSubShaders.AlphaTestOn, CoreKeywordDescriptors.WriteSmoothness, CoreKeywordDescriptors.GBufferNormalsOct }, includes = TerrainCoreIncludes.DepthNormalsOnly, // Custom Interpolator Support @@ -1502,6 +1502,7 @@ static class TerrainLitKeywords public static readonly KeywordCollection Forward = new KeywordCollection { { ScreenSpaceAmbientOcclusion }, + { CoreKeywordDescriptors.ScreenSpaceReflection }, { CoreKeywordDescriptors.StaticLightmap }, { CoreKeywordDescriptors.DynamicLightmap }, { CoreKeywordDescriptors.DirectionalLightmapCombined }, @@ -1533,6 +1534,7 @@ static class TerrainLitKeywords { CoreKeywordDescriptors.GBufferNormalsOct }, { CoreKeywordDescriptors.LightLayers }, { CoreKeywordDescriptors.RenderPassEnabled }, + { CoreKeywordDescriptors.ScreenSpaceReflection }, { CoreKeywordDescriptors.DebugDisplay }, }; } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderScriptableStripper.cs b/Packages/com.unity.render-pipelines.universal/Editor/ShaderScriptableStripper.cs index 0e5cd32bcda..1145ff39221 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderScriptableStripper.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderScriptableStripper.cs @@ -159,6 +159,8 @@ public bool PassHasKeyword(LocalKeyword keyword) LocalKeyword m_GbufferNormalsOct; LocalKeyword m_ScreenSpaceOcclusion; LocalKeyword m_ScreenSpaceIrradiance; + LocalKeyword m_ScreenSpaceReflection; + LocalKeyword m_WriteSmoothness; LocalKeyword m_UseFastSRGBLinearConversion; LocalKeyword m_LightLayers; LocalKeyword m_DecalLayers; @@ -230,6 +232,8 @@ private void InitializeLocalShaderKeywords([DisallowNull] Shader shader) m_GbufferNormalsOct = TryGetLocalKeyword(shader, ShaderKeywordStrings._GBUFFER_NORMALS_OCT); m_ScreenSpaceOcclusion = TryGetLocalKeyword(shader, ShaderKeywordStrings.ScreenSpaceOcclusion); m_ScreenSpaceIrradiance = TryGetLocalKeyword(shader, ShaderKeywordStrings.ScreenSpaceIrradiance); + m_ScreenSpaceReflection = TryGetLocalKeyword(shader, ShaderKeywordStrings.ScreenSpaceReflection); + m_WriteSmoothness = TryGetLocalKeyword(shader, ShaderKeywordStrings.WriteSmoothness); m_UseFastSRGBLinearConversion = TryGetLocalKeyword(shader, ShaderKeywordStrings.UseFastSRGBLinearConversion); m_LightLayers = TryGetLocalKeyword(shader, ShaderKeywordStrings.LightLayers); m_DecalLayers = TryGetLocalKeyword(shader, ShaderKeywordStrings.DecalLayers); @@ -666,6 +670,22 @@ internal bool StripUnusedFeatures_ScreenSpaceOcclusion(ref IShaderScriptableStri return false; } + internal bool StripUnusedFeatures_ScreenSpaceReflection(ref IShaderScriptableStrippingData strippingData, ref ShaderStripTool stripTool) + { +#if URP_SCREEN_SPACE_REFLECTION + // Screen Space Reflection + if (stripTool.StripMultiCompile(m_ScreenSpaceReflection, ShaderFeatures.ScreenSpaceReflection)) + return true; + + if (stripTool.StripMultiCompile(m_WriteSmoothness, ShaderFeatures.ScreenSpaceReflection)) + return true; + + return false; +#else + return strippingData.IsKeywordEnabled(m_ScreenSpaceReflection) || strippingData.IsKeywordEnabled(m_WriteSmoothness); +#endif + } + internal bool StripUnusedFeatures_DecalsDbuffer(ref IShaderScriptableStrippingData strippingData, ref ShaderStripTool stripTool) { // DBuffer @@ -727,6 +747,15 @@ internal bool StripUnusedFeatures_WriteRenderingLayers(ref IShaderScriptableStri { if (strippingData.passName == kPassNameDepthNormals) { +#if URP_SCREEN_SPACE_REFLECTION + // If SSR is enabled, always keep the variant with WriteRenderingLayers disabled. We need this for the SSR transparent depthnormal pass. + if (strippingData.IsShaderFeatureEnabled(ShaderFeatures.ScreenSpaceReflection)) + { + if (stripTool.StripMultiCompileKeepOffVariant(m_WriteRenderingLayers, ShaderFeatures.DepthNormalPassRenderingLayers)) + return true; + } + else +#endif if (stripTool.StripMultiCompile(m_WriteRenderingLayers, ShaderFeatures.DepthNormalPassRenderingLayers)) return true; } @@ -896,6 +925,9 @@ internal bool StripUnusedFeatures(ref IShaderScriptableStrippingData strippingDa if (StripUnusedFeatures_ScreenSpaceOcclusion(ref strippingData, ref stripTool)) return true; + if (StripUnusedFeatures_ScreenSpaceReflection(ref strippingData, ref stripTool)) + return true; + if (StripUnusedFeatures_DecalsDbuffer(ref strippingData, ref stripTool)) return true; diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAssetPrefiltering.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAssetPrefiltering.cs index 814e25d750b..3554670c15e 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAssetPrefiltering.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAssetPrefiltering.cs @@ -104,6 +104,16 @@ internal enum PrefilteringModeAdditionalLights [ShaderKeywordFilter.SelectIf(PrefilteringMode.SelectOnly, keywordNames: ShaderKeywordStrings.ScreenSpaceOcclusion)] [SerializeField] private PrefilteringMode m_PrefilteringModeScreenSpaceOcclusion = PrefilteringMode.Select; + // Screen Space Reflection + [ShaderKeywordFilter.RemoveIf(PrefilteringMode.Remove, keywordNames: ShaderKeywordStrings.ScreenSpaceReflection)] + [ShaderKeywordFilter.SelectIf(PrefilteringMode.Select, keywordNames: new [] {"", ShaderKeywordStrings.ScreenSpaceReflection})] + [ShaderKeywordFilter.SelectIf(PrefilteringMode.SelectOnly, keywordNames: ShaderKeywordStrings.ScreenSpaceReflection)] + [SerializeField] private PrefilteringMode m_PrefilteringModeScreenSpaceReflection = PrefilteringMode.Select; + + // Keyword used by the DepthNormalOnly pass to write smoothness into alpha channel for screen space reflections. + [ShaderKeywordFilter.RemoveIf(true, keywordNames: ShaderKeywordStrings.WriteSmoothness)] + [SerializeField] private bool m_PrefilterWriteSmoothness = true; + // Rendering Debugger [ShaderKeywordFilter.RemoveIf(true, keywordNames:ShaderKeywordStrings.DEBUG_DISPLAY)] [SerializeField] private bool m_PrefilterDebugKeywords = false; @@ -221,6 +231,7 @@ internal struct ShaderPrefilteringData public PrefilteringModeAdditionalLights additionalLightsPrefilteringMode; public PrefilteringMode additionalLightsShadowsPrefilteringMode; public PrefilteringMode screenSpaceOcclusionPrefilteringMode; + public PrefilteringMode screenSpaceReflectionPrefilteringMode; public bool useLegacyLightmaps; public bool stripXRKeywords; @@ -255,6 +266,9 @@ internal struct ShaderPrefilteringData public bool stripScreenSpaceIrradiance; + // Keyword used by the DepthNormalOnly pass to write smoothness into alpha channel for screen space reflections. + public bool stripWriteSmoothness; + public static ShaderPrefilteringData GetDefault() { return new ShaderPrefilteringData() @@ -265,6 +279,7 @@ public static ShaderPrefilteringData GetDefault() additionalLightsPrefilteringMode = PrefilteringModeAdditionalLights.SelectAll, additionalLightsShadowsPrefilteringMode = PrefilteringMode.Select, screenSpaceOcclusionPrefilteringMode = PrefilteringMode.Select, + screenSpaceReflectionPrefilteringMode = PrefilteringMode.Select, }; } } @@ -281,6 +296,7 @@ internal void UpdateShaderKeywordPrefiltering(ref ShaderPrefilteringData prefilt m_PrefilteringModeAdditionalLight = prefilteringData.additionalLightsPrefilteringMode; m_PrefilteringModeAdditionalLightShadows = prefilteringData.additionalLightsShadowsPrefilteringMode; m_PrefilteringModeScreenSpaceOcclusion = prefilteringData.screenSpaceOcclusionPrefilteringMode; + m_PrefilteringModeScreenSpaceReflection = prefilteringData.screenSpaceReflectionPrefilteringMode; m_PrefilterUseLegacyLightmaps = prefilteringData.useLegacyLightmaps; m_PrefilterXRKeywords = prefilteringData.stripXRKeywords; @@ -316,6 +332,8 @@ internal void UpdateShaderKeywordPrefiltering(ref ShaderPrefilteringData prefilt m_PrefilterReflectionProbeAtlas = prefilteringData.stripReflectionProbeAtlas; m_PrefilterScreenSpaceIrradiance = prefilteringData.stripScreenSpaceIrradiance; + + m_PrefilterWriteSmoothness = prefilteringData.stripWriteSmoothness; } } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/FrameData/UniversalRenderingData.cs b/Packages/com.unity.render-pipelines.universal/Runtime/FrameData/UniversalRenderingData.cs index 62316da81c1..345c7a1844d 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/FrameData/UniversalRenderingData.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/FrameData/UniversalRenderingData.cs @@ -52,6 +52,14 @@ public class UniversalRenderingData : ContextItem /// public bool stencilLodCrossFadeEnabled { get; internal set; } +#if URP_SCREEN_SPACE_REFLECTION + /// + /// True if per-pixel smoothness should be written to the alpha channel of the CameraDepthNormals texture, if it exists. + /// Used for screen space reflections. + /// + public bool writesSmoothnessToDepthNormalsAlpha { get; internal set; } +#endif + /// public override void Reset() { @@ -63,6 +71,9 @@ public override void Reset() prepassLayerMask = -1; opaqueLayerMask = -1; transparentLayerMask = -1; +#if URP_SCREEN_SPACE_REFLECTION + writesSmoothnessToDepthNormalsAlpha = false; +#endif } } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/History/BeforeTransparentsColorHistory.cs b/Packages/com.unity.render-pipelines.universal/Runtime/History/BeforeTransparentsColorHistory.cs new file mode 100644 index 00000000000..99937af59b4 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/History/BeforeTransparentsColorHistory.cs @@ -0,0 +1,20 @@ +namespace UnityEngine.Rendering.Universal +{ + /// + /// Color history before rendering transparent objects. Raw rendered geometry. No UI overlay. + /// Color space is linear RGB. + /// No mips. + /// MSAA is not supported and is resolved for the history. + /// XR is supported. + /// + internal sealed class BeforeTransparentsColorHistory : ColorHistory + { + /// + public override void OnCreate(BufferedRTHandleSystem owner, uint typeId) + { + m_Names[0] = "BeforeTransparentsColorHistory0"; + m_Names[1] = "BeforeTransparentsColorHistory1"; + base.OnCreate(owner, typeId); + } + } +} diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/History/BeforeTransparentsColorHistory.cs.meta b/Packages/com.unity.render-pipelines.universal/Runtime/History/BeforeTransparentsColorHistory.cs.meta new file mode 100644 index 00000000000..dcd2a92a5b8 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/History/BeforeTransparentsColorHistory.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b1a6c4c4329a09f49a96f22a8922f69a \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/History/ColorHistory.cs b/Packages/com.unity.render-pipelines.universal/Runtime/History/ColorHistory.cs new file mode 100644 index 00000000000..0bc07262e41 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/History/ColorHistory.cs @@ -0,0 +1,128 @@ +using System; +using UnityEngine.Experimental.Rendering; + +namespace UnityEngine.Rendering.Universal +{ + /// + /// Base class for color history. + /// Color space is linear RGB. + /// No mips. + /// MSAA is not supported and is resolved for the history. + /// XR is supported. + /// + public abstract class ColorHistory : CameraHistoryItem + { + private int[] m_Ids = new int[2]; + /// + /// The names to use for history items. + /// + protected string[] m_Names = new[] + { + "ColorHistory0", + "ColorHistory1" + }; + private RenderTextureDescriptor m_Descriptor; + private Hash128 m_DescKey; + + /// + public override void OnCreate(BufferedRTHandleSystem owner, uint typeId) + { + base.OnCreate(owner, typeId); + m_Ids[0] = MakeId(0); + m_Ids[1] = MakeId(1); + } + + /// + /// Get the current history texture. + /// Current history might not be valid yet. It is valid only after executing the producing render pass. + /// + /// Eye index, typically XRPass.multipassId. + /// The texture. + public RTHandle GetCurrentTexture(int eyeIndex = 0) + { + if ((uint)eyeIndex >= m_Ids.Length) + return null; + + return GetCurrentFrameRT(m_Ids[eyeIndex]); + } + + /// + /// Get the previous history texture. + /// Previous history might not be valid yet. It is valid only after executing the producing render pass. + /// + /// Eye index, typically XRPass.multipassId. + /// The texture. + public RTHandle GetPreviousTexture(int eyeIndex = 0) + { + if ((uint)eyeIndex >= m_Ids.Length) + return null; + + return GetPreviousFrameRT(m_Ids[eyeIndex]); + } + + private bool IsAllocated() + { + return GetCurrentTexture() != null; + } + + // True if the desc changed, graphicsFormat etc. + private bool IsDirty(ref RenderTextureDescriptor desc) + { + return m_DescKey != Hash128.Compute(ref desc); + } + + private void Alloc(ref RenderTextureDescriptor desc, bool xrMultipassEnabled) + { + // In generic case, the current texture might not have been written yet. We need double buffering. + AllocHistoryFrameRT(m_Ids[0], 2, ref desc, m_Names[0]); + + if(xrMultipassEnabled) + AllocHistoryFrameRT(m_Ids[1], 2, ref desc, m_Names[1]); + + m_Descriptor = desc; + m_DescKey = Hash128.Compute(ref desc); + } + + /// + /// Release the history texture(s). + /// + public override void Reset() + { + for(int i = 0; i < m_Ids.Length; i++) + ReleaseHistoryFrameRT(m_Ids[i]); + } + + internal RenderTextureDescriptor GetHistoryDescriptor(ref RenderTextureDescriptor cameraDesc) + { + var colorDesc = cameraDesc; + colorDesc.depthStencilFormat = GraphicsFormat.None; + colorDesc.mipCount = 0; + colorDesc.msaaSamples = 1; + + return colorDesc; + } + + // Return true if the RTHandles were reallocated. + internal bool Update(UniversalCameraData cameraData, ref RenderTextureDescriptor cameraDesc, bool xrMultipassEnabled = false) + { + if (cameraDesc.width > 0 && cameraDesc.height > 0 && cameraDesc.graphicsFormat != GraphicsFormat.None) + { + var historyDesc = GetHistoryDescriptor(ref cameraDesc); + + Camera camera = cameraData.camera; + bool isPreview = camera.cameraType == CameraType.Preview; + bool isRenderRequest = camera.isProcessingRenderRequest; + if (!isPreview && !isRenderRequest && IsDirty(ref historyDesc)) + Reset(); + + if (!IsAllocated()) + { + Alloc(ref historyDesc, xrMultipassEnabled); + return true; + } + } + + return false; + } + } +} diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/History/ColorHistory.cs.meta b/Packages/com.unity.render-pipelines.universal/Runtime/History/ColorHistory.cs.meta new file mode 100644 index 00000000000..dd0960cb009 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/History/ColorHistory.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b0ecc0d40b758794593fe6ee53c2b117 \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/History/RawColorHistory.cs b/Packages/com.unity.render-pipelines.universal/Runtime/History/RawColorHistory.cs index d74ae87a1e7..acc0692fbf8 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/History/RawColorHistory.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/History/RawColorHistory.cs @@ -11,113 +11,14 @@ namespace UnityEngine.Rendering.Universal /// MSAA is not supported and is resolved for the history. /// XR is supported. /// - public sealed class RawColorHistory : CameraHistoryItem + public sealed class RawColorHistory : ColorHistory { - private int[] m_Ids = new int[2]; - private static readonly string[] m_Names = new[] - { - "RawColorHistory0", - "RawColorHistory1" - }; - private RenderTextureDescriptor m_Descriptor; - private Hash128 m_DescKey; - /// public override void OnCreate(BufferedRTHandleSystem owner, uint typeId) { + m_Names[0] = "RawColorHistory0"; + m_Names[1] = "RawColorHistory1"; base.OnCreate(owner, typeId); - m_Ids[0] = MakeId(0); - m_Ids[1] = MakeId(1); - } - - /// - /// Get the current history texture. - /// Current history might not be valid yet. It is valid only after executing the producing render pass. - /// - /// Eye index, typically XRPass.multipassId. - /// The texture. - public RTHandle GetCurrentTexture(int eyeIndex = 0) - { - if ((uint)eyeIndex >= m_Ids.Length) - return null; - - return GetCurrentFrameRT(m_Ids[eyeIndex]); - } - - /// - /// Get the previous history texture. - /// Previous history might not be valid yet. It is valid only after executing the producing render pass. - /// - /// Eye index, typically XRPass.multipassId. - /// The texture. - public RTHandle GetPreviousTexture(int eyeIndex = 0) - { - if ((uint)eyeIndex >= m_Ids.Length) - return null; - - return GetPreviousFrameRT(m_Ids[eyeIndex]); - } - - private bool IsAllocated() - { - return GetCurrentTexture() != null; - } - - // True if the desc changed, graphicsFormat etc. - private bool IsDirty(ref RenderTextureDescriptor desc) - { - return m_DescKey != Hash128.Compute(ref desc); - } - - private void Alloc(ref RenderTextureDescriptor desc, bool xrMultipassEnabled) - { - // In generic case, the current texture might not have been written yet. We need double buffering. - AllocHistoryFrameRT(m_Ids[0], 2, ref desc, m_Names[0]); - - if(xrMultipassEnabled) - AllocHistoryFrameRT(m_Ids[1], 2, ref desc, m_Names[1]); - - m_Descriptor = desc; - m_DescKey = Hash128.Compute(ref desc); - } - - /// - /// Release the history texture(s). - /// - public override void Reset() - { - for(int i = 0; i < m_Ids.Length; i++) - ReleaseHistoryFrameRT(m_Ids[i]); - } - - internal RenderTextureDescriptor GetHistoryDescriptor(ref RenderTextureDescriptor cameraDesc) - { - var colorDesc = cameraDesc; - colorDesc.depthStencilFormat = GraphicsFormat.None; - colorDesc.mipCount = 0; - colorDesc.msaaSamples = 1; - - return colorDesc; - } - - // Return true if the RTHandles were reallocated. - internal bool Update(ref RenderTextureDescriptor cameraDesc, bool xrMultipassEnabled = false) - { - if (cameraDesc.width > 0 && cameraDesc.height > 0 && cameraDesc.graphicsFormat != GraphicsFormat.None) - { - var historyDesc = GetHistoryDescriptor(ref cameraDesc); - - if (IsDirty(ref historyDesc)) - Reset(); - - if (!IsAllocated()) - { - Alloc(ref historyDesc, xrMultipassEnabled); - return true; - } - } - - return false; } } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen.meta b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen.meta new file mode 100644 index 00000000000..702238e83f8 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cd6ee03b8cfece34586c63ce0d561baf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenRenderPipelineRuntimeResources.cs b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenRenderPipelineRuntimeResources.cs new file mode 100644 index 00000000000..565805de8a9 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenRenderPipelineRuntimeResources.cs @@ -0,0 +1,46 @@ +using System; + +namespace UnityEngine.Rendering +{ + /// + /// Common global resources for mip pyramid generator (color, depth). + /// + [Serializable] + [SupportedOnRenderPipeline] + [Categorization.CategoryInfo(Name = "R: Mip Generator Resources", Order = 1000), HideInInspector] + internal sealed class MipGenRenderPipelineRuntimeResources : IRenderPipelineResources + { + /// + /// Version of the SSR Resources + /// + public int version => 0; + + bool IRenderPipelineGraphicsSettings.isAvailableInPlayerBuild => true; + + [SerializeField, ResourcePath("Runtime/MipGen/Shaders/ColorPyramidPS.shader")] + private Shader m_ColorPyramidPS; + + public Shader colorPyramidPS + { + get => m_ColorPyramidPS; + set => this.SetValueAndNotify(ref m_ColorPyramidPS, value); + } + + [SerializeField, ResourcePath("Runtime/MipGen/Shaders/ColorPyramid.compute")] + public ComputeShader m_ColorPyramidCS; + public ComputeShader colorPyramidCS + { + get => m_ColorPyramidCS; + set => this.SetValueAndNotify(ref m_ColorPyramidCS, value); + } + + [SerializeField, ResourcePath("Runtime/MipGen/Shaders/DepthPyramid.compute")] + private ComputeShader m_DepthPyramidCS; + + public ComputeShader depthPyramidCS + { + get => m_DepthPyramidCS; + set => this.SetValueAndNotify(ref m_DepthPyramidCS, value); + } + } +} diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenRenderPipelineRuntimeResources.cs.meta b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenRenderPipelineRuntimeResources.cs.meta new file mode 100644 index 00000000000..e1f2cd6e65f --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenRenderPipelineRuntimeResources.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 26bfb1c84b583444c85ebb814cb4eaf9 \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenerator.cs b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenerator.cs new file mode 100644 index 00000000000..8f7fcd4f482 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenerator.cs @@ -0,0 +1,509 @@ +using UnityEngine.Rendering.RenderGraphModule; +using UnityEngine.Rendering.RenderGraphModule.Util; +using UnityEngine.Rendering.Universal; + +namespace UnityEngine.Rendering +{ + internal struct PackedMipChainInfo + { + public Vector2Int textureSize; + public int mipLevelCount; // mips contain min (closest) depth + public int mipLevelCountCheckerboard; + public Vector2Int[] mipLevelSizes; + public Vector2Int[] mipLevelOffsets; // mips contain min (closest) depth + public Vector2Int[] mipLevelOffsetsCheckerboard; + + private Vector2 cachedTextureScale; + private Vector2Int cachedHardwareTextureSize; + private int cachedCheckerboardMipCount; + + public void Allocate() + { + mipLevelOffsets = new Vector2Int[15]; + mipLevelOffsetsCheckerboard = new Vector2Int[15]; + mipLevelSizes = new Vector2Int[15]; + } + + enum PackDirection + { + Right, + Down, + } + + static Vector2Int NextMipBegin(Vector2Int prevMipBegin, Vector2Int prevMipSize, PackDirection dir) + { + Vector2Int mipBegin = prevMipBegin; + if (dir == PackDirection.Right) + mipBegin.x += prevMipSize.x; + else + mipBegin.y += prevMipSize.y; + return mipBegin; + } + + // We pack all MIP levels into the top MIP level to avoid the Pow2 MIP chain restriction. + // We compute the required size iteratively. + // This function is NOT fast, but it is illustrative, and can be optimized later. + public void ComputePackedMipChainInfo(Vector2Int viewportSize, int checkerboardMipCount) + { + // only support up to 2 mips of checkerboard data being created + checkerboardMipCount = Mathf.Clamp(checkerboardMipCount, 0, 2); + + bool isHardwareDrsOn = DynamicResolutionHandler.instance.HardwareDynamicResIsEnabled(); + Vector2Int hardwareTextureSize = isHardwareDrsOn ? DynamicResolutionHandler.instance.ApplyScalesOnSize(viewportSize) : viewportSize; + Vector2 textureScale = isHardwareDrsOn ? new Vector2((float)viewportSize.x / (float)hardwareTextureSize.x, (float)viewportSize.y / (float)hardwareTextureSize.y) : new Vector2(1.0f, 1.0f); + + // No work needed. + if (cachedHardwareTextureSize == hardwareTextureSize && cachedTextureScale == textureScale && cachedCheckerboardMipCount == checkerboardMipCount) + return; + + cachedHardwareTextureSize = hardwareTextureSize; + cachedTextureScale = textureScale; + cachedCheckerboardMipCount = checkerboardMipCount; + + mipLevelSizes[0] = hardwareTextureSize; + mipLevelOffsets[0] = Vector2Int.zero; + mipLevelOffsetsCheckerboard[0] = mipLevelOffsets[0]; + + int mipLevel = 0; + Vector2Int mipSize = hardwareTextureSize; + bool hasCheckerboard = (checkerboardMipCount != 0); + do + { + mipLevel++; + + // Round up. + mipSize.x = Mathf.Max(1, (mipSize.x + 1) >> 1); + mipSize.y = Mathf.Max(1, (mipSize.y + 1) >> 1); + + mipLevelSizes[mipLevel] = mipSize; + + Vector2Int prevMipSize = mipLevelSizes[mipLevel - 1]; + Vector2Int prevMipBegin = mipLevelOffsets[mipLevel - 1]; + Vector2Int prevMipBeginCheckerboard = mipLevelOffsetsCheckerboard[mipLevel - 1]; + + Vector2Int mipBegin = prevMipBegin; + Vector2Int mipBeginCheckerboard = prevMipBeginCheckerboard; + if (mipLevel == 1) + { + // first mip always below full resolution + mipBegin = NextMipBegin(prevMipBegin, prevMipSize, PackDirection.Down); + + // pack checkerboard next to it if present + if (hasCheckerboard) + mipBeginCheckerboard = NextMipBegin(mipBegin, mipSize, PackDirection.Right); + else + mipBeginCheckerboard = mipBegin; + } + else + { + // alternate directions, mip 2 starts with down if checkerboard, right if not + bool isOdd = ((mipLevel & 1) != 0); + PackDirection dir = (isOdd ^ hasCheckerboard) ? PackDirection.Down : PackDirection.Right; + + mipBegin = NextMipBegin(prevMipBegin, prevMipSize, dir); + mipBeginCheckerboard = NextMipBegin(prevMipBeginCheckerboard, prevMipSize, dir); + } + + mipLevelOffsets[mipLevel] = mipBegin; + mipLevelOffsetsCheckerboard[mipLevel] = mipBeginCheckerboard; + + hardwareTextureSize.x = Mathf.Max(hardwareTextureSize.x, mipBegin.x + mipSize.x); + hardwareTextureSize.y = Mathf.Max(hardwareTextureSize.y, mipBegin.y + mipSize.y); + hardwareTextureSize.x = Mathf.Max(hardwareTextureSize.x, mipBeginCheckerboard.x + mipSize.x); + hardwareTextureSize.y = Mathf.Max(hardwareTextureSize.y, mipBeginCheckerboard.y + mipSize.y); + } + while ((mipSize.x > 1) || (mipSize.y > 1)); + + textureSize = new Vector2Int( + (int)Mathf.Ceil((float)hardwareTextureSize.x * textureScale.x), (int)Mathf.Ceil((float)hardwareTextureSize.y * textureScale.y)); + + mipLevelCount = mipLevel + 1; + mipLevelCountCheckerboard = hasCheckerboard ? (1 + checkerboardMipCount) : 0; + } + } + + internal class MipGenerator + { + ComputeShader m_ColorPyramidCS = null; + ComputeShader m_DepthPyramidCS = null; + Shader m_ColorPyramidPS; + Material m_ColorPyramidPSMat; + MaterialPropertyBlock m_PropertyBlockBlur; + + int m_DepthDownsampleKernel = -1; + int m_ColorDownsampleKernel = -1; + int m_ColorGaussianKernel = -1; + + bool m_PreferCompute; + bool m_SupportCompute; + + LocalKeyword m_DisableTexture2DArrayColorKeyword; + LocalKeyword m_DisableTexture2DArrayColorPSKeyword; + LocalKeyword m_DisableTexture2DArrayDepthKeyword; + LocalKeyword m_EnableCheckerboardKeyword; + + public static readonly int _DepthMipChain = Shader.PropertyToID("_DepthMipChain"); + public static readonly int _DepthPyramidConstants = Shader.PropertyToID("DepthPyramidConstants"); + + public static readonly int _Size = Shader.PropertyToID("_Size"); + public static readonly int _Source = Shader.PropertyToID("_Source"); + public static readonly int _Destination = Shader.PropertyToID("_Destination"); + + public static readonly int _SourceMip = Shader.PropertyToID("_SourceMip"); + public static readonly int _SrcScaleBias = Shader.PropertyToID("_SrcScaleBias"); + public static readonly int _SrcUvLimits = Shader.PropertyToID("_SrcUvLimits"); + + public static readonly string k_EnableCheckerboard = "ENABLE_CHECKERBOARD"; + + public MipGenerator(bool preferCompute = true) + { + if (!GraphicsSettings.TryGetRenderPipelineSettings(out var runtimeShaders)) + { + Debug.LogErrorFormat( + $"Couldn't find the required resources for the {nameof(MipGenerator)} ."); + } + + m_SupportCompute = SystemInfo.supportsComputeShaders + && runtimeShaders.colorPyramidCS.HasKernel("ColorDownsample") + && runtimeShaders.colorPyramidCS.HasKernel("ColorGaussian") + && runtimeShaders.depthPyramidCS.HasKernel("DepthDownsample"); + if (m_SupportCompute) + { + m_ColorPyramidCS = runtimeShaders.colorPyramidCS; + m_DepthPyramidCS = runtimeShaders.depthPyramidCS; + + m_ColorDownsampleKernel = m_ColorPyramidCS.FindKernel("ColorDownsample"); + m_ColorGaussianKernel = m_ColorPyramidCS.FindKernel("ColorGaussian"); + m_DisableTexture2DArrayColorKeyword = new LocalKeyword(m_ColorPyramidCS, ShaderKeywordStrings.DisableTexture2DXArray); + + m_DepthDownsampleKernel = m_DepthPyramidCS.FindKernel("DepthDownsample"); + m_DisableTexture2DArrayDepthKeyword = new LocalKeyword(m_DepthPyramidCS, ShaderKeywordStrings.DisableTexture2DXArray); + m_EnableCheckerboardKeyword = new LocalKeyword(m_DepthPyramidCS, k_EnableCheckerboard); + } + + m_ColorPyramidPS = runtimeShaders.colorPyramidPS; + m_DisableTexture2DArrayColorPSKeyword = new LocalKeyword(m_ColorPyramidPS, ShaderKeywordStrings.DisableTexture2DXArray); + m_ColorPyramidPSMat = CoreUtils.CreateEngineMaterial(m_ColorPyramidPS); + m_PropertyBlockBlur = new MaterialPropertyBlock(); + + m_PreferCompute = preferCompute; + } + + public void Release() + { + CoreUtils.Destroy(m_ColorPyramidPSMat); + } + + class DepthPyramidPassData + { + public PackedMipChainInfo info; + public ComputeShader cs; + public int kernel; + public TextureHandle depthTexture; + public LocalKeyword disableTexture2DArrayKeyword; + public LocalKeyword enableCheckerboardKeyword; + } + + // Generates an in-place depth pyramid Compute only + // TODO: Mip-mapping depth is problematic for precision at lower mips, generate a packed atlas instead + public void RenderMinDepthPyramid(RenderGraph renderGraph, TextureHandle depthTexture, ref PackedMipChainInfo depthBufferMipChainInfo) + { + if (!m_SupportCompute) + { + Debug.LogError("MipGenerator: Can't render depth pyramid, platform doesn't support compute shaders."); + return; + } + + using (var builder = renderGraph.AddComputePass("Generate Depth Buffer MIP Chain", out var passData)) + { + passData.info = depthBufferMipChainInfo; + passData.cs = m_DepthPyramidCS; + passData.kernel = m_DepthDownsampleKernel; + passData.depthTexture = depthTexture; + passData.disableTexture2DArrayKeyword = m_DisableTexture2DArrayDepthKeyword; + passData.enableCheckerboardKeyword = m_EnableCheckerboardKeyword; + + // Enable global state modification so we can set keywords. + builder.AllowGlobalStateModification(true); + builder.UseTexture(passData.depthTexture, AccessFlags.ReadWrite); + builder.SetRenderFunc(static (data, context) => + { + var cmd = context.cmd; + var sourceIsArray = (((RenderTexture)data.depthTexture).dimension == TextureDimension.Tex2DArray); + + cmd.SetKeyword(data.cs, data.disableTexture2DArrayKeyword, !sourceIsArray); + + // Note: Gather() doesn't take a LOD parameter and we cannot bind an SRV of a MIP level, + // and we don't support Min samplers either. So we are forced to perform 4x loads. + for (int dstIndex0 = 1; dstIndex0 < data.info.mipLevelCount;) + { + int minCount = Mathf.Min(data.info.mipLevelCount - dstIndex0, 4); + int cbCount = 0; + if (dstIndex0 < data.info.mipLevelCountCheckerboard) + { + cbCount = data.info.mipLevelCountCheckerboard - dstIndex0; + Debug.Assert(dstIndex0 == 1, "expected to make checkerboard mips on the first pass"); + Debug.Assert(cbCount <= minCount, "expected fewer checkerboard mips than min mips"); + Debug.Assert(cbCount <= 2, "expected 2 or fewer checkerboard mips for now"); + } + + Vector2Int srcOffset = data.info.mipLevelOffsets[dstIndex0 - 1]; + Vector2Int srcSize = data.info.mipLevelSizes[dstIndex0 - 1]; + int dstIndex1 = Mathf.Min(dstIndex0 + 1, data.info.mipLevelCount - 1); + int dstIndex2 = Mathf.Min(dstIndex0 + 2, data.info.mipLevelCount - 1); + int dstIndex3 = Mathf.Min(dstIndex0 + 3, data.info.mipLevelCount - 1); + + DepthPyramidConstants cb = new DepthPyramidConstants + { + _MinDstCount = (uint)minCount, + _CbDstCount = (uint)cbCount, + _SrcOffset = srcOffset, + _SrcLimit = srcSize - Vector2Int.one, + _DstSize0 = data.info.mipLevelSizes[dstIndex0], + _DstSize1 = data.info.mipLevelSizes[dstIndex1], + _DstSize2 = data.info.mipLevelSizes[dstIndex2], + _DstSize3 = data.info.mipLevelSizes[dstIndex3], + _MinDstOffset0 = data.info.mipLevelOffsets[dstIndex0], + _MinDstOffset1 = data.info.mipLevelOffsets[dstIndex1], + _MinDstOffset2 = data.info.mipLevelOffsets[dstIndex2], + _MinDstOffset3 = data.info.mipLevelOffsets[dstIndex3], + _CbDstOffset0 = data.info.mipLevelOffsetsCheckerboard[dstIndex0], + _CbDstOffset1 = data.info.mipLevelOffsetsCheckerboard[dstIndex1], + }; + + ConstantBuffer.Push(cmd, in cb, data.cs, _DepthPyramidConstants); + + cmd.SetComputeTextureParam(data.cs, data.kernel, _DepthMipChain, data.depthTexture); + cmd.SetKeyword(data.cs, data.enableCheckerboardKeyword, cbCount != 0); + + Vector2Int dstSize = data.info.mipLevelSizes[dstIndex0]; + cmd.DispatchCompute(data.cs, data.kernel, CoreUtils.DivRoundUp(dstSize.x, 8), CoreUtils.DivRoundUp(dstSize.y, 8), ((RenderTexture)data.depthTexture).volumeDepth); + + dstIndex0 += minCount; + } + + }); + } + } + + private class PassDataMipChainRaster + { + public MaterialPropertyBlock propertyBlock; + public Material material; + public TextureHandle source; + public int dstMipWidth, dstMipHeight; + public int srcMipLevel; + public float scaleX, scaleY; + public float blurSourceTextureWidth, blurSourceTextureHeight; + public LocalKeyword disableTexture2DArrayKeyword; + public bool sourceIsArray; + } + + private class PassDataMipChainCompute + { + public int numTheadGroupX, numTheadGroupY, numTheadGroupZ; + public int srcMipWidth, srcMipHeight; + public int dstMipWidth, dstMipHeight; + public int srcMipLevel; + public TextureHandle tempDownsamplePyramid, destination; + public ComputeShader cs; + public LocalKeyword disableTexture2DArrayKeyword; + public int downsampleKernel, gaussianKernel; + public bool sourceIsArray; + } + + // Generates the gaussian pyramid of source into destination + // We can't do it in place as the color pyramid has to be read while writing to the color + // buffer in some cases (e.g. refraction, distortion) + // Returns the number of mips + public int RenderColorGaussianPyramid(RenderGraph renderGraph, Vector2Int size, TextureHandle source, TextureHandle destination) + { + TextureDesc descSrc = renderGraph.GetTextureDesc(source); + TextureDesc descDst = renderGraph.GetTextureDesc(destination); + + // Select between Tex2D and Tex2DArray versions of the kernels + bool sourceIsArray = (descSrc.dimension == TextureDimension.Tex2DArray); + // Sanity check + if (sourceIsArray) + { + Debug.Assert(descSrc.dimension == descDst.dimension, "MipGenerator source texture does not match dimension of destination!"); + } + + int srcMipLevel = 0; + int srcMipWidth = size.x; + int srcMipHeight = size.y; + + bool isHardwareDrsOn = DynamicResolutionHandler.instance.HardwareDynamicResIsEnabled(); + var hardwareTextureSize = new Vector2Int(descSrc.width, descSrc.height); + if (isHardwareDrsOn) + hardwareTextureSize = DynamicResolutionHandler.instance.ApplyScalesOnSize(hardwareTextureSize); + + renderGraph.AddCopyPass(source, destination, "Copy mip 0"); + var finalTargetSize = new Vector2Int(descDst.width, descDst.height); + if (descDst.useDynamicScale && isHardwareDrsOn) + finalTargetSize = DynamicResolutionHandler.instance.ApplyScalesOnSize(finalTargetSize); + + bool usePixelShader = !m_SupportCompute || !m_PreferCompute; + + // Note: smaller mips are excluded as we don't need them and the gaussian compute works + // on 8x8 blocks + while (srcMipWidth >= 8 || srcMipHeight >= 8) + { + int dstMipWidth = Mathf.Max(1, srcMipWidth >> 1); + int dstMipHeight = Mathf.Max(1, srcMipHeight >> 1); + + var desc = new TextureDesc(dstMipWidth, dstMipHeight); + desc.name = "Temporary Downsampled Pyramid"; + desc.scale = Vector2.one * 0.5f; + desc.dimension = descSrc.dimension; + desc.colorFormat = descDst.colorFormat; + desc.enableRandomWrite = !usePixelShader; + desc.useMipMap = false; + desc.slices = sourceIsArray ? TextureXR.slices : 1; + var tempDownsamplePyramid = renderGraph.CreateTexture(desc); + + // Scale for downsample + float downsampleScaleX = ((float)srcMipWidth / finalTargetSize.x); + float downsampleScaleY = ((float)srcMipHeight / finalTargetSize.y); + + if (usePixelShader) + { + // Downsample. + renderGraph.AddBlitPass(destination, tempDownsamplePyramid, new(downsampleScaleX, downsampleScaleY), Vector2.zero, sourceMip: srcMipLevel, passName: "Color Pyramid - Downsample"); + + // In this mip generation process, source viewport can be smaller than the source render target itself because of the RTHandle system + // We are not using the scale provided by the RTHandle system for two reasons: + // - Source might be a planar probe which will not be scaled by the system (since it's actually the final target of probe rendering at the exact size) + // - When computing mip size, depending on even/odd sizes, the scale computed for mip 0 might miss a texel at the border. + // This can result in a shift in the mip map downscale that depends on the render target size rather than the actual viewport + // (Two rendering at the same viewport size but with different RTHandle reference size would yield different results which can break automated testing) + // So in the end we compute a specific scale for downscale and blur passes at each mip level. + + // Scales for Blur + // Same size as m_TempColorTargets which is the source for vertical blur + desc.name = "Temp Gaussian Pyramid Target"; + desc.slices = sourceIsArray ? TextureXR.slices : 1; + desc.dimension = descSrc.dimension; + desc.filterMode = FilterMode.Bilinear; + desc.colorFormat = descDst.colorFormat; + desc.enableRandomWrite = false; + desc.useMipMap = false; + var tempColorTarget = renderGraph.CreateTexture(desc); + + var hardwareBlurSourceTextureSize = new Vector2Int(dstMipWidth, dstMipHeight); + if (isHardwareDrsOn) + hardwareBlurSourceTextureSize = DynamicResolutionHandler.instance.ApplyScalesOnSize(hardwareBlurSourceTextureSize); + + float blurSourceTextureWidth = (float)hardwareBlurSourceTextureSize.x; + float blurSourceTextureHeight = (float)hardwareBlurSourceTextureSize.y; + + float scaleX = ((float)dstMipWidth / blurSourceTextureWidth); + float scaleY = ((float)dstMipHeight / blurSourceTextureHeight); + + // Blur horizontal. + using (var builder = renderGraph.AddRasterRenderPass("Color Pyramid - Horizontal Blur", out var passData)) + { + passData.propertyBlock = m_PropertyBlockBlur; + passData.source = tempDownsamplePyramid; + passData.material = m_ColorPyramidPSMat; + passData.dstMipWidth = dstMipWidth; + passData.dstMipHeight = dstMipHeight; + passData.scaleX = scaleX; + passData.scaleY = scaleY; + passData.blurSourceTextureWidth = blurSourceTextureWidth; + passData.blurSourceTextureHeight = blurSourceTextureHeight; + passData.disableTexture2DArrayKeyword = m_DisableTexture2DArrayColorPSKeyword; + passData.sourceIsArray = sourceIsArray; + + builder.UseTexture(passData.source, AccessFlags.Read); + builder.SetRenderAttachment(tempColorTarget, 0); + builder.SetRenderFunc(static (data, context) => MipChainRasterBlurExecutePass(data, context, false)); + } + + // Blur vertical. + using (var builder = renderGraph.AddRasterRenderPass("Color Pyramid - Vertical Blur", out var passData)) + { + passData.propertyBlock = m_PropertyBlockBlur; + passData.source = tempColorTarget; + passData.material = m_ColorPyramidPSMat; + passData.dstMipWidth = dstMipWidth; + passData.dstMipHeight = dstMipHeight; + passData.scaleX = scaleX; + passData.scaleY = scaleY; + passData.blurSourceTextureWidth = blurSourceTextureWidth; + passData.blurSourceTextureHeight = blurSourceTextureHeight; + passData.disableTexture2DArrayKeyword = m_DisableTexture2DArrayColorPSKeyword; + passData.sourceIsArray = sourceIsArray; + + builder.UseTexture(passData.source, AccessFlags.Read); + builder.SetRenderAttachment(destination, 0, AccessFlags.Write, srcMipLevel + 1, -1); + builder.SetRenderFunc(static (data, context) => MipChainRasterBlurExecutePass(data, context, true)); + } + } + else + { + using (var builder = renderGraph.AddComputePass("Color Pyramid - MIP Chain (Compute)", out var passData)) + { + passData.numTheadGroupX = (dstMipWidth + 7) / 8; + passData.numTheadGroupY = (dstMipHeight + 7) / 8; + passData.numTheadGroupZ = TextureXR.slices; + passData.srcMipWidth = srcMipWidth; + passData.srcMipHeight = srcMipHeight; + passData.dstMipWidth = dstMipWidth; + passData.dstMipHeight = dstMipHeight; + passData.srcMipLevel = srcMipLevel; + passData.tempDownsamplePyramid = tempDownsamplePyramid; + passData.destination = destination; + passData.cs = m_ColorPyramidCS; + passData.disableTexture2DArrayKeyword = m_DisableTexture2DArrayColorKeyword; + passData.downsampleKernel = m_ColorDownsampleKernel; + passData.gaussianKernel = m_ColorGaussianKernel; + passData.sourceIsArray = sourceIsArray; + + // Enable global state modification so we can set keywords. + builder.AllowGlobalStateModification(true); + builder.UseTexture(passData.tempDownsamplePyramid, AccessFlags.ReadWrite); + builder.UseTexture(destination, AccessFlags.ReadWrite); + + builder.SetRenderFunc(static (PassDataMipChainCompute data, ComputeGraphContext context) => + { + context.cmd.SetKeyword(data.cs, data.disableTexture2DArrayKeyword, !data.sourceIsArray); + + // Downsample. + context.cmd.SetComputeVectorParam(data.cs, _Size, new Vector4(data.srcMipWidth, data.srcMipHeight, 0f, 0f)); + context.cmd.SetComputeTextureParam(data.cs, data.downsampleKernel, _Source, data.destination, data.srcMipLevel); + context.cmd.SetComputeTextureParam(data.cs, data.downsampleKernel, _Destination, data.tempDownsamplePyramid); + context.cmd.DispatchCompute(data.cs, data.downsampleKernel, data.numTheadGroupX, data.numTheadGroupY, data.numTheadGroupZ); + + // Single pass blur + context.cmd.SetComputeVectorParam(data.cs, _Size, new Vector4(data.dstMipWidth, data.dstMipHeight, 0f, 0f)); + context.cmd.SetComputeTextureParam(data.cs, data.gaussianKernel, _Source, data.tempDownsamplePyramid); + context.cmd.SetComputeTextureParam(data.cs, data.gaussianKernel, _Destination, data.destination, data.srcMipLevel + 1); + context.cmd.DispatchCompute(data.cs, data.gaussianKernel, data.numTheadGroupX, data.numTheadGroupY, data.numTheadGroupZ); + }); + } + } + + srcMipLevel++; + srcMipWidth = dstMipWidth; + srcMipHeight = dstMipHeight; + + finalTargetSize.x >>= 1; + finalTargetSize.y >>= 1; + } + + return srcMipLevel + 1; + } + + static void MipChainRasterBlurExecutePass(PassDataMipChainRaster data, RasterGraphContext context, bool isVertical) + { + data.propertyBlock.SetTexture(_Source, data.source); + data.propertyBlock.SetVector(_SrcScaleBias, new Vector4(data.scaleX, data.scaleY, 0f, 0f)); + data.propertyBlock.SetVector(_SrcUvLimits, new Vector4((data.dstMipWidth - 0.5f) / data.blurSourceTextureWidth, (data.dstMipHeight - 0.5f) / data.blurSourceTextureHeight, !isVertical ? 1.0f / data.blurSourceTextureWidth : 0f, isVertical ? 1.0f / data.blurSourceTextureHeight : 0)); + data.propertyBlock.SetFloat(_SourceMip, 0); + data.material.SetKeyword(data.disableTexture2DArrayKeyword, !data.sourceIsArray); + context.cmd.SetViewport(new Rect(0, 0, data.dstMipWidth, data.dstMipHeight)); + context.cmd.DrawProcedural(Matrix4x4.identity, data.material, 0, MeshTopology.Triangles, 3, 1, data.propertyBlock); + } + } +} diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenerator.cs.meta b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenerator.cs.meta new file mode 100644 index 00000000000..e53674be8cd --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/MipGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 68deae0b402bcaa43a6f4fb81a956eaa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders.meta b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders.meta new file mode 100644 index 00000000000..2a6b2a1e40b --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6c88990944d5cd446b5b7b917b2c85a9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramid.compute b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramid.compute new file mode 100644 index 00000000000..a68f35ba18a --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramid.compute @@ -0,0 +1,188 @@ +// +// This is a modified version of the BlurCS compute shader from Microsoft's MiniEngine +// library. The copyright notice from the original version is included below. +// +// The original source code of MiniEngine is available on GitHub. +// https://github.com/Microsoft/DirectX-Graphics-Samples +// + +// +// Copyright (c) Microsoft. All rights reserved. +// This code is licensed under the MIT License (MIT). +// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF +// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY +// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR +// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. +// +// Developed by Minigraph +// +// Author: Bob Brown +// + +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch switch2 glcore gles3 webgpu + +#pragma kernel ColorGaussian KERNEL_SIZE=8 MAIN_GAUSSIAN=ColorGaussian +#pragma kernel ColorDownsample KERNEL_SIZE=8 MAIN_DOWNSAMPLE=ColorDownsample + +#pragma multi_compile_local _ DISABLE_TEXTURE2D_X_ARRAY + +//#define NO_ALPHA + +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureXR.hlsl" + +RW_TEXTURE2D_X(unorm float4, _Source); +RW_TEXTURE2D_X(unorm float4, _Destination); + +CBUFFER_START(cb) + float4 _Size; // x: src width, y: src height, zw: unused +CBUFFER_END + +// 16x16 pixels with an 8x8 center that we will be blurring writing out. Each uint is two color +// channels packed together. +// The reason for separating channels is to reduce bank conflicts in the local data memory +// controller. A large stride will cause more threads to collide on the same memory bank. +groupshared uint gs_cacheR[128]; +groupshared uint gs_cacheG[128]; +groupshared uint gs_cacheB[128]; +#if !defined(NO_ALPHA) +groupshared uint gs_cacheA[128]; +#endif + +float4 BlurPixels(float4 a, float4 b, float4 c, float4 d, float4 e, float4 f, float4 g, float4 h, float4 i) +{ + return 0.27343750 * (e ) + + 0.21875000 * (d + f) + + 0.10937500 * (c + g) + + 0.03125000 * (b + h) + + 0.00390625 * (a + i); +} + +void Store2Pixels(uint index, float4 pixel1, float4 pixel2) +{ + gs_cacheR[index] = f32tof16(pixel1.r) | f32tof16(pixel2.r) << 16; + gs_cacheG[index] = f32tof16(pixel1.g) | f32tof16(pixel2.g) << 16; + gs_cacheB[index] = f32tof16(pixel1.b) | f32tof16(pixel2.b) << 16; +#if !defined(NO_ALPHA) + gs_cacheA[index] = f32tof16(pixel1.a) | f32tof16(pixel2.a) << 16; +#endif +} + +void Load2Pixels(uint index, out float4 pixel1, out float4 pixel2) +{ + uint rr = gs_cacheR[index]; + uint gg = gs_cacheG[index]; + uint bb = gs_cacheB[index]; +#if !defined(NO_ALPHA) + uint aa = gs_cacheA[index]; +#else + uint aa = 0; +#endif + pixel1 = float4(f16tof32(rr ), f16tof32(gg ), f16tof32(bb ), f16tof32(aa )); + pixel2 = float4(f16tof32(rr >> 16), f16tof32(gg >> 16), f16tof32(bb >> 16), f16tof32(aa >> 16)); +} + +void Store1Pixel(uint index, float4 pixel) +{ + gs_cacheR[index] = asuint(pixel.r); + gs_cacheG[index] = asuint(pixel.g); + gs_cacheB[index] = asuint(pixel.b); +#if !defined(NO_ALPHA) + gs_cacheA[index] = asuint(pixel.a); +#endif +} + +void Load1Pixel(uint index, out float4 pixel) +{ +#if defined(NO_ALPHA) + uint a = 0; +#else + uint a = gs_cacheA[index]; +#endif + pixel = asfloat(uint4(gs_cacheR[index], gs_cacheG[index], gs_cacheB[index], a)); +} + +// Blur two pixels horizontally. This reduces LDS reads and pixel unpacking. +void BlurHorizontally(uint outIndex, uint leftMostIndex) +{ + float4 s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + Load2Pixels(leftMostIndex + 0, s0, s1); + Load2Pixels(leftMostIndex + 1, s2, s3); + Load2Pixels(leftMostIndex + 2, s4, s5); + Load2Pixels(leftMostIndex + 3, s6, s7); + Load2Pixels(leftMostIndex + 4, s8, s9); + + Store1Pixel(outIndex , BlurPixels(s0, s1, s2, s3, s4, s5, s6, s7, s8)); + Store1Pixel(outIndex + 1, BlurPixels(s1, s2, s3, s4, s5, s6, s7, s8, s9)); +} + +void BlurVertically(uint2 pixelCoord, uint topMostIndex) +{ + float4 s0, s1, s2, s3, s4, s5, s6, s7, s8; + Load1Pixel(topMostIndex , s0); + Load1Pixel(topMostIndex + 8, s1); + Load1Pixel(topMostIndex + 16, s2); + Load1Pixel(topMostIndex + 24, s3); + Load1Pixel(topMostIndex + 32, s4); + Load1Pixel(topMostIndex + 40, s5); + Load1Pixel(topMostIndex + 48, s6); + Load1Pixel(topMostIndex + 56, s7); + Load1Pixel(topMostIndex + 64, s8); + + float4 blurred = BlurPixels(s0, s1, s2, s3, s4, s5, s6, s7, s8); + + // Write to the final target + _Destination[COORD_TEXTURE2D_X(pixelCoord)] = blurred; +} + +[numthreads(KERNEL_SIZE, KERNEL_SIZE, 1)] +void MAIN_GAUSSIAN(uint2 groupId : SV_GroupID, uint2 groupThreadId : SV_GroupThreadID, uint3 dispatchThreadId : SV_DispatchThreadID) +{ + UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z); + + // Upper-left pixel coordinate of quad that this thread will read + int2 threadUL = (groupThreadId << 1) + (groupId << 3) - 4; + uint2 uthreadUL = uint2(max(0, threadUL)); + + uint2 size = uint2(_Size.xy) - 1u; + float4 p00 = _Source[COORD_TEXTURE2D_X(min(uthreadUL + uint2(0u, 0u), size))]; + float4 p10 = _Source[COORD_TEXTURE2D_X(min(uthreadUL + uint2(1u, 0u), size))]; + float4 p11 = _Source[COORD_TEXTURE2D_X(min(uthreadUL + uint2(1u, 1u), size))]; + float4 p01 = _Source[COORD_TEXTURE2D_X(min(uthreadUL + uint2(0u, 1u), size))]; + + // Store the 4 downsampled pixels in LDS + uint destIdx = groupThreadId.x + (groupThreadId.y << 4u); + Store2Pixels(destIdx , p00, p10); + Store2Pixels(destIdx + 8u, p01, p11); + + GroupMemoryBarrierWithGroupSync(); + + // Horizontally blur the pixels in LDS + uint row = groupThreadId.y << 4u; + BlurHorizontally(row + (groupThreadId.x << 1u), row + groupThreadId.x + (groupThreadId.x & 4u)); + + GroupMemoryBarrierWithGroupSync(); + + // Vertically blur the pixels in LDS and write the result to memory + BlurVertically(dispatchThreadId.xy, (groupThreadId.y << 3u) + groupThreadId.x); +} + +[numthreads(KERNEL_SIZE, KERNEL_SIZE, 1)] +void MAIN_DOWNSAMPLE(uint3 dispatchThreadId : SV_DispatchThreadID) +{ + UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z); + + uint2 offset = dispatchThreadId.xy * 2u; + uint2 size = uint2(_Size.xy) - 1u; + + uint2 c00 = min(offset + uint2(0u, 0u), size); + uint2 c10 = min(offset + uint2(1u, 0u), size); + uint2 c11 = min(offset + uint2(1u, 1u), size); + uint2 c01 = min(offset + uint2(0u, 1u), size); + float4 p00 = _Source[COORD_TEXTURE2D_X(c00)]; + float4 p10 = _Source[COORD_TEXTURE2D_X(c10)]; + float4 p11 = _Source[COORD_TEXTURE2D_X(c11)]; + float4 p01 = _Source[COORD_TEXTURE2D_X(c01)]; + + _Destination[COORD_TEXTURE2D_X(dispatchThreadId.xy)] = (p00 + p01 + p11 + p10) * 0.25; +} diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramid.compute.meta b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramid.compute.meta new file mode 100644 index 00000000000..20f2715d8e6 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramid.compute.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 28969cfddd9ef3f4e94b971690146a4f +timeCreated: 1503754250 +licenseType: Pro +ComputeShaderImporter: + currentAPIMask: 131076 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.hlsl b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.hlsl new file mode 100644 index 00000000000..a7a8cada8de --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.hlsl @@ -0,0 +1,57 @@ +#pragma multi_compile_local _ DISABLE_TEXTURE2D_X_ARRAY + +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + +TEXTURE2D_X_HALF(_Source); +uniform float4 _SrcScaleBias; +uniform float4 _SrcUvLimits; // {xy: max uv, zw: offset of blur for 1 texel } +uniform half _SourceMip; + +struct Attributes +{ + uint vertexID : SV_VertexID; + UNITY_VERTEX_INPUT_INSTANCE_ID +}; + +struct Varyings +{ + float4 positionCS : SV_POSITION; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_OUTPUT_STEREO +}; + +Varyings Vert(Attributes input) +{ + Varyings output; + UNITY_SETUP_INSTANCE_ID(input); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + output.positionCS = GetFullScreenTriangleVertexPosition(input.vertexID); + output.texcoord = GetFullScreenTriangleTexCoord(input.vertexID) * _SrcScaleBias.xy + _SrcScaleBias.zw; + return output; +} + +half4 Frag(Varyings input) : SV_Target +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + // Gaussian weights for 9 texel kernel from center textel to furthest texel. Keep in sync with ColorPyramid.compute + const half gaussWeights[] = { 0.27343750, 0.21875000, 0.10937500, 0.03125000, 0.00390625 }; + + float2 offset = _SrcUvLimits.zw; + float2 offset1 = offset * (1.0 + (gaussWeights[2] / (gaussWeights[1] + gaussWeights[2]))); + float2 offset2 = offset * (3.0 + (gaussWeights[4] / (gaussWeights[3] + gaussWeights[4]))); + + float2 uv_m2 = input.texcoord.xy - offset2; + float2 uv_m1 = input.texcoord.xy - offset1; + float2 uv_p0 = input.texcoord.xy; + float2 uv_p1 = min(_SrcUvLimits.xy, input.texcoord.xy + offset1); + float2 uv_p2 = min(_SrcUvLimits.xy, input.texcoord.xy + offset2); + + return + + SAMPLE_TEXTURE2D_X_LOD(_Source, sampler_LinearClamp, uv_m2, _SourceMip) * (gaussWeights[3] + gaussWeights[4]) + + SAMPLE_TEXTURE2D_X_LOD(_Source, sampler_LinearClamp, uv_m1, _SourceMip) * (gaussWeights[1] + gaussWeights[2]) + + SAMPLE_TEXTURE2D_X_LOD(_Source, sampler_LinearClamp, uv_p0, _SourceMip) * gaussWeights[0] + + SAMPLE_TEXTURE2D_X_LOD(_Source, sampler_LinearClamp, uv_p1, _SourceMip) * (gaussWeights[1] + gaussWeights[2]) + + SAMPLE_TEXTURE2D_X_LOD(_Source, sampler_LinearClamp, uv_p2, _SourceMip) * (gaussWeights[3] + gaussWeights[4]); +} diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.hlsl.meta b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.hlsl.meta new file mode 100644 index 00000000000..835cc8b0f27 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.hlsl.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 95152aa728f8eec4d9d5c1988ddd90e6 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.shader b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.shader new file mode 100644 index 00000000000..5ac3e092f29 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.shader @@ -0,0 +1,23 @@ +Shader "Hidden/ColorPyramidPS" +{ + SubShader + { + Tags{ "RenderPipeline" = "UniversalPipeline" } + + Pass + { + ZWrite Off ZTest Always Blend Off Cull Off + ColorMask RGBA + + HLSLPROGRAM + #pragma editor_sync_compilation + #pragma target 2.0 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch switch2 glcore gles3 webgpu + #pragma vertex Vert + #pragma fragment Frag + #include_with_pragmas "ColorPyramidPS.hlsl" + ENDHLSL + } + } + Fallback Off +} diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.shader.meta b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.shader.meta new file mode 100644 index 00000000000..f40c57fedd9 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/ColorPyramidPS.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 63b92baba208e314c8fdebe52ca0cc34 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramid.compute b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramid.compute new file mode 100644 index 00000000000..97933346c24 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramid.compute @@ -0,0 +1,130 @@ +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch switch2 glcore gles3 webgpu + +#pragma multi_compile_local _ ENABLE_CHECKERBOARD +#pragma multi_compile_local _ DISABLE_TEXTURE2D_X_ARRAY + +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureXR.hlsl" +#include "Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.hlsl" + +#pragma kernel DepthDownsample + +RW_TEXTURE2D_X(float, _DepthMipChain); + +#if UNITY_REVERSED_Z +#define MIN_DEPTH(A, B) max((A), (B)) +#define MIN3_DEPTH(A, B, C) Max3((A), (B), (C)) +#define MAX_DEPTH(A, B) min((A), (B)) +#define MAX3_DEPTH(A, B, C) Min3((A), (B), (C)) +#else +#define MIN_DEPTH(A, B) min((A), (B)) +#define MIN3_DEPTH(A, B, C) Min3((A), (B), (C)) +#define MAX_DEPTH(A, B) max((A), (B)) +#define MAX3_DEPTH(A, B, C) Max3((A), (B), (C)) +#endif + +uint2 CoordInTileByIndex(uint i) +{ + // decode i = [yxxyyx] (we want each pair of bits to have an x and a y) + return uint2( + (i & 1) | ((i >> 2) & 6), + ((i >> 1) & 3) | ((i >> 3) & 4)); +} + +groupshared float s_minDepth[32]; +#ifdef ENABLE_CHECKERBOARD +groupshared float s_maxDepth[32]; +#endif + +void SubgroupMergeDepths(uint threadID, uint bitIndex, inout float minDepth, inout float maxDepth) +{ + uint highIndex = threadID >> (bitIndex + 1); + uint lowIndex = threadID & ((1 << (bitIndex + 1)) - 1); + + if (lowIndex == (1 << bitIndex)) + { + s_minDepth[highIndex] = minDepth; +#ifdef ENABLE_CHECKERBOARD + s_maxDepth[highIndex] = maxDepth; +#endif + } + GroupMemoryBarrierWithGroupSync(); + + if (lowIndex == 0) + { + minDepth = MIN_DEPTH(minDepth, s_minDepth[highIndex]); +#ifdef ENABLE_CHECKERBOARD + maxDepth = MAX_DEPTH(maxDepth, s_maxDepth[highIndex]); +#endif + } + GroupMemoryBarrierWithGroupSync(); +} + +float CheckerboardDepth(uint2 coord, float minDepth, float maxDepth) +{ + return ((coord.x ^ coord.y) & 1) ? minDepth : maxDepth; +} + +// Downsample a depth texture by taking the min value of sampled pixels +[numthreads(64, 1, 1)] +void DepthDownsample(uint threadID : SV_GroupThreadID, uint3 groupID : SV_GroupID) +{ + UNITY_XR_ASSIGN_VIEW_INDEX(groupID.z); + + // assign threads to pixels in a swizzle-like pattern + int2 dstCoord0 = (groupID.xy << 3) | CoordInTileByIndex(threadID); + + int2 readOffsetUL = dstCoord0 << 1; + float p00 = _DepthMipChain[COORD_TEXTURE2D_X(_SrcOffset + min(readOffsetUL + int2(0, 0), _SrcLimit))]; + float p10 = _DepthMipChain[COORD_TEXTURE2D_X(_SrcOffset + min(readOffsetUL + int2(1, 0), _SrcLimit))]; + float p01 = _DepthMipChain[COORD_TEXTURE2D_X(_SrcOffset + min(readOffsetUL + int2(0, 1), _SrcLimit))]; + float p11 = _DepthMipChain[COORD_TEXTURE2D_X(_SrcOffset + min(readOffsetUL + int2(1, 1), _SrcLimit))]; + float minDepth = MIN3_DEPTH(p00, p10, MIN_DEPTH(p01, p11)); + float maxDepth = MAX3_DEPTH(p00, p10, MAX_DEPTH(p01, p11)); + + // write dst0 + if (all(dstCoord0 < _DstSize0)) + { + _DepthMipChain[COORD_TEXTURE2D_X(_MinDstOffset0 + dstCoord0)] = minDepth; +#ifdef ENABLE_CHECKERBOARD + if (_CbDstCount >= 1) + _DepthMipChain[COORD_TEXTURE2D_X(_CbDstOffset0 + dstCoord0)] = CheckerboardDepth(dstCoord0, minDepth, maxDepth); +#endif + } + + // merge to thread 0 in subgroup size 4 + SubgroupMergeDepths(threadID, 0, minDepth, maxDepth); + SubgroupMergeDepths(threadID, 1, minDepth, maxDepth); + if (_MinDstCount >= 2 && (threadID & 0x3) == 0) + { + int2 dstCoord1 = dstCoord0 >> 1; + if (all(dstCoord1 < _DstSize1)) + { + _DepthMipChain[COORD_TEXTURE2D_X(_MinDstOffset1 + dstCoord1)] = minDepth; +#ifdef ENABLE_CHECKERBOARD + if (_CbDstCount >= 2) + _DepthMipChain[COORD_TEXTURE2D_X(_CbDstOffset1 + dstCoord1)] = CheckerboardDepth(dstCoord1, minDepth, maxDepth); +#endif + } + } + + // merge to thread 0 in subgroup size 16 + SubgroupMergeDepths(threadID, 2, minDepth, maxDepth); + SubgroupMergeDepths(threadID, 3, minDepth, maxDepth); + if (_MinDstCount >= 3 && (threadID & 0xf) == 0) + { + int2 dstCoord2 = dstCoord0 >> 2; + if (all(dstCoord2 < _DstSize2)) + _DepthMipChain[COORD_TEXTURE2D_X(_MinDstOffset2 + dstCoord2)] = minDepth; + } + + // merge to thread 0 + SubgroupMergeDepths(threadID, 4, minDepth, maxDepth); + SubgroupMergeDepths(threadID, 5, minDepth, maxDepth); + if (_MinDstCount >= 4 && (threadID & 0x3f) == 0) + { + int2 dstCoord3 = dstCoord0 >> 3; + if (all(dstCoord3 < _DstSize3)) + _DepthMipChain[COORD_TEXTURE2D_X(_MinDstOffset3 + dstCoord3)] = minDepth; + } +} diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramid.compute.meta b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramid.compute.meta new file mode 100644 index 00000000000..b2d59121e15 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramid.compute.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 90a204702cd44e54cac7ed4fc6e5d86b +timeCreated: 1506516404 +licenseType: Pro +ComputeShaderImporter: + externalObjects: {} + currentAPIMask: 4 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs new file mode 100644 index 00000000000..5d56fa43cbe --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs @@ -0,0 +1,27 @@ +namespace UnityEngine.Rendering +{ + [GenerateHLSL(needAccessors = false, generateCBuffer = true)] + internal unsafe struct DepthPyramidConstants + { + public uint _MinDstCount; + public uint _CbDstCount; + public uint _DepthPyramidPad0; + public uint _DepthPyramidPad1; + + public Vector2Int _SrcOffset; + public Vector2Int _SrcLimit; + + public Vector2Int _DstSize0; + public Vector2Int _DstSize1; + public Vector2Int _DstSize2; + public Vector2Int _DstSize3; + + public Vector2Int _MinDstOffset0; + public Vector2Int _MinDstOffset1; + public Vector2Int _MinDstOffset2; + public Vector2Int _MinDstOffset3; + + public Vector2Int _CbDstOffset0; + public Vector2Int _CbDstOffset1; + } +} diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.hlsl b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.hlsl new file mode 100644 index 00000000000..5e8e9edaad3 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.hlsl @@ -0,0 +1,29 @@ +// +// This file was automatically generated. Please don't edit by hand. Execute Editor command [ Edit > Rendering > Generate Shader Includes ] instead +// + +#ifndef DEPTHPYRAMIDCONSTANTS_CS_HLSL +#define DEPTHPYRAMIDCONSTANTS_CS_HLSL +// Generated from UnityEngine.Rendering.DepthPyramidConstants +// PackingRules = Exact +CBUFFER_START(DepthPyramidConstants) + uint _MinDstCount; + uint _CbDstCount; + uint _DepthPyramidPad0; + uint _DepthPyramidPad1; + int2 _SrcOffset; + int2 _SrcLimit; + int2 _DstSize0; + int2 _DstSize1; + int2 _DstSize2; + int2 _DstSize3; + int2 _MinDstOffset0; + int2 _MinDstOffset1; + int2 _MinDstOffset2; + int2 _MinDstOffset3; + int2 _CbDstOffset0; + int2 _CbDstOffset1; +CBUFFER_END + + +#endif diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.hlsl.meta b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.hlsl.meta new file mode 100644 index 00000000000..1673d674312 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dda90eae3301de545856ee63771154fd +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.meta b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.meta new file mode 100644 index 00000000000..fe0048c2a11 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/MipGen/Shaders/DepthPyramidConstants.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7f6fd62f76461a0429f9b8049a8f339c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DepthNormalOnlyPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DepthNormalOnlyPass.cs index ed1a959a5d8..962b05d5b7d 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DepthNormalOnlyPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DepthNormalOnlyPass.cs @@ -30,12 +30,13 @@ public partial class DepthNormalOnlyPass : ScriptableRenderPass /// The RenderPassEvent to use. /// The RenderQueueRange to use for creating filtering settings that control what objects get rendered. /// The layer mask to use for creating filtering settings that control what objects get rendered. + /// The ProfilingSampler to use in the profiler and frame debugger for this pass. /// /// /// - public DepthNormalOnlyPass(RenderPassEvent evt, RenderQueueRange renderQueueRange, LayerMask layerMask) + public DepthNormalOnlyPass(RenderPassEvent evt, RenderQueueRange renderQueueRange, LayerMask layerMask, ProfilingSampler sampler = null) { - profilingSampler = ProfilingSampler.Get(URPProfileId.DrawDepthNormalPrepass); + profilingSampler = sampler ?? ProfilingSampler.Get(URPProfileId.DrawDepthNormalPrepass); m_FilteringSettings = new FilteringSettings(renderQueueRange, layerMask); renderPassEvent = evt; shaderTagIds = k_DepthNormals; @@ -83,6 +84,8 @@ private static void ExecutePass(RasterCommandBuffer cmd, PassData passData, Rend // Enable Rendering Layers if (passData.enableRenderingLayers) cmd.SetKeyword(ShaderGlobalKeywords.WriteRenderingLayers, true); + if (passData.outputSmoothness) + cmd.SetKeyword(ShaderGlobalKeywords.WriteSmoothness, true); // Draw cmd.DrawRendererList(rendererList); @@ -90,6 +93,8 @@ private static void ExecutePass(RasterCommandBuffer cmd, PassData passData, Rend // Clean up if (passData.enableRenderingLayers) cmd.SetKeyword(ShaderGlobalKeywords.WriteRenderingLayers, false); + if (passData.outputSmoothness) + cmd.SetKeyword(ShaderGlobalKeywords.WriteSmoothness, false); } /// @@ -110,14 +115,14 @@ public override void OnCameraCleanup(CommandBuffer cmd) private class PassData { internal bool enableRenderingLayers; + internal bool outputSmoothness; internal RenderingLayerUtils.MaskSize maskSize; internal RendererListHandle rendererList; } private RendererListParams InitRendererListParams(UniversalRenderingData renderingData, UniversalCameraData cameraData, UniversalLightData lightData) { - var sortFlags = cameraData.defaultOpaqueSortFlags; - var drawSettings = RenderingUtils.CreateDrawingSettings(this.shaderTagIds, renderingData, cameraData, lightData, sortFlags); + var drawSettings = RenderingUtils.CreateDrawingSettings(this.shaderTagIds, renderingData, cameraData, lightData, GetSortingCriteria(cameraData)); drawSettings.perObjectData = PerObjectData.None; return new RendererListParams(renderingData.cullResults, drawSettings, m_FilteringSettings); } @@ -143,6 +148,11 @@ internal void Render(RenderGraph renderGraph, ContextContainer frameData, in Tex builder.SetRenderAttachmentDepth(depthTexture, AccessFlags.ReadWrite); passData.enableRenderingLayers = enableRenderingLayers; +#if URP_SCREEN_SPACE_REFLECTION + passData.outputSmoothness = renderingData.writesSmoothnessToDepthNormalsAlpha; +#else + passData.outputSmoothness = false; +#endif if (passData.enableRenderingLayers) { @@ -175,8 +185,8 @@ internal void Render(RenderGraph renderGraph, ContextContainer frameData, in Tex if (setGlobalDepth) builder.SetGlobalTextureAfterPass(depthTexture, s_CameraDepthTextureID); - // Required here because of RenderingLayerUtils.SetupProperties - if (passData.enableRenderingLayers) + // Required here because of RenderingLayerUtils.SetupProperties, and for setting keywords in ExecutePass + if (passData.enableRenderingLayers || passData.outputSmoothness) builder.AllowGlobalStateModification(true); builder.SetRenderFunc(static (PassData data, RasterGraphContext context) => @@ -187,5 +197,15 @@ internal void Render(RenderGraph renderGraph, ContextContainer frameData, in Tex }); } } + + /// + /// Gets the sorting criteria to use for a given camera. Override to customize behavior. + /// + /// The UniversalCameraData of the camera to get sorting criteria for. + /// The sorting criteria to use. + protected virtual SortingCriteria GetSortingCriteria(UniversalCameraData cameraData) + { + return cameraData.defaultOpaqueSortFlags; + } } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature.meta b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature.meta new file mode 100644 index 00000000000..a6a7e6066c9 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b697a9bf7423546468db3365e062400a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/.001-screen-space-reflection-decisions.md b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/.001-screen-space-reflection-decisions.md new file mode 100644 index 00000000000..8a9a231d3d1 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/.001-screen-space-reflection-decisions.md @@ -0,0 +1,146 @@ +# SSR in URP Architecture Decision Record + +Date Created: May 2, 2025 +Last Updated: December 09, 2025 +Author: Kasper Engelstoft + +1\. Context +URP (Universal Render Pipeline) lacked support for dynamic Screen Space Reflections (SSR). Both the Built-in pipeline and HDRP support SSR, but with divergent implementations. +The goal is that SSR in URP is performant, scalable and suitable for a wide range of platforms (from Switch and mobile to high-end consoles) and rendering paths while aligning with Unity’s broader render pipeline unification efforts. + +Key requirements and constraints: + +* Support all render loops : forward, forward+, deferred and deferred+. +* Support XR +* Deliver high performance and configurable quality, with optimizations for low-end hardware. +* Support rough/glossy reflections, transparency, and fallback to reflection probes and global environment probe. +* Integrate with Unity’s Volume framework for parameter blending. +* Provide a flexible, scalable solution with presets (low, medium, high, custom). +* Minimize UX divergence from HDRP and maximize code reuse where feasible. + +--- + +## 2\. Decisions + +### 2.1 SSR Integration + +* SSR is delivered as a Renderer Feature in URP. Integration points: + * Can be run as a post-process pass (After Opaque) or before the main shading pass (integrated into the light loop, Before Opaque). + * The code paths have different performance/quality trade-offs. + +### 2.2 Ray Marching + +* Both hierarchical (HiZ/depth pyramid) and fixed-step (linear) ray marching are supported. + * HiZ is recommended for high-end/desktop + * Linear is recommended for low-end/mobile. + * Bisection/binary search is available as a refinement step. + * The user can select via Volume settings. + +### 2.3 Rough/Glossy Reflections + +* A color pyramid MIP chain (generated using Gaussian or the driver provided box blur) is generated for rough reflection lookup. + * Roughness-to-mip-level heuristics are based on Filament, Godot, and Frostbite research. +* Roughness is packed into the alpha channel of the DepthNormals texture (deferred/forward). + * This is a change to the DepthNormals prepass. + * For forward, DepthNormals is always enabled if SSR is present. +* Stochastic SSR using multiple rays and denoising is an expensive technique and doesn’t fit the platform reach of URP. Physically based reflections will be added to URP later as part of the realtime GI program. + +### 2.4 Transparency + +* SSR supports transparent objects via a secondary depth buffer. +* Reflection on transparent objects is supported, with caveats noted in the UI/tooltips. + +### 2.5 Temporal Reprojection + +* Temporal reprojection is available (in the Before Opaque path), using motion vectors and last-frame color. +* AfterOpaque mode does not use motion vectors. + +### 2.6 Fallbacks + +* SSR uses the reflection hierarchy when on ray misses. The fallback first samples local reflection probes and then the global reflection probe. +* A constant color fallback can be achieved using a local ReflectionProbe set to Custom with a 1x1 color texture. +* "Reflect Sky" toggle allows for capturing sky reflections. + +### 2.7 Upscaling and Performance + +* SSR can be run at full, half, or quarter resolution. +* Edge-aware upscaling (bilateral, Kawase, etc.) is available, but simple upscaling is recommended for low-end. +* Early-out in shader disables SSR for fully rough pixels. +* Multiple performance presets are available, and settings are grouped by quality/performance impact. + +### 2.8 Volume Framework Integration + +* All user-facing SSR settings are exposed as Volume overrides, with the exception of a few renderer feature toggles (e.g. AfterOpaque, Respect HDR). +* Presets (Fast, Balanced, High, Best) are provided; custom settings are also supported. + +### 2.9 Platform and Render Path Coverage + +* Tested on metal, DX11, DX12, Vulkan, GLCore, GLES. + * Known issues remain on WebGL, the feature isn’t supported. +* XR, foveated rendering, and dynamic resolution are in scope, with some workarounds and ongoing investigations. +* Performance targets: + * Switch, midrange mobile: ≤4ms (half/quarter-res SSR). + * PS5: ≤2.7ms (full-res SSR). + +### 2.10 Shader Support + +* SSR is supported on: Lit, Complex Lit, Particles Lit, Terrain Lit, SpeedTree8. +* ShaderGraph support is present for Lit SSR materials. + +--- + +## 3\. Consequences + +### Positive Outcomes + +* URP achieves a balanced feature parity with HDRP and built-in for SSR. +* SSR is flexible, scalable, and performant across target platforms. +* Volume-based parameter blending and presets simplify authoring and tuning. +* Code reuse with HDRP for core algorithms (color/depth pyramid, marcher). + +### Trade-offs / Limitations + +* Forward rendering requires a DepthNormals prepass, which may impact performance. +* Some settings required shader variant management and stripping. +* HiZ marching is not always faster, linear stepping can be faster on some platforms/scenes. +* Some features (e.g., contact hardening, specular elongation, per-material disables) are not implemented but can be added in the future. +* Remaining bugs and edge cases (dynamic resolution, WebGL, multi-camera, etc.) are being tracked in Jira. + +--- + +## 4\. Alternatives Considered + +| Alternative | Pros | Cons / Reason Not Chosen | +| :---- | :---- | :---- | +| Realtime cubemap camera reflections | Simple for planar surfaces | Not scalable, not screen-space, perf. | +| Realtime raytracing | Highest quality | Not feasible for many target platforms | +| Porting built-in SSR | Not modern, less flexible, not scalable | | +| Porting HDRP SSR as-is | High quality, shared code | Too complex for URP’s platform reach | +| Per-object SSR (Shiny SSR style) | No mask needed, implicit roughness | More drawcalls, less flexible | + +--- + +## 5\. References + +* [PRD: Screen Space Reflections in URP](https://docs.google.com/document/d/1W7zztONjkkReThoZSySLoCoz984U3bD1BLKTOxXx-A8/edit?tab=t.gyhavq2l84im) +* [\[TDD\] Screen Space Reflections in URP](https://docs.google.com/document/d/1gKrDkFkqiYZ4yigPwiFM8GuE587URxSo-5SjmaHTRz4/edit?tab=t.0#heading=h.vfvplx8fy7nm) +* [Jira Epic: SSR implementation in URP](https://jira.unity3d.com/browse/GFXLIGHT-1542) +* [Tech Analysis Deck](https://docs.google.com/presentation/d/1ge3SHtF6z5o99VaqipsfuPdOssIjvQyaA_ToRslHHDY/edit?slide=id.g308e3868d11_0_52) +* [Slack channel \#temp-team-ssr-in-urp](https://unity.slack.com/archives/C08Q1V7BHPW) +* [Draft PR](https://github.cds.internal.unity3d.com/unity/unity/pull/76006) + +--- + +## 6\. Open Questions & Next Steps + +* How to best handle multi-camera and scene view support? +* Continue to collect feedback from Tech Art and QA, iterate on presets, and update documentation/tooltips. +* Performance pass to squeeze out more performance on mobile. + +--- + +## 7\. Revision History + +* May 2, 2025: Initial draft (Kasper Engelstoft) +* June 11, 2025: Major update with TDD alignment, design/UX feedback, Slack history, and current open issues (SSR team) +* December 09, 2025: Updated status to Final, converted to .md file and added it to the repo (Kasper Engelstoft) \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionDepthNormalOnlyTransparentPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionDepthNormalOnlyTransparentPass.cs new file mode 100644 index 00000000000..684efc3790e --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionDepthNormalOnlyTransparentPass.cs @@ -0,0 +1,84 @@ +#if URP_SCREEN_SPACE_REFLECTION +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering.RenderGraphModule; +using UnityEngine.Rendering.RenderGraphModule.Util; + +namespace UnityEngine.Rendering.Universal +{ + // A separate DepthNormal pass that renders only transparents. Used to support transparency in screen space reflections. + internal class ScreenSpaceReflectionDepthNormalOnlyTransparentPass : Internal.DepthNormalOnlyPass + { + static readonly ProfilingSampler m_ProfilingSampler = new ProfilingSampler("SSR Depth Normal Only Transparent"); + + readonly Internal.CopyDepthPass m_CopyDepthPass; + + public ScreenSpaceReflectionDepthNormalOnlyTransparentPass(RenderPassEvent evt, RenderQueueRange renderQueueRange, LayerMask layerMask) + : base(evt, renderQueueRange, layerMask, m_ProfilingSampler) + { + ConfigureInput(ScriptableRenderPassInput.Depth | ScriptableRenderPassInput.Normal); + + if (GraphicsSettings.TryGetRenderPipelineSettings( + out var universalRendererShaders)) + { + //Pass event not used because we call the render function directly. + m_CopyDepthPass = new(RenderPassEvent.AfterRenderingPrePasses, universalRendererShaders.copyDepthPS, false, true, false, "Copy Depth"); + } + else + { + Debug.LogError("Failed to create the copy depth path required for the SSR Depth Normal Only Transparent pass"); + } + } + + public void UpdateRenderPassEvent(RenderPassEvent evt) + { + renderPassEvent = evt; + } + + /// + protected override SortingCriteria GetSortingCriteria(UniversalCameraData cameraData) + { + // Sort for transparent without opaque. + var sortingCriteria = cameraData.defaultOpaqueSortFlags; + sortingCriteria = sortingCriteria & ~SortingCriteria.CommonOpaque | SortingCriteria.CommonTransparent; + return sortingCriteria; + } + + public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData) + { + var resourceData = frameData.Get(); + var cameraData = frameData.Get(); + var ssrData = frameData.GetOrCreate(); + if (!ssrData.depthTransparentTexture.IsValid()) + { + var depthDescriptor = resourceData.cameraDepth.GetDescriptor(renderGraph); + depthDescriptor.msaaSamples = MSAASamples.None; // Depth-Only pass don't use MSAA + depthDescriptor.format = GraphicsFormat.None; + depthDescriptor.depthBufferBits = DepthBits.Depth32; + ssrData.depthTransparentTexture = UniversalRenderer.CreateRenderGraphTexture(renderGraph, depthDescriptor, "SSRDepthTransparentTexture", false, Color.clear); + } + if (!ssrData.normalTransparentTexture.IsValid()) + { + var normalDescriptor = resourceData.cameraNormalsTexture.GetDescriptor(renderGraph); + normalDescriptor.msaaSamples = MSAASamples.None; // Never use MSAA for the normal texture! + normalDescriptor.format = GetGraphicsFormat(); + normalDescriptor.depthBufferBits = DepthBits.None; + ssrData.normalTransparentTexture = UniversalRenderer.CreateRenderGraphTexture(renderGraph, normalDescriptor, "SSRNormalTransparentTexture", true, Color.clear); + } + + m_CopyDepthPass.Render(renderGraph, frameData, ssrData.depthTransparentTexture, resourceData.cameraDepthTexture); + renderGraph.AddCopyPass(resourceData.cameraNormalsTexture, ssrData.normalTransparentTexture, "Copy Normal Texture"); + + if (enableRenderingLayers) + { + Debug.LogError("DepthNormalOnlyPass does not support enableRenderingLayers when called as a reusable pass."); + return; + } + + if (ssrData.depthTransparentTexture.IsValid() && ssrData.normalTransparentTexture.IsValid()) + { + Render(renderGraph, frameData, ssrData.normalTransparentTexture, ssrData.depthTransparentTexture, TextureHandle.nullHandle, uint.MaxValue, false, false, false); + } + } + } +} +#endif diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionDepthNormalOnlyTransparentPass.cs.meta b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionDepthNormalOnlyTransparentPass.cs.meta new file mode 100644 index 00000000000..c230dc32d25 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionDepthNormalOnlyTransparentPass.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5aa83714c555c924a9a8b60e2608da99 \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPass.cs new file mode 100644 index 00000000000..091533630a1 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPass.cs @@ -0,0 +1,637 @@ +#if URP_SCREEN_SPACE_REFLECTION +using System; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering.RenderGraphModule; +using UnityEngine.Rendering.RenderGraphModule.Util; +using static UnityEngine.Rendering.RenderGraphModule.Util.RenderGraphUtils; +using static UnityEngine.Rendering.Universal.ScreenSpaceReflectionVolumeSettings; + +namespace UnityEngine.Rendering.Universal +{ + internal class ScreenSpaceReflectionPass : ScriptableRenderPass + { + public class SharedSSRData : ContextItem + { + // Used for transparency support, outputs from transparency depthnormal prepass + public TextureHandle depthTransparentTexture = TextureHandle.nullHandle; + public TextureHandle normalTransparentTexture = TextureHandle.nullHandle; + + public override void Reset() + { + depthTransparentTexture = TextureHandle.nullHandle; + normalTransparentTexture = TextureHandle.nullHandle; + } + } + + // Enums + private enum ShaderPasses + { + Reflection = 0, // Generate reflected color texture + BlitAfterOpaque = 1, // Blit to screen (only when using After Opaque mode) + + // Bilateral blur passes, 8-12 taps each. + BilateralBlurHorizontal = 2, + BilateralBlurVertical = 3, + BilateralBlurFinal = 4, + + // Gaussian blur passes, 4 taps each + GaussianBlurHorizontal = 5, + GaussianBlurVertical = 6, + + // Single pass kawase blur. + KawaseBlur = 7, + } + + // Constants + const string k_ScreenSpaceReflectionTextureName = "_ScreenSpaceReflectionTexture"; + const string k_HiZTrace = "_HIZ_TRACE"; + const string k_UseMotionVectors = "_USE_MOTION_VECTORS"; + const string k_RefineDepth = "_REFINE_DEPTH"; + + // Statics + internal static class ShaderConstants + { + internal static readonly int _ReflectionParam = Shader.PropertyToID("_ScreenSpaceReflectionParam"); + internal static readonly int _MaxRayLength = Shader.PropertyToID("_MaxRayLength"); + internal static readonly int _MaxRaySteps = Shader.PropertyToID("_MaxRaySteps"); + internal static readonly int _Downsample = Shader.PropertyToID("_Downsample"); + internal static readonly int _ThicknessScaleAndBias = Shader.PropertyToID("_ThicknessScaleAndBias"); + internal static readonly int _ScreenSpaceReflectionFinalTexture = Shader.PropertyToID(k_ScreenSpaceReflectionTextureName); + internal static readonly int _ProjectionParams2 = Shader.PropertyToID("_ProjectionParams2"); + internal static readonly int _CameraProjections = Shader.PropertyToID("_CameraProjections"); + internal static readonly int _CameraInverseProjections = Shader.PropertyToID("_CameraInverseProjections"); + internal static readonly int _CameraInverseViewProjections = Shader.PropertyToID("_CameraInverseViewProjections"); + internal static readonly int _CameraViews = Shader.PropertyToID("_CameraViews"); + internal static readonly int _CameraColorTexture = Shader.PropertyToID("_CameraColorTexture"); + internal static readonly int _CameraDepthTexture = Shader.PropertyToID("_CameraDepthTexture"); + internal static readonly int _CameraNormalsTexture = Shader.PropertyToID("_CameraNormalsTexture"); + internal static readonly int _SmoothnessTexture = Shader.PropertyToID("_SmoothnessTexture"); + internal static readonly int _MotionVectorColorTexture = Shader.PropertyToID("_MotionVectorColorTexture"); + internal static readonly int _SsrDepthPyramidMaxMip = Shader.PropertyToID("_SsrDepthPyramidMaxMip"); + internal static readonly int _SsrDepthPyramid = Shader.PropertyToID("_DepthPyramid"); + internal static readonly int _MinimumSmoothnessAndFadeStart = Shader.PropertyToID("_MinimumSmoothnessAndFadeStart"); + internal static readonly int _ScreenEdgeFadeAndViewConeDot = Shader.PropertyToID("_ScreenEdgeFadeAndViewConeDot"); + internal static readonly int _ReflectSky = Shader.PropertyToID("_ReflectSky"); + internal static readonly int _HitRefinementSteps = Shader.PropertyToID("_HitRefinementSteps"); + internal static readonly int _DepthPyramidMipLevelOffsets = Shader.PropertyToID("_DepthPyramidMipLevelOffsets"); + internal static readonly int _SourceSize = Shader.PropertyToID("_SourceSize"); + } + + // Private Variables + Material m_Material; + LocalKeywordSet m_LocalKeywords; + bool m_AfterOpaque; + + struct LocalKeywordSet + { + public LocalKeyword hiZTraceKeyword; + public LocalKeyword useMotionVectorsKeyword; + public LocalKeyword refineDepthKeyword; + + public void Init(Shader shader) + { + hiZTraceKeyword = new(shader, k_HiZTrace); + useMotionVectorsKeyword = new(shader, k_UseMotionVectors); + refineDepthKeyword = new(shader, k_RefineDepth); + } + }; + + readonly ProfilingSampler m_ProfilingSampler = ProfilingSampler.Get(URPProfileId.SSR); + readonly ProfilingSampler m_DepthPyramidSampler = new("SSR - Depth Pyramid Generation"); + readonly ProfilingSampler m_UpscalingSampler = new("SSR - Upscaling"); + readonly ProfilingSampler m_FinalBlitSampler = new("SSR - Final Blit"); + + MipGenerator m_MipGenerator = new(); + //We need to have this struct as a member in order to only allocate the arrays once. + PackedMipChainInfo m_PackedMipChainInfo; + + public ScreenSpaceReflectionPass() + { + m_PackedMipChainInfo.Allocate(); + } + + public void Dispose() + { + m_MipGenerator.Release(); + } + + internal bool Setup(ScriptableRenderer renderer, Material material, bool afterOpaque, UniversalRenderingData renderingData, CameraType cameraType) + { + m_AfterOpaque = afterOpaque; + + if (m_Material != material) + { + m_Material = material; + if (m_Material != null) + { + m_LocalKeywords.Init(m_Material.shader); + } + } + + var settings = VolumeManager.instance.stack.GetComponent(); + + // Rendering after PrePasses is usually correct except when depth priming is in play: + // then we rely on a depth resolve taking place after the PrePasses in order to have it ready for SSR. + + ScriptableRenderPassInput requiredInputs; + if (renderer is UniversalRenderer { usesDeferredLighting: true }) + { + renderPassEvent = m_AfterOpaque ? (settings.ShouldRenderTransparents() ? RenderPassEvent.AfterRenderingTransparents + 25 : RenderPassEvent.AfterRenderingSkybox + 25) : RenderPassEvent.AfterRenderingPrePasses + 5; + + requiredInputs = ScriptableRenderPassInput.Depth | ScriptableRenderPassInput.Normal; + + // Deferred rendering before opaques, need to generate smoothness in depth normals prepass as GBuffer isn't ready yet. + if (!m_AfterOpaque) + renderingData.writesSmoothnessToDepthNormalsAlpha = true; + } + else + { + renderPassEvent = m_AfterOpaque ? (settings.ShouldRenderTransparents() ? RenderPassEvent.AfterRenderingTransparents + 25 : RenderPassEvent.BeforeRenderingTransparents + 25) : RenderPassEvent.AfterRenderingPrePasses + 5; + + // Request DepthNormals texture. + requiredInputs = ScriptableRenderPassInput.Depth | ScriptableRenderPassInput.Normal; + + // With forward rendering, we are forced to generate a smoothness in depth normals prepass. + renderingData.writesSmoothnessToDepthNormalsAlpha = true; + } + + // Before opaque needs motion vectors for reprojection. + if (!m_AfterOpaque && (cameraType == CameraType.VR || cameraType == CameraType.Game)) + requiredInputs |= ScriptableRenderPassInput.Motion; + + ConfigureInput(requiredInputs); + + return m_Material != null; + } + + + private class ScreenSpaceReflectionPassData + { + // Camera data. This is not expected to change during a frame. + internal UniversalCameraData cameraData; + internal Matrix4x4[] cameraInverseViewProjections = new Matrix4x4[2]; + internal Matrix4x4[] cameraProjections = new Matrix4x4[2]; + internal Matrix4x4[] cameraInverseProjections = new Matrix4x4[2]; + internal Matrix4x4[] cameraViews = new Matrix4x4[2]; + internal Vector4[] depthPyramidMipOffsets = new Vector4[15]; + + // Material containg SSR pass, and keywords. + internal Material material; + internal LocalKeywordSet localKeywords; + + // MipInfo for HiZ marching. + internal PackedMipChainInfo mipsInfo; + + // Required textures. + internal TextureHandle cameraColor; // Camera target texture. + internal TextureHandle cameraDepth; // Camera depth target texture. + internal TextureHandle cameraNormalsTexture; // Normals. + internal TextureHandle smoothnessTexture; // Texture containing smoothness in the alpha channel. + internal TextureHandle ssrTexture; // Output texture containing reflected colors. + internal TextureHandle blackTexture; // A black fallback texture. + + // Optional textures. + internal TextureHandle lastFrameCameraColor; // Camera target texture from last frame (only needed if AfterOpaque=false). + internal TextureHandle motionVectorColor; // Motion vectors (only needed if AfterOpaque=false). + internal TextureHandle depthPyramidTexture; // Depth pyramid texture for HiZ marching (only needed if LinearMarching=false). + + // Settings. + internal float minimumSmoothness; + internal float smoothnessFadeStart; + internal float normalFade; + internal float screenEdgeFade; + internal float maxRayLength; + internal float rayLengthFade; + internal float thicknessScale; + internal float thicknessBias; + internal float thicknessScaleFine; + internal float thicknessBiasFine; + internal int hitRefinementSteps; + internal int maxRaySteps; + internal int resolutionScale; + internal bool reflectSky; + internal bool afterOpaque; + internal bool linearMarching; + } + + public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData) + { + var settings = VolumeManager.instance.stack.GetComponent(); + + UniversalCameraData cameraData = frameData.Get(); + UniversalResourceData resourceData = frameData.Get(); + + // Create the texture handles... + CreateRenderTextureHandles(renderGraph, + resourceData, + settings, + out TextureHandle ssrTexture, + out TextureHandle blurTexture, + out TextureHandle upscaleTexture, + out TextureHandle mipGenTexture, + out TextureHandle finalTexture, + out TextureHandle depthPyramidTexture); + + // Get input resources. + SharedSSRData ssrData = frameData.GetOrCreate(); + TextureHandle cameraDepthTexture = resourceData.cameraDepthTexture; + TextureHandle cameraNormalsTexture = resourceData.cameraNormalsTexture; + TextureHandle cameraColorTexture = resourceData.cameraColor; + TextureHandle motionVectorColorTexture = resourceData.motionVectorColor; + TextureHandle smoothnessTexture = settings.ShouldRenderTransparents() ? ssrData.normalTransparentTexture : cameraNormalsTexture; + if (settings.ShouldRenderTransparents()) + { + cameraDepthTexture = ssrData.depthTransparentTexture; + cameraNormalsTexture = ssrData.normalTransparentTexture; + } + + using (new RenderGraphProfilingScope(renderGraph, m_ProfilingSampler)) + { + if (!settings.ShouldUseLinearMarching()) + { + using (new RenderGraphProfilingScope(renderGraph, m_DepthPyramidSampler)) + { + renderGraph.AddBlitPass(cameraDepthTexture, depthPyramidTexture, new(1f, 2f), Vector2.zero, filterMode: BlitFilterMode.ClampNearest, passName: "Copy depth to mip 0"); + m_PackedMipChainInfo.ComputePackedMipChainInfo(new Vector2Int(cameraData.cameraTargetDescriptor.width / (int)settings.resolution.value, cameraData.cameraTargetDescriptor.height / (int)settings.resolution.value), 0); + m_MipGenerator.RenderMinDepthPyramid(renderGraph, depthPyramidTexture, ref m_PackedMipChainInfo); + } + } + + using (var builder = renderGraph.AddRasterRenderPass("SSR - Main Pass", out var passData)) + { + // Shader keyword changes are considered as global state modifications + builder.AllowGlobalStateModification(true); + + // Set required pass data. + passData.cameraData = cameraData; + passData.afterOpaque = m_AfterOpaque; + passData.linearMarching = settings.ShouldUseLinearMarching(); + passData.minimumSmoothness = settings.minimumSmoothness.value; + passData.smoothnessFadeStart = settings.smoothnessFadeStart.value; + passData.normalFade = settings.normalFade.value; + passData.screenEdgeFade = Mathf.Max(0.001f, settings.screenEdgeFadeDistance.value * 0.5f); + passData.reflectSky = settings.reflectSky.value; + passData.hitRefinementSteps = settings.hitRefinementSteps.value; + passData.maxRayLength = settings.maxRayLength.value; + passData.rayLengthFade = settings.rayLengthFade.value; + passData.maxRaySteps = settings.maxRaySteps.value; + passData.resolutionScale = (int)settings.resolution.value; + passData.material = m_Material; + passData.localKeywords = m_LocalKeywords; + passData.mipsInfo = m_PackedMipChainInfo; + passData.cameraColor = cameraColorTexture; + passData.cameraDepth = cameraDepthTexture; + passData.ssrTexture = ssrTexture; + passData.cameraNormalsTexture = cameraNormalsTexture; + passData.smoothnessTexture = smoothnessTexture; + passData.blackTexture = (TextureXR.slices > 1 && TextureXR.initialized) ? renderGraph.defaultResources.blackTextureXR : renderGraph.defaultResources.blackTexture; + CalculateThicknessScaleAndBias(cameraData.camera.nearClipPlane, cameraData.camera.farClipPlane, settings.objectThickness.value, + out passData.thicknessScale, out passData.thicknessBias); + CalculateThicknessScaleAndBias(cameraData.camera.nearClipPlane, cameraData.camera.farClipPlane, settings.objectThickness.value * settings.finalThicknessMultiplier.value, + out passData.thicknessScaleFine, out passData.thicknessBiasFine); + + // Set optional input textures to black by default. + passData.lastFrameCameraColor = passData.blackTexture; + passData.motionVectorColor = passData.blackTexture; + passData.depthPyramidTexture = passData.blackTexture; + + // Declare required input textures. + builder.SetRenderAttachment(passData.ssrTexture, 0, AccessFlags.ReadWrite); + builder.UseTexture(passData.cameraDepth); + builder.UseTexture(passData.cameraColor); + builder.UseTexture(passData.cameraNormalsTexture); + builder.UseTexture(passData.smoothnessTexture); + builder.UseTexture(passData.blackTexture); + + // If we are using HiZ marching, set the depth pyramid texture. + if (!settings.ShouldUseLinearMarching()) + { + passData.depthPyramidTexture = depthPyramidTexture; + builder.UseTexture(passData.depthPyramidTexture); + } + + // If AfterOpaque=false, set the motion vector and last frame color textures. + // When AfterOpaque=true, we use the current frame color instead, and need no motion vectors. + if (!passData.afterOpaque && cameraData.historyManager != null) + { + int multipassId = 0; +#if ENABLE_VR && ENABLE_XR_MODULE + multipassId = cameraData.xr.multipassId; +#endif + + // If we are rendering transparents in SSR, we want the last frame color to include transparents. + // Otherwise, we want last frame color before rendering transparents. + RTHandle historyTexture; + if (settings.ShouldRenderTransparents()) + { + cameraData.historyManager.RequestAccess(); + RawColorHistory history = cameraData.historyManager.GetHistoryForRead(); + historyTexture = history?.GetPreviousTexture(multipassId); + } + else + { + cameraData.historyManager.RequestAccess(); + BeforeTransparentsColorHistory history = cameraData.historyManager.GetHistoryForRead(); + historyTexture = history?.GetPreviousTexture(multipassId); + } + + if (historyTexture != null) + { + passData.lastFrameCameraColor = renderGraph.ImportTexture(historyTexture); + builder.UseTexture(passData.lastFrameCameraColor); + } + + // We also need motion vectors to reproject. + if (input.HasFlag(ScriptableRenderPassInput.Motion)) + { + passData.motionVectorColor = motionVectorColorTexture; + builder.UseTexture(passData.motionVectorColor); + } + } + + // If running before opaque pass, we need to export the SSR texture as a global uniform, + // so it can be sampled in the opaque pass. + if (!passData.afterOpaque) + { + builder.UseTexture(finalTexture, AccessFlags.ReadWrite); + builder.SetGlobalTextureAfterPass(finalTexture, ShaderConstants._ScreenSpaceReflectionFinalTexture); + } + + builder.SetRenderFunc(static (ssrData, rgContext) => + { + SetupKeywordsAndParameters(ref ssrData); + + var cmd = rgContext.cmd; + ssrData.material.SetVector(ShaderConstants._SourceSize, PostProcessUtils.CalcShaderSourceSize(ssrData.cameraColor)); + + ssrData.material.SetTexture(ShaderConstants._CameraDepthTexture, ssrData.cameraDepth); + if (ssrData.afterOpaque) + ssrData.material.SetTexture(ShaderConstants._CameraColorTexture, ssrData.cameraColor); + // Somehow this texture can be null even when TextureHandle.IsValid() is true, guard against that. + else if (((RTHandle)ssrData.lastFrameCameraColor)?.rt == null) + ssrData.material.SetTexture(ShaderConstants._CameraColorTexture, ssrData.blackTexture); + else + ssrData.material.SetTexture(ShaderConstants._CameraColorTexture, ssrData.lastFrameCameraColor); + + ssrData.material.SetTexture(ShaderConstants._CameraNormalsTexture, ssrData.cameraNormalsTexture); + ssrData.material.SetTexture(ShaderConstants._SmoothnessTexture, ssrData.smoothnessTexture); + ssrData.material.SetTexture(ShaderConstants._MotionVectorColorTexture, ssrData.motionVectorColor); + + // Main SSR Pass + Blitter.BlitTexture(cmd, ssrData.ssrTexture, new Vector4(1, 1, 0, 0), ssrData.material, (int)ShaderPasses.Reflection); + + if (!ssrData.afterOpaque) + { + // We only want URP shaders to sample SSR if After Opaque is disabled... + cmd.SetKeyword(ShaderGlobalKeywords.ScreenSpaceReflection, true); + cmd.SetGlobalVector(ShaderConstants._ReflectionParam, new Vector4(1f, ssrData.minimumSmoothness, ssrData.smoothnessFadeStart, 0f)); + } + }); + } + + // Upscale pass. + TextureHandle fullResSSRTexture = ssrTexture; + using (new RenderGraphProfilingScope(renderGraph, m_UpscalingSampler)) + { + if (settings.resolution != ScreenSpaceReflectionVolumeSettings.Resolution.Full) + { + fullResSSRTexture = upscaleTexture; + + if (settings.upscalingMethod == UpscalingMethod.None) + { + renderGraph.AddBlitPass(ssrTexture, upscaleTexture, Vector2.one, Vector2.zero, passName: "Nearest", filterMode: RenderGraphModule.Util.RenderGraphUtils.BlitFilterMode.ClampNearest); + } + else if (settings.upscalingMethod == UpscalingMethod.Kawase) + { + var blitParam = new BlitMaterialParameters(ssrTexture, upscaleTexture, Vector2.one, Vector2.zero, m_Material, (int)ShaderPasses.KawaseBlur); + renderGraph.AddBlitPass(blitParam, passName: "KawaseBlur"); + } + else if (settings.upscalingMethod == UpscalingMethod.Gaussian) + { + var blitParam = new BlitMaterialParameters(ssrTexture, blurTexture, Vector2.one, Vector2.zero, m_Material, (int)ShaderPasses.GaussianBlurHorizontal); + renderGraph.AddBlitPass(blitParam, passName: "GaussianBlurHorizontal"); + blitParam = new BlitMaterialParameters(blurTexture, upscaleTexture, Vector2.one, Vector2.zero, m_Material, (int)ShaderPasses.GaussianBlurVertical); + renderGraph.AddBlitPass(blitParam, passName: "GaussianBlurVertical"); + } + else if (settings.upscalingMethod == UpscalingMethod.Bilateral) + { + var blitParam = new BlitMaterialParameters(ssrTexture, blurTexture, Vector2.one, Vector2.zero, m_Material, (int)ShaderPasses.BilateralBlurHorizontal); + renderGraph.AddBlitPass(blitParam, passName: "BilateralBlurHorizontal"); + blitParam = new BlitMaterialParameters(blurTexture, ssrTexture, Vector2.one, Vector2.zero, m_Material, (int)ShaderPasses.BilateralBlurVertical); + renderGraph.AddBlitPass(blitParam, passName: "BilateralBlurVertical"); + + blitParam = new BlitMaterialParameters(ssrTexture, upscaleTexture, Vector2.one, Vector2.zero, m_Material, (int)ShaderPasses.BilateralBlurFinal); + renderGraph.AddBlitPass(blitParam, passName: "BilateralBlurFinal"); + } + } + } + + // Final blit pass. + using (new RenderGraphProfilingScope(renderGraph, m_FinalBlitSampler)) + { + var viewportSizeWithScale = new Vector2Int(cameraData.cameraTargetDescriptor.width, cameraData.cameraTargetDescriptor.height); + if (m_AfterOpaque) + { + TextureHandle textureToBlit = fullResSSRTexture; + if (settings.ShouldUseGaussianBlurRoughness()) + { + textureToBlit = mipGenTexture; + m_MipGenerator.RenderColorGaussianPyramid(renderGraph, viewportSizeWithScale, fullResSSRTexture, mipGenTexture); + } + var blitParam = new BlitMaterialParameters(textureToBlit, finalTexture, Vector2.one, Vector2.zero, m_Material, (int)ShaderPasses.BlitAfterOpaque); + renderGraph.AddBlitPass(blitParam, passName: "Final blit"); + } + else + { + if (settings.ShouldUseGaussianBlurRoughness()) + m_MipGenerator.RenderColorGaussianPyramid(renderGraph, viewportSizeWithScale, fullResSSRTexture, finalTexture); + else + { + renderGraph.AddCopyPass(fullResSSRTexture, finalTexture, passName: "Final blit"); + } + } + } + } + } + + static void SetupKeywordsAndParameters(ref ScreenSpaceReflectionPassData data) + { + UniversalCameraData cameraData = data.cameraData; +#if ENABLE_VR && ENABLE_XR_MODULE + int eyeCount = cameraData.xr.enabled && cameraData.xr.singlePassEnabled ? 2 : 1; +#else + int eyeCount = 1; +#endif + for (int eyeIndex = 0; eyeIndex < eyeCount; eyeIndex++) + { + Matrix4x4 view = cameraData.GetViewMatrix(eyeIndex); + Matrix4x4 proj = cameraData.GetGPUProjectionMatrix(true, eyeIndex); + data.cameraProjections[eyeIndex] = proj; + data.cameraInverseProjections[eyeIndex] = proj.inverse; + data.cameraViews[eyeIndex] = view; + data.cameraInverseViewProjections[eyeIndex] = (proj * view).inverse; + } + + data.material.SetVector(ShaderConstants._ProjectionParams2, new Vector4(1.0f / cameraData.camera.nearClipPlane, 0.0f, 0.0f, 0.0f)); + data.material.SetMatrixArray(ShaderConstants._CameraProjections, data.cameraProjections); + data.material.SetMatrixArray(ShaderConstants._CameraInverseProjections, data.cameraInverseProjections); + data.material.SetMatrixArray(ShaderConstants._CameraViews, data.cameraViews); + data.material.SetMatrixArray(ShaderConstants._CameraInverseViewProjections, data.cameraInverseViewProjections); + data.material.SetVector(ShaderConstants._MinimumSmoothnessAndFadeStart, new Vector4(data.minimumSmoothness, data.smoothnessFadeStart)); + data.material.SetVector(ShaderConstants._ScreenEdgeFadeAndViewConeDot, new Vector4(data.screenEdgeFade, 1.0f - data.screenEdgeFade, 2.0f * data.normalFade - 1.0f)); + data.material.SetInteger(ShaderConstants._ReflectSky, data.reflectSky ? 1 : 0); + data.material.SetInteger(ShaderConstants._HitRefinementSteps, data.hitRefinementSteps); + data.material.SetVector(ShaderConstants._MaxRayLength, new Vector4(data.maxRayLength, data.maxRayLength - Math.Max(0.01f, data.rayLengthFade))); + data.material.SetInteger(ShaderConstants._MaxRaySteps, data.maxRaySteps); + data.material.SetInteger(ShaderConstants._Downsample, data.resolutionScale); + data.material.SetVector(ShaderConstants._ThicknessScaleAndBias, new Vector4(data.thicknessScale, data.thicknessBias, data.thicknessScaleFine, data.thicknessBiasFine)); + + if (!data.linearMarching) + { + for (int i = 0; i < data.mipsInfo.mipLevelCount; i++) + { + data.depthPyramidMipOffsets[i] = new Vector4(data.mipsInfo.mipLevelOffsets[i].x, data.mipsInfo.mipLevelOffsets[i].y, 0, 0); + } + + data.material.SetVectorArray(ShaderConstants._DepthPyramidMipLevelOffsets, data.depthPyramidMipOffsets); + data.material.SetInteger(ShaderConstants._SsrDepthPyramidMaxMip, data.mipsInfo.mipLevelCount); + data.material.SetTexture(ShaderConstants._SsrDepthPyramid, data.depthPyramidTexture); + } + + CoreUtils.SetKeyword(data.material, data.localKeywords.hiZTraceKeyword, !data.linearMarching); + CoreUtils.SetKeyword(data.material, data.localKeywords.refineDepthKeyword, data.hitRefinementSteps > 0); + CoreUtils.SetKeyword(data.material, data.localKeywords.useMotionVectorsKeyword, !data.afterOpaque && !cameraData.isSceneViewCamera); + } + + // Instead of calculating the 'floor' depth by adding a constant thickness to the linear depth from the depth buffer, we treat thickness as a multiplier + // on the linear depth, i.e. linearFloorDepth = (1.0 + thickness) * linearDepth. To avoid converting to/from linear depth during marching, we precalculate + // a scale and bias on the device depth which lets us do the comparison on it directly. + private void CalculateThicknessScaleAndBias(float nearClip, float farClip, float thickness, out float thicknessScale, out float thicknessBias) + { + // Derivation below. 'b' is the floor device depth, 'd' is device depth, 'f' and 'n' are the far and near clip, and 'k_s', 'k_b' are the scale and bias. + // b = DeviceDepth((1 + thickness) * LinearDepth(d)) + // b = ((f - n) * d + n * (1 - (1 + thickness))) / ((f - n) * (1 + thickness)) + // b = ((f - n) * d - n * thickness) / ((f - n) * (1 + thickness)) + // b = d / (1 + thickness) - n / (f - n) * (thickness / (1 + thickness)) + // b = d * k_s + k_b + + // For non-reversed-Z (OpenGL), the derivation of thicknessScale is the same, but the derivation of thicknessBias becomes: + // thicknessBiasOpenGL = farClip / (farClip - nearClip) * (thickness * thicknessScale) + + thicknessScale = 1.0f / (1.0f + thickness); + if (SystemInfo.usesReversedZBuffer) + thicknessBias = -nearClip / (farClip - nearClip) * (thickness * thicknessScale); + else + thicknessBias = farClip / (farClip - nearClip) * (thickness * thicknessScale); + } + + private void CreateRenderTextureHandles( + RenderGraph renderGraph, + UniversalResourceData resourceData, + ScreenSpaceReflectionVolumeSettings settings, + out TextureHandle ssrTexture, + out TextureHandle blurTexture, + out TextureHandle upscaleTexture, + out TextureHandle mipGenTexture, + out TextureHandle finalTexture, + out TextureHandle depthPyramidTexture) + { + bool needRoughnessMips = settings.roughReflections.value != RoughReflectionsQuality.Disabled; + bool boxBlurRoughness = settings.roughReflections.value == RoughReflectionsQuality.BoxBlur; + + TextureDesc cameraDesc = resourceData.cameraColor.GetDescriptor(renderGraph); + bool useHdrRendering = GraphicsFormatUtility.IsHDRFormat(cameraDesc.format); + GraphicsFormat colorFormat = useHdrRendering ? GraphicsFormat.R16G16B16A16_SFloat : GraphicsFormat.R8G8B8A8_UNorm; + + TextureDesc fullResWithMips = cameraDesc; + fullResWithMips.format = colorFormat; + fullResWithMips.msaaSamples = MSAASamples.None; + fullResWithMips.useMipMap = needRoughnessMips; + fullResWithMips.autoGenerateMips = boxBlurRoughness; + fullResWithMips.enableRandomWrite = SystemInfo.supportsComputeShaders; + + TextureDesc fullResNoMips = fullResWithMips; + fullResNoMips.useMipMap = false; + + TextureDesc lowResWithMips = cameraDesc; + lowResWithMips.format = colorFormat; + lowResWithMips.msaaSamples = MSAASamples.None; + lowResWithMips.useMipMap = needRoughnessMips; + lowResWithMips.autoGenerateMips = boxBlurRoughness; + lowResWithMips.enableRandomWrite = false; + lowResWithMips.width /= (int)settings.resolution.value; + lowResWithMips.height /= (int)settings.resolution.value; + + TextureDesc lowResNoMips = lowResWithMips; + lowResNoMips.useMipMap = false; + + // Main output texture for SSR pass. Potentially low res. Only needs mips if we are relying on automips rather than gaussian mipchain, so there is no mipGenTexture. + TextureDesc ssrTextureDescriptor = boxBlurRoughness ? lowResWithMips : lowResNoMips; + ssrTexture = UniversalRenderer.CreateRenderGraphTexture(renderGraph, ssrTextureDescriptor, "_SSR_ReflectionTexture", false, Color.clear, FilterMode.Bilinear); + + // Temporary texture for bilateral and gaussian blur. No mips. + bool gaussian = settings.upscalingMethod.value == UpscalingMethod.Gaussian; + bool bilateral = settings.upscalingMethod.value == UpscalingMethod.Bilateral; + if (settings.resolution != ScreenSpaceReflectionVolumeSettings.Resolution.Full && (gaussian || bilateral)) + blurTexture = UniversalRenderer.CreateRenderGraphTexture(renderGraph, lowResNoMips, "_SSR_BlurTexture", false, Color.clear, FilterMode.Bilinear); + else + blurTexture = TextureHandle.nullHandle; + + // Temporary texture storing output of upscale. Only needs mips if we are relying on automips rather than gaussian mipchain, so there is no mipGenTexture. + TextureDesc upscaleTextureDescriptor = boxBlurRoughness ? fullResWithMips : fullResNoMips; + if (settings.resolution != ScreenSpaceReflectionVolumeSettings.Resolution.Full) + upscaleTexture = UniversalRenderer.CreateRenderGraphTexture(renderGraph, upscaleTextureDescriptor, "_SSR_UpscaleTexture", false, Color.clear, FilterMode.Bilinear); + else + upscaleTexture = TextureHandle.nullHandle; + + // Temporary texture storing mipchain from color pyramid generator for rough reflections. Full res, with mips. + // Only needed in AfterOpaque, otherwise mips generated directly to final texture. + if (settings.ShouldUseGaussianBlurRoughness() && m_AfterOpaque) + mipGenTexture = UniversalRenderer.CreateRenderGraphTexture(renderGraph, fullResWithMips, "_SSR_MipGenTexture", false, Color.clear, FilterMode.Bilinear); + else + mipGenTexture = TextureHandle.nullHandle; + + // Final texture. If after opaque, this is the screen target, otherwise a persistent texture with mips. + finalTexture = m_AfterOpaque ? resourceData.activeColorTexture : UniversalRenderer.CreateRenderGraphTexture(renderGraph, fullResWithMips, k_ScreenSpaceReflectionTextureName, false, Color.clear, FilterMode.Bilinear); + + // Depth pyramid for Hi-Z tracing. + if (!settings.ShouldUseLinearMarching()) + { + // Base format on precision of input depth. + // If the selected format isn't supported as UAV, try to fall back to a format with wider support. + TextureDesc depthDesc = resourceData.cameraDepthTexture.GetDescriptor(renderGraph); + GraphicsFormat depthFormat = depthDesc.format; + if (GraphicsFormatUtility.IsDepthFormat(depthDesc.format)) + depthFormat = GraphicsFormatUtility.GetDepthBits(depthDesc.format) > 16 ? GraphicsFormat.R32_SFloat : GraphicsFormat.R16_SFloat; + if (!SystemInfo.IsFormatSupported(depthFormat, GraphicsFormatUsage.LoadStore)) + depthFormat = GraphicsFormat.R32_SFloat; + if (!SystemInfo.IsFormatSupported(depthFormat, GraphicsFormatUsage.LoadStore)) + depthFormat = GraphicsFormat.R32G32B32A32_SFloat; + + TextureDesc depthPyramidDesc = cameraDesc; + depthPyramidDesc.height *= 2; + depthPyramidDesc.format = depthFormat; + depthPyramidDesc.msaaSamples = MSAASamples.None; + depthPyramidDesc.useMipMap = false; + depthPyramidDesc.autoGenerateMips = false; + depthPyramidDesc.enableRandomWrite = true; + depthPyramidDesc.width /= (int)settings.resolution.value; + depthPyramidDesc.height /= (int)settings.resolution.value; + depthPyramidTexture = UniversalRenderer.CreateRenderGraphTexture(renderGraph, depthPyramidDesc, "_SSR_DepthPyramid", false, Color.clear, FilterMode.Point); + } + else + depthPyramidTexture = TextureHandle.nullHandle; + } + + /// + public override void OnCameraCleanup(CommandBuffer cmd) + { + if (cmd == null) + throw new ArgumentNullException(nameof(cmd)); + + if (!m_AfterOpaque) + cmd.SetKeyword(ShaderGlobalKeywords.ScreenSpaceReflection, false); + } + } +} +#endif diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPass.cs.meta b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPass.cs.meta new file mode 100644 index 00000000000..a59cdc7fca9 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPass.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0953ad13244b62d44989cf390cd1a2c3 \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPersistentResources.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPersistentResources.cs new file mode 100644 index 00000000000..63654f65406 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPersistentResources.cs @@ -0,0 +1,28 @@ +using System; + +namespace UnityEngine.Rendering.Universal +{ + [Serializable] + [SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))] + [Categorization.CategoryInfo(Name = "R: SSR Resources", Order = 1010)] + [Categorization.ElementInfo(Order = 0)] + class ScreenSpaceReflectionPersistentResources : IRenderPipelineResources + { + [SerializeField] [ResourcePath("Shaders/Utils/ComputeScreenSpaceReflection.shader")] + Shader m_Shader; + + public Shader Shader + { + get => m_Shader; + set => this.SetValueAndNotify(ref m_Shader, value); + } + + public bool isAvailableInPlayerBuild => true; + + [SerializeField] [HideInInspector] + int m_Version = 0; + + /// Current version of the resource container. Used only for upgrading a project. + public int version => m_Version; + } +} diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPersistentResources.cs.meta b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPersistentResources.cs.meta new file mode 100644 index 00000000000..ebf0636b4f9 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionPersistentResources.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7d889ceca5f694540a4607aa3c632402 \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionRendererFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionRendererFeature.cs new file mode 100644 index 00000000000..165157c34cb --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionRendererFeature.cs @@ -0,0 +1,109 @@ +#if URP_SCREEN_SPACE_REFLECTION +namespace UnityEngine.Rendering.Universal +{ + /// + /// The class for the SSR renderer feature. + /// + [SupportedOnRenderer(typeof(UniversalRendererData))] + [DisallowMultipleRendererFeature("Screen Space Reflection")] + [Tooltip("The Screen Space Reflection produces realtime reflections without the need for reflection probes.")] + public class ScreenSpaceReflectionRendererFeature : ScriptableRendererFeature + { + /// Whether to apply screen space reflections after the opaque pass or before the opaque pass. + [Tooltip("Whether to apply screen space reflections after the opaque pass or before the opaque pass. Enabling this feature may improve performance on low-end platforms, but will result in less physically correct reflections.")] + public bool afterOpaque; + + ScreenSpaceReflectionDepthNormalOnlyTransparentPass m_TransparentDepthNormalPass = null; + ScreenSpaceReflectionPass m_SSRPass = null; + + Shader m_Shader = null; + Material m_Material = null; + + /// + public override void Create() + { + if (m_SSRPass == null) + m_SSRPass = new ScreenSpaceReflectionPass(); + } + + /// + protected override void Dispose(bool disposing) + { + m_SSRPass?.Dispose(); + m_TransparentDepthNormalPass = null; + m_SSRPass = null; + CoreUtils.Destroy(m_Material); + } + + /// + public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData) + { + var universalRenderingData = renderingData.universalRenderingData; + var universalCameraData = renderingData.frameData.Get(); + + if (UniversalRenderer.IsOffscreenDepthTexture(universalCameraData)) + return; + + // Currently no orthographic support, so ignore these cameras. + if (universalCameraData.camera.orthographic) + return; + + var settings = VolumeManager.instance.stack.GetComponent(); + if (settings.mode == ScreenSpaceReflectionVolumeSettings.ReflectionMode.Disabled) + return; + + if (!TryPrepareResources(universalRenderingData.transparentLayerMask, settings)) + return; + + if (!settings.linearMarching.value && !SystemInfo.supportsComputeShaders) + Debug.LogWarning("Screen Space Reflection settings are incompatible with the current platform. Linear Marching must be enabled on platforms without computer shader support. Falling back to linear marching."); + + bool shouldAdd = m_SSRPass.Setup(renderer, m_Material, afterOpaque, universalRenderingData, universalCameraData.cameraType); + if (shouldAdd) + { + if (settings.ShouldRenderTransparents()) + { + var renderPassEvent = afterOpaque ? RenderPassEvent.AfterRenderingTransparents : RenderPassEvent.AfterRenderingPrePasses; + m_TransparentDepthNormalPass.UpdateRenderPassEvent(renderPassEvent); + renderer.EnqueuePass(m_TransparentDepthNormalPass); + } + + renderer.EnqueuePass(m_SSRPass); + } + } + + bool TryPrepareResources(LayerMask transparentLayerMask, ScreenSpaceReflectionVolumeSettings settings) + { + if (settings.ShouldRenderTransparents()) + { + if (m_TransparentDepthNormalPass == null) + m_TransparentDepthNormalPass = new(RenderPassEvent.AfterRenderingPrePasses, RenderQueueRange.transparent, transparentLayerMask); + } + + if (m_Shader == null) + { + if (!GraphicsSettings.TryGetRenderPipelineSettings(out var ssrPersistentResources)) + { + Debug.LogErrorFormat( + $"Couldn't find the required resources for the {nameof(ScreenSpaceReflectionRendererFeature)}. If this exception appears in the Player, make sure at least one {nameof(ScreenSpaceReflectionRendererFeature)} is enabled or adjust your stripping settings."); + return false; + } + + m_Shader = ssrPersistentResources.Shader; + } + + if (m_Material == null && m_Shader != null) + m_Material = CoreUtils.CreateEngineMaterial(m_Shader); + + if (m_Material == null) + { + Debug.LogError($"{GetType().Name}.AddRenderPasses(): Missing material. {name} render pass will not be added."); + return false; + } + + return true; + + } + } +} +#endif diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionRendererFeature.cs.meta b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionRendererFeature.cs.meta new file mode 100644 index 00000000000..e5897634f20 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionRendererFeature.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: fb9f2fe3baf0e8c46bf390df937e6187 \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionVolumeSettings.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionVolumeSettings.cs new file mode 100644 index 00000000000..5f978723706 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionVolumeSettings.cs @@ -0,0 +1,130 @@ +#if URP_SCREEN_SPACE_REFLECTION +using System; + +namespace UnityEngine.Rendering.Universal +{ + /// + /// A volume component that holds settings for the Screen Space Reflections Renderer Feature. + /// + [Serializable, VolumeComponentMenu("Lighting/Screen Space Reflection"), SupportedOnRenderPipeline] + [DisplayInfo(name = "Screen Space Reflection")] + public class ScreenSpaceReflectionVolumeSettings : VolumeComponent + { + /// + /// An enum specifying which resolution to render Screen Space Reflections at. + /// + public enum Resolution + { + Full = 1, + Half = 2, + Quarter = 4, + } + + /// + /// An enum specifying which technique to use for upscaling Screen Space Reflections. + /// + public enum UpscalingMethod + { + None, + Kawase, + Gaussian, + Bilateral, + } + + /// + /// An enum specifying which quality to use for Screen Space Reflections. + /// + public enum RoughReflectionsQuality + { + Disabled, + BoxBlur, + GaussianBlur, + } + + /// + /// An enum specifying which objects to reflect using Screen Space Reflections. + /// + public enum ReflectionMode + { + Disabled, + OpaquesOnly, + OpaquesAndTransparents, + } + + /// The mode determining which objects to reflect using Screen Space Reflections. + [Tooltip("The mode determining which objects to reflect using Screen Space Reflections. 'Opaques Only' will only render opaque objects in reflections, while 'Opaques And Transparents' will also render transparent objects in reflections.")] + public EnumParameter mode = new(ReflectionMode.OpaquesOnly); + + /// The resolution to render Screen Space Reflections at. + [Tooltip("The resolution to render Screen Space Reflections at. Lower values will yield better performance, but lower quality.")] + public EnumParameter resolution = new(Resolution.Full); + + /// The technique to use for upscaling Screen Space Reflections. + [Tooltip("The method to use for upscaling the low resolution SSR texture. 'Kawase' is the most performant method, followed by 'Gaussian', and finally 'Bilateral'.")] + public EnumParameter upscalingMethod = new(UpscalingMethod.Bilateral); + + /// Whether to use linear marching to calculate Screen Space Reflections, rather than hierarchical depth buffer marching. + [Tooltip("Whether to use linear marching to calculate Screen Space Reflections, rather than hierarchical depth buffer marching. With the option disabled, Unity generates a depth pyramid and uses its for hierarchical marching. This is more accurate, but may be less performant on low-end devices.")] + public BoolParameter linearMarching = new(false); + + /// Amount of binary search steps applied at the end of the ray to refine hit results, reducing stair-stepping artifacts and gaps in reflections caused by linear marching, where initial steps may be imprecise and miss fine details. + [Tooltip("Amount of binary search steps applied at the end of the ray to refine hit results, reducing stair-stepping artifacts and gaps in reflections caused by linear marching, where initial steps may be imprecise and miss fine details.")] + public MinIntParameter hitRefinementSteps = new(4,0); + + /// Multiplies the regular thickness to compute a finer value, used with additional refinement steps to achieve more precise hit detection. + [Tooltip("Multiplies the regular thickness to compute a finer value, used with additional refinement steps to achieve more precise hit detection.")] + public ClampedFloatParameter finalThicknessMultiplier = new(0.25f, 0.0f, 1f); + + /// Whether to enable rough reflections by blurring the reflected color. + [Tooltip("Whether to enable rough reflections by blurring the reflected color. Disabling will improve performance, but all reflections will be mirror-like.")] + public EnumParameter roughReflections = new(RoughReflectionsQuality.GaussianBlur); + + /// The minimum amount of surface smoothness at which Screen Space Reflections are used. + [Tooltip("The minimum amount of surface smoothness at which Screen Space Reflections are used. Higher values will result in less objects receiving Screen Space Reflections.")] + public ClampedFloatParameter minimumSmoothness = new(0.05f, 0.0f, 1.0f); + + /// The smoothness value at which the smoothness-controlled fade out starts. + [Tooltip("The smoothness value at which the smoothness-controlled fade out starts. The fade is in the range [Min Smoothness, Smoothness Fade Start].")] + public ClampedFloatParameter smoothnessFadeStart = new(0.1f, 0.0f, 1.0f); + + /// How much to fade reflections based on the reflection normal. + [Tooltip("How much to fade reflections based on the reflection normal.")] + public ClampedFloatParameter normalFade = new(0.0f, 0.0f, 1.0f); + + /// The distance at which the reflection fades out near the edge of the screen. + [Tooltip("The distance at which the reflection fades out near the edge of the screen.")] + public ClampedFloatParameter screenEdgeFadeDistance = new(0.2f, 0.0f, 1.0f); + + /// Whether to use Screen Space Reflections to handle reflections of the sky. + [Tooltip("Whether to use SSR to handle sky reflection. If you disable this property, pixels that reflect the sky will sample from nearby reflection probes, or the skybox.")] + public BoolParameter reflectSky = new(false); + + /// The maximum distance in world space units a ray can travel. Only has an effect when linearMarching is enabled. + [Tooltip("The maximum distance in world space units a ray can travel.")] + public MinFloatParameter maxRayLength = new(10f, 0f); + + /// The fade distance in world space units before the maximum ray length. Only has an effect when linearMarching is enabled. + [Tooltip("The fade distance in world space units before the maximum ray length. Only has an effect when Linear Marching is enabled.")] + public MinFloatParameter rayLengthFade = new(1f, 0f); + + /// The maximum amount of steps to take when tracing rays. + [Tooltip("The maximum amount of steps to take when tracing rays.")] + public MinIntParameter maxRaySteps = new(48, 1); + + /// How close to the depth buffer a ray must be to be considered a hit. + [Tooltip("How close to the depth buffer a ray must be to be considered a hit. Higher values will result in less accurate reflections, but may help mitigate shimmering artifacts.")] + public ClampedFloatParameter objectThickness = new(0.02f, 0f, 1f); + + // Helpers + internal bool ShouldRenderTransparents() => mode.value == ReflectionMode.OpaquesAndTransparents; + internal bool ShouldUseGaussianBlurRoughness() => roughReflections.value == RoughReflectionsQuality.GaussianBlur; + internal bool ShouldUseLinearMarching() => linearMarching.value || !SystemInfo.supportsComputeShaders; + + // Allow listening for property changes, to support presets in the presence of undo and changing values from script etc. +#if UNITY_EDITOR + internal event Action propertyChanged; + private void OnValidate() => propertyChanged?.Invoke(); +#endif + } +} +#endif diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionVolumeSettings.cs.meta b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionVolumeSettings.cs.meta new file mode 100644 index 00000000000..40d75232d67 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceReflectionRendererFeature/ScreenSpaceReflectionVolumeSettings.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2274cd80d4e22254d98d0282578183e0 \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs index fd2e6695f6e..54f925c8b18 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs @@ -1151,6 +1151,9 @@ static void ClearRenderingState(IBaseCommandBuffer cmd) cmd.SetKeyword(ShaderGlobalKeywords.LightLayers, false); cmd.SetKeyword(ShaderGlobalKeywords.ScreenSpaceOcclusion, false); cmd.SetGlobalVector(ScreenSpaceAmbientOcclusionPass.s_AmbientOcclusionParamID, Vector4.zero); +#if URP_SCREEN_SPACE_REFLECTION + cmd.SetGlobalVector(ScreenSpaceReflectionPass.ShaderConstants._ReflectionParam, Vector4.zero); +#endif } // Scene filtering is enabled when in prefab editing mode diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs index 74d013532d9..12c63f07a06 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs @@ -664,8 +664,10 @@ protected override void ProcessRenderRequests(ScriptableRenderConte int mipLevel = standardRequest != null ? standardRequest.mipLevel : singleRequest.mipLevel; int slice = standardRequest != null ? standardRequest.slice : singleRequest.slice; int face = standardRequest != null ? (int)standardRequest.face : (int)singleRequest.face; + bool isPreview = standardRequest != null ? standardRequest.isPreview : false; //store data that will be changed + var originalCameraType = camera.cameraType; var originalTarget = camera.targetTexture; //set data @@ -690,6 +692,8 @@ protected override void ProcessRenderRequests(ScriptableRenderConte temporaryRT = RenderTexture.GetTemporary(RTDesc); } + if (isPreview) + camera.cameraType = CameraType.Preview; camera.targetTexture = temporaryRT ? temporaryRT : destination; if (standardRequest != null) @@ -761,6 +765,7 @@ protected override void ProcessRenderRequests(ScriptableRenderConte } //restore data + camera.cameraType = originalCameraType; camera.targetTexture = originalTarget; Graphics.SetRenderTarget(originalTarget); RenderTexture.ReleaseTemporary(temporaryRT); @@ -787,9 +792,17 @@ public static void RenderSingleCamera(ScriptableRenderContext context, Camera ca internal static void RenderSingleCameraInternal(ScriptableRenderContext context, Camera camera, bool isLastBaseCamera = true) { UniversalAdditionalCameraData additionalCameraData = null; + #if URP_SCREEN_SPACE_REFLECTION + camera.gameObject.TryGetComponent(out additionalCameraData); + + // We need this to support screen space reflections in the scene view, as it requires color history, + // which in turn requires a UniversalAdditionalCameraData component to be present on the scene view camera. + if (camera.cameraType == CameraType.SceneView && additionalCameraData == null) + additionalCameraData = camera.gameObject.AddComponent(); + #else if (IsGameCamera(camera)) camera.gameObject.TryGetComponent(out additionalCameraData); - + #endif RenderSingleCameraInternal(context, camera, ref additionalCameraData, isLastBaseCamera); } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs index 46975110ee8..1b4244e25a6 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs @@ -914,6 +914,7 @@ internal static class ShaderGlobalKeywords public static GlobalKeyword ReflectionProbeBlending; public static GlobalKeyword ReflectionProbeAtlas; public static GlobalKeyword ReflectionProbeRotation; + public static GlobalKeyword ScreenSpaceReflection; public static GlobalKeyword SoftShadows; public static GlobalKeyword SoftShadowsLow; public static GlobalKeyword SoftShadowsMedium; @@ -937,6 +938,7 @@ internal static class ShaderGlobalKeywords public static GlobalKeyword DecalNormalBlendHigh; public static GlobalKeyword DecalLayers; public static GlobalKeyword WriteRenderingLayers; + public static GlobalKeyword WriteSmoothness; public static GlobalKeyword ScreenSpaceOcclusion; public static GlobalKeyword ScreenSpaceIrradiance; public static GlobalKeyword _SPOT; @@ -1033,6 +1035,7 @@ public static void InitializeShaderGlobalKeywords() ShaderGlobalKeywords.ReflectionProbeBlending = GlobalKeyword.Create(ShaderKeywordStrings.ReflectionProbeBlending); ShaderGlobalKeywords.ReflectionProbeAtlas = GlobalKeyword.Create(ShaderKeywordStrings.ReflectionProbeAtlas); ShaderGlobalKeywords.ReflectionProbeRotation = GlobalKeyword.Create(ShaderKeywordStrings.ReflectionProbeRotation); + ShaderGlobalKeywords.ScreenSpaceReflection = GlobalKeyword.Create(ShaderKeywordStrings.ScreenSpaceReflection); ShaderGlobalKeywords.SoftShadows = GlobalKeyword.Create(ShaderKeywordStrings.SoftShadows); ShaderGlobalKeywords.SoftShadowsLow = GlobalKeyword.Create(ShaderKeywordStrings.SoftShadowsLow); ShaderGlobalKeywords.SoftShadowsMedium = GlobalKeyword.Create(ShaderKeywordStrings.SoftShadowsMedium); @@ -1056,6 +1059,7 @@ public static void InitializeShaderGlobalKeywords() ShaderGlobalKeywords.DecalNormalBlendHigh = GlobalKeyword.Create(ShaderKeywordStrings.DecalNormalBlendHigh); ShaderGlobalKeywords.DecalLayers = GlobalKeyword.Create(ShaderKeywordStrings.DecalLayers); ShaderGlobalKeywords.WriteRenderingLayers = GlobalKeyword.Create(ShaderKeywordStrings.WriteRenderingLayers); + ShaderGlobalKeywords.WriteSmoothness = GlobalKeyword.Create(ShaderKeywordStrings.WriteSmoothness); ShaderGlobalKeywords.ScreenSpaceOcclusion = GlobalKeyword.Create(ShaderKeywordStrings.ScreenSpaceOcclusion); ShaderGlobalKeywords.ScreenSpaceIrradiance = GlobalKeyword.Create(ShaderKeywordStrings.ScreenSpaceIrradiance); ShaderGlobalKeywords._SPOT = GlobalKeyword.Create(ShaderKeywordStrings._SPOT); @@ -1153,6 +1157,9 @@ public static class ShaderKeywordStrings /// Keyword used for ReflectionProbe rotation. public const string ReflectionProbeRotation = "REFLECTION_PROBE_ROTATION"; + /// Keyword used for Screen Space Reflection (SSR). + public const string ScreenSpaceReflection = "_SCREEN_SPACE_REFLECTION"; + /// Keyword used for soft shadows. public const string SoftShadows = "_SHADOWS_SOFT"; @@ -1228,6 +1235,9 @@ public static class ShaderKeywordStrings /// Keyword used for writing Rendering Layers. public const string WriteRenderingLayers = "_WRITE_RENDERING_LAYERS"; + /// Keyword used for writing roughness to alpha channel of normals texture. + public const string WriteSmoothness = "_WRITE_SMOOTHNESS"; + /// Keyword used for low quality Subpixel Morphological Anti-aliasing (SMAA). public const string SmaaLow = "_SMAA_PRESET_LOW"; @@ -1943,6 +1953,7 @@ internal enum URPProfileId MainLightShadow, ResolveShadows, SSAO, + SSR, // PostProcessPass StopNaNs, diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs index 57d2ef3c5ab..3827697d92e 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs @@ -161,6 +161,7 @@ internal RenderingMode renderingModeActual { DrawScreenSpaceUIPass m_DrawOverlayUIPass; CopyColorPass m_HistoryRawColorCopyPass; + CopyColorPass m_HistoryBeforeTransparentsColorCopyPass; CopyDepthPass m_HistoryRawDepthCopyPass; StencilCrossFadeRenderPass m_StencilCrossFadeRenderPass; @@ -404,6 +405,7 @@ public UniversalRenderer(UniversalRendererData data) : base(data) // History generation passes for "raw color/depth". These execute only if explicitly requested by users. // VFX system particles uses these. See RawColorHistory.cs. m_HistoryRawColorCopyPass = new CopyColorPass(RenderPassEvent.BeforeRenderingPostProcessing, m_SamplingMaterial, m_BlitMaterial, customPassName: "Copy Color Raw History"); + m_HistoryBeforeTransparentsColorCopyPass = new CopyColorPass(RenderPassEvent.BeforeRenderingTransparents, m_SamplingMaterial, m_BlitMaterial, customPassName: "Copy Color History Before Transparents"); m_HistoryRawDepthCopyPass = new CopyDepthPass(RenderPassEvent.BeforeRenderingPostProcessing, copyDephPS, false, customPassName: "Copy Depth Raw History"); m_DrawOffscreenUIPass = new DrawScreenSpaceUIPass(RenderPassEvent.BeforeRenderingPostProcessing); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs index 735807ba34c..ea8c082e1bd 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs @@ -288,6 +288,8 @@ internal static void GetTextureDesc(in RenderTextureDescriptor desc, out Texture rgDesc.useDynamicScale = desc.useDynamicScale; rgDesc.useDynamicScaleExplicit = desc.useDynamicScaleExplicit; rgDesc.vrUsage = desc.vrUsage; + rgDesc.useMipMap = desc.useMipMap; + rgDesc.autoGenerateMips = desc.autoGenerateMips; } internal static TextureHandle CreateRenderGraphTexture(RenderGraph renderGraph, in TextureDesc desc, string name, bool clear, Color clearColor, @@ -538,7 +540,7 @@ private void RenderRawColorDepthHistory(RenderGraph renderGraph, UniversalCamera var colorHistory = history.GetHistoryForWrite(); if (colorHistory != null) { - colorHistory.Update(ref cameraData.cameraTargetDescriptor, xrMultipassEnabled); + colorHistory.Update(cameraData, ref cameraData.cameraTargetDescriptor, xrMultipassEnabled); if (colorHistory.GetCurrentTexture(multipassId) != null) { var colorHistoryTarget = renderGraph.ImportTexture(colorHistory.GetCurrentTexture(multipassId)); @@ -582,6 +584,36 @@ private void RenderRawColorDepthHistory(RenderGraph renderGraph, UniversalCamera } } + // Copy internal color buffer before transparents into the history. + private void RenderBeforeTransparentsColorHistory(RenderGraph renderGraph, UniversalCameraData cameraData, UniversalResourceData resourceData) + { + if (cameraData != null && cameraData.historyManager != null && resourceData != null) + { + UniversalCameraHistory history = cameraData.historyManager; + + bool xrMultipassEnabled = false; + int multipassId = 0; +#if ENABLE_VR && ENABLE_XR_MODULE + xrMultipassEnabled = cameraData.xr.enabled && !cameraData.xr.singlePassEnabled; + multipassId = cameraData.xr.multipassId; +#endif + + if (history.IsAccessRequested() && resourceData.cameraColor.IsValid()) + { + var colorHistory = history.GetHistoryForWrite(); + if (colorHistory != null) + { + colorHistory.Update(cameraData, ref cameraData.cameraTargetDescriptor, xrMultipassEnabled); + if (colorHistory.GetCurrentTexture(multipassId) != null) + { + var colorHistoryTarget = renderGraph.ImportTexture(colorHistory.GetCurrentTexture(multipassId)); + m_HistoryBeforeTransparentsColorCopyPass.RenderToExistingTexture(renderGraph, frameData, colorHistoryTarget, resourceData.cameraColor, Downsampling.None); + } + } + } + } + } + /// /// Called before recording the render graph. Can be used to initialize resources. /// @@ -1249,6 +1281,8 @@ private void OnMainRendering(RenderGraph renderGraph, ScriptableRenderContext co } #endif + RenderBeforeTransparentsColorHistory(renderGraph, cameraData, resourceData); + #if ENABLE_ADAPTIVE_PERFORMANCE if (needTransparencyPass) #endif @@ -1871,7 +1905,7 @@ void CreateCameraNormalsTexture(RenderGraph renderGraph, TextureDesc descriptor) DepthNormalOnlyPass.k_CameraNormalsTextureName : DeferredLights.k_GBufferNames[m_DeferredLights.GBufferNormalSmoothnessIndex]; descriptor.format = !usesDeferredLighting ? DepthNormalOnlyPass.GetGraphicsFormat() : m_DeferredLights.GetGBufferFormat(m_DeferredLights.GBufferNormalSmoothnessIndex); - resourceData.cameraNormalsTexture = CreateRenderGraphTexture(renderGraph, descriptor, normalsName, true, Color.black); + resourceData.cameraNormalsTexture = CreateRenderGraphTexture(renderGraph, descriptor, normalsName, true, Color.clear); } void CreateRenderingLayersTexture(RenderGraph renderGraph, TextureDesc descriptor) diff --git a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl new file mode 100644 index 00000000000..dc1636b1272 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl @@ -0,0 +1,670 @@ +#ifndef UNIVERSAL_SSR_INCLUDED +#define UNIVERSAL_SSR_INCLUDED + +// Includes +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderVariablesFunctions.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ImageBasedLighting.hlsl" +#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl" + +// Textures & Samplers +TEXTURE2D_X(_CameraColorTexture); +SAMPLER(sampler_CameraColorTexture); + +TEXTURE2D_X(_SmoothnessTexture); +SAMPLER(sampler_SmoothnessTexture); + +TEXTURE2D_X(_MotionVectorColorTexture); +SAMPLER(sampler_MotionVectorColorTexture); + +SAMPLER(sampler_BlitTexture); + +// Params +float4x4 _CameraInverseViewProjections[2]; +float4x4 _CameraProjections[2]; +float4x4 _CameraInverseProjections[2]; +float4x4 _CameraViews[2]; + +float4 _SourceSize; + +TYPED_TEXTURE2D_X(float, _DepthPyramid); +float4 _DepthPyramidMipLevelOffsets[15]; +int _SsrDepthPyramidMaxMip; + +// SSR Settings +float4 _MaxRayLength; +int _MaxRaySteps; +uint _Downsample; +int _HiZTrace; +int _HitRefinementSteps; +float4 _ThicknessScaleAndBias; +float4 _MinimumSmoothnessAndFadeStart; +float4 _ScreenEdgeFadeAndViewConeDot; +int _ReflectSky; + +float GetMaxRayLength() +{ + return _MaxRayLength.x; +} + +float GetRayLengthFadeStart() +{ + return _MaxRayLength.y; +} + +float GetThicknessScale() +{ + return _ThicknessScaleAndBias.x; +} + +float GetThicknessBias() +{ + return _ThicknessScaleAndBias.y; +} + +float GetThicknessScaleFine() +{ + return _ThicknessScaleAndBias.z; +} + +float GetThicknessBiasFine() +{ + return _ThicknessScaleAndBias.w; +} + +float GetViewConeDot() +{ + return _ScreenEdgeFadeAndViewConeDot.z; +} + +float2 GetScreenEdgeFade() +{ + return _ScreenEdgeFadeAndViewConeDot.xy; +} + +float GetMinimumSmoothness() +{ + return _MinimumSmoothnessAndFadeStart.x; +} + +#if defined(USING_STEREO_MATRICES) +#define unity_eyeIndex unity_StereoEyeIndex +#else +#define unity_eyeIndex 0 +#endif + +// Constants +#define SSR_TRACE_EPS 0.000488281f + +// ------------------------------------------------------------------ +// Screen Space Marching +// ------------------------------------------------------------------ +bool TraceScreenSpaceRay( + float2 startPosSS, + float startZ, + float2 endPosSS, + float endZ, + float4 screenSizeWithInverse, + out float3 rayHitPosNDC, + out int iterCount) +{ + // Calculate the step to take each iteration, and the total step count + float rayScreenDeltaX = endPosSS.x - startPosSS.x; + float rayScreenDeltaY = endPosSS.y - startPosSS.y; + float rayScreenDeltaZ = endZ - startZ; + float useDeltaX = abs(rayScreenDeltaX) >= abs(rayScreenDeltaY) ? 1.0 : 0.0; + float rayScreenDelta = min(lerp(abs(rayScreenDeltaY), abs(rayScreenDeltaX), useDeltaX), _MaxRaySteps); + float3 rayStep = float3(rayScreenDeltaX, rayScreenDeltaY, rayScreenDeltaZ) / max(rayScreenDelta, 0.001); + + // March against depth buffer with coarse steps + float3 rayPosSS = float3(startPosSS, startZ); + float rayHitT = 0; + rayHitPosNDC = 0; + float prevT = 0; + bool hitCoarse = false; + + for (iterCount = 0; iterCount < rayScreenDelta; iterCount++) + { + rayPosSS += rayStep; + + // We went offscreen, so stop + if (rayPosSS.x < 0 || rayPosSS.x > screenSizeWithInverse.z || rayPosSS.y < 0 || rayPosSS.y > screenSizeWithInverse.w) + return false; + + // How far along the ray are we in [0; 1]? + rayHitT = lerp((rayPosSS.y - startPosSS.y) / rayScreenDeltaY, (rayPosSS.x - startPosSS.x) / rayScreenDeltaX, useDeltaX); + + // Get current depth of scene at the ray position. + float rawSceneDepth = LoadSceneDepth(rayPosSS.xy * _Downsample); + + // Check if we've hit something + bool aboveBase = !COMPARE_DEVICE_DEPTH_CLOSER(rayPosSS.z, rawSceneDepth); + bool belowFloor = COMPARE_DEVICE_DEPTH_CLOSER(rayPosSS.z, rawSceneDepth * GetThicknessScale() + GetThicknessBias()); + if (aboveBase && belowFloor) + { + hitCoarse = true; + break; + } + prevT = rayHitT; + } + rayHitPosNDC = float3(rayPosSS.xy * screenSizeWithInverse.xy, rayPosSS.z); + + #ifdef _REFINE_DEPTH + if (hitCoarse) + { + // Refine depth by testing intersections at points between the last 2 coarse positions, + // using a smaller thickness value. + float t0 = prevT; + float t1 = 2.0 * rayHitT - t0; + + int step = 0; + bool hitFine = false; + for (; step < _HitRefinementSteps; step++) + { + float t = t0 + (t1 - t0) * 0.5; + + float2 candidateHitPosSS = lerp(startPosSS, endPosSS, t); + candidateHitPosSS = round(candidateHitPosSS - 0.5) + 0.5; // round to nearest texel center + float rayDepth = lerp(startZ, endZ, t); + float rawSceneDepth = LoadSceneDepth(candidateHitPosSS * _Downsample); + + bool aboveBase = !COMPARE_DEVICE_DEPTH_CLOSER(rayDepth, rawSceneDepth); + bool belowFloor = COMPARE_DEVICE_DEPTH_CLOSER(rayDepth, rawSceneDepth * GetThicknessScale() + GetThicknessBias()); + if (aboveBase && belowFloor) + { + hitFine = COMPARE_DEVICE_DEPTH_CLOSER(rayDepth, rawSceneDepth * GetThicknessScaleFine() + GetThicknessBiasFine()); + + rayHitPosNDC = float3(candidateHitPosSS * screenSizeWithInverse.xy, rayDepth); + t1 = t; + } + else + { + t0 = t; + } + } + iterCount += step; + + if (!hitFine) + return false; + } + #endif + + return hitCoarse || _ReflectSky; +} + +bool TraceScreenSpaceRayHiZ( + float2 startPosSS, + float startZ, + float2 endPosSS, + float endZ, + float2 screenSize, + out float3 rayHitPosNDC, + out int iterCount) +{ + // We start tracing from the center of the current pixel, and do so up to the far plane. + float3 rayOrigin = float3(startPosSS, startZ); + + float3 rayDir = float3(endPosSS, endZ) - rayOrigin; + float3 rcpRayDir = rcp(rayDir); + int2 rayStep = int2(rcpRayDir.x >= 0 ? 1 : 0, + rcpRayDir.y >= 0 ? 1 : 0); + float3 raySign = float3(rcpRayDir.x >= 0 ? 1 : -1, + rcpRayDir.y >= 0 ? 1 : -1, + rcpRayDir.z >= 0 ? 1 : -1); + bool rayTowardsEye = rcpRayDir.z >= 0; + + // Extend and clip the end point to the frustum. + float tMax; + { + // Shrink the frustum by half a texel for efficiency reasons. + const float halfTexel = 0.5; + + float3 bounds; + bounds.x = (rcpRayDir.x >= 0) ? screenSize.x - halfTexel : halfTexel; + bounds.y = (rcpRayDir.y >= 0) ? screenSize.y - halfTexel : halfTexel; + // If we do not want to intersect the skybox, it is more efficient to not trace too far. + float maxDepth = (_ReflectSky != 0) ? -0.00000024 : 0.00000024; // 2^-22 + bounds.z = (rcpRayDir.z >= 0) ? 1 : maxDepth; + + float3 dist = bounds * rcpRayDir - (rayOrigin * rcpRayDir); + tMax = Min3(dist.x, dist.y, dist.z); + } + + // Clamp the MIP level to give the compiler more information to optimize. + const int maxMipLevel = min(_SsrDepthPyramidMaxMip, 14); + + // Start ray marching from the next texel to avoid self-intersections. + float t; + { + // 'rayOrigin' is the exact texel center. + float2 dist = abs(0.5 * rcpRayDir.xy); + t = min(dist.x, dist.y); + } + + float3 rayPos; + + int mipLevel = 0; + iterCount = 0; + bool hit = false; + bool miss = false; + bool belowMip0 = false; // This value is set prior to entering the cell + + while (!(hit || miss) && (t <= tMax) && (iterCount < _MaxRaySteps)) + { + rayPos = rayOrigin + t * rayDir; + + // Ray position often ends up on the edge. To determine (and look up) the right cell, + // we need to bias the position by a small epsilon in the direction of the ray. + float2 sgnEdgeDist = round(rayPos.xy) - rayPos.xy; + float2 satEdgeDist = clamp(raySign.xy * sgnEdgeDist + SSR_TRACE_EPS, 0, SSR_TRACE_EPS); + rayPos.xy += raySign.xy * satEdgeDist; + + int2 mipCoord = (int2)rayPos.xy >> mipLevel; + int2 mipOffset = int2(_DepthPyramidMipLevelOffsets[mipLevel].xy); + // Bounds define 4 faces of a cube: + // 2 walls in front of the ray, and a floor and a base below it. + float4 bounds; + + bounds.xy = (mipCoord + rayStep) << mipLevel; + bounds.z = LOAD_TEXTURE2D_X_LOD(_DepthPyramid, int2(mipOffset + mipCoord), 0).r; + + // We define the depth of the base as the depth value as: + // b = DeviceDepth((1 + thickness) * LinearDepth(d)) + // b = ((f - n) * d + n * (1 - (1 + thickness))) / ((f - n) * (1 + thickness)) + // b = ((f - n) * d - n * thickness) / ((f - n) * (1 + thickness)) + // b = d / (1 + thickness) - n / (f - n) * (thickness / (1 + thickness)) + // b = d * k_s + k_b + bounds.w = bounds.z * GetThicknessScale() + GetThicknessBias(); + + float4 dist = bounds * rcpRayDir.xyzz - (rayOrigin.xyzz * rcpRayDir.xyzz); + float distWall = min(dist.x, dist.y); + float distFloor = dist.z; + float distBase = dist.w; + + // Note: 'rayPos' given by 't' can correspond to one of several depth values: + // - above or exactly on the floor + // - inside the floor (between the floor and the base) + // - below the base + bool belowFloor = !COMPARE_DEVICE_DEPTH_CLOSER(rayPos.z, bounds.z); + bool aboveBase = COMPARE_DEVICE_DEPTH_CLOSEREQUAL(rayPos.z, bounds.w); + bool insideFloor = belowFloor && aboveBase; + bool hitFloor = (t <= distFloor) && (distFloor <= distWall); + + // Game rules: + // * if the closest intersection is with the wall of the cell, switch to the coarser MIP, and advance the ray. + // * if the closest intersection is with the heightmap below, switch to the finer MIP, and advance the ray. + // * if the closest intersection is with the heightmap above, switch to the finer MIP, and do NOT advance the ray. + // Victory conditions: + // * See below. Do NOT reorder the statements! + + miss = belowMip0 && insideFloor; + hit = (mipLevel == 0) && (hitFloor || insideFloor); + belowMip0 = (mipLevel == 0) && belowFloor; + + // 'distFloor' can be smaller than the current distance 't'. + // We can also safely ignore 'distBase'. + // If we hit the floor, it's always safe to jump there. + // If we are at (mipLevel != 0) and we are below the floor, we should not move. + t = hitFloor ? distFloor : (((mipLevel != 0) && belowFloor) ? t : distWall); + rayPos.z = bounds.z; // Retain the depth of the potential intersection + + // Warning: both rays towards the eye, and tracing behind objects has linear + // rather than logarithmic complexity! This is due to the fact that we only store + // the maximum value of depth, and not the min-max. + mipLevel += (hitFloor || belowFloor || rayTowardsEye) ? -1 : 1; + mipLevel = clamp(mipLevel, 0, maxMipLevel); + + // mipLevel = 0; + + iterCount++; + } + + // Treat intersections with the sky as misses. + miss = miss || ((_ReflectSky == 0) && (rayPos.z == 0)); + hit = hit && !miss; + + rayHitPosNDC = float3(floor(rayPos.xy) / screenSize + (0.5 / screenSize), rayPos.z); + + return hit; +} + +float2 SampleMotionVector(float2 uv) +{ + return SAMPLE_TEXTURE2D_X(_MotionVectorColorTexture, sampler_MotionVectorColorTexture, uv).xy; +} + +float SampleSmoothness(float2 uv) +{ + return SAMPLE_TEXTURE2D_X(_SmoothnessTexture, sampler_SmoothnessTexture, uv).a; +} + +float4 ComputeSSR(Varyings input) : SV_Target +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + float2 positionNDC = input.texcoord; + float2 positionSS = input.positionCS.xy; + float deviceDepth = LoadSceneDepth(uint2(positionSS) * _Downsample).r; + + // If the smoothness is below our minimum, don't do any raymarching + float perceptualSmoothness = SampleSmoothness(positionNDC); + UNITY_BRANCH if (perceptualSmoothness <= GetMinimumSmoothness()) + { + #if UNITY_REVERSED_Z + float alpha = deviceDepth != 0; + #else + float alpha = deviceDepth != 1; + #endif + // Output the framebuffer color -> + // avoids bleeding black/uninitialized texels into reflections when blurring. + // If the pixel is showing skybox, output 0 alpha -> + // avoids bleeding the skybox color into reflections when blurring, which would cause haloing. + // If the pixel is showing an object, output 1 alpha -> + // avoids bleeding 0 alpha into reflections when blurring, which would cause peter-panning. + return float4(SAMPLE_TEXTURE2D_X_LOD(_CameraColorTexture, sampler_CameraColorTexture, positionNDC, 0).rgb, alpha); + } + + // Calculate ray origin and direction in view space and screen space + float3 normalWS = SampleSceneNormals(positionNDC); + float3 positionWS = ComputeWorldSpacePosition(positionNDC, deviceDepth, _CameraInverseViewProjections[unity_eyeIndex]); + float3 positionToCamWS = GetWorldSpaceNormalizeViewDir(positionWS); + float3 positionVS = mul(_CameraViews[unity_eyeIndex], float4(positionWS, 1)).xyz; + float3 rayDirWS = reflect(-positionToCamWS, normalWS); + float3 rayDirVS = SafeNormalize(mul(_CameraViews[unity_eyeIndex], float4(rayDirWS, 0)).xyz); + + // Calculate ray end position in view space and screen space + float rayLength = 1; + + #ifndef _HIZ_TRACE + // Clamp ray length such that the end point is in front of the camera. + // Not needed for Hi-Z path as there is no end point, only a direction. + rayLength = rayDirVS.z > 0 ? min(GetMaxRayLength(), -positionVS.z / rayDirVS.z * 0.999) : GetMaxRayLength(); + #endif + + float3 endPosVS = positionVS + rayDirVS * rayLength; + float3 startPosNDC = float3(positionNDC, deviceDepth); + float3 endPosNDC = ComputeNormalizedDeviceCoordinatesWithZ(endPosVS, _CameraProjections[unity_eyeIndex]); + + #ifndef _HIZ_TRACE + // Clamp ray length such that the end point is within the view frustum. + // Not needed for Hi-Z path as there is no end point, only a direction. + float3 rayDeltaNDC = endPosNDC - startPosNDC; + float rayLengthNDC = length(rayDeltaNDC); + float3 rayDirNDC = rayDeltaNDC * rcp(rayLengthNDC); + float3 maxDistanceNDC = rayDirNDC >= 0 ? (1 - startPosNDC) / rayDirNDC : -startPosNDC / rayDirNDC; + endPosNDC = startPosNDC + rayDirNDC * min(rayLengthNDC, min(maxDistanceNDC.x, min(maxDistanceNDC.y, maxDistanceNDC.z))); + #endif + + float4 screenSizeWithInverse = _BlitTexture_TexelSize; + float2 endPosSS = endPosNDC.xy * screenSizeWithInverse.zw; + + float3 rayHitPosNDC; + int iterCount; + bool hit; + #ifdef _HIZ_TRACE + hit = TraceScreenSpaceRayHiZ(positionSS, deviceDepth, endPosSS.xy, endPosNDC.z, screenSizeWithInverse.zw, rayHitPosNDC, iterCount); + #else + hit = TraceScreenSpaceRay(positionSS, deviceDepth, endPosSS.xy, endPosNDC.z, screenSizeWithInverse, rayHitPosNDC, iterCount); + #endif + + UNITY_BRANCH if (hit) + { + #ifdef _USE_MOTION_VECTORS + rayHitPosNDC.xy -= SampleMotionVector(rayHitPosNDC.xy); + #endif + + float3 hitColor = SAMPLE_TEXTURE2D_X_LOD(_CameraColorTexture, sampler_CameraColorTexture, rayHitPosNDC.xy, 0).rgb; + + // Fade rays pointing toward camera. + float viewDotRay = dot(SafeNormalize(positionVS), rayDirVS); + float viewConeDot = GetViewConeDot(); + const float normalFadeFactor = 0.1; + float fade = smoothstep(viewConeDot, viewConeDot + normalFadeFactor, viewDotRay); + + // Fade rays hitting near the max distance, if we aren't reflecting the sky. + #ifndef _HIZ_TRACE + if (!_ReflectSky) + { + float4 rayHitPosCS = ComputeClipSpacePosition(rayHitPosNDC.xy, rayHitPosNDC.z); + float4 rayHitPosVS = mul(_CameraInverseProjections[unity_eyeIndex], rayHitPosCS); + rayHitPosVS.xyz /= rayHitPosVS.w; + fade *= smoothstep(GetMaxRayLength(), GetRayLengthFadeStart(), distance(positionVS, rayHitPosVS.xyz)); + } + #endif + + // Fade rays reaching near the edge of the screen, to avoid a harsh discontinuity. + float2 edgeDist = smoothstep(0, GetScreenEdgeFade().x, rayHitPosNDC.xy) * smoothstep(1, GetScreenEdgeFade().y, rayHitPosNDC.xy); + fade *= edgeDist.x * edgeDist.y; + + return float4(hitColor, fade); + } + + // Even if we hit nothing, we output the framebuffer color (but with 0 weight). + // This provides the blur/upscale kernel with data needed to avoid blurring black into + // the reflections, which leads to ugly borders. + return float4(SAMPLE_TEXTURE2D_X_LOD(_CameraColorTexture, sampler_CameraColorTexture, positionNDC, 0).rgb, 0); +} + +// ------------------------------------------------------------------ +// Compositing for AfterOpaque mode +// ------------------------------------------------------------------ +float4 CompositeSSRAfterOpaque(Varyings input) : SV_Target +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord); + + float perceptualSmoothness = SAMPLE_TEXTURE2D_X(_SmoothnessTexture, sampler_SmoothnessTexture, uv).a; + + // Map roughness to mip level to get blur. + float perceptualRoughness = PerceptualSmoothnessToPerceptualRoughness(perceptualSmoothness); + float mipLevel = PerceptualRoughnessToMipmapLevel(perceptualRoughness); + float4 reflColor = SAMPLE_TEXTURE2D_X_LOD(_BlitTexture, sampler_TrilinearClamp, uv, mipLevel); + + // Fade out reflections with smoothness. + // Not physically correct, but we can't do much better without more data. + reflColor.a *= perceptualSmoothness; + + return reflColor; +} + +// ------------------------------------------------------------------ +// Bilateral Blur +// ------------------------------------------------------------------ +#define SAMPLE_BASEMAP(uv) float4(SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_BlitTexture, UnityStereoTransformScreenSpaceTex(uv))); + +float CompareNormal(float3 d1, float3 d2) +{ + return smoothstep(0.8, 1.0, dot(d1, d2)); +} + +// Geometry-aware separable bilateral filter +float4 BilateralBlur(const float2 uv, const float2 delta) : SV_Target +{ + float4 p0 = SAMPLE_BASEMAP(uv); + float4 p1a = SAMPLE_BASEMAP(uv - delta * 1.3846153846); + float4 p1b = SAMPLE_BASEMAP(uv + delta * 1.3846153846); + float4 p2a = SAMPLE_BASEMAP(uv - delta * 3.2307692308); + float4 p2b = SAMPLE_BASEMAP(uv + delta * 3.2307692308); + + float3 n0 = SampleSceneNormals(uv); + float3 n1a = SampleSceneNormals(uv - delta * 1.3846153846); + float3 n1b = SampleSceneNormals(uv + delta * 1.3846153846); + float3 n2a = SampleSceneNormals(uv - delta * 3.2307692308); + float3 n2b = SampleSceneNormals(uv + delta * 3.2307692308); + + float w0 = float(0.2270270270); + float w1a = CompareNormal(n0, n1a) * float(0.3162162162); + float w1b = CompareNormal(n0, n1b) * float(0.3162162162); + float w2a = CompareNormal(n0, n2a) * float(0.0702702703); + float w2b = CompareNormal(n0, n2b) * float(0.0702702703); + + float4 s = 0.0; + s += p0 * w0; + s += p1a * w1a; + s += p1b * w1b; + s += p2a * w2a; + s += p2b * w2b; + s *= rcp(w0 + w1a + w1b + w2a + w2b); + + return s; +} + +// Geometry-aware bilateral filter (single pass/small kernel) +float4 BilateralBlurSinglePass(const float2 uv, const float2 delta) +{ + float4 p0 = SAMPLE_BASEMAP(uv ); + float4 p1 = SAMPLE_BASEMAP(uv + float2(-delta.x, -delta.y)); + float4 p2 = SAMPLE_BASEMAP(uv + float2( delta.x, -delta.y)); + float4 p3 = SAMPLE_BASEMAP(uv + float2(-delta.x, delta.y)); + float4 p4 = SAMPLE_BASEMAP(uv + float2( delta.x, delta.y)); + + float3 n0 = SampleSceneNormals(uv); + float3 n1a = SampleSceneNormals(uv - delta * 1.3846153846); + float3 n1b = SampleSceneNormals(uv + delta * 1.3846153846); + float3 n2a = SampleSceneNormals(uv - delta * 3.2307692308); + float3 n2b = SampleSceneNormals(uv + delta * 3.2307692308); + + float w0 = 1.0; + float w1 = CompareNormal(n0, n1a); + float w2 = CompareNormal(n0, n1b); + float w3 = CompareNormal(n0, n2a); + float w4 = CompareNormal(n0, n2b); + + float4 s = 0.0; + s += p0 * w0; + s += p1 * w1; + s += p2 * w2; + s += p3 * w3; + s += p4 * w4; + + return s *= rcp(w0 + w1 + w2 + w3 + w4); +} + +float4 HorizontalBilateralBlur(Varyings input) : SV_Target +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + const float2 uv = input.texcoord; + const float2 delta = float2(_SourceSize.z * _Downsample, 0.0); + return BilateralBlur(uv, delta); +} + +float4 VerticalBilateralBlur(Varyings input) : SV_Target +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + const float2 uv = input.texcoord; + const float2 delta = float2(0.0, _SourceSize.w * _Downsample); + return BilateralBlur(uv, delta); +} + +float4 FinalBilateralBlur(Varyings input) : SV_Target +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + const float2 uv = input.texcoord; + const float2 delta = _SourceSize.zw * _Downsample; + return BilateralBlurSinglePass(uv, delta ); +} + +// ------------------------------------------------------------------ +// Gaussian Blur +// ------------------------------------------------------------------ +float4 GaussianBlur(float2 uv, float2 pixelOffset) +{ + float4 colOut = 0; + + // Kernel width 7 x 7 + const int stepCount = 2; + + const half gWeights[stepCount] ={ + 0.44908, + 0.05092 + }; + const half gOffsets[stepCount] ={ + 0.53805, + 2.06278 + }; + + UNITY_UNROLL + for( int i = 0; i < stepCount; i++ ) + { + float2 texCoordOffset = gOffsets[i] * pixelOffset; + float4 p1 = SAMPLE_BASEMAP(uv + texCoordOffset); + float4 p2 = SAMPLE_BASEMAP(uv - texCoordOffset); + float4 col = p1 + p2; + colOut += gWeights[i] * col; + } + + return colOut; +} + +float4 HorizontalGaussianBlur(Varyings input) : SV_Target +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + float2 uv = input.texcoord; + float2 delta = float2(_SourceSize.z * _Downsample, 0.0); + return GaussianBlur(uv, delta); +} + +float4 VerticalGaussianBlur(Varyings input) : SV_Target +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + float2 uv = input.texcoord; + float2 delta = float2(0.0, _SourceSize.w * _Downsample); + return GaussianBlur(uv, delta); +} + +// ------------------------------------------------------------------ +// Kawase Blur +// ------------------------------------------------------------------ +float4 KawaseBlurFilter(float2 texCoord, float2 pixelSize) +{ + float2 texCoordSample; + float2 halfPixelSize = pixelSize * 0.5; + float2 dUV = halfPixelSize.xy; + + float4 cOut; + + // Sample top left pixel + texCoordSample.x = texCoord.x - dUV.x; + texCoordSample.y = texCoord.y + dUV.y; + cOut = SAMPLE_BASEMAP(texCoordSample); + + // Sample top right pixel + texCoordSample.x = texCoord.x + dUV.x; + texCoordSample.y = texCoord.y + dUV.y; + cOut += SAMPLE_BASEMAP(texCoordSample); + + // Sample bottom right pixel + texCoordSample.x = texCoord.x + dUV.x; + texCoordSample.y = texCoord.y - dUV.y; + cOut += SAMPLE_BASEMAP(texCoordSample); + + // Sample bottom left pixel + texCoordSample.x = texCoord.x - dUV.x; + texCoordSample.y = texCoord.y - dUV.y; + cOut += SAMPLE_BASEMAP(texCoordSample); + + // Average + cOut *= 0.25; + + return cOut; +} + +float4 KawaseBlur(Varyings input) : SV_Target +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + float2 uv = input.texcoord; + float2 texelSize = _SourceSize.zw * _Downsample; + return KawaseBlurFilter(uv, texelSize); +} + +#endif //UNIVERSAL_SSR_INCLUDED diff --git a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl.meta b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl.meta new file mode 100644 index 00000000000..2c7bfdbb8c5 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3ea3b96bfb18c244d807bea74fe8a9d5 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl index 086680f4c94..ddfa4d612b3 100644 --- a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl +++ b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl @@ -4,6 +4,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ImageBasedLighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RealtimeLights.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SampleScreenSpaceReflection.hlsl" #define AMBIENT_PROBE_BUFFER 0 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/AmbientProbe.hlsl" @@ -421,37 +422,52 @@ half3 CalculateIrradianceFromReflectionProbes(half3 reflectVector, float3 positi half3 GlossyEnvironmentReflection(half3 reflectVector, float3 positionWS, half perceptualRoughness, half occlusion, float2 normalizedScreenSpaceUV) { - half3 irradiance; + half3 irradiance = 0; + #if defined(_SCREENSPACEREFLECTIONS_OFF) + half4 ssrColor = 0; + #else + half4 ssrColor = GetScreenSpaceReflection(normalizedScreenSpaceUV, perceptualRoughness); + #endif -#if !defined(_ENVIRONMENTREFLECTIONS_OFF) - if (_REFLECTION_PROBE_BLENDING) - { - irradiance = CalculateIrradianceFromReflectionProbes(reflectVector, positionWS, perceptualRoughness, normalizedScreenSpaceUV); - } - else + // We skip sampling reflection probes if they would be overwritten by SSR anyways. + // This optimization causes a miscompilation when using FXC, and the rendering path + // is single pass stereo instancing, so disable it in that path. + #if !defined(STEREO_INSTANCING_ON) || defined(UNITY_COMPILER_DXC) + if (ssrColor.a < 1.0) + #endif { - if (_REFLECTION_PROBE_BOX_PROJECTION) + #if !defined(_ENVIRONMENTREFLECTIONS_OFF) + if (_REFLECTION_PROBE_BLENDING) { - #if defined(REFLECTION_PROBE_ROTATION) - float3 probeCenterPosWS0 = unity_SpecCube0_BoxMin.xyz + (unity_SpecCube0_BoxMax.xyz - unity_SpecCube0_BoxMin.xyz) / 2; - float3 rotPosWS0 = RotateVectorByQuat(unity_SpecCube0_Rotation, positionWS - probeCenterPosWS0) + probeCenterPosWS0; - half3 rotReflectVector0 = RotateVectorByQuat(unity_SpecCube0_Rotation, reflectVector); - float4 inverseRotation0 = -unity_SpecCube0_Rotation; - inverseRotation0.w = -inverseRotation0.w; - reflectVector = BoxProjectedCubemapDirection(rotReflectVector0, rotPosWS0, unity_SpecCube0_ProbePosition, unity_SpecCube0_BoxMin, unity_SpecCube0_BoxMax); - reflectVector = RotateVectorByQuat(inverseRotation0, reflectVector); - #else - reflectVector = BoxProjectedCubemapDirection(reflectVector, positionWS, unity_SpecCube0_ProbePosition, unity_SpecCube0_BoxMin, unity_SpecCube0_BoxMax); - #endif + irradiance = CalculateIrradianceFromReflectionProbes(reflectVector, positionWS, perceptualRoughness, normalizedScreenSpaceUV); } - half mip = PerceptualRoughnessToMipmapLevel(perceptualRoughness); - half4 encodedIrradiance = half4(SAMPLE_TEXTURECUBE_LOD(unity_SpecCube0, samplerunity_SpecCube0, reflectVector, mip)); - - irradiance = DecodeHDREnvironment(encodedIrradiance, unity_SpecCube0_HDR); + else + { + if (_REFLECTION_PROBE_BOX_PROJECTION) + { + #if defined(REFLECTION_PROBE_ROTATION) + float3 probeCenterPosWS0 = unity_SpecCube0_BoxMin.xyz + (unity_SpecCube0_BoxMax.xyz - unity_SpecCube0_BoxMin.xyz) / 2; + float3 rotPosWS0 = RotateVectorByQuat(unity_SpecCube0_Rotation, positionWS - probeCenterPosWS0) + probeCenterPosWS0; + half3 rotReflectVector0 = RotateVectorByQuat(unity_SpecCube0_Rotation, reflectVector); + float4 inverseRotation0 = -unity_SpecCube0_Rotation; + inverseRotation0.w = -inverseRotation0.w; + reflectVector = BoxProjectedCubemapDirection(rotReflectVector0, rotPosWS0, unity_SpecCube0_ProbePosition, unity_SpecCube0_BoxMin, unity_SpecCube0_BoxMax); + reflectVector = RotateVectorByQuat(inverseRotation0, reflectVector); + #else + reflectVector = BoxProjectedCubemapDirection(reflectVector, positionWS, unity_SpecCube0_ProbePosition, unity_SpecCube0_BoxMin, unity_SpecCube0_BoxMax); + #endif + } + half mip = PerceptualRoughnessToMipmapLevel(perceptualRoughness); + half4 encodedIrradiance = half4(SAMPLE_TEXTURECUBE_LOD(unity_SpecCube0, samplerunity_SpecCube0, reflectVector, mip)); + + irradiance = DecodeHDREnvironment(encodedIrradiance, unity_SpecCube0_HDR); + } + #else // _ENVIRONMENTREFLECTIONS_OFF + irradiance = _GlossyEnvironmentColor.rgb; + #endif // !_ENVIRONMENTREFLECTIONS_OFF } -#else // _ENVIRONMENTREFLECTIONS_OFF - irradiance = _GlossyEnvironmentColor.rgb; -#endif // !_ENVIRONMENTREFLECTIONS_OFF + + irradiance = lerp(irradiance.rgb, ssrColor.rgb, ssrColor.a); return irradiance * occlusion; } diff --git a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl index fe30ce9367e..6c79c35a090 100644 --- a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl +++ b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl @@ -125,6 +125,12 @@ uint _MainLightLayerMask; // w: directLightStrength half4 _AmbientOcclusionParam; +// x: SSR Enabled/Disabled (Needed for situations when OFF keyword is stripped out but feature disabled in runtime) +// y: Minimum smoothness, used as a mask for SSR. +// z: Smoothness fade start. +// w is currently unused +half4 _ScreenSpaceReflectionParam; + half4 _AdditionalLightsCount; uint _RenderingLayerMaxInt; diff --git a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/SampleScreenSpaceReflection.hlsl b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/SampleScreenSpaceReflection.hlsl new file mode 100644 index 00000000000..13f6953346f --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/SampleScreenSpaceReflection.hlsl @@ -0,0 +1,37 @@ +#ifndef SAMPLE_SCREEN_SPACE_REFLECTION_INCLUDED +#define SAMPLE_SCREEN_SPACE_REFLECTION_INCLUDED + +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + +// SSR reflection color +TEXTURE2D_X(_ScreenSpaceReflectionTexture); + +half4 SampleScreenSpaceReflection(float2 normalizedScreenSpaceUV, float perceptualRoughness) +{ + float2 uv = UnityStereoTransformScreenSpaceTex(normalizedScreenSpaceUV); + + // Map roughness to mip level to get blur. + float mipLevel = PerceptualRoughnessToMipmapLevel(perceptualRoughness); + float4 reflColor = SAMPLE_TEXTURE2D_X_LOD(_ScreenSpaceReflectionTexture, sampler_TrilinearClamp, uv, mipLevel); + + // Fade out reflections for pixels that have smoothness below our minimum. + float perceptualSmoothness = PerceptualRoughnessToPerceptualSmoothness(perceptualRoughness); + float fadeStart = _ScreenSpaceReflectionParam.y; + float fadeEnd = _ScreenSpaceReflectionParam.z; + float fade = smoothstep(fadeStart, fadeEnd, perceptualSmoothness); + reflColor.a *= fade; + + return reflColor; +} + +half4 GetScreenSpaceReflection(float2 normalizedScreenSpaceUV, float perceptualRoughness) +{ +#if _SCREEN_SPACE_REFLECTION_KEYWORD_DECLARED + if (_SCREEN_SPACE_REFLECTION) + return SampleScreenSpaceReflection(normalizedScreenSpaceUV, perceptualRoughness) * _ScreenSpaceReflectionParam.x; + else +#endif + return 0; +} + +#endif diff --git a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/SampleScreenSpaceReflection.hlsl.meta b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/SampleScreenSpaceReflection.hlsl.meta new file mode 100644 index 00000000000..e0c1454979f --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/SampleScreenSpaceReflection.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 229e2e6b5e442024a819f1a5bc578442 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/ComplexLit.shader b/Packages/com.unity.render-pipelines.universal/Shaders/ComplexLit.shader index 4803b9211d0..c6daa8f4a96 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/ComplexLit.shader +++ b/Packages/com.unity.render-pipelines.universal/Shaders/ComplexLit.shader @@ -24,6 +24,7 @@ Shader "Universal Render Pipeline/Complex Lit" [ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0 [ToggleOff] _EnvironmentReflections("Environment Reflections", Float) = 1.0 + [ToggleOff] _ScreenSpaceReflections("Screen Space Reflections", Float) = 1.0 _BumpScale("Scale", Float) = 1.0 _BumpMap("Normal Map", 2D) = "bump" {} @@ -131,6 +132,7 @@ Shader "Universal Render Pipeline/Complex Lit" #pragma shader_feature_local_fragment _ _CLEARCOAT _CLEARCOATMAP #pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF #pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF + #pragma shader_feature_local_fragment _SCREENSPACEREFLECTIONS_OFF #pragma shader_feature_local_fragment _SPECULAR_SETUP // ------------------------------------- @@ -151,6 +153,7 @@ Shader "Universal Render Pipeline/Complex Lit" #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION #pragma multi_compile_fragment _ _REFLECTION_PROBE_ATLAS + #pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT #pragma multi_compile_fragment _ _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION @@ -281,6 +284,7 @@ Shader "Universal Render Pipeline/Complex Lit" #pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF #pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF + #pragma shader_feature_local_fragment _SCREENSPACEREFLECTIONS_OFF #pragma shader_feature_local_fragment _SPECULAR_SETUP #pragma shader_feature_local _RECEIVE_SHADOWS_OFF @@ -291,6 +295,7 @@ Shader "Universal Render Pipeline/Complex Lit" //#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED @@ -398,11 +403,14 @@ Shader "Universal Render Pipeline/Complex Lit" #pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED #pragma shader_feature_local _ALPHATEST_ON #pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + #pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP + #pragma shader_feature_local_fragment _SCREENSPACEREFLECTIONS_OFF // ------------------------------------- // Universal Pipeline keywords #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT // forward-only variant #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + #pragma multi_compile _ _WRITE_SMOOTHNESS // ------------------------------------- // Unity defined keywords diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Lit.shader b/Packages/com.unity.render-pipelines.universal/Shaders/Lit.shader index 71fdd29999d..f9440afd889 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Lit.shader +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Lit.shader @@ -21,6 +21,7 @@ Shader "Universal Render Pipeline/Lit" [ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0 [ToggleOff] _EnvironmentReflections("Environment Reflections", Float) = 1.0 + [ToggleOff] _ScreenSpaceReflections("Screen Space Reflections", Float) = 1.0 _BumpScale("Scale", Float) = 1.0 _BumpMap("Normal Map", 2D) = "bump" {} @@ -131,6 +132,7 @@ Shader "Universal Render Pipeline/Lit" #pragma shader_feature_local_fragment _OCCLUSIONMAP #pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF #pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF + #pragma shader_feature_local_fragment _SCREENSPACEREFLECTIONS_OFF #pragma shader_feature_local_fragment _SPECULAR_SETUP // ------------------------------------- @@ -145,6 +147,7 @@ Shader "Universal Render Pipeline/Lit" #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION #pragma multi_compile_fragment _ _REFLECTION_PROBE_ATLAS + #pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION #pragma multi_compile_fragment _ _SCREEN_SPACE_IRRADIANCE @@ -278,6 +281,7 @@ Shader "Universal Render Pipeline/Lit" #pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF #pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF + #pragma shader_feature_local_fragment _SCREENSPACEREFLECTIONS_OFF #pragma shader_feature_local_fragment _SPECULAR_SETUP #pragma shader_feature_local _RECEIVE_SHADOWS_OFF @@ -288,6 +292,7 @@ Shader "Universal Render Pipeline/Lit" //#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED @@ -396,6 +401,8 @@ Shader "Universal Render Pipeline/Lit" #pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED #pragma shader_feature_local _ALPHATEST_ON #pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + #pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP + #pragma shader_feature_local_fragment _SCREENSPACEREFLECTIONS_OFF // ------------------------------------- // Unity defined keywords @@ -404,6 +411,8 @@ Shader "Universal Render Pipeline/Lit" // ------------------------------------- // Universal Pipeline keywords #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + #pragma multi_compile _ _WRITE_SMOOTHNESS + #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT //-------------------------------------- // GPU Instancing diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/LitDepthNormalsPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/LitDepthNormalsPass.hlsl index e2cbc01382d..fe1a88948dc 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/LitDepthNormalsPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/LitDepthNormalsPass.hlsl @@ -18,7 +18,7 @@ #define REQUIRES_WORLD_SPACE_TANGENT_INTERPOLATOR #endif -#if defined(_ALPHATEST_ON) || defined(_PARALLAXMAP) || defined(_NORMALMAP) || defined(_DETAIL) +#if defined(_ALPHATEST_ON) || defined(_PARALLAXMAP) || defined(_NORMALMAP) || defined(_DETAIL) || defined(_WRITE_SMOOTHNESS) #define REQUIRES_UV_INTERPOLATOR #endif @@ -99,8 +99,12 @@ void DepthNormalsFragment( UNITY_SETUP_INSTANCE_ID(input); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + #if defined(_ALPHATEST_ON) || defined(_WRITE_SMOOTHNESS) + float alpha = SampleAlbedoAlpha(input.uv, TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap)).a; + #endif + #if defined(_ALPHATEST_ON) - Alpha(SampleAlbedoAlpha(input.uv, TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap)).a, _BaseColor, _Cutoff); + Alpha(alpha, _BaseColor, _Cutoff); #endif #if defined(LOD_FADE_CROSSFADE) @@ -142,6 +146,10 @@ void DepthNormalsFragment( outNormalWS = half4(NormalizeNormalPerPixel(normalWS), 0.0); #endif + #if defined(_WRITE_SMOOTHNESS) && !defined(_SCREENSPACEREFLECTIONS_OFF) + outNormalWS.a = SampleMetallicSpecGloss(input.uv, alpha).a; + #endif + #ifdef _WRITE_RENDERING_LAYERS outRenderingLayers = EncodeMeshRenderingLayer(); #endif diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Nature/SpeedTree8.shader b/Packages/com.unity.render-pipelines.universal/Shaders/Nature/SpeedTree8.shader index f728bc82a0e..36c36e442a8 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Nature/SpeedTree8.shader +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Nature/SpeedTree8.shader @@ -62,6 +62,7 @@ Shader "Universal Render Pipeline/Nature/SpeedTree8" #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION #pragma multi_compile_fragment _ _REFLECTION_PROBE_ATLAS + #pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION @@ -253,10 +254,13 @@ Shader "Universal Render Pipeline/Nature/SpeedTree8" #pragma shader_feature_local_vertex _WINDQUALITY_NONE _WINDQUALITY_FAST _WINDQUALITY_BETTER _WINDQUALITY_BEST _WINDQUALITY_PALM #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local_fragment EFFECT_EXTRA_TEX #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile_instancing #pragma multi_compile_vertex LOD_FADE_PERCENTAGE + #pragma multi_compile _ _WRITE_SMOOTHNESS + #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT #pragma instancing_options assumeuniformscaling maxcount:50 diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Nature/SpeedTree8Passes.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Nature/SpeedTree8Passes.hlsl index 5b702d20636..954c6745128 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Nature/SpeedTree8Passes.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Nature/SpeedTree8Passes.hlsl @@ -595,11 +595,21 @@ half4 SpeedTree8FragDepthNormal(SpeedTreeDepthNormalFragmentInput input) : SV_Ta normalTs = normalize(normalTs); #endif + half outputAlpha = 0.0; + #ifdef _WRITE_SMOOTHNESS + #ifdef EFFECT_EXTRA_TEX + half4 extra = tex2D(_ExtraTex, uv); + outputAlpha = extra.r; + #else + outputAlpha = _Glossiness; + #endif + #endif + #if defined(EFFECT_BUMP) float3 normalWS = TransformTangentToWorld(normalTs, half3x3(input.interpolated.tangentWS.xyz, input.interpolated.bitangentWS.xyz, input.interpolated.normalWS.xyz)); - return half4(NormalizeNormalPerPixel(normalWS), 0.0h); + return half4(NormalizeNormalPerPixel(normalWS), outputAlpha); #else - return half4(NormalizeNormalPerPixel(input.interpolated.normalWS), 0.0h); + return half4(NormalizeNormalPerPixel(input.interpolated.normalWS), outputAlpha); #endif } diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesDepthNormalsPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesDepthNormalsPass.hlsl index 0c2c6241a9a..768ac42254d 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesDepthNormalsPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesDepthNormalsPass.hlsl @@ -51,7 +51,7 @@ half4 DepthNormalsFragment(VaryingsDepthNormalsParticle input) : SV_TARGET UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); // Inputs... - #if defined(_ALPHATEST_ON) || defined(_NORMALMAP) + #if defined(_ALPHATEST_ON) || defined(_NORMALMAP) || defined(_WRITE_SMOOTHNESS) float2 uv = input.texcoord; #if defined(_FLIPBOOKBLENDING_ON) @@ -84,14 +84,23 @@ half4 DepthNormalsFragment(VaryingsDepthNormalsParticle input) : SV_TARGET float3 normalWS = input.normalWS; #endif + half outputAlpha = 0; + #if defined(_WRITE_SMOOTHNESS) + #if defined(_METALLICSPECGLOSSMAP) + outputAlpha = BlendTexture(TEXTURE2D_ARGS(_MetallicGlossMap, sampler_MetallicGlossMap), uv, blendUv).a * _Smoothness; + #else + outputAlpha = _Smoothness; + #endif + #endif + // Output... #if defined(_GBUFFER_NORMALS_OCT) float2 octNormalWS = PackNormalOctQuadEncode(normalWS); // values between [-1, +1], must use fp32 on some platforms float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); // values between [ 0, 1] half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); // values between [ 0, 1] - return half4(packedNormalWS, 0.0); + return half4(packedNormalWS, outputAlpha); #else - return half4(NormalizeNormalPerPixel(normalWS), 0.0); + return half4(NormalizeNormalPerPixel(normalWS), outputAlpha); #endif } diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesInput.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesInput.hlsl index 92e9224a838..99d75a3f074 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesInput.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesInput.hlsl @@ -129,7 +129,7 @@ struct VaryingsDepthNormalsParticle half4 color : COLOR; #endif - #if defined(_ALPHATEST_ON) || defined(_NORMALMAP) + #if defined(_ALPHATEST_ON) || defined(_NORMALMAP) || defined(_WRITE_SMOOTHNESS) float2 texcoord : TEXCOORD0; #if defined(_FLIPBOOKBLENDING_ON) diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLit.shader b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLit.shader index e5d17589efd..2fd8fa7a4f7 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLit.shader +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLit.shader @@ -140,6 +140,7 @@ Shader "Universal Render Pipeline/Particles/Lit" #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION #pragma multi_compile_fragment _ _REFLECTION_PROBE_ATLAS + #pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION #pragma multi_compile_fragment _ _LIGHT_COOKIES @@ -223,6 +224,7 @@ Shader "Universal Render Pipeline/Particles/Lit" //#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED @@ -313,6 +315,7 @@ Shader "Universal Render Pipeline/Particles/Lit" #pragma shader_feature_local _ _FLIPBOOKBLENDING_ON #pragma shader_feature_local _ _ALPHATEST_ON #pragma shader_feature_local_fragment _ _COLOROVERLAY_ON _COLORCOLOR_ON _COLORADDSUBDIFF_ON + #pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP // ------------------------------------- // Unity defined keywords @@ -324,6 +327,11 @@ Shader "Universal Render Pipeline/Particles/Lit" // Includes #include_with_pragmas "Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLitInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesDepthNormalsPass.hlsl" + + // ------------------------------------- + // Universal Pipeline keywords + #pragma multi_compile _ _WRITE_SMOOTHNESS + #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT ENDHLSL } // ------------------------------------------------------------------ diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLit.shader b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLit.shader index b914b8ccc35..63ef81f088b 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLit.shader +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLit.shader @@ -79,6 +79,7 @@ Shader "Universal Render Pipeline/Terrain/Lit" #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING #pragma multi_compile_fragment _ _REFLECTION_PROBE_ATLAS + #pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION #pragma multi_compile_fragment _ _SCREEN_SPACE_IRRADIANCE @@ -167,6 +168,7 @@ Shader "Universal Render Pipeline/Terrain/Lit" //#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS //#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING + #pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED @@ -242,6 +244,8 @@ Shader "Universal Render Pipeline/Terrain/Lit" #pragma fragment DepthNormalOnlyFragment #pragma shader_feature_local _NORMALMAP + #pragma multi_compile _ _WRITE_SMOOTHNESS + #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" #pragma multi_compile_instancing diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitAdd.shader b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitAdd.shader index 80232b438d8..ed84d866e27 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitAdd.shader +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitAdd.shader @@ -73,6 +73,7 @@ Shader "Hidden/Universal Render Pipeline/Terrain/Lit (Add Pass)" #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING #pragma multi_compile_fragment _ _REFLECTION_PROBE_ATLAS + #pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION #pragma multi_compile_fragment _ _LIGHT_COOKIES diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitBase.shader b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitBase.shader index 1cefc8c4e6d..cb0001a9afc 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitBase.shader +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitBase.shader @@ -51,6 +51,7 @@ Shader "Hidden/Universal Render Pipeline/Terrain/Lit (Base Pass)" #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING #pragma multi_compile_fragment _ _REFLECTION_PROBE_ATLAS + #pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION #pragma multi_compile_fragment _ _LIGHT_COOKIES @@ -205,6 +206,7 @@ Shader "Hidden/Universal Render Pipeline/Terrain/Lit (Base Pass)" #pragma multi_compile_instancing #pragma instancing_options assumeuniformscaling nomatrices nolightprobe nolightmap #pragma shader_feature_local _NORMALMAP + #pragma multi_compile _ _WRITE_SMOOTHNESS #include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitDepthNormalsPass.hlsl" diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitDepthNormalsPass.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitDepthNormalsPass.hlsl index aa297c36f63..653a7be2fa3 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitDepthNormalsPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitDepthNormalsPass.hlsl @@ -97,9 +97,31 @@ void DepthNormalOnlyFragment( half3 normalWS = IN.normal; #endif - normalWS = NormalizeNormalPerPixel(normalWS); + #if defined(_GBUFFER_NORMALS_OCT) + normalWS = normalize(normalWS); + float2 octNormalWS = PackNormalOctQuadEncode(normalWS); // values between [-1, +1], must use fp32 on some platforms + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); // values between [ 0, 1] + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); // values between [ 0, 1] + outNormalWS = half4(packedNormalWS, 0.0); + #else + outNormalWS = half4(NormalizeNormalPerPixel(normalWS), 0.0); + #endif + + #if defined(_WRITE_SMOOTHNESS) + half4 hasMask = half4(_LayerHasMask0, _LayerHasMask1, _LayerHasMask2, _LayerHasMask3); + half4 masks[4]; + ComputeMasks(masks, hasMask, IN.uvSplat01, IN.uvSplat23); - outNormalWS = half4(normalWS, 0.0); + half weight; + half4 mixedDiffuse; + half4 defaultSmoothness; + SplatmapMix(IN.uvMainAndLM, IN.uvSplat01, IN.uvSplat23, splatControl, weight, mixedDiffuse, defaultSmoothness, normalTS); + half4 maskSmoothness = half4(masks[0].a, masks[1].a, masks[2].a, masks[3].a); + defaultSmoothness = lerp(defaultSmoothness, maskSmoothness, hasMask); + half smoothness = dot(splatControl, defaultSmoothness); + + outNormalWS.a = smoothness; + #endif #ifdef _WRITE_RENDERING_LAYERS outRenderingLayers = EncodeMeshRenderingLayer(); diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitPasses.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitPasses.hlsl index f0a4cc34558..662bbe2cc93 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitPasses.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitPasses.hlsl @@ -370,7 +370,7 @@ Varyings SplatmapVert(Attributes v) return o; } -void ComputeMasks(out half4 masks[4], half4 hasMask, Varyings IN) +void ComputeMasks(out half4 masks[4], half4 hasMask, float4 uvSplat01, float4 uvSplat23) { masks[0] = 0.5h; masks[1] = 0.5h; @@ -378,10 +378,10 @@ void ComputeMasks(out half4 masks[4], half4 hasMask, Varyings IN) masks[3] = 0.5h; #ifdef _MASKMAP - masks[0] = lerp(masks[0], SAMPLE_TEXTURE2D(_Mask0, sampler_Mask0, IN.uvSplat01.xy), hasMask.x); - masks[1] = lerp(masks[1], SAMPLE_TEXTURE2D(_Mask1, sampler_Mask0, IN.uvSplat01.zw), hasMask.y); - masks[2] = lerp(masks[2], SAMPLE_TEXTURE2D(_Mask2, sampler_Mask0, IN.uvSplat23.xy), hasMask.z); - masks[3] = lerp(masks[3], SAMPLE_TEXTURE2D(_Mask3, sampler_Mask0, IN.uvSplat23.zw), hasMask.w); + masks[0] = lerp(masks[0], SAMPLE_TEXTURE2D(_Mask0, sampler_Mask0, uvSplat01.xy), hasMask.x); + masks[1] = lerp(masks[1], SAMPLE_TEXTURE2D(_Mask1, sampler_Mask0, uvSplat01.zw), hasMask.y); + masks[2] = lerp(masks[2], SAMPLE_TEXTURE2D(_Mask2, sampler_Mask0, uvSplat23.xy), hasMask.z); + masks[3] = lerp(masks[3], SAMPLE_TEXTURE2D(_Mask3, sampler_Mask0, uvSplat23.zw), hasMask.w); #endif masks[0] *= _MaskMapRemapScale0.rgba; @@ -423,7 +423,7 @@ void SplatmapFragment( half4 hasMask = half4(_LayerHasMask0, _LayerHasMask1, _LayerHasMask2, _LayerHasMask3); half4 masks[4]; - ComputeMasks(masks, hasMask, IN); + ComputeMasks(masks, hasMask, IN.uvSplat01, IN.uvSplat23); float2 splatUV = (IN.uvMainAndLM.xy * (_Control_TexelSize.zw - 1.0f) + 0.5f) * _Control_TexelSize.xy; half4 splatControl = SAMPLE_TEXTURE2D(_Control, sampler_Control, splatUV); diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Utils/ComputeScreenSpaceReflection.shader b/Packages/com.unity.render-pipelines.universal/Shaders/Utils/ComputeScreenSpaceReflection.shader new file mode 100644 index 00000000000..3d42fa3ec3f --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Utils/ComputeScreenSpaceReflection.shader @@ -0,0 +1,137 @@ +Shader "Hidden/Universal Render Pipeline/ComputeScreenSpaceReflection" +{ + HLSLINCLUDE + #pragma editor_sync_compilation + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl" + ENDHLSL + + SubShader + { + Tags + { + "RenderType" = "Opaque" + "RenderPipeline" = "UniversalPipeline" + } + Cull Off + ZWrite Off + ZTest Always + + // ------------------------------------------------------------------ + // Screen Space Reflection + // ------------------------------------------------------------------ + // Main SSR pass + Pass + { + Name "SSR_Main" + + HLSLPROGRAM + #pragma vertex Vert + #pragma fragment ComputeSSR + #pragma multi_compile_local_fragment _ _HIZ_TRACE + #pragma multi_compile_local_fragment _ _REFINE_DEPTH + #pragma multi_compile_local_fragment _ _USE_MOTION_VECTORS + #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl" + ENDHLSL + } + + // Pass to blit after opaque with alpha blending + Pass + { + Name "SSR_AfterOpaque" + + ZTest Off + Blend SrcAlpha OneMinusSrcAlpha + + HLSLPROGRAM + #pragma vertex Vert + #pragma fragment CompositeSSRAfterOpaque + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl" + ENDHLSL + } + + // ------------------------------------------------------------------ + // Bilateral Blur + // ------------------------------------------------------------------ + Pass + { + Name "SSR_Bilateral_HorizontalBlur" + + HLSLPROGRAM + #pragma vertex Vert + #pragma fragment HorizontalBilateralBlur + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl" + ENDHLSL + } + + Pass + { + Name "SSR_Bilateral_VerticalBlur" + + HLSLPROGRAM + #pragma vertex Vert + #pragma fragment VerticalBilateralBlur + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl" + ENDHLSL + } + + Pass + { + Name "SSR_Bilateral_FinalBlur" + + HLSLPROGRAM + #pragma vertex Vert + #pragma fragment FinalBilateralBlur + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl" + ENDHLSL + } + + // ------------------------------------------------------------------ + // Gaussian Blur + // ------------------------------------------------------------------ + Pass + { + Name "SSR_Gaussian_HorizontalBlur" + + HLSLPROGRAM + #pragma vertex Vert + #pragma fragment HorizontalGaussianBlur + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl" + ENDHLSL + } + + Pass + { + Name "SSR_Gaussian_VerticalBlur" + + HLSLPROGRAM + #pragma vertex Vert + #pragma fragment VerticalGaussianBlur + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl" + ENDHLSL + } + + // ------------------------------------------------------------------ + // Kawase Blur + // ------------------------------------------------------------------ + Pass + { + Name "SSR_KawaseBlur" + + HLSLPROGRAM + #pragma vertex Vert + #pragma fragment KawaseBlur + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ComputeScreenSpaceReflection.hlsl" + ENDHLSL + } + } +} diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/Utils/ComputeScreenSpaceReflection.shader.meta b/Packages/com.unity.render-pipelines.universal/Shaders/Utils/ComputeScreenSpaceReflection.shader.meta new file mode 100644 index 00000000000..c0427de388c --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Shaders/Utils/ComputeScreenSpaceReflection.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7b3e6785f5f6b634794df3a85a2a35da +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Tests/Editor/ShaderBuildPreprocessorTests.cs b/Packages/com.unity.render-pipelines.universal/Tests/Editor/ShaderBuildPreprocessorTests.cs index 9301d8d5300..8f6df91e0f2 100644 --- a/Packages/com.unity.render-pipelines.universal/Tests/Editor/ShaderBuildPreprocessorTests.cs +++ b/Packages/com.unity.render-pipelines.universal/Tests/Editor/ShaderBuildPreprocessorTests.cs @@ -29,6 +29,7 @@ private class TestHelper internal bool containsSurfaceCache; #endif internal bool everyRendererHasSSAO; + internal bool everyRendererHasSSR; internal ShaderFeatures defaultURPAssetFeatures { @@ -108,7 +109,7 @@ internal ShaderFeatures GetSupportedShaderFeaturesFromAsset() #if SURFACE_CACHE return ShaderBuildPreprocessor.GetSupportedShaderFeaturesFromAsset(ref urpAsset, ref rendererShaderFeatures, ref ssaoRendererFeatures, stripUnusedVariants, out containsForwardRenderer, out containsSurfaceCache, out everyRendererHasSSAO); #else - return ShaderBuildPreprocessor.GetSupportedShaderFeaturesFromAsset(ref urpAsset, ref rendererShaderFeatures, ref ssaoRendererFeatures, stripUnusedVariants, out containsForwardRenderer, out everyRendererHasSSAO); + return ShaderBuildPreprocessor.GetSupportedShaderFeaturesFromAsset(ref urpAsset, ref rendererShaderFeatures, ref ssaoRendererFeatures, stripUnusedVariants, out containsForwardRenderer, out everyRendererHasSSAO, out everyRendererHasSSR); #endif } @@ -940,6 +941,32 @@ public void TestGetSupportedShaderFeaturesFromRendererFeatures_SurfaceCacheGI() } #endif +#if URP_SCREEN_SPACE_REFLECTION + [Test] + public void TestGetSupportedShaderFeaturesFromRendererFeatures_ScreenSpaceReflection() + { + ScreenSpaceReflectionRendererFeature ssrFeature = ScriptableObject.CreateInstance(); + m_TestHelper.rendererFeatures.Add(ssrFeature); + + // Enabled feature + m_TestHelper.rendererFeatures[0].SetActive(true); + + RendererRequirements rendererRequirements = m_TestHelper.defaultRendererRequirements; + ShaderFeatures actual = m_TestHelper.GetSupportedShaderFeaturesFromRendererFeatures(rendererRequirements); + ShaderFeatures expected = ShaderFeatures.ScreenSpaceReflection; + m_TestHelper.AssertShaderFeaturesAndReset(expected, actual); + + // Disabled feature + m_TestHelper.rendererFeatures[0].SetActive(false); + rendererRequirements = m_TestHelper.defaultRendererRequirements; + actual = m_TestHelper.GetSupportedShaderFeaturesFromRendererFeatures(rendererRequirements); + expected = ShaderFeatures.None; + m_TestHelper.AssertShaderFeaturesAndReset(expected, actual); + + Object.DestroyImmediate(ssrFeature); + } +#endif + [Test] public void TestGetSupportedShaderFeaturesFromRendererFeatures_Decals() { diff --git a/Packages/com.unity.render-pipelines.universal/Tests/Editor/ShaderPrefilteringTests.cs b/Packages/com.unity.render-pipelines.universal/Tests/Editor/ShaderPrefilteringTests.cs index 9aa6f172a32..be95d9c0959 100644 --- a/Packages/com.unity.render-pipelines.universal/Tests/Editor/ShaderPrefilteringTests.cs +++ b/Packages/com.unity.render-pipelines.universal/Tests/Editor/ShaderPrefilteringTests.cs @@ -15,6 +15,7 @@ class TestHelper { internal bool isAssetUsingforward = true; internal bool everyRendererHasSSAO = false; + internal bool everyRendererHasSSR = false; internal bool stripXRKeywords = true; internal bool stripHDRKeywords = true; internal bool stripDebugDisplay = true; @@ -34,9 +35,9 @@ public TestHelper() internal ShaderPrefilteringData CreatePrefilteringSettings(ShaderFeatures shaderFeatures) { #if SURFACE_CACHE - return ShaderBuildPreprocessor.CreatePrefilteringSettings(ref shaderFeatures, isAssetUsingforward, everyRendererHasSSAO, stripXRKeywords, stripHDRKeywords, stripDebugDisplay, stripScreenCoordOverride, stripBicubicLightmapSampling, stripReflectionProbeRotation, stripScreenSpaceIrradiance, stripUnusedVariants, ref ssaoRendererFeatures); + return ShaderBuildPreprocessor.CreatePrefilteringSettings(ref shaderFeatures, isAssetUsingforward, everyRendererHasSSAO, everyRendererHasSSR, stripXRKeywords, stripHDRKeywords, stripDebugDisplay, stripScreenCoordOverride, stripBicubicLightmapSampling, stripReflectionProbeRotation, stripScreenSpaceIrradiance, stripUnusedVariants, ref ssaoRendererFeatures); #else - return ShaderBuildPreprocessor.CreatePrefilteringSettings(ref shaderFeatures, isAssetUsingforward, everyRendererHasSSAO, stripXRKeywords, stripHDRKeywords, stripDebugDisplay, stripScreenCoordOverride, stripBicubicLightmapSampling, stripReflectionProbeRotation, stripUnusedVariants, ref ssaoRendererFeatures); + return ShaderBuildPreprocessor.CreatePrefilteringSettings(ref shaderFeatures, isAssetUsingforward, everyRendererHasSSAO, everyRendererHasSSR, stripXRKeywords, stripHDRKeywords, stripDebugDisplay, stripScreenCoordOverride, stripBicubicLightmapSampling, stripReflectionProbeRotation, stripUnusedVariants, ref ssaoRendererFeatures); #endif } @@ -49,6 +50,7 @@ internal void AssertPrefilteringData(ShaderPrefilteringData expected, ShaderPref Assert.AreEqual(expected.additionalLightsPrefilteringMode, actual.additionalLightsPrefilteringMode, "additionalLightsPrefilteringMode mismatch"); Assert.AreEqual(expected.additionalLightsShadowsPrefilteringMode, actual.additionalLightsShadowsPrefilteringMode, "additionalLightsShadowsPrefilteringMode mismatch"); Assert.AreEqual(expected.screenSpaceOcclusionPrefilteringMode, actual.screenSpaceOcclusionPrefilteringMode, "screenSpaceOcclusionPrefilteringMode mismatch"); + Assert.AreEqual(expected.screenSpaceReflectionPrefilteringMode, actual.screenSpaceReflectionPrefilteringMode, "screenSpaceReflectionPrefilteringMode mismatch"); Assert.AreEqual(expected.stripXRKeywords, actual.stripXRKeywords, "stripXRKeywords mismatch"); Assert.AreEqual(expected.stripHDRKeywords, actual.stripHDRKeywords, "stripHDRKeywords mismatch"); @@ -70,6 +72,8 @@ internal void AssertPrefilteringData(ShaderPrefilteringData expected, ShaderPref Assert.AreEqual(expected.stripSSAOSampleCountMedium, actual.stripSSAOSampleCountMedium, "stripNativeRenderPass mismatch"); Assert.AreEqual(expected.stripSSAOSampleCountHigh, actual.stripSSAOSampleCountHigh, "stripNativeRenderPass mismatch"); + Assert.AreEqual(expected.stripWriteSmoothness, actual.stripWriteSmoothness, "stripWriteSmoothness mismatch"); + Assert.AreEqual(expected, actual, "Some mismatch between the Prefiltering Data that is not covered in the previous tests."); } } @@ -490,5 +494,48 @@ public void TestCreatePrefilteringSettings_ScreenSpaceOcclusion() actual = helper.CreatePrefilteringSettings(ShaderFeatures.None); helper.AssertPrefilteringData(expected, actual); } + + [Test] + public void TestCreatePrefilteringSettings_ScreenSpaceReflection() + { + ShaderPrefilteringData actual; + ShaderPrefilteringData expected; + TestHelper helper = new(); + + // SSR disabled + expected = helper.defaultPrefilteringData; + expected.screenSpaceReflectionPrefilteringMode = PrefilteringMode.Remove; + expected.stripWriteSmoothness = true; + actual = helper.CreatePrefilteringSettings(ShaderFeatures.None); + helper.AssertPrefilteringData(expected, actual); + +#if URP_SCREEN_SPACE_REFLECTION + // SSR enabled + expected = helper.defaultPrefilteringData; + expected.screenSpaceReflectionPrefilteringMode = PrefilteringMode.Select; + expected.stripWriteSmoothness = false; + actual = helper.CreatePrefilteringSettings(ShaderFeatures.ScreenSpaceReflection); + helper.AssertPrefilteringData(expected, actual); + + // Every Renderer has SSR with & without strip unused variants + helper.everyRendererHasSSR = true; + helper.stripUnusedVariants = true; + expected = helper.defaultPrefilteringData; + expected.screenSpaceReflectionPrefilteringMode = PrefilteringMode.SelectOnly; + expected.stripWriteSmoothness = false; + actual = helper.CreatePrefilteringSettings(ShaderFeatures.ScreenSpaceReflection); + helper.AssertPrefilteringData(expected, actual); + + helper.stripUnusedVariants = false; + expected = helper.defaultPrefilteringData; + expected.screenSpaceReflectionPrefilteringMode = PrefilteringMode.Select; + expected.stripWriteSmoothness = false; + actual = helper.CreatePrefilteringSettings(ShaderFeatures.ScreenSpaceReflection); + helper.AssertPrefilteringData(expected, actual); + + helper.stripUnusedVariants = true; + helper.everyRendererHasSSR = false; +#endif + } } } diff --git a/Packages/com.unity.render-pipelines.universal/Tests/Editor/ShaderScriptableStripperTests.cs b/Packages/com.unity.render-pipelines.universal/Tests/Editor/ShaderScriptableStripperTests.cs index 59b37a6f749..8bd50f4db91 100644 --- a/Packages/com.unity.render-pipelines.universal/Tests/Editor/ShaderScriptableStripperTests.cs +++ b/Packages/com.unity.render-pipelines.universal/Tests/Editor/ShaderScriptableStripperTests.cs @@ -785,6 +785,7 @@ public void TestStripUnusedFeatures(string shaderName) TestStripUnusedFeatures_ReflectionProbes(shader); TestStripUnusedFeatures_AdditionalLights(shader); TestStripUnusedFeatures_ScreenSpaceOcclusion(shader); + TestStripUnusedFeatures_ScreenSpaceReflection(shader); TestStripUnusedFeatures_DecalsDbuffer(shader); TestStripUnusedFeatures_DecalsNormalBlend(shader); TestStripUnusedFeatures_DecalLayers(shader); @@ -1645,6 +1646,53 @@ public void TestStripUnusedFeatures_ScreenSpaceOcclusion(Shader shader) helper.IsFalse(helper.stripper.StripUnusedFeatures_ScreenSpaceOcclusion(ref helper.data, ref helper.featureStripTool)); } + public void TestStripUnusedFeatures_ScreenSpaceReflection(Shader shader) + { + TestHelper helper; + + // None + helper = new TestHelper(shader, ShaderFeatures.None); + TestHelper.s_PassKeywords = new List() {ShaderKeywordStrings.ScreenSpaceReflection, ShaderKeywordStrings.WriteSmoothness}; + helper.IsFalse(helper.stripper.StripUnusedFeatures_ScreenSpaceReflection(ref helper.data, ref helper.featureStripTool)); + + helper = new TestHelper(shader, ShaderFeatures.None); + TestHelper.s_EnabledKeywords = new List() {ShaderKeywordStrings.ScreenSpaceReflection, ShaderKeywordStrings.WriteSmoothness}; + TestHelper.s_PassKeywords = new List() {ShaderKeywordStrings.ScreenSpaceReflection}; + helper.AreEqual(shader != null, helper.stripper.StripUnusedFeatures_ScreenSpaceReflection(ref helper.data, ref helper.featureStripTool)); + + helper = new TestHelper(shader, ShaderFeatures.None); + TestHelper.s_EnabledKeywords = new List() {ShaderKeywordStrings.ScreenSpaceReflection, ShaderKeywordStrings.WriteSmoothness}; + TestHelper.s_PassKeywords = new List() {ShaderKeywordStrings.WriteSmoothness}; + helper.AreEqual(shader != null, helper.stripper.StripUnusedFeatures_ScreenSpaceReflection(ref helper.data, ref helper.featureStripTool)); + + helper = new TestHelper(shader, ShaderFeatures.None); + TestHelper.s_EnabledKeywords = new List() {ShaderKeywordStrings.ScreenSpaceReflection, ShaderKeywordStrings.WriteSmoothness}; + TestHelper.s_PassKeywords = new List() {ShaderKeywordStrings.ScreenSpaceReflection, ShaderKeywordStrings.WriteSmoothness}; + helper.AreEqual(shader != null, helper.stripper.StripUnusedFeatures_ScreenSpaceReflection(ref helper.data, ref helper.featureStripTool)); + +#if URP_SCREEN_SPACE_REFLECTION + // ScreenSpaceReflection + helper = new TestHelper(shader, ShaderFeatures.ScreenSpaceReflection); + TestHelper.s_PassKeywords = new List() {ShaderKeywordStrings.ScreenSpaceReflection, ShaderKeywordStrings.WriteSmoothness}; + helper.AreEqual(shader != null, helper.stripper.StripUnusedFeatures_ScreenSpaceReflection(ref helper.data, ref helper.featureStripTool)); + + helper = new TestHelper(shader, ShaderFeatures.ScreenSpaceReflection); + TestHelper.s_EnabledKeywords = new List() {ShaderKeywordStrings.ScreenSpaceReflection, ShaderKeywordStrings.WriteSmoothness}; + TestHelper.s_PassKeywords = new List() {ShaderKeywordStrings.ScreenSpaceReflection}; + helper.IsFalse(helper.stripper.StripUnusedFeatures_ScreenSpaceReflection(ref helper.data, ref helper.featureStripTool)); + + helper = new TestHelper(shader, ShaderFeatures.ScreenSpaceReflection); + TestHelper.s_EnabledKeywords = new List() {ShaderKeywordStrings.ScreenSpaceReflection, ShaderKeywordStrings.WriteSmoothness}; + TestHelper.s_PassKeywords = new List() {ShaderKeywordStrings.WriteSmoothness}; + helper.IsFalse(helper.stripper.StripUnusedFeatures_ScreenSpaceReflection(ref helper.data, ref helper.featureStripTool)); + + helper = new TestHelper(shader, ShaderFeatures.ScreenSpaceReflection); + TestHelper.s_EnabledKeywords = new List() {ShaderKeywordStrings.ScreenSpaceReflection, ShaderKeywordStrings.WriteSmoothness}; + TestHelper.s_PassKeywords = new List() {ShaderKeywordStrings.ScreenSpaceReflection, ShaderKeywordStrings.WriteSmoothness}; + helper.IsFalse(helper.stripper.StripUnusedFeatures_ScreenSpaceReflection(ref helper.data, ref helper.featureStripTool)); +#endif + } + public void TestStripUnusedFeatures_DecalsDbuffer(Shader shader) { TestHelper helper; diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/CommonAssets/URPAssets/250_SSR.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/CommonAssets/URPAssets/250_SSR.asset new file mode 100644 index 00000000000..ac8047afa76 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/CommonAssets/URPAssets/250_SSR.asset @@ -0,0 +1,146 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} + m_Name: 250_SSR + m_EditorClassIdentifier: + k_AssetVersion: 13 + k_AssetPreviousVersion: 13 + m_RendererType: 1 + m_RendererData: {fileID: 0} + m_RendererDataList: + - {fileID: 11400000, guid: 80b467157715a524ab1b1e3d8ccdaae3, type: 2} + - {fileID: 11400000, guid: 3811ab7aa1742d2419e0ba3992b8138d, type: 2} + m_DefaultRendererIndex: 0 + m_RequireDepthTexture: 1 + m_RequireOpaqueTexture: 1 + m_OpaqueDownsampling: 1 + m_SupportsTerrainHoles: 0 + m_SupportsHDR: 1 + m_HDRColorBufferPrecision: 0 + m_MSAA: 4 + m_RenderScale: 1 + m_UpscalingFilter: 0 + m_FsrOverrideSharpness: 0 + m_FsrSharpness: 0.92 + m_EnableLODCrossFade: 0 + m_LODCrossFadeDitheringType: 1 + m_ShEvalMode: 0 + m_LightProbeSystem: 0 + m_ProbeVolumeMemoryBudget: 1024 + m_ProbeVolumeBlendingMemoryBudget: 128 + m_SupportProbeVolumeGPUStreaming: 0 + m_SupportProbeVolumeDiskStreaming: 0 + m_SupportProbeVolumeScenarios: 0 + m_SupportProbeVolumeScenarioBlending: 0 + m_ProbeVolumeSHBands: 1 + m_MainLightRenderingMode: 1 + m_MainLightShadowsSupported: 1 + m_MainLightShadowmapResolution: 2048 + m_AdditionalLightsRenderingMode: 1 + m_AdditionalLightsPerObjectLimit: 8 + m_AdditionalLightShadowsSupported: 1 + m_AdditionalLightsShadowmapResolution: 512 + m_AdditionalLightsShadowResolutionTierLow: 512 + m_AdditionalLightsShadowResolutionTierMedium: 1024 + m_AdditionalLightsShadowResolutionTierHigh: 2048 + m_ReflectionProbeBlending: 0 + m_ReflectionProbeBoxProjection: 0 + m_ReflectionProbeAtlas: 0 + m_ShadowDistance: 56 + m_ShadowCascadeCount: 4 + m_Cascade2Split: 0.25 + m_Cascade3Split: {x: 0.154, y: 0.478} + m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} + m_CascadeBorder: 0.1 + m_ShadowDepthBias: 1 + m_ShadowNormalBias: 1 + m_AnyShadowsSupported: 1 + m_SoftShadowsSupported: 1 + m_ConservativeEnclosingSphere: 0 + m_NumIterationsEnclosingSphere: 64 + m_SoftShadowQuality: 2 + m_AdditionalLightsCookieResolution: 2048 + m_AdditionalLightsCookieFormat: 3 + m_UseSRPBatcher: 1 + m_SupportsDynamicBatching: 0 + m_MixedLightingSupported: 1 + m_SupportsLightCookies: 0 + m_SupportsLightLayers: 0 + m_DebugLevel: 0 + m_StoreActionsOptimization: 0 + m_UseAdaptivePerformance: 1 + m_ColorGradingMode: 0 + m_ColorGradingLutSize: 32 + m_AllowPostProcessAlphaOutput: 0 + m_UseFastSRGBLinearConversion: 0 + m_SupportDataDrivenLensFlare: 1 + m_SupportScreenSpaceLensFlare: 1 + m_GPUResidentDrawerMode: 0 + m_SmallMeshScreenPercentage: 0 + m_GPUResidentDrawerEnableOcclusionCullingInCameras: 0 + m_ShadowType: 0 + m_LocalShadowsSupported: 1 + m_LocalShadowsAtlasResolution: 512 + m_MaxPixelLights: 4 + m_ShadowAtlasResolution: 2048 + m_VolumeFrameworkUpdateMode: 0 + m_VolumeProfile: {fileID: 0} + apvScenesData: + obsoleteSceneBounds: + m_Keys: [] + m_Values: [] + obsoleteHasProbeVolumes: + m_Keys: [] + m_Values: + m_PrefilteringModeMainLightShadows: 3 + m_PrefilteringModeAdditionalLight: 3 + m_PrefilteringModeAdditionalLightShadows: 2 + m_PrefilterXRKeywords: 1 + m_PrefilteringModeForwardPlus: 0 + m_PrefilteringModeDeferredRendering: 1 + m_PrefilteringModeScreenSpaceOcclusion: 0 + m_PrefilteringModeScreenSpaceReflection: 1 + m_PrefilterWriteSmoothnessAlpha: 1 + m_PrefilterDebugKeywords: 1 + m_PrefilterWriteRenderingLayers: 1 + m_PrefilterHDROutput: 1 + m_PrefilterAlphaOutput: 1 + m_PrefilterSSAODepthNormals: 1 + m_PrefilterSSAOSourceDepthLow: 1 + m_PrefilterSSAOSourceDepthMedium: 1 + m_PrefilterSSAOSourceDepthHigh: 1 + m_PrefilterSSAOInterleaved: 1 + m_PrefilterSSAOBlueNoise: 1 + m_PrefilterSSAOSampleCountLow: 1 + m_PrefilterSSAOSampleCountMedium: 1 + m_PrefilterSSAOSampleCountHigh: 1 + m_PrefilterDBufferMRT1: 1 + m_PrefilterDBufferMRT2: 1 + m_PrefilterDBufferMRT3: 1 + m_PrefilterSoftShadowsQualityLow: 1 + m_PrefilterSoftShadowsQualityMedium: 1 + m_PrefilterSoftShadowsQualityHigh: 1 + m_PrefilterSoftShadows: 0 + m_PrefilterScreenCoord: 1 + m_PrefilterScreenSpaceIrradiance: 0 + m_PrefilterNativeRenderPass: 0 + m_PrefilterUseLegacyLightmaps: 0 + m_PrefilterBicubicLightmapSampling: 0 + m_PrefilterReflectionProbeRotation: 0 + m_PrefilterReflectionProbeBlending: 0 + m_PrefilterReflectionProbeBoxProjection: 0 + m_PrefilterReflectionProbeAtlas: 0 + m_ShaderVariantLogLevel: 0 + m_ShadowCascades: 3 + m_Textures: + blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3} + bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/CommonAssets/URPAssets/250_SSR.asset.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/CommonAssets/URPAssets/250_SSR.asset.meta new file mode 100644 index 00000000000..e89f531c1fb --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/CommonAssets/URPAssets/250_SSR.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 498e927d1873deb499fde229a98dc6b7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets.meta new file mode 100644 index 00000000000..6940cb2fa87 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a15b1c3d3fe78764c924c1c7e93a27e8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRDeferred.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRDeferred.asset new file mode 100644 index 00000000000..341020520cd --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRDeferred.asset @@ -0,0 +1,73 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3001245531574240432 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fb9f2fe3baf0e8c46bf390df937e6187, type: 3} + m_Name: ScreenSpaceReflectionRendererFeature + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ScreenSpaceReflectionRendererFeature + m_Active: 1 + AfterOpaque: 0 + RespectHDR: 0 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} + m_Name: SSRDeferred + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalRendererData + debugShaders: + debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, + type: 3} + hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} + probeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, + type: 3} + probeVolumeResources: + probeVolumeDebugShader: {fileID: 0} + probeVolumeFragmentationDebugShader: {fileID: 0} + probeVolumeOffsetDebugShader: {fileID: 0} + probeVolumeSamplingDebugShader: {fileID: 0} + probeSamplingDebugMesh: {fileID: 0} + probeSamplingDebugTexture: {fileID: 0} + probeVolumeBlendStatesCS: {fileID: 0} + m_RendererFeatures: + - {fileID: -3001245531574240432} + m_RendererFeatureMap: 50fbc91e176f59d6 + xrSystemData: {fileID: 0} + postProcessData: {fileID: 0} + m_AssetVersion: 3 + m_PrepassLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_OpaqueLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_TransparentLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_DefaultStencilState: + overrideStencilState: 0 + stencilReference: 0 + stencilCompareFunction: 8 + passOperation: 2 + failOperation: 0 + zFailOperation: 0 + m_ShadowTransparentReceive: 1 + m_RenderingMode: 1 + m_DepthPrimingMode: 0 + m_CopyDepthMode: 1 + m_DepthAttachmentFormat: 0 + m_DepthTextureFormat: 0 + m_AccurateGbufferNormals: 0 + m_IntermediateTextureMode: 1 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRDeferred.asset.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRDeferred.asset.meta new file mode 100644 index 00000000000..03756bb4627 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRDeferred.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3811ab7aa1742d2419e0ba3992b8138d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRForward.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRForward.asset new file mode 100644 index 00000000000..49274bd0eac --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRForward.asset @@ -0,0 +1,73 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3001245531574240432 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fb9f2fe3baf0e8c46bf390df937e6187, type: 3} + m_Name: ScreenSpaceReflectionRendererFeature + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ScreenSpaceReflectionRendererFeature + m_Active: 1 + AfterOpaque: 0 + RespectHDR: 0 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} + m_Name: SSRForward + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalRendererData + debugShaders: + debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, + type: 3} + hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} + probeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, + type: 3} + probeVolumeResources: + probeVolumeDebugShader: {fileID: 0} + probeVolumeFragmentationDebugShader: {fileID: 0} + probeVolumeOffsetDebugShader: {fileID: 0} + probeVolumeSamplingDebugShader: {fileID: 0} + probeSamplingDebugMesh: {fileID: 0} + probeSamplingDebugTexture: {fileID: 0} + probeVolumeBlendStatesCS: {fileID: 0} + m_RendererFeatures: + - {fileID: -3001245531574240432} + m_RendererFeatureMap: 50fbc91e176f59d6 + xrSystemData: {fileID: 0} + postProcessData: {fileID: 0} + m_AssetVersion: 3 + m_PrepassLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_OpaqueLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_TransparentLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_DefaultStencilState: + overrideStencilState: 0 + stencilReference: 0 + stencilCompareFunction: 8 + passOperation: 2 + failOperation: 0 + zFailOperation: 0 + m_ShadowTransparentReceive: 1 + m_RenderingMode: 0 + m_DepthPrimingMode: 0 + m_CopyDepthMode: 1 + m_DepthAttachmentFormat: 0 + m_DepthTextureFormat: 0 + m_AccurateGbufferNormals: 0 + m_IntermediateTextureMode: 1 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRForward.asset.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRForward.asset.meta new file mode 100644 index 00000000000..d6560041d1b --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRForward.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 80b467157715a524ab1b1e3d8ccdaae3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRMirror.mat b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRMirror.mat new file mode 100644 index 00000000000..e304cc1df81 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRMirror.mat @@ -0,0 +1,137 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SSRMirror + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 1 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 1 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _WorkflowMode: 1 + - _XRMotionVectorsPass: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &7109470340642185049 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRMirror.mat.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRMirror.mat.meta new file mode 100644 index 00000000000..d6714d98eb6 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRMirror.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5d32cb63ca65f0b48bd69d84dc9e42ff +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRRoughMirror.mat b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRRoughMirror.mat new file mode 100644 index 00000000000..4d6fb913369 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRRoughMirror.mat @@ -0,0 +1,137 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SSRRoughMirror + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 1 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0.478 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _WorkflowMode: 1 + - _XRMotionVectorsPass: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &7109470340642185049 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRRoughMirror.mat.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRRoughMirror.mat.meta new file mode 100644 index 00000000000..ab786792a61 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRRoughMirror.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4bc338a1441d5b340a2399c2e45e31eb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolume.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolume.asset new file mode 100644 index 00000000000..eececc0df26 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolume.asset @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-2494577891554613672 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2274cd80d4e22254d98d0282578183e0, type: 3} + m_Name: ScreenSpaceReflectionVolumeSettings + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ScreenSpaceReflectionVolumeSettings + active: 1 + mode: + m_OverrideState: 1 + m_Value: 1 + resolution: + m_OverrideState: 1 + m_Value: 1 + upscalingMethod: + m_OverrideState: 1 + m_Value: 3 + linearMarching: + m_OverrideState: 1 + m_Value: 0 + refineDepth: + m_OverrideState: 1 + m_Value: 1 + refineDepthSteps: + m_OverrideState: 1 + m_Value: 5 + finalThicknessMultiplier: + m_OverrideState: 1 + m_Value: 0.16 + roughReflections: + m_OverrideState: 1 + m_Value: 2 + minimumSmoothness: + m_OverrideState: 1 + m_Value: 0.05 + smoothnessFadeStart: + m_OverrideState: 1 + m_Value: 0.1 + normalFade: + m_OverrideState: 1 + m_Value: 0 + screenEdgeFadeDistance: + m_OverrideState: 1 + m_Value: 0.2 + reflectSky: + m_OverrideState: 1 + m_Value: 0 + maxRayLength: + m_OverrideState: 1 + m_Value: 30 + rayLengthFade: + m_OverrideState: 0 + m_Value: 1 + maxRaySteps: + m_OverrideState: 1 + m_Value: 64 + objectThickness: + m_OverrideState: 1 + m_Value: 0.01 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: SSRVolume + m_EditorClassIdentifier: Unity.RenderPipelines.Core.Runtime::UnityEngine.Rendering.VolumeProfile + components: + - {fileID: -2494577891554613672} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolume.asset.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolume.asset.meta new file mode 100644 index 00000000000..7be46447427 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolume.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a245d27401ec11e4e835e46cd1442e24 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolumeLinearMarching.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolumeLinearMarching.asset new file mode 100644 index 00000000000..d68c2f72682 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolumeLinearMarching.asset @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-2494577891554613672 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2274cd80d4e22254d98d0282578183e0, type: 3} + m_Name: ScreenSpaceReflectionVolumeSettings + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ScreenSpaceReflectionVolumeSettings + active: 1 + mode: + m_OverrideState: 0 + m_Value: 1 + resolution: + m_OverrideState: 1 + m_Value: 1 + upscalingMethod: + m_OverrideState: 1 + m_Value: 3 + linearMarching: + m_OverrideState: 1 + m_Value: 1 + refineDepth: + m_OverrideState: 1 + m_Value: 1 + refineDepthSteps: + m_OverrideState: 1 + m_Value: 5 + finalThicknessMultiplier: + m_OverrideState: 1 + m_Value: 0.16 + roughReflections: + m_OverrideState: 0 + m_Value: 2 + minimumSmoothness: + m_OverrideState: 0 + m_Value: 0.05 + smoothnessFadeStart: + m_OverrideState: 0 + m_Value: 0.1 + normalFade: + m_OverrideState: 0 + m_Value: 0 + screenEdgeFadeDistance: + m_OverrideState: 0 + m_Value: 0.2 + reflectSky: + m_OverrideState: 0 + m_Value: 0 + maxRayLength: + m_OverrideState: 1 + m_Value: 30 + rayLengthFade: + m_OverrideState: 0 + m_Value: 1 + maxRaySteps: + m_OverrideState: 1 + m_Value: 64 + objectThickness: + m_OverrideState: 1 + m_Value: 0.045 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: SSRVolumeLinearMarching + m_EditorClassIdentifier: Unity.RenderPipelines.Core.Runtime::UnityEngine.Rendering.VolumeProfile + components: + - {fileID: -2494577891554613672} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolumeLinearMarching.asset.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolumeLinearMarching.asset.meta new file mode 100644 index 00000000000..f7dc0854000 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_Assets/SSRVolumeLinearMarching.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e23d661539c592242a3fb894a59d15af +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Deferred.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Deferred.unity new file mode 100644 index 00000000000..32a7f5d4049 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Deferred.unity @@ -0,0 +1,1098 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0, g: 0, b: 0, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 2.92 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 10 + m_BakeResolution: 10 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 0.5 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 4 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 0 + m_TextureCompression: 0 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 128 + m_PVRBounces: 1 + m_PVREnvironmentSampleCount: 128 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &30577811 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 30577813} + - component: {fileID: 30577812} + m_Layer: 0 + m_Name: Global Volume + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &30577812 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 30577811} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Core.Runtime::UnityEngine.Rendering.Volume + m_IsGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: a245d27401ec11e4e835e46cd1442e24, type: 2} +--- !u!4 &30577813 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 30577811} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.02411, y: 0, z: -1.04696} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &63163425 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 63163429} + - component: {fileID: 63163428} + - component: {fileID: 63163427} + - component: {fileID: 63163426} + m_Layer: 0 + m_Name: Plane (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 2147483647 + m_IsActive: 1 +--- !u!64 &63163426 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63163425} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &63163427 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63163425} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4bc338a1441d5b340a2399c2e45e31eb, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &63163428 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63163425} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &63163429 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63163425} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 3} + m_LocalScale: {x: 1, y: 1, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &133629209 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 133629213} + - component: {fileID: 133629212} + - component: {fileID: 133629211} + - component: {fileID: 133629210} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &133629210 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133629209} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &133629211 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133629209} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9b02cdc6dbf754bf1aa60a08bf1c909d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &133629212 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133629209} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &133629213 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133629209} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.5, y: 1.72, z: -1.77} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &163676334 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 163676336} + - component: {fileID: 163676335} + m_Layer: 0 + m_Name: SelectQualityLevel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &163676335 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 163676334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f1decc188d2f3146ab93291a5c743e9, type: 3} + m_Name: + m_EditorClassIdentifier: + qualityLevelIndex: 14 + callbacks: [] +--- !u!4 &163676336 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 163676334} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.38117677, y: 6.107272, z: 0.46914768} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &341310080 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 341310083} + - component: {fileID: 341310082} + - component: {fileID: 341310081} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &341310081 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 341310080} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_CustomShadowLayers: 0 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 + m_RenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_ShadowRenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_Version: 4 + m_LightLayerMask: 1 + m_ShadowLayerMask: 1 + m_RenderingLayers: 1 + m_ShadowRenderingLayers: 1 +--- !u!108 &341310082 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 341310080} + m_Enabled: 1 + serializedVersion: 13 + m_Type: 1 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize2D: {x: 10, y: 10} + m_Shadows: + m_Type: 1 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 2 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 + m_ShapeRadius: 0 + m_ShadowAngle: 0 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 +--- !u!4 &341310083 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 341310080} + serializedVersion: 2 + m_LocalRotation: {x: 0.67504096, y: -0.12967286, z: -0.6366785, w: 0.34949282} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 17.862, y: -86.687, z: -139.345} +--- !u!1 &553140003 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 553140007} + - component: {fileID: 553140006} + - component: {fileID: 553140005} + - component: {fileID: 553140004} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &553140004 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553140003} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &553140005 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553140003} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 58bbc5d4f141a4cbc9e0f0cc569fdbca, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &553140006 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553140003} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &553140007 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553140003} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -2.5, y: 3.13, z: 0.38} + m_LocalScale: {x: 0.21007, y: 6.5844, z: 9.327918} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1726969896 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1726969900} + - component: {fileID: 1726969899} + - component: {fileID: 1726969898} + - component: {fileID: 1726969897} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 2147483647 + m_IsActive: 1 +--- !u!64 &1726969897 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726969896} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1726969898 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726969896} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 5d32cb63ca65f0b48bd69d84dc9e42ff, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1726969899 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726969896} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1726969900 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726969896} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -2} + m_LocalScale: {x: 1, y: 1, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1731902562 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1731902566} + - component: {fileID: 1731902565} + - component: {fileID: 1731902564} + - component: {fileID: 1731902563} + m_Layer: 0 + m_Name: Cube (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1731902563 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1731902562} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1731902564 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1731902562} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9b02cdc6dbf754bf1aa60a08bf1c909d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1731902565 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1731902562} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1731902566 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1731902562} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.5, y: 1.56, z: 1.31} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1865670496 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1865670501} + - component: {fileID: 1865670500} + - component: {fileID: 1865670498} + - component: {fileID: 1865670497} + - component: {fileID: 1865670499} + - component: {fileID: 1865670502} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1865670497 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 +--- !u!124 &1865670498 +Behaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 +--- !u!114 &1865670499 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73231aa468d81ea49bc3d914080de185, type: 3} + m_Name: + m_EditorClassIdentifier: + ImageComparisonSettings: + TargetWidth: 512 + TargetHeight: 512 + TargetMSAASamples: 1 + PerPixelCorrectnessThreshold: 0.005 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 + RMSEThreshold: 0 + AverageCorrectnessThreshold: 0.0012 + IncorrectPixelsThreshold: 0.0000038146973 + UseHDR: 0 + UseBackBuffer: 0 + ImageResolution: 0 + ActiveImageTests: 1 + ActivePixelTests: -1 + WaitFrames: 10 + XRCompatible: 1 + gpuDrivenCompatible: 1 + CheckMemoryAllocation: 0 + renderBackendCompatibility: 0 + SetBackBufferResolution: 0 +--- !u!20 &1865670500 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 30 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1865670501 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + serializedVersion: 2 + m_LocalRotation: {x: -0.10438335, y: 0.8451999, z: -0.17909561, w: -0.49261156} + m_LocalPosition: {x: 8.582722, y: 5.52, z: 5.651631} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &1865670502 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: 1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 163676336} + - {fileID: 1865670501} + - {fileID: 1726969900} + - {fileID: 63163429} + - {fileID: 341310083} + - {fileID: 30577813} + - {fileID: 553140007} + - {fileID: 133629213} + - {fileID: 1731902566} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Deferred.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Deferred.unity.meta new file mode 100644 index 00000000000..7a126c5c90c --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Deferred.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9cd4d21ae9ec1e74bb90b89215b485cc +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Forward.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Forward.unity new file mode 100644 index 00000000000..f68095315d7 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Forward.unity @@ -0,0 +1,1098 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0, g: 0, b: 0, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 2.92 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 10 + m_BakeResolution: 10 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 0.5 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 4 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 0 + m_TextureCompression: 0 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 128 + m_PVRBounces: 1 + m_PVREnvironmentSampleCount: 128 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &30577811 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 30577813} + - component: {fileID: 30577812} + m_Layer: 0 + m_Name: Global Volume + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &30577812 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 30577811} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Core.Runtime::UnityEngine.Rendering.Volume + m_IsGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: a245d27401ec11e4e835e46cd1442e24, type: 2} +--- !u!4 &30577813 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 30577811} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.02411, y: 0, z: -1.04696} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &63163425 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 63163429} + - component: {fileID: 63163428} + - component: {fileID: 63163427} + - component: {fileID: 63163426} + m_Layer: 0 + m_Name: Plane (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 2147483647 + m_IsActive: 1 +--- !u!64 &63163426 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63163425} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &63163427 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63163425} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4bc338a1441d5b340a2399c2e45e31eb, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &63163428 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63163425} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &63163429 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63163425} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 3} + m_LocalScale: {x: 1, y: 1, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &133629209 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 133629213} + - component: {fileID: 133629212} + - component: {fileID: 133629211} + - component: {fileID: 133629210} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &133629210 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133629209} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &133629211 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133629209} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9b02cdc6dbf754bf1aa60a08bf1c909d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &133629212 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133629209} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &133629213 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133629209} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.5, y: 1.72, z: -1.77} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &163676334 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 163676336} + - component: {fileID: 163676335} + m_Layer: 0 + m_Name: SelectQualityLevel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &163676335 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 163676334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f1decc188d2f3146ab93291a5c743e9, type: 3} + m_Name: + m_EditorClassIdentifier: + qualityLevelIndex: 14 + callbacks: [] +--- !u!4 &163676336 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 163676334} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.38117677, y: 6.107272, z: 0.46914768} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &341310080 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 341310083} + - component: {fileID: 341310082} + - component: {fileID: 341310081} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &341310081 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 341310080} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_CustomShadowLayers: 0 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 + m_RenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_ShadowRenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_Version: 4 + m_LightLayerMask: 1 + m_ShadowLayerMask: 1 + m_RenderingLayers: 1 + m_ShadowRenderingLayers: 1 +--- !u!108 &341310082 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 341310080} + m_Enabled: 1 + serializedVersion: 13 + m_Type: 1 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize2D: {x: 10, y: 10} + m_Shadows: + m_Type: 1 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 2 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 + m_ShapeRadius: 0 + m_ShadowAngle: 0 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 +--- !u!4 &341310083 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 341310080} + serializedVersion: 2 + m_LocalRotation: {x: 0.67504096, y: -0.12967286, z: -0.6366785, w: 0.34949282} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 17.862, y: -86.687, z: -139.345} +--- !u!1 &553140003 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 553140007} + - component: {fileID: 553140006} + - component: {fileID: 553140005} + - component: {fileID: 553140004} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &553140004 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553140003} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &553140005 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553140003} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 58bbc5d4f141a4cbc9e0f0cc569fdbca, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &553140006 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553140003} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &553140007 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553140003} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -2.5, y: 3.13, z: 0.38} + m_LocalScale: {x: 0.21007, y: 6.5844, z: 9.327918} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1726969896 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1726969900} + - component: {fileID: 1726969899} + - component: {fileID: 1726969898} + - component: {fileID: 1726969897} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 2147483647 + m_IsActive: 1 +--- !u!64 &1726969897 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726969896} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1726969898 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726969896} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 5d32cb63ca65f0b48bd69d84dc9e42ff, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1726969899 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726969896} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1726969900 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726969896} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -2} + m_LocalScale: {x: 1, y: 1, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1731902562 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1731902566} + - component: {fileID: 1731902565} + - component: {fileID: 1731902564} + - component: {fileID: 1731902563} + m_Layer: 0 + m_Name: Cube (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1731902563 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1731902562} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1731902564 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1731902562} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9b02cdc6dbf754bf1aa60a08bf1c909d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1731902565 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1731902562} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1731902566 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1731902562} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.5, y: 1.56, z: 1.31} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1865670496 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1865670501} + - component: {fileID: 1865670500} + - component: {fileID: 1865670498} + - component: {fileID: 1865670497} + - component: {fileID: 1865670499} + - component: {fileID: 1865670502} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1865670497 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 +--- !u!124 &1865670498 +Behaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 +--- !u!114 &1865670499 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73231aa468d81ea49bc3d914080de185, type: 3} + m_Name: + m_EditorClassIdentifier: + ImageComparisonSettings: + TargetWidth: 512 + TargetHeight: 512 + TargetMSAASamples: 1 + PerPixelCorrectnessThreshold: 0.005 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 + RMSEThreshold: 0 + AverageCorrectnessThreshold: 0.0012 + IncorrectPixelsThreshold: 0.0000038146973 + UseHDR: 0 + UseBackBuffer: 0 + ImageResolution: 0 + ActiveImageTests: 1 + ActivePixelTests: -1 + WaitFrames: 10 + XRCompatible: 1 + gpuDrivenCompatible: 1 + CheckMemoryAllocation: 0 + renderBackendCompatibility: 0 + SetBackBufferResolution: 0 +--- !u!20 &1865670500 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 30 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1865670501 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + serializedVersion: 2 + m_LocalRotation: {x: -0.10438335, y: 0.8451999, z: -0.17909561, w: -0.49261156} + m_LocalPosition: {x: 8.582722, y: 5.52, z: 5.651631} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &1865670502 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: 0 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 163676336} + - {fileID: 1865670501} + - {fileID: 1726969900} + - {fileID: 63163429} + - {fileID: 341310083} + - {fileID: 30577813} + - {fileID: 553140007} + - {fileID: 133629213} + - {fileID: 1731902566} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Forward.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Forward.unity.meta new file mode 100644 index 00000000000..9d4f5c5631e --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_Forward.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c24f637f3ff55634cab3aff03c5f2dd2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_ForwardLinearMarching.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_ForwardLinearMarching.unity new file mode 100644 index 00000000000..05a676484a4 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_ForwardLinearMarching.unity @@ -0,0 +1,1098 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0, g: 0, b: 0, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 2.92 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 10 + m_BakeResolution: 10 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 0.5 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 4 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 0 + m_TextureCompression: 0 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 128 + m_PVRBounces: 1 + m_PVREnvironmentSampleCount: 128 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &30577811 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 30577813} + - component: {fileID: 30577812} + m_Layer: 0 + m_Name: Global Volume + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &30577812 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 30577811} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Core.Runtime::UnityEngine.Rendering.Volume + m_IsGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: e23d661539c592242a3fb894a59d15af, type: 2} +--- !u!4 &30577813 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 30577811} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.02411, y: 0, z: -1.04696} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &63163425 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 63163429} + - component: {fileID: 63163428} + - component: {fileID: 63163427} + - component: {fileID: 63163426} + m_Layer: 0 + m_Name: Plane (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 2147483647 + m_IsActive: 1 +--- !u!64 &63163426 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63163425} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &63163427 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63163425} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4bc338a1441d5b340a2399c2e45e31eb, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &63163428 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63163425} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &63163429 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 63163425} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 3} + m_LocalScale: {x: 1, y: 1, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &133629209 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 133629213} + - component: {fileID: 133629212} + - component: {fileID: 133629211} + - component: {fileID: 133629210} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &133629210 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133629209} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &133629211 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133629209} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9b02cdc6dbf754bf1aa60a08bf1c909d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &133629212 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133629209} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &133629213 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133629209} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.5, y: 1.72, z: -1.77} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &163676334 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 163676336} + - component: {fileID: 163676335} + m_Layer: 0 + m_Name: SelectQualityLevel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &163676335 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 163676334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f1decc188d2f3146ab93291a5c743e9, type: 3} + m_Name: + m_EditorClassIdentifier: + qualityLevelIndex: 14 + callbacks: [] +--- !u!4 &163676336 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 163676334} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.38117677, y: 6.107272, z: 0.46914768} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &341310080 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 341310083} + - component: {fileID: 341310082} + - component: {fileID: 341310081} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &341310081 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 341310080} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_CustomShadowLayers: 0 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 + m_RenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_ShadowRenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_Version: 4 + m_LightLayerMask: 1 + m_ShadowLayerMask: 1 + m_RenderingLayers: 1 + m_ShadowRenderingLayers: 1 +--- !u!108 &341310082 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 341310080} + m_Enabled: 1 + serializedVersion: 13 + m_Type: 1 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize2D: {x: 10, y: 10} + m_Shadows: + m_Type: 1 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 2 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 + m_ShapeRadius: 0 + m_ShadowAngle: 0 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 +--- !u!4 &341310083 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 341310080} + serializedVersion: 2 + m_LocalRotation: {x: 0.67504096, y: -0.12967286, z: -0.6366785, w: 0.34949282} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 17.862, y: -86.687, z: -139.345} +--- !u!1 &553140003 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 553140007} + - component: {fileID: 553140006} + - component: {fileID: 553140005} + - component: {fileID: 553140004} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &553140004 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553140003} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &553140005 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553140003} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 58bbc5d4f141a4cbc9e0f0cc569fdbca, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &553140006 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553140003} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &553140007 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 553140003} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -2.5, y: 3.13, z: 0.38} + m_LocalScale: {x: 0.21007, y: 6.5844, z: 9.327918} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1726969896 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1726969900} + - component: {fileID: 1726969899} + - component: {fileID: 1726969898} + - component: {fileID: 1726969897} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 2147483647 + m_IsActive: 1 +--- !u!64 &1726969897 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726969896} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1726969898 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726969896} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 5d32cb63ca65f0b48bd69d84dc9e42ff, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1726969899 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726969896} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1726969900 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726969896} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -2} + m_LocalScale: {x: 1, y: 1, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1731902562 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1731902566} + - component: {fileID: 1731902565} + - component: {fileID: 1731902564} + - component: {fileID: 1731902563} + m_Layer: 0 + m_Name: Cube (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1731902563 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1731902562} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1731902564 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1731902562} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9b02cdc6dbf754bf1aa60a08bf1c909d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1731902565 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1731902562} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1731902566 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1731902562} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.5, y: 1.56, z: 1.31} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1865670496 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1865670501} + - component: {fileID: 1865670500} + - component: {fileID: 1865670498} + - component: {fileID: 1865670497} + - component: {fileID: 1865670499} + - component: {fileID: 1865670502} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1865670497 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 +--- !u!124 &1865670498 +Behaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 +--- !u!114 &1865670499 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73231aa468d81ea49bc3d914080de185, type: 3} + m_Name: + m_EditorClassIdentifier: + ImageComparisonSettings: + TargetWidth: 512 + TargetHeight: 512 + TargetMSAASamples: 1 + PerPixelCorrectnessThreshold: 0.005 + PerPixelGammaThreshold: 0.003921569 + PerPixelAlphaThreshold: 0.003921569 + RMSEThreshold: 0 + AverageCorrectnessThreshold: 0.0012 + IncorrectPixelsThreshold: 0.0000038146973 + UseHDR: 0 + UseBackBuffer: 0 + ImageResolution: 0 + ActiveImageTests: 1 + ActivePixelTests: -1 + WaitFrames: 10 + XRCompatible: 1 + gpuDrivenCompatible: 1 + CheckMemoryAllocation: 0 + renderBackendCompatibility: 0 + SetBackBufferResolution: 0 +--- !u!20 &1865670500 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 30 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1865670501 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + serializedVersion: 2 + m_LocalRotation: {x: -0.10438335, y: 0.8451999, z: -0.17909561, w: -0.49261156} + m_LocalPosition: {x: 8.582722, y: 5.52, z: 5.651631} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &1865670502 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865670496} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: 0 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 163676336} + - {fileID: 1865670501} + - {fileID: 1726969900} + - {fileID: 63163429} + - {fileID: 341310083} + - {fileID: 30577813} + - {fileID: 553140007} + - {fileID: 133629213} + - {fileID: 1731902566} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_ForwardLinearMarching.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_ForwardLinearMarching.unity.meta new file mode 100644 index 00000000000..65496a3705b --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/Assets/Scenes/250_SSR_ForwardLinearMarching.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bb487e1697be66043b99b449091bc89b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/ProjectSettings/GraphicsSettings.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/ProjectSettings/GraphicsSettings.asset index dcbad8d7b5c..ffc1446431d 100644 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/ProjectSettings/GraphicsSettings.asset +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/ProjectSettings/GraphicsSettings.asset @@ -116,7 +116,15 @@ GraphicsSettings: UnityEngine.Rendering.Universal.UniversalRenderPipeline: {fileID: 11400000, guid: 7e7acb644b0c301488c70628952b1f1c, type: 2} m_ShaderBuildSettings: - keywordDeclarationOverrides: [] + keywordDeclarationOverrides: + - keywords: + - name: _ + keepInBuild: 1 + - name: _SCREEN_SPACE_REFLECTION + keepInBuild: 1 + variantGenerationMode: 3 + numInternalDefines: 0 + defines: [] m_LightsUseLinearIntensity: 1 m_LightsUseColorTemperature: 1 m_LogWhenShaderIsCompiled: 0 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/ProjectSettings/ProjectSettings.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/ProjectSettings/ProjectSettings.asset index d268cc447ab..b8441cfe5c2 100644 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/ProjectSettings/ProjectSettings.asset +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/ProjectSettings/ProjectSettings.asset @@ -698,15 +698,19 @@ PlayerSettings: webGLWebAssemblyBigInt: 0 webGLCloseOnQuit: 0 scriptingDefineSymbols: - Android: LWRP_DEBUG_STATIC_POSTFX - Nintendo Switch: LWRP_DEBUG_STATIC_POSTFX - PS4: LWRP_DEBUG_STATIC_POSTFX - Standalone: LWRP_DEBUG_STATIC_POSTFX - WebGL: LWRP_DEBUG_STATIC_POSTFX - Windows Store Apps: LWRP_DEBUG_STATIC_POSTFX - XboxOne: LWRP_DEBUG_STATIC_POSTFX - iPhone: LWRP_DEBUG_STATIC_POSTFX - tvOS: LWRP_DEBUG_STATIC_POSTFX + Android: LWRP_DEBUG_STATIC_POSTFX;URP_SCREEN_SPACE_REFLECTION + GameCoreScarlett: URP_SCREEN_SPACE_REFLECTION + GameCoreXboxOne: URP_SCREEN_SPACE_REFLECTION + Nintendo Switch: LWRP_DEBUG_STATIC_POSTFX;URP_SCREEN_SPACE_REFLECTION + Nintendo Switch 2: URP_SCREEN_SPACE_REFLECTION + PS4: LWRP_DEBUG_STATIC_POSTFX;URP_SCREEN_SPACE_REFLECTION + PS5: URP_SCREEN_SPACE_REFLECTION + Standalone: LWRP_DEBUG_STATIC_POSTFX;URP_SCREEN_SPACE_REFLECTION + WebGL: LWRP_DEBUG_STATIC_POSTFX;URP_SCREEN_SPACE_REFLECTION + Windows Store Apps: LWRP_DEBUG_STATIC_POSTFX;URP_SCREEN_SPACE_REFLECTION + XboxOne: LWRP_DEBUG_STATIC_POSTFX;URP_SCREEN_SPACE_REFLECTION + iPhone: LWRP_DEBUG_STATIC_POSTFX;URP_SCREEN_SPACE_REFLECTION + tvOS: LWRP_DEBUG_STATIC_POSTFX;URP_SCREEN_SPACE_REFLECTION additionalCompilerArguments: Standalone: - -warnaserror+ diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/ProjectSettings/QualitySettings.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/ProjectSettings/QualitySettings.asset index 1dc66ffb9c2..f6a7369b243 100644 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/ProjectSettings/QualitySettings.asset +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Lighting/ProjectSettings/QualitySettings.asset @@ -752,13 +752,70 @@ QualitySettings: terrainFadeLength: 5 terrainMaxTrees: 50 excludedTargetPlatforms: [] + - serializedVersion: 5 + name: 14-250_SSR + pixelLightCount: 4 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 4 + shadowDistance: 150 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + skinWeights: 4 + globalTextureMipmapLimit: 0 + textureMipmapLimitSettings: [] + anisotropicTextures: 2 + antiAliasing: 4 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + useLegacyDetailDistribution: 1 + adaptiveVsync: 0 + vSyncCount: 1 + realtimeGICPUUsage: 25 + adaptiveVsyncExtraA: 0 + adaptiveVsyncExtraB: 0 + lodBias: 2 + meshLodThreshold: 1 + maximumLODLevel: 0 + enableLODCrossFade: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4096 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 11400000, guid: 498e927d1873deb499fde229a98dc6b7, + type: 2} + terrainQualityOverrides: 0 + terrainPixelError: 1 + terrainDetailDensityScale: 1 + terrainBasemapDistance: 1000 + terrainDetailDistance: 80 + terrainTreeDistance: 5000 + terrainBillboardStart: 50 + terrainFadeLength: 5 + terrainMaxTrees: 50 + excludedTargetPlatforms: [] m_TextureMipmapLimitGroupNames: [] m_PerPlatformDefaultQuality: Android: 0 EmbeddedLinux: 0 LinuxHeadlessSimulation: 0 + GameCoreScarlett: 0 + GameCoreXboxOne: 0 Nintendo Switch: 0 QNX: 0 + Nintendo Switch 2: 0 Standalone: 0 VisionOS: 0 WebGL: 0 From f89c63c20180e86d311018f1e55e18628d55b17a Mon Sep 17 00:00:00 2001 From: Layla Arab Date: Wed, 4 Mar 2026 21:06:13 +0000 Subject: [PATCH 38/95] Add tracking to TerrainData in Surface Cache --- .../SurfaceCache/SurfaceCacheWorld.cs | 2 +- .../RenderPipeline/SceneUpdatesTracker.cs | 311 ++++++++++++++---- .../SurfaceCacheGIRendererFeature.cs | 258 +++++++++++++-- 3 files changed, 486 insertions(+), 85 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCacheWorld.cs b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCacheWorld.cs index c29c2d48d14..99738a0694f 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCacheWorld.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCacheWorld.cs @@ -429,7 +429,7 @@ public InstanceHandle AddInstance( Span isOpaque = stackalloc bool[1]; _materialPool.GetMaterialInfo(material.Value, out materialIndices[0], out bool isTransmissive); - isOpaque[0] = !isTransmissive; + isOpaque[0] = false; // This property is not used for terrain, set to false. Component comp = terrain; InstanceHandle instance = _instanceHandleSet.Add(); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/RenderPipeline/SceneUpdatesTracker.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/RenderPipeline/SceneUpdatesTracker.cs index 013db4ee8b9..e6f30ad8c26 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/RenderPipeline/SceneUpdatesTracker.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/RenderPipeline/SceneUpdatesTracker.cs @@ -12,13 +12,16 @@ namespace UnityEngine.Rendering.LiveGI internal class SceneChanges { public List addedMeshRenderers; - public List changedMeshRenderers; + public List changedMeshRenderers; public List removedMeshRenderers; public List addedTerrains; - public List changedTerrains; + public List changedTerrains; public List removedTerrains; - public List changedTerrainData; + + public List addedTerrainData; + public List changedTerrainData; + public List removedTerrainData; public List addedMaterials; public List removedMaterials; @@ -31,13 +34,17 @@ internal class SceneChanges public SceneChanges() { addedMeshRenderers = new List(); - changedMeshRenderers = new List(); + changedMeshRenderers = new List(); removedMeshRenderers = new List(); addedTerrains = new List(); - changedTerrains = new List(); + changedTerrains = new List(); removedTerrains = new List(); + addedTerrainData = new List(); + changedTerrainData = new List(); + removedTerrainData = new List(); + addedMaterials = new List(); removedMaterials = new List(); changedMaterials = new List(); @@ -51,6 +58,7 @@ public bool HasChanges() { return (addedMeshRenderers.Count | removedMeshRenderers.Count | changedMeshRenderers.Count | addedTerrains.Count | changedTerrains.Count | removedTerrains.Count + | addedTerrainData.Count | changedTerrainData.Count | removedTerrainData.Count | addedMaterials.Count | removedMaterials.Count | changedMaterials.Count | addedLights.Count | removedLights.Count | changedLights.Count) != 0; } @@ -65,6 +73,10 @@ public void Clear() removedTerrains.Clear(); changedTerrains.Clear(); + addedTerrainData.Clear(); + removedTerrainData.Clear(); + changedTerrainData.Clear(); + addedMaterials.Clear(); removedMaterials.Clear(); changedMaterials.Clear(); @@ -76,17 +88,23 @@ public void Clear() } [System.Flags] - internal enum ModifiedProperties { Transform = 1, Material = 2, IsStatic = 4, ShadowCasting = 8, Layer = 16 } + internal enum ModifiedProperties { Transform = 1, Material = 2, IsStatic = 4, ShadowCasting = 8, Layer = 16, Heightmap = 32, TreeInstances = 64, Holes = 128 } + + internal struct MeshRendererChanges + { + public MeshRenderer meshRenderer; + public ModifiedProperties changes; + } - internal struct MeshRendererInstanceChanges + internal struct TerrainChanges { - public MeshRenderer instance; + public Terrain terrain; public ModifiedProperties changes; } - internal struct TerrainInstanceChanges + internal struct TerrainDataChanges { - public Terrain instance; + public TerrainData terrainData; public ModifiedProperties changes; } @@ -119,7 +137,7 @@ public MaterialData(Material material, uint timestamp) public Timestamp timestamp; } - class MeshRendererInstanceData + class MeshRendererDescriptor { public Timestamp timestamp; public EntityId[] materialIDs; @@ -129,7 +147,7 @@ class MeshRendererInstanceData public ShadowCastingMode shadowCastingMode; } - class TerrainInstanceData + class TerrainDescriptor { public Timestamp timestamp; public EntityId materialID; @@ -139,38 +157,38 @@ class TerrainInstanceData public ShadowCastingMode shadowCastingMode; } - class TerrainDataSnapshot + class LightDescriptor { + public Light light; public Timestamp timestamp; - public Texture heightmapTexture; - public int treeInstanceCount; - public UnityEngine.Hash128 heightmapImageContentsHash; } - class LightData + class TerrainDataDescriptor { - public Light light; public Timestamp timestamp; + public TerrainData terrainData; + public int treeInstanceCount; + public Hash128 heightmapImageContentsHash; + public Hash128 holesContentsHash; } ObjectDispatcher m_ObjectDispatcher; - Dictionary m_MeshRenderers; - Dictionary m_Terrains; + Dictionary m_MeshRenderers; + Dictionary m_Terrains; + Dictionary m_TerrainData; Dictionary m_Materials; - Dictionary m_TerrainData; - Dictionary m_Lights; + Dictionary m_Lights; SceneChanges m_Changes; uint m_Timestamp; - public SceneUpdatesTracker() { m_Changes = new SceneChanges(); - m_MeshRenderers = new Dictionary(); - m_Terrains = new Dictionary(); - m_TerrainData = new Dictionary(); + m_MeshRenderers = new Dictionary(); + m_Terrains = new Dictionary(); + m_TerrainData = new Dictionary(); m_Materials = new Dictionary(); - m_Lights = new Dictionary(); + m_Lights = new Dictionary(); m_ObjectDispatcher = new ObjectDispatcher(); @@ -181,6 +199,7 @@ public SceneUpdatesTracker() m_ObjectDispatcher.EnableTransformTracking(ObjectDispatcher.TransformTrackingType.GlobalTRS); m_ObjectDispatcher.EnableTypeTracking(ObjectDispatcher.TypeTrackingFlags.SceneObjects); m_ObjectDispatcher.EnableTransformTracking(ObjectDispatcher.TransformTrackingType.GlobalTRS); + m_ObjectDispatcher.EnableTypeTracking(ObjectDispatcher.TypeTrackingFlags.SceneObjects | ObjectDispatcher.TypeTrackingFlags.Assets); m_ObjectDispatcher.EnableTypeTracking(ObjectDispatcher.TypeTrackingFlags.SceneObjects | ObjectDispatcher.TypeTrackingFlags.Assets); m_ObjectDispatcher.EnableTypeTracking(ObjectDispatcher.TypeTrackingFlags.SceneObjects); m_ObjectDispatcher.EnableTransformTracking(ObjectDispatcher.TransformTrackingType.GlobalTRS); @@ -199,6 +218,7 @@ public SceneChanges GetChanges(bool filterBakedLights) FindMeshRendererChanges(); FindTerrainChanges(); + FindTerrainDataChanges(); FindMaterialsChanges(); FindLightChanges(filterBakedLights); @@ -210,9 +230,9 @@ private void FindMaterialsChanges() using var materialChanges = m_ObjectDispatcher.GetTypeChangesAndClear(Unity.Collections.Allocator.Temp); // Handle added materials in mesh renderers - foreach (var meshRendererInstance in m_MeshRenderers.Values) + foreach (var meshRenderer in m_MeshRenderers.Values) { - foreach (var material in meshRendererInstance.materials) + foreach (var material in meshRenderer.materials) { MaterialData data = null; if (material == null) @@ -230,9 +250,9 @@ private void FindMaterialsChanges() } // Handle added materials in terrains - foreach (var terrainInstance in m_Terrains.Values) + foreach (var terrain in m_Terrains.Values) { - var material = terrainInstance.material; + var material = terrain.material; MaterialData data = null; if (material == null) continue; @@ -275,8 +295,7 @@ private void FindMaterialsChanges() // Handle changed materials foreach (Material changedMaterial in materialChanges.changed) { - MaterialData data; - if (!m_Materials.TryGetValue(changedMaterial.GetEntityId(), out data)) + if (!m_Materials.TryGetValue(changedMaterial.GetEntityId(), out var data)) continue; if (data.timestamp.creation == m_Timestamp) // if this is an instance that has just been added @@ -335,7 +354,7 @@ private void FindMeshRendererChanges() foreach (var item in changedRenderers) { var meshRenderer = item.Value.objectReference; - bool tranformChanged = item.Value.transformChanged; + bool transformChanged = item.Value.transformChanged; if (!meshRenderer.enabled || !meshRenderer.gameObject.activeInHierarchy) { @@ -345,17 +364,17 @@ private void FindMeshRendererChanges() if (!m_MeshRenderers.TryGetValue(meshRenderer.GetEntityId(), out var oldData)) { // This renderer was just added - var newData = CreateInstanceData(m_Timestamp, meshRenderer); + var newData = CreateMeshRendererDescriptor(m_Timestamp, meshRenderer); m_MeshRenderers.Add(meshRenderer.GetEntityId(), newData); m_Changes.addedMeshRenderers.Add(meshRenderer); continue; } - var data = CreateInstanceData(m_Timestamp, meshRenderer); + var data = CreateMeshRendererDescriptor(m_Timestamp, meshRenderer); ModifiedProperties changes = 0; - if (tranformChanged) + if (transformChanged) changes |= ModifiedProperties.Transform; if (!IntArraySequenceEqual(oldData.materialIDs, data.materialIDs)) @@ -369,10 +388,10 @@ private void FindMeshRendererChanges() if (changes != 0) { - m_Changes.changedMeshRenderers.Add(new MeshRendererInstanceChanges() + m_Changes.changedMeshRenderers.Add(new MeshRendererChanges() { changes = changes, - instance = meshRenderer + meshRenderer = meshRenderer }); m_MeshRenderers[meshRenderer.GetEntityId()] = data; @@ -380,6 +399,19 @@ private void FindMeshRendererChanges() } } + static MeshRendererDescriptor CreateMeshRendererDescriptor(uint timestamp, MeshRenderer meshRenderer) + { + return new MeshRendererDescriptor() + { + timestamp = new Timestamp { lastVisit = timestamp, creation = timestamp }, + isStatic = meshRenderer.gameObject.isStatic, + materials = meshRenderer.sharedMaterials, + materialIDs = Array.ConvertAll(meshRenderer.sharedMaterials, mat => mat != null ? mat.GetEntityId() : EntityId.None), + shadowCastingMode = meshRenderer.shadowCastingMode, + renderer = meshRenderer, + }; + } + private void FindTerrainChanges() { // Handle changed terrains @@ -416,7 +448,7 @@ private void FindTerrainChanges() foreach (var item in changedTerrains) { var terrain = item.Value.objectReference; - bool tranformChanged = item.Value.transformChanged; + bool transformChanged = item.Value.transformChanged; if (!terrain.enabled || !terrain.gameObject.activeInHierarchy) { @@ -426,17 +458,17 @@ private void FindTerrainChanges() if (!m_Terrains.TryGetValue(terrain.GetEntityId(), out var oldData)) { // This terrain was just added - var newData = CreateInstanceData(m_Timestamp, terrain); + var newData = CreateTerrainDescriptor(m_Timestamp, terrain); m_Terrains.Add(terrain.GetEntityId(), newData); m_Changes.addedTerrains.Add(terrain); continue; } - var data = CreateInstanceData(m_Timestamp, terrain); + var data = CreateTerrainDescriptor(m_Timestamp, terrain); ModifiedProperties changes = 0; - if (tranformChanged) + if (transformChanged) changes |= ModifiedProperties.Transform; if (oldData.materialID != data.materialID) @@ -450,10 +482,10 @@ private void FindTerrainChanges() if (changes != 0) { - m_Changes.changedTerrains.Add(new TerrainInstanceChanges() + m_Changes.changedTerrains.Add(new TerrainChanges() { changes = changes, - instance = terrain + terrain = terrain }); m_Terrains[terrain.GetEntityId()] = data; @@ -461,32 +493,137 @@ private void FindTerrainChanges() } } - static MeshRendererInstanceData CreateInstanceData(uint timestamp, MeshRenderer meshRenderer) + static TerrainDescriptor CreateTerrainDescriptor(uint timestamp, Terrain terrain) { - return new MeshRendererInstanceData() + return new TerrainDescriptor() { timestamp = new Timestamp { lastVisit = timestamp, creation = timestamp }, - isStatic = meshRenderer.gameObject.isStatic, - materials = meshRenderer.sharedMaterials, - materialIDs = Array.ConvertAll(meshRenderer.sharedMaterials, mat => mat != null ? mat.GetEntityId() : EntityId.None), - shadowCastingMode = meshRenderer.shadowCastingMode, - renderer = meshRenderer, + isStatic = terrain.gameObject.isStatic, + material = terrain.splatBaseMaterial, + materialID = terrain.splatBaseMaterial != null ? terrain.splatBaseMaterial.GetEntityId() : EntityId.None, + shadowCastingMode = terrain.shadowCastingMode, + terrain = terrain, }; } - static TerrainInstanceData CreateInstanceData(uint timestamp, Terrain terrain) + private void FindTerrainDataChanges() { - return new TerrainInstanceData() + var terrainDataChanges = m_ObjectDispatcher.GetTypeChangesAndClear(Unity.Collections.Allocator.Temp); + + // Handle removed terrain data + foreach (var key in terrainDataChanges.destroyedID) + { + m_TerrainData.Remove(key); + m_Changes.removedTerrainData.Add(key); + } + + // Update the remaining timestamps of the active terrain data + List keys = new List(m_TerrainData.Keys); + foreach (var key in keys) + { + if (!m_TerrainData[key].terrainData) + continue; + + m_TerrainData[key].timestamp.lastVisit = m_Timestamp; + } + + foreach (var obj in terrainDataChanges.changed) + { + var terrainData = obj as TerrainData; + if (terrainData == null) + continue; + + if (!m_TerrainData.TryGetValue(terrainData.GetEntityId(), out var oldData)) + { + // This terrain data was just added + var newData = CreateTerrainDataDescriptor(m_Timestamp, terrainData); + m_TerrainData.Add(terrainData.GetEntityId(), newData); + m_Changes.addedTerrainData.Add(terrainData); + continue; + } + + var data = CreateTerrainDataDescriptor(m_Timestamp, terrainData); + + ModifiedProperties changes = 0; + + if (oldData.treeInstanceCount != data.treeInstanceCount) + changes |= ModifiedProperties.TreeInstances; + + if (oldData.heightmapImageContentsHash != data.heightmapImageContentsHash) + changes |= ModifiedProperties.Heightmap; + + if (oldData.holesContentsHash != data.holesContentsHash) + changes |= ModifiedProperties.Holes; + + if (changes != 0) + { + m_Changes.changedTerrainData.Add(new TerrainDataChanges() + { + terrainData = terrainData, + changes = changes + }); + + m_TerrainData[terrainData.GetEntityId()] = data; + } + + // When holes change, the terrain material may have changed, so we need to refresh the terrain descriptors + if ((changes & ModifiedProperties.Holes) != 0) + RefreshTerrainDescriptorsForTerrainData(terrainData); + } + } + + static TerrainDataDescriptor CreateTerrainDataDescriptor(uint timestamp, TerrainData terrainData) + { + return new TerrainDataDescriptor() { timestamp = new Timestamp { lastVisit = timestamp, creation = timestamp }, - isStatic = terrain.gameObject.isStatic, - material = terrain.splatBaseMaterial, - materialID = terrain.splatBaseMaterial != null ? terrain.splatBaseMaterial.GetEntityId() : EntityId.None, - shadowCastingMode = terrain.shadowCastingMode, - terrain = terrain, + terrainData = terrainData, + treeInstanceCount = terrainData.treeInstanceCount, + heightmapImageContentsHash = terrainData.heightmapTexture != null ? GetTerrainDataHeightmapHash(terrainData) : new Hash128(), + holesContentsHash = terrainData.holesTexture != null ? GetTerrainDataHolesHash(terrainData) : new Hash128() }; } + static void RefreshTerrainDescriptorAndEmitChanges( + Terrain terrain, + Dictionary terrains, + List changedTerrains, + Dictionary terrainData, + uint timestamp) + { + var entityId = terrain.GetEntityId(); + Debug.Assert(terrains.ContainsKey(entityId)); + var oldDescriptor = terrains[entityId]; + + var newDescriptor = CreateTerrainDescriptor(timestamp, terrain); + newDescriptor.timestamp = oldDescriptor.timestamp; + + if (oldDescriptor.materialID != newDescriptor.materialID) + { + changedTerrains.Add(new TerrainChanges() + { + changes = ModifiedProperties.Material, + terrain = terrain + }); + } + + terrains[entityId] = newDescriptor; + } + + void RefreshTerrainDescriptorsForTerrainData(TerrainData terrainData) + { + var terrainsToRefresh = new List(); + foreach (var kvp in m_Terrains) + { + var descriptor = kvp.Value; + if (descriptor.terrain != null && descriptor.terrain.terrainData == terrainData) + terrainsToRefresh.Add(descriptor.terrain); + } + + foreach (var terrain in terrainsToRefresh) + RefreshTerrainDescriptorAndEmitChanges(terrain, m_Terrains, m_Changes.changedTerrains, m_TerrainData, m_Timestamp); + } + static private bool ShouldIncludeLight(Light light, bool filterBakedLights) { return light.enabled && @@ -530,7 +667,7 @@ private void FindLightChanges(bool filterBakedLights) if (!ShouldIncludeLight(light, filterBakedLights)) continue; - var newData = CreateLightData(m_Timestamp, light); + var newData = CreateLightDescriptor(m_Timestamp, light); // Newly added lights if (!m_Lights.ContainsKey(light.GetEntityId())) @@ -546,15 +683,63 @@ private void FindLightChanges(bool filterBakedLights) } } - LightData CreateLightData(uint timestamp, Light light) + static LightDescriptor CreateLightDescriptor(uint timestamp, Light light) { - return new LightData() + return new LightDescriptor() { timestamp = new Timestamp { lastVisit = timestamp, creation = timestamp }, light = light, }; } + static Hash128 GetTerrainDataHeightmapHash(TerrainData terrainData) + { + Hash128 hash = new Hash128(); + + var resolution = terrainData.heightmapResolution; + if (resolution == 0) + return hash; + + var heights = terrainData.GetHeights(0, 0, resolution, resolution); + for (var y = 0; y < resolution; y++) + { + var row = new float[resolution]; + for (var x = 0; x < resolution; x++) + { + row[x] = heights[y, x]; + } + hash.Append(row); + } + + var scale = terrainData.heightmapScale; + hash.Append(scale.x); + hash.Append(scale.y); + hash.Append(scale.z); + + return hash; + } + + static Hash128 GetTerrainDataHolesHash(TerrainData terrainData) + { + Hash128 hash = new Hash128(); + + var holesResolution = terrainData.holesResolution; + if (holesResolution == 0) + return hash; + + var holes = terrainData.GetHoles(0, 0, holesResolution, holesResolution); + for (var y = 0; y < holesResolution; y++) + { + var row = new byte[holesResolution]; + for (var x = 0; x < holesResolution; x++) + { + row[x] = holes[y, x] ? (byte)1 : (byte)0; + } + hash.Append(row); + } + return hash; + } + struct ChangedObject where T : Component { @@ -562,7 +747,7 @@ struct ChangedObject public bool transformChanged; } - Dictionary> MergeChanges(Object[] changedRenderers, Component[] changedTransforms) + static Dictionary> MergeChanges(Object[] changedRenderers, Component[] changedTransforms) where T : Component { var map = new Dictionary>(); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs index 6187a5ba71e..8ec7e36c1b5 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs @@ -339,7 +339,7 @@ private class ScreenIrradianceUpsamplingPassData private Matrix4x4 _prevClipToWorldTransform = Matrix4x4.identity; - readonly private uint _environmentCubemapResolution = 32; + private readonly uint _environmentCubemapResolution = 32; public SurfaceCachePass( RayTracingContext rtContext, @@ -579,6 +579,9 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer changes.addedTerrains, changes.changedTerrains, changes.removedTerrains, + changes.addedTerrainData, + changes.changedTerrainData, + changes.removedTerrainData, _fallbackMaterial); const bool multiplyPunctualLightIntensityByPI = false; @@ -886,6 +889,21 @@ class WorldAdapter : IDisposable private MaterialPool.MaterialDescriptor _fallbackMaterialDescriptor; private MaterialHandle _fallbackMaterialHandle; + // Maps TerrainData EntityID to list of Terrains that use that TerrainData + private readonly Dictionary> _terrainDataToTerrains = new(); + +#if UNITY_EDITOR + private class TerrainRebuild + { + public Terrain terrain; + public double timeSinceLastChange; + public EntityId materialEntityId; + } + + private readonly Dictionary _deferredTerrainRebuilds = new(); + private const double k_TerrainRebuildDelay = 0.5; +#endif + public WorldAdapter(SurfaceCacheWorld world, Material fallbackMaterial) { _fallbackMaterialDescriptor = MaterialPool.ConvertUnityMaterialToMaterialDescriptor(fallbackMaterial); @@ -894,7 +912,7 @@ public WorldAdapter(SurfaceCacheWorld world, Material fallbackMaterial) _entityIDToWorldMaterialDescriptors.Add(fallbackMaterial.GetEntityId(), _fallbackMaterialDescriptor); } - public void UpdateMaterials(SurfaceCacheWorld world, List addedMaterials, List removedMaterials, List changedMaterials) + internal void UpdateMaterials(SurfaceCacheWorld world, List addedMaterials, List removedMaterials, List changedMaterials) { UpdateMaterials(world, _entityIDToWorldMaterialHandles, _entityIDToWorldMaterialDescriptors, addedMaterials, removedMaterials, changedMaterials); } @@ -987,29 +1005,19 @@ private static void UpdateLights( internal void UpdateMeshRenderers( SurfaceCacheWorld world, List addedMeshRenderers, - List changedMeshRenderers, + List changedMeshRenderers, List removedMeshRenderers, Material fallbackMaterial) { UpdateMeshRenderers(world, _entityIDToWorldInstanceHandles, _entityIDToWorldMaterialHandles, addedMeshRenderers, changedMeshRenderers, removedMeshRenderers, fallbackMaterial); } - internal void UpdateTerrains( - SurfaceCacheWorld world, - List addedTerrains, - List changedTerrains, - List removedTerrains, - Material fallbackMaterial) - { - UpdateTerrains(world, _entityIDToWorldInstanceHandles, _entityIDToWorldMaterialHandles, addedTerrains, changedTerrains, removedTerrains, fallbackMaterial); - } - private static void UpdateMeshRenderers( SurfaceCacheWorld world, Dictionary entityIDToInstanceHandle, Dictionary entityIDToMaterialHandle, List addedMeshRenderers, - List changedMeshRenderers, + List changedMeshRenderers, List removedMeshRenderers, Material fallbackMaterial) { @@ -1054,7 +1062,7 @@ private static void UpdateMeshRenderers( foreach (var meshRendererUpdate in changedMeshRenderers) { - var meshRenderer = meshRendererUpdate.instance; + var meshRenderer = meshRendererUpdate.meshRenderer; var gameObject = meshRenderer.gameObject; Debug.Assert(entityIDToInstanceHandle.ContainsKey(meshRenderer.GetEntityId())); @@ -1088,22 +1096,105 @@ private static void UpdateMeshRenderers( } } - private void UpdateTerrains( + internal void UpdateTerrains( + SurfaceCacheWorld world, + List addedTerrains, + List changedTerrains, + List removedTerrains, + List addedTerrainData, + List changedTerrainData, + List removedTerrainData, + Material fallbackMaterial) + { + UpdateTerrains(world, _entityIDToWorldInstanceHandles, _entityIDToWorldMaterialHandles, addedTerrains, changedTerrains, removedTerrains, addedTerrainData, changedTerrainData, removedTerrainData, _terrainDataToTerrains +#if UNITY_EDITOR + , _deferredTerrainRebuilds +#endif + , fallbackMaterial); + } + + private static void UpdateTerrains( SurfaceCacheWorld world, Dictionary entityIDToInstanceHandle, Dictionary entityIDToMaterialHandle, List addedTerrains, - List changedTerrains, + List changedTerrains, List removedTerrains, - Material fallbackMaterial) + List addedTerrainData, + List changedTerrainData, + List removedTerrainData, + Dictionary> terrainDataToTerrains +#if UNITY_EDITOR + , Dictionary deferredTerrainRebuilds +#endif + , Material fallbackMaterial) { foreach (var terrainEntityID in removedTerrains) { +#if UNITY_EDITOR + deferredTerrainRebuilds.Remove(terrainEntityID); +#endif + if (entityIDToInstanceHandle.TryGetValue(terrainEntityID, out var instanceHandle)) { world.RemoveInstance(instanceHandle); entityIDToInstanceHandle.Remove(terrainEntityID); } + + foreach (var entry in terrainDataToTerrains) + { + var terrainToRemove = entry.Value.Find(t => t.GetEntityId() == terrainEntityID); + if (terrainToRemove != null) + { + entry.Value.Remove(terrainToRemove); + break; + } + } + } +#if UNITY_EDITOR + // Rebuild terrains whose heightmap/tree changes have been idle past the delay + ProcessDeferredTerrainRebuilds(world, entityIDToInstanceHandle, entityIDToMaterialHandle, deferredTerrainRebuilds, fallbackMaterial); +#endif + // Register existing terrains that were reassigned to this newly seen TerrainData + foreach (var terrainData in addedTerrainData) + { + var terrainDataEntityID = terrainData.GetEntityId(); + if (!terrainDataToTerrains.TryGetValue(terrainDataEntityID, out var terrainList)) + { + terrainList = new List(); + terrainDataToTerrains[terrainDataEntityID] = terrainList; + } + + var toMove = new List(); + foreach (var entry in terrainDataToTerrains) + { + if (entry.Key == terrainDataEntityID) + continue; + foreach (var terrain in entry.Value) + { + if (terrain.terrainData == terrainData && entityIDToInstanceHandle.ContainsKey(terrain.GetEntityId())) + toMove.Add(terrain); + } + } + + // Remove each reassigned terrain from its old list, add to this TerrainData's list, + // and rebuild the world instance so geometry matches the new TerrainData + foreach (var terrain in toMove) + { + foreach (var entry in terrainDataToTerrains) + { + if (entry.Value.Remove(terrain)) + break; + } + terrainList.Add(terrain); + var terrainEntityID = terrain.GetEntityId(); + if (!entityIDToInstanceHandle.TryGetValue(terrainEntityID, out var instanceHandle)) + continue; + var material = terrain.splatBaseMaterial; + var matEntityId = material == null ? fallbackMaterial.GetEntityId() : material.GetEntityId(); + RebuildTerrainInstance(world, entityIDToInstanceHandle, entityIDToMaterialHandle, + terrain, terrainEntityID, instanceHandle, matEntityId, fallbackMaterial); + } } foreach (var terrain in addedTerrains) @@ -1113,17 +1204,33 @@ private void UpdateTerrains( var material = terrain.splatBaseMaterial; var matEntityId = material == null ? fallbackMaterial.GetEntityId() : material.GetEntityId(); var materialHandle = entityIDToMaterialHandle[matEntityId]; - uint mask = 1u; + uint mask = 1u; InstanceHandle instance = world.AddInstance(terrain, materialHandle, mask, in localToWorldMatrix); var entityID = terrain.GetEntityId(); Debug.Assert(!entityIDToInstanceHandle.ContainsKey(entityID)); entityIDToInstanceHandle.Add(entityID, instance); + + var terrainData = terrain.terrainData; + if (terrainData != null) + { + var terrainDataEntityID = terrainData.GetEntityId(); + if (!terrainDataToTerrains.TryGetValue(terrainDataEntityID, out var terrainList)) + { + terrainList = new List(); + terrainDataToTerrains[terrainDataEntityID] = terrainList; + } + + if (!terrainList.Contains(terrain)) + { + terrainList.Add(terrain); + } + } } foreach (var terrainUpdate in changedTerrains) { - var terrain = terrainUpdate.instance; + var terrain = terrainUpdate.terrain; var gameObject = terrain.gameObject; Debug.Assert(entityIDToInstanceHandle.ContainsKey(terrain.GetEntityId())); @@ -1145,11 +1252,120 @@ private void UpdateTerrains( var mask = material != null ? 1u : 0u; - world.UpdateInstanceMask(instanceHandle, new uint[] { mask } ); + world.UpdateInstanceMask(instanceHandle, new uint[] { mask }); + } + } + + foreach (var terrainDataEntityID in removedTerrainData) + { + terrainDataToTerrains.Remove(terrainDataEntityID); + } + + foreach (var terrainDataUpdate in changedTerrainData) + { + var terrainData = terrainDataUpdate.terrainData; + var changes = terrainDataUpdate.changes; + + var terrainDataEntityID = terrainData.GetEntityId(); + if (!terrainDataToTerrains.TryGetValue(terrainDataEntityID, out var affectedTerrains)) + continue; + + if ((changes & ModifiedProperties.Heightmap) == 0 && (changes & ModifiedProperties.Holes) == 0) + continue; + + foreach (var terrain in affectedTerrains) + { + var terrainEntityID = terrain.GetEntityId(); + + if (!entityIDToInstanceHandle.TryGetValue(terrainEntityID, out var instanceHandle)) + continue; + + var material = terrain.splatBaseMaterial; + var matEntityId = material == null ? fallbackMaterial.GetEntityId() : material.GetEntityId(); + +#if UNITY_EDITOR + // Delay the removing and re-adding the terrain when in the editor + // to avoid lag when the user is actively editing the terrain + if (deferredTerrainRebuilds.TryGetValue(terrainEntityID, out var pending)) + { + pending.timeSinceLastChange = UnityEditor.EditorApplication.timeSinceStartup; + pending.materialEntityId = matEntityId; + } + else + { + deferredTerrainRebuilds[terrainEntityID] = new TerrainRebuild + { + terrain = terrain, + timeSinceLastChange = UnityEditor.EditorApplication.timeSinceStartup, + materialEntityId = matEntityId + }; + } +#else + // Immediately remove and re-add the terrain to World in a Player + RebuildTerrainInstance(world, entityIDToInstanceHandle, entityIDToMaterialHandle, + terrain, terrainEntityID, instanceHandle, matEntityId, fallbackMaterial); +#endif } } } +#if UNITY_EDITOR + private static void ProcessDeferredTerrainRebuilds( + SurfaceCacheWorld world, + Dictionary entityIDToInstanceHandle, + Dictionary entityIDToMaterialHandle, + Dictionary terrainRebuilds, + Material fallbackMaterial) + { + // Rebuild terrains that have been idle past the delay (avoids lag while editing) + var currentTime = UnityEditor.EditorApplication.timeSinceStartup; + var terrainsToRebuild = new List(); + + foreach (var entry in terrainRebuilds) + { + if (currentTime - entry.Value.timeSinceLastChange >= k_TerrainRebuildDelay) + { + terrainsToRebuild.Add(entry.Key); + } + } + + foreach (var terrainEntityID in terrainsToRebuild) + { + var pending = terrainRebuilds[terrainEntityID]; + + if (entityIDToInstanceHandle.TryGetValue(terrainEntityID, out var instanceHandle)) + { + RebuildTerrainInstance(world, entityIDToInstanceHandle, entityIDToMaterialHandle, pending.terrain, terrainEntityID, instanceHandle, pending.materialEntityId, fallbackMaterial); + } + + terrainRebuilds.Remove(terrainEntityID); + } + } +#endif + + private static void RebuildTerrainInstance( + SurfaceCacheWorld world, + Dictionary entityIDToInstanceHandle, + Dictionary entityIDToMaterialHandle, + Terrain terrain, + EntityId terrainEntityID, + InstanceHandle instanceHandle, + EntityId materialEntityId, + Material fallbackMaterial) + { + world.RemoveInstance(instanceHandle); + entityIDToInstanceHandle.Remove(terrainEntityID); + + var localToWorldMatrix = terrain.transform.localToWorldMatrix; + var fallbackMaterialHandle = entityIDToMaterialHandle[fallbackMaterial.GetEntityId()]; + var materialHandle = entityIDToMaterialHandle.GetValueOrDefault(materialEntityId, fallbackMaterialHandle); + uint mask = 1u; + + InstanceHandle instance = world.AddInstance(terrain, materialHandle, mask, in localToWorldMatrix); + Debug.Assert(!entityIDToInstanceHandle.ContainsKey(terrainEntityID)); + entityIDToInstanceHandle.Add(terrainEntityID, instance); + } + public void Dispose() { CoreUtils.Destroy(_fallbackMaterialDescriptor.Albedo); From e756659a7e69d0f9f7d652e04b5b0707ec6246f3 Mon Sep 17 00:00:00 2001 From: Sumin Cho Date: Thu, 5 Mar 2026 03:04:14 +0000 Subject: [PATCH 39/95] Add warning message for Probe Volumes in Rendering Debugger --- .../Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs index 99ffcf56b71..d2303810a94 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs @@ -458,6 +458,15 @@ void RefreshDebug(DebugUI.Field field, T value) widgetList.Add(new DebugUI.RuntimeDebugShadersMessageBox()); +#if !UNITY_EDITOR + widgetList.Add(new DebugUI.MessageBox + { + displayName = "Warning: Probe Volume debugging is not supported in the Player.", + style = DebugUI.MessageBox.Style.Warning, + flags = DebugUI.Flags.RuntimeOnly + }); +#endif + var subdivContainer = new DebugUI.Container() { displayName = "Subdivision Visualization", From 2511b18df4cb7bf07409ac6354b4f850165d74bb Mon Sep 17 00:00:00 2001 From: Arttu Peltonen Date: Thu, 5 Mar 2026 06:12:01 +0000 Subject: [PATCH 40/95] Fix stripping for URP Debug Shaders --- .../UniversalDebugShaderStripper.cs | 18 ++++++++++++++++++ .../UniversalDebugShaderStripper.cs.meta | 3 +++ .../Runtime/Debug/DebugHandler.cs | 2 +- .../UniversalRenderPipelineDebugShaders.cs | 11 +++-------- 4 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/UniversalDebugShaderStripper.cs create mode 100644 Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/UniversalDebugShaderStripper.cs.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/UniversalDebugShaderStripper.cs b/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/UniversalDebugShaderStripper.cs new file mode 100644 index 00000000000..e7bf4cf580e --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/UniversalDebugShaderStripper.cs @@ -0,0 +1,18 @@ +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +namespace UnityEditor.Rendering +{ + class UniversalDebugShaderStripper : IRenderPipelineGraphicsSettingsStripper + { + public bool active => true; + + public bool CanRemoveSettings(UniversalRenderPipelineDebugShaders settings) + { + if (!CoreBuildData.instance.developmentBuild) + return true; + + return GraphicsSettings.GetRenderPipelineSettings()?.stripRuntimeDebugShaders ?? false; + } + } +} diff --git a/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/UniversalDebugShaderStripper.cs.meta b/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/UniversalDebugShaderStripper.cs.meta new file mode 100644 index 00000000000..cef7830885b --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Editor/BuildProcessors/GraphicsSettingsStrippers/UniversalDebugShaderStripper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6728b86022214f8a8337014ddb1b4b0e +timeCreated: 1772610774 \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Debug/DebugHandler.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Debug/DebugHandler.cs index f1da7614340..5403e6287c3 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Debug/DebugHandler.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Debug/DebugHandler.cs @@ -136,7 +136,7 @@ public bool TryGetScreenClearColor(ref Color color) internal bool HDRDebugViewIsActive(bool resolveFinalTarget) { // HDR debug views should only apply to the last camera in the stack - return DebugDisplaySettings.lightingSettings.hdrDebugMode != HDRDebugMode.None && resolveFinalTarget; + return m_HDRDebugViewMaterial != null && DebugDisplaySettings.lightingSettings.hdrDebugMode != HDRDebugMode.None && resolveFinalTarget; } internal bool WriteToDebugScreenTexture(bool resolveFinalTarget) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RenderPipelineResources/UniversalRenderPipelineDebugShaders.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RenderPipelineResources/UniversalRenderPipelineDebugShaders.cs index 9c22009a540..3bec01e0021 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RenderPipelineResources/UniversalRenderPipelineDebugShaders.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RenderPipelineResources/UniversalRenderPipelineDebugShaders.cs @@ -8,7 +8,7 @@ namespace UnityEngine.Rendering.Universal /// /// You cannot edit these resources through the editor's UI; use the API for advanced changes. /// Changing this through the API is only allowed in the Editor. In the Player, this raises an error. - /// + /// /// This container is removed for non-development build. /// /// @@ -17,7 +17,7 @@ namespace UnityEngine.Rendering.Universal /// /// using UnityEngine.Rendering; /// using UnityEngine.Rendering.Universal; - /// + /// /// public static class URPUniversalRendererDebugShadersHelper /// { /// public static Shader replacementPS @@ -43,12 +43,7 @@ public class UniversalRenderPipelineDebugShaders : IRenderPipelineResources /// public int version => 0; - bool IRenderPipelineGraphicsSettings.isAvailableInPlayerBuild => -#if DEVELOPMENT_BUILD || UNITY_EDITOR - true; -#else - false; -#endif + bool IRenderPipelineGraphicsSettings.isAvailableInPlayerBuild => true; [SerializeField] [ResourcePath("Shaders/Debug/DebugReplacement.shader")] From af68df02aee93e66bfded02e06dbb75a50a9d923 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Thu, 5 Mar 2026 06:12:03 +0000 Subject: [PATCH 41/95] [VFX] Fix Sort.compute crash caused by OOB buffer access --- .../com.unity.visualeffectgraph/Shaders/Sort.compute | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Packages/com.unity.visualeffectgraph/Shaders/Sort.compute b/Packages/com.unity.visualeffectgraph/Shaders/Sort.compute index 217e205ddda..419fea2b19e 100644 --- a/Packages/com.unity.visualeffectgraph/Shaders/Sort.compute +++ b/Packages/com.unity.visualeffectgraph/Shaders/Sort.compute @@ -41,13 +41,6 @@ #define USE_ALTERNATE_BITONIC_NETWORK 0 #endif -// Some platforms require the use of a dynamic branch when accessing buffers that could be out of bounds -#if defined(SHADER_API_SWITCH) || defined(SHADER_API_SWITCH2) -#define USE_DYNAMIC_BRANCH UNITY_BRANCH -#else -#define USE_DYNAMIC_BRANCH -#endif - #define ELEMENTS_PER_THREAD (2 * ITERATIONS_COUNT) #define BITONIC_THREADS_COUNT ELEMENTS_COUNT / ELEMENTS_PER_THREAD #define MERGE_THREADS_COUNT ELEMENTS_COUNT @@ -120,7 +113,7 @@ void LoadFromMemory(uint3 groupId, uint ldsIndex) KVP kvp = { REJECTED_VALUE, 0xFFFFFFFF }; - USE_DYNAMIC_BRANCH + UNITY_BRANCH if (instanceDstIndex < GetElementCount(groupId.z)) kvp = inputSequence[totalInstanceCount + memIndex]; @@ -254,7 +247,7 @@ void MERGE_PASS(uint3 groupId : SV_GroupID, const int arrayStart = arraySize * (id / arraySize); // If the current array considered is less than one half filled (due to element count), we can copy it directly as it is already sorted - USE_DYNAMIC_BRANCH + UNITY_BRANCH if (GetElementCount(groupId.z) - (uint)arrayStart <= subArraySize) { #if FINAL_PASS From d428bb30f22f091769d6e3cfd078d636e0374cdb Mon Sep 17 00:00:00 2001 From: Cian Noonan Date: Thu, 5 Mar 2026 06:12:03 +0000 Subject: [PATCH 42/95] Correct cases where we could fail to update HDRP VolumeProfile component list --- .../Editor/BuildProcessors/HDRPPreprocessBuild.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessBuild.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessBuild.cs index 466f109fec8..6f5f580b732 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessBuild.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessBuild.cs @@ -41,10 +41,19 @@ public void OnPreprocessBuild(BuildReport report) ConfigureMinimumMaxLoDValueForAllQualitySettings(); - if (HDRenderPipelineGlobalSettings.instance.TryInitializeDefaultVolumeProfile(out var defaultVolumeProfileSettings) || - VolumeProfileUtils.TryEnsureAllOverridesForDefaultProfile(defaultVolumeProfileSettings?.volumeProfile)) + if (HDRenderPipelineGlobalSettings.instance.TryInitializeDefaultVolumeProfile(out var defaultVolumeProfileSettings)) { - Debug.Log("Default Volume Profile has been modified to ensure all overrides are present. This is required to avoid missing overrides at runtime which can lead to unexpected rendering issues. Please save these changes to avoid this message in the future."); + Debug.Log("Default Volume Profile has been created or Diffusion Profiles have been updated to ensure all components are present. This is required to avoid missing overrides at runtime which can lead to unexpected rendering issues. Please save these changes to avoid this message in the future."); + } + + if (defaultVolumeProfileSettings == null) + { + throw new BuildFailedException("Failed to initialize the Default Volume Profile. A Default Volume Profile is required for HDRP to function properly."); + } + + if (VolumeProfileUtils.TryEnsureAllOverridesForDefaultProfile(defaultVolumeProfileSettings.volumeProfile)) + { + Debug.Log("Default Volume Profile has been modified to ensure all components are present. This is required to avoid missing overrides at runtime which can lead to unexpected rendering issues. Please save these changes to avoid this message in the future."); } LogIncludedAssets(m_BuildData.renderPipelineAssets); From db4fe975bb236bde9a17d4a9ad6516c19ced6f7e Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Thu, 5 Mar 2026 16:22:10 +0000 Subject: [PATCH 43/95] CHANGE: bump com.unity.performance.profile-analyzer to 1.3.2 --- .../Projects/VisualEffectGraph_HDRP/Packages/manifest.json | 2 +- .../Projects/VisualEffectGraph_URP/Packages/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Packages/manifest.json b/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Packages/manifest.json index d4d7d2fbad8..d357277dd83 100644 --- a/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Packages/manifest.json +++ b/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Packages/manifest.json @@ -5,7 +5,7 @@ "com.unity.ide.rider": "3.0.22", "com.unity.ide.visualstudio": "2.0.18", "com.unity.inputsystem": "1.6.1", - "com.unity.performance.profile-analyzer": "1.2.2", + "com.unity.performance.profile-analyzer": "1.3.2", "com.unity.render-pipelines.core": "file:../../../../../Packages/com.unity.render-pipelines.core", "com.unity.render-pipelines.high-definition": "file:../../../../../Packages/com.unity.render-pipelines.high-definition", "com.unity.render-pipelines.high-definition-config": "file:../../../../../Packages/com.unity.render-pipelines.high-definition-config", diff --git a/Tests/SRPTests/Projects/VisualEffectGraph_URP/Packages/manifest.json b/Tests/SRPTests/Projects/VisualEffectGraph_URP/Packages/manifest.json index fd8fd3c0e83..b7ec3e084f7 100644 --- a/Tests/SRPTests/Projects/VisualEffectGraph_URP/Packages/manifest.json +++ b/Tests/SRPTests/Projects/VisualEffectGraph_URP/Packages/manifest.json @@ -4,7 +4,7 @@ "dependencies": { "com.unity.ide.rider": "3.0.22", "com.unity.ide.visualstudio": "2.0.18", - "com.unity.performance.profile-analyzer": "1.2.2", + "com.unity.performance.profile-analyzer": "1.3.2", "com.unity.render-pipelines.core": "file:../../../../../Packages/com.unity.render-pipelines.core", "com.unity.render-pipelines.universal": "file:../../../../../Packages/com.unity.render-pipelines.universal", "com.unity.render-pipelines.universal-config": "file:../../../../../Packages/com.unity.render-pipelines.universal-config", From baff45e907cffbeca78b22b25f453c94e4f9c3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20V=C3=A1zquez?= Date: Thu, 5 Mar 2026 22:24:47 +0000 Subject: [PATCH 44/95] [Render Pipeline Converter]Multiple fixes --- .../Tools/Converter/AssetsConverter.cs | 31 +++++++++++++- .../RenderPipelineConverterAssetItem.cs | 8 +++- ...RenderPipelineConverterMaterialUpgrader.cs | 3 ++ .../RenderPipelineConverterVisualElement.cs | 18 +++++++- .../Window/RenderPipelineConvertersEditor.cs | 42 ++++++++++++------- .../BuiltInToHDRPMaterialUpgrader.cs | 14 +++++++ .../BuiltInToURP2DShaderConverter.cs | 15 +++++++ .../Converter/URP3DToURP2DShaderConverter.cs | 14 +++++++ .../AnimationClipConverter.cs | 29 ++++++++++--- .../BuiltInToURP3DMaterialUpgrader.cs | 15 +++++++ .../Tools/Converters/PPv2/PPv2Converter.cs | 27 ++++++++---- 11 files changed, 182 insertions(+), 34 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/AssetsConverter.cs b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/AssetsConverter.cs index cb27aafa418..9f1b51c9221 100644 --- a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/AssetsConverter.cs +++ b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/AssetsConverter.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using UnityEngine; namespace UnityEditor.Rendering.Converter { @@ -24,16 +25,42 @@ void OnSearchFinish() onScanFinish?.Invoke(returnList); } + var processedIds = new HashSet(); + SearchServiceUtils.RunQueuedSearch ( SearchServiceUtils.IndexingOptions.DeepSearch, contextSearchQueriesAndIds, (item, description) => { - var assetItem = new RenderPipelineConverterAssetItem(item.id) + // Direct conversion - works for both assets and scene objects + var unityObject = item.ToObject(); + + if (unityObject == null) + return; + + // Ensure we're always working with GameObjects + GameObject go = null; + + if (unityObject is GameObject gameObject) + go = gameObject; + else if (unityObject is Component component) + go = component.gameObject; + else + return; // Not a GameObject or Component + + var gid = GlobalObjectId.GetGlobalObjectIdSlow(go); + if (!processedIds.Add(gid.ToString())) + return; + + int type = gid.identifierType; // 1=Asset, 2=SceneObject + + var assetItem = new RenderPipelineConverterAssetItem(gid.ToString()) { - info = description + name = $"{unityObject.name} ({(type == 1 ? "Prefab" : "SceneObject")})", + info = type == 1 ? AssetDatabase.GetAssetPath(unityObject) : go.scene.path, }; + assets.Add(assetItem); }, OnSearchFinish diff --git a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/RenderPipelineConverterAssetItem.cs b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/RenderPipelineConverterAssetItem.cs index de8db770eb8..6ea909ec366 100644 --- a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/RenderPipelineConverterAssetItem.cs +++ b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/RenderPipelineConverterAssetItem.cs @@ -30,7 +30,13 @@ public string guid public string GlobalObjectId => m_GlobalObjectId; - public string name => System.IO.Path.GetFileNameWithoutExtension(assetPath); + [SerializeField] + private string m_Name; + public string name + { + get => string.IsNullOrEmpty(m_Name) ? System.IO.Path.GetFileNameWithoutExtension(assetPath) : m_Name; + set => m_Name = value; + } [SerializeField] private string m_Info; diff --git a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/RenderPipelineConverterMaterialUpgrader.cs b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/RenderPipelineConverterMaterialUpgrader.cs index d4c0681e554..d8abea0461c 100644 --- a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/RenderPipelineConverterMaterialUpgrader.cs +++ b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/RenderPipelineConverterMaterialUpgrader.cs @@ -76,6 +76,9 @@ public void OnClicked() [Serializable] internal abstract class RenderPipelineConverterMaterialUpgrader : IRenderPipelineConverter { + public virtual bool isEnabled => m_UpgradersCache != null && m_UpgradersCache.Count > 0; + public virtual string isDisabledMessage => "No material upgraders specified for this converter."; + /// /// List of material upgraders to use for this converter. /// diff --git a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConverterVisualElement.cs b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConverterVisualElement.cs index c2fa84830db..144174199d2 100644 --- a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConverterVisualElement.cs +++ b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConverterVisualElement.cs @@ -37,6 +37,18 @@ internal class RenderPipelineConverterVisualElement : VisualElement public Action converterSelected; + private bool m_IsEnabled; + + private void SetEnabled(bool value, bool force = false) + { + if (m_IsEnabled != value || force) + { + m_IsEnabled = value; + m_HeaderFoldout.tooltip = (m_IsEnabled) ? description : converter.isDisabledMessage; + m_HeaderFoldout.SetEnabled(m_IsEnabled); + } + } + public RenderPipelineConverterVisualElement(Node converterInfo) { m_ConverterInfo = converterInfo; @@ -47,8 +59,10 @@ public RenderPipelineConverterVisualElement(Node converterInfo) m_HeaderFoldout = m_RootVisualElement.Q("conveterFoldout"); m_HeaderFoldout.text = displayName; - m_HeaderFoldout.tooltip = (converter.isEnabled) ? description : converter.isDisabledMessage; - m_HeaderFoldout.SetEnabled(converter.isEnabled); + + SetEnabled(converter.isEnabled, true); + m_HeaderFoldout.schedule.Execute(() => SetEnabled(converter.isEnabled)).Every(500); + m_HeaderFoldout.value = state.isExpanded; m_HeaderFoldout.RegisterCallback>((evt) => { diff --git a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConvertersEditor.cs b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConvertersEditor.cs index 382aec1187a..c915ff2de74 100644 --- a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConvertersEditor.cs +++ b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConvertersEditor.cs @@ -221,7 +221,8 @@ public void CreateGUI() if (converterNodeCategory.name == to.label) currentContainer = converterNodeCategory; } - HideUnhideConverters(); + + ConfigureUI(); }; m_SourcePipelineDropDown.RegisterCallback>((evt) => @@ -234,40 +235,51 @@ public void CreateGUI() HideUnhideConverters(); }); + ConfigureUI(); + + UpdateUiForPlayMode(EditorApplication.isPlaying); + } + + private void ConfigureUI() + { HideUnhideConverters(); EnableOrDisableScanButton(); EnableOrDisableConvertButton(); - - UpdateUiForPlayMode(EditorApplication.isPlaying); } private bool CanEnableScan() { - foreach (var kvp in m_ConvertersVisualElements) + foreach (var child in currentContainer.children) { - var ve = kvp.Value; - if (ve.isSelectedAndEnabled && - !ve.state.isInitialized) + if (m_ConvertersVisualElements.TryGetValue(child, out var ve)) { - return true; + if (ve.isSelectedAndEnabled && + !ve.state.isInitialized) + { + return true; + } } } + return false; } private bool CanEnableConvert() { - foreach (var kvp in m_ConvertersVisualElements) + foreach (var child in currentContainer.children) { - var ve = kvp.Value; - if (ve.isSelectedAndEnabled && - ve.state.isInitialized && - ve.state.selectedItemsCount > 0 && - ve.state.pending > 0) + if (m_ConvertersVisualElements.TryGetValue(child, out var ve)) { - return true; + if (ve.isSelectedAndEnabled && + ve.state.isInitialized && + ve.state.selectedItemsCount > 0 && + ve.state.pending > 0) + { + return true; + } } } + return false; } diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Tools/Converter/BuiltInToHDRPMaterialUpgrader.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Tools/Converter/BuiltInToHDRPMaterialUpgrader.cs index 43dd879866f..d6f10debc84 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Tools/Converter/BuiltInToHDRPMaterialUpgrader.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Tools/Converter/BuiltInToHDRPMaterialUpgrader.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using UnityEditor.Rendering.Converter; using UnityEngine.Categorization; +using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; namespace UnityEditor.Rendering.HighDefinition @@ -13,6 +14,19 @@ namespace UnityEditor.Rendering.HighDefinition Description = "This converter scans all materials that reference Built-in shaders and upgrades them to use High Definition Render Pipeline (HDRP) shaders.")] internal sealed class BuiltInToHDRPMaterialUpgrader : RenderPipelineConverterMaterialUpgrader { + public override bool isEnabled + { + get + { + if (GraphicsSettings.currentRenderPipeline is not HDRenderPipelineAsset urpAsset) + return false; + + return true; + } + } + + public override string isDisabledMessage => "Converter requires HDRP. Convert your project to HDRP to use this converter."; + protected override List upgraders { get diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Converter/BuiltInToURP2DShaderConverter.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/Converter/BuiltInToURP2DShaderConverter.cs index 74e4307e3f6..911cdabadf9 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/Converter/BuiltInToURP2DShaderConverter.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/Converter/BuiltInToURP2DShaderConverter.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using UnityEditor.Rendering.Converter; using UnityEngine.Categorization; +using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; namespace UnityEditor.Rendering.Universal @@ -13,6 +14,20 @@ namespace UnityEditor.Rendering.Universal Description = "Converts references to Built-In shaders to URP (2D) shaders.")] internal sealed class BuiltInToURP2DShaderConverter : RenderPipelineConverterMaterialUpgrader { + public override bool isEnabled + { + get + { + if (GraphicsSettings.currentRenderPipeline is not UniversalRenderPipelineAsset urpAsset) + return false; + + return urpAsset.scriptableRenderer is Renderer2D; + } + } + + public override string isDisabledMessage => "Converter requires URP with a Renderer 2D. Convert your project to URP to use this converter."; + + protected override List upgraders { get diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Converter/URP3DToURP2DShaderConverter.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/Converter/URP3DToURP2DShaderConverter.cs index 2ce5ed95325..375da0821da 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/Converter/URP3DToURP2DShaderConverter.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/Converter/URP3DToURP2DShaderConverter.cs @@ -15,6 +15,20 @@ namespace UnityEditor.Rendering.Universal Description = "Converts references to URP Lit and Simple Lit shaders to Mesh 2D Lit shader.")] internal sealed class URP3DToURP2DShaderConverter : RenderPipelineConverterMaterialUpgrader { + + public override bool isEnabled + { + get + { + if (GraphicsSettings.currentRenderPipeline is not UniversalRenderPipelineAsset urpAsset) + return false; + + return urpAsset.scriptableRenderer is Renderer2D; + } + } + + public override string isDisabledMessage => "Converter requires URP with a Renderer 2D. Convert your project to URP to use this converter."; + protected override List upgraders { get diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Tools/Converters/AnimationClipConverter/AnimationClipConverter.cs b/Packages/com.unity.render-pipelines.universal/Editor/Tools/Converters/AnimationClipConverter/AnimationClipConverter.cs index d2474e9b732..314ebf0656a 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/Tools/Converters/AnimationClipConverter/AnimationClipConverter.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/Tools/Converters/AnimationClipConverter/AnimationClipConverter.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; using System.Text; -using NUnit.Framework; using UnityEditor.Rendering.Converter; using UnityEngine; using UnityEngine.Categorization; +using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; using static UnityEditor.Rendering.AnimationClipUpgrader; using ClipPath = UnityEditor.Rendering.AnimationClipUpgrader.ClipPath; @@ -46,6 +46,18 @@ public AnimationClipConverterItem(GlobalObjectId gid, string assetPath) Description = "Updates animation clips that reference material properties to work with URP shaders.\nEnsures material animations continue working after converting Materials from Built-in RP to URP.")] internal sealed class AnimationClipConverter : IRenderPipelineConverter { + public bool isEnabled + { + get + { + if (GraphicsSettings.currentRenderPipeline is not UniversalRenderPipelineAsset urpAsset) + return false; + + return urpAsset.scriptableRenderer is UniversalRenderer; + } + } + public string isDisabledMessage => "Converter requires URP with an Universal Renderer. Convert your project to URP to use this converter."; + [SerializeField] internal List assets = new(); @@ -106,14 +118,21 @@ void OnAnimationClipDependenciesSearchFinish() ( SearchServiceUtils.IndexingOptions.DeepSearch, query, - (searchItem, path) => + (item, path) => { - if (searchItem.ToObject() is not GameObject go || go.scene == null) + var unityObject = item.ToObject(); + + if (unityObject == null) return; - var gid = GlobalObjectId.GetGlobalObjectIdSlow(go); + var gid = GlobalObjectId.GetGlobalObjectIdSlow(unityObject); + int type = gid.identifierType; // 1=Asset, 2=SceneObject - var assetItem = new RenderPipelineConverterAssetItem(gid, go.scene.path); + var assetItem = new RenderPipelineConverterAssetItem(gid.ToString()) + { + name = unityObject.name, + info = path, + }; if (animatorUsingClip.TryGetValue(path, out var list)) { diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Tools/Converters/BuiltInToURP3DMaterialUpgrader.cs b/Packages/com.unity.render-pipelines.universal/Editor/Tools/Converters/BuiltInToURP3DMaterialUpgrader.cs index 0e97e287d06..b503bc5c6f5 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/Tools/Converters/BuiltInToURP3DMaterialUpgrader.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/Tools/Converters/BuiltInToURP3DMaterialUpgrader.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using UnityEditor.Rendering.Converter; using UnityEngine.Categorization; +using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; namespace UnityEditor.Rendering.Universal @@ -14,6 +15,20 @@ namespace UnityEditor.Rendering.Universal Description = "This converter scans all materials that reference Built-in shaders and upgrades them to use Universal Render Pipeline (URP) shaders.")] internal sealed class BuiltInToURP3DMaterialUpgrader : RenderPipelineConverterMaterialUpgrader { + + public override bool isEnabled + { + get + { + if (GraphicsSettings.currentRenderPipeline is not UniversalRenderPipelineAsset urpAsset) + return false; + + return urpAsset.scriptableRenderer is UniversalRenderer; + } + } + + public override string isDisabledMessage => "Converter requires URP with a Universal Renderer. Convert your project to URP to use this converter."; + internal static List FetchMaterialUpgraders() { var allURPUpgraders = MaterialUpgrader.FetchAllUpgradersForPipeline(typeof(UniversalRenderPipelineAsset)); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Tools/Converters/PPv2/PPv2Converter.cs b/Packages/com.unity.render-pipelines.universal/Editor/Tools/Converters/PPv2/PPv2Converter.cs index 094c8f94d97..943eade6a22 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/Tools/Converters/PPv2/PPv2Converter.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/Tools/Converters/PPv2/PPv2Converter.cs @@ -1,20 +1,22 @@ -#if PPV2_EXISTS using System; using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; using System.Text; -using UnityEditor.SceneManagement; -using UnityEngine.Categorization; using UnityEditor.Rendering.Converter; +using UnityEngine.Categorization; +using UnityEngine.Rendering.Universal; + +#if PPV2_EXISTS using UnityEngine; using UnityEngine.Rendering; -using UnityEngine.Rendering.Universal; -using UnityEngine.SceneManagement; +using System.IO; +using System.Linq; +using System.Reflection; +using UnityEditor.SceneManagement; using BIRPRendering = UnityEngine.Rendering.PostProcessing; +using UnityEngine.SceneManagement; using Object = UnityEngine.Object; using URPRendering = UnityEngine.Rendering.Universal; +#endif namespace UnityEditor.Rendering.Universal { @@ -28,6 +30,7 @@ namespace UnityEditor.Rendering.Universal internal class PPv2Converter : AssetsConverter { +#if PPV2_EXISTS public override bool isEnabled => s_PostProcessTypesToSearch?.Count() > 0; public override string isDisabledMessage => "Missing types to search"; @@ -484,6 +487,12 @@ public IEnumerable GetAllBIRPConverters() return derivedTypes; } +#else + public override bool isEnabled => false; + public override string isDisabledMessage => "Post Processing package is not installed. Please install the Post Processing package package to enable this converter."; + protected override List<(string query, string description)> contextSearchQueriesAndIds + => null; + protected override Status ConvertObject(UnityEngine.Object obj, StringBuilder message) { return Status.Error; } +#endif } } -#endif From 9023edfe9e760c518e6a57e32a653496654b9e32 Mon Sep 17 00:00:00 2001 From: Yvain Raeymaekers Date: Thu, 5 Mar 2026 22:24:51 +0000 Subject: [PATCH 45/95] [GFXLIGHT-2100] Graceful handling of Static Batching=On --- .../RendererFeatures/SurfaceCacheGIEditor.cs | 8 +- .../SurfaceCacheGIRendererFeature.cs | 164 +++++++++++------- 2 files changed, 105 insertions(+), 67 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/SurfaceCacheGIEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/SurfaceCacheGIEditor.cs index 60a5439b9e7..85db0727fde 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/SurfaceCacheGIEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/SurfaceCacheGIEditor.cs @@ -98,7 +98,13 @@ public override void OnInspectorGUI() if (!m_IsInitialized) Init(); - if (SceneView.lastActiveSceneView && !SceneView.lastActiveSceneView.sceneViewState.alwaysRefreshEnabled) + if (PlayerSettings.GetStaticBatchingForPlatform(EditorUserBuildSettings.activeBuildTarget)) + { + var surfaceCacheFeature = (SurfaceCacheGIRendererFeature)target; + + EditorGUILayout.HelpBox(SurfaceCacheGIRendererFeature.k_StaticBatchingErrorMesssage, surfaceCacheFeature.isActive ? MessageType.Error : MessageType.Warning); + } + else if (SceneView.lastActiveSceneView && !SceneView.lastActiveSceneView.sceneViewState.alwaysRefreshEnabled) { EditorGUILayout.HelpBox("Enable \"Always Refresh\" in the Scene View to see realtime updates in the Scene View.", MessageType.Info); } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs index 8ec7e36c1b5..006660bd47a 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs @@ -94,6 +94,8 @@ public enum DebugViewMode_ FlatNormal } + public static readonly string k_StaticBatchingErrorMesssage = "Surface Cache GI cannot run because it is incompatible with Static Batching. You can disable the option in the Player Settings."; + // URP currently cannot render motion vectors properly in Scene View, so we disable it. // https://jira.unity3d.com/browse/SRP-743 // When this is fixed, we probably want to enable this always. @@ -438,9 +440,7 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer var worldToClipTransform = viewToClipTransform * worldToViewTransform; var clipToWorldTransform = worldToClipTransform.inverse; - var screenResolution = new int2( - (int)(cameraData.pixelWidth * cameraData.renderScale), - (int)(cameraData.pixelHeight * cameraData.renderScale)); + var screenResolution = new int2(cameraData.pixelWidth, cameraData.pixelHeight); // This avoids applying surface cache to e.g. preview cameras. if (cameraData.cameraType != CameraType.Game && cameraData.cameraType != CameraType.SceneView) @@ -1032,8 +1032,8 @@ private static void UpdateMeshRenderers( foreach (var meshRenderer in addedMeshRenderers) { - Debug.Assert(!meshRenderer.isPartOfStaticBatch); - + Debug.Assert(meshRenderer.isPartOfStaticBatch, "Static Batching is not supported by Surface Cache GI."); + var mesh = meshRenderer.GetComponent().sharedMesh; if (mesh == null || mesh.vertexCount == 0) @@ -1461,85 +1461,103 @@ void ClearResources() _rtContext = null; } + bool ResourcesCreated() + { + return _pass != null; + } + public override void Create() { ClearResources(); - if (isActive) - { - var rtBackend = RayTracingBackend.Compute; + if (!isActive) + return; - { - var resources = new RayTracingResources(); #if UNITY_EDITOR - resources.Load(); + if (CheckStaticBatchingStatus()) + return; +#endif + + var rtBackend = RayTracingBackend.Compute; + + { + var resources = new RayTracingResources(); +#if UNITY_EDITOR + resources.Load(); #else - resources.LoadFromRenderPipelineResources(); + resources.LoadFromRenderPipelineResources(); #endif - _rtContext = new RayTracingContext(rtBackend, resources); - } + _rtContext = new RayTracingContext(rtBackend, resources); + } - var universalRenderPipelineResources = GraphicsSettings.GetRenderPipelineSettings(); - Debug.Assert(universalRenderPipelineResources != null); + var universalRenderPipelineResources = GraphicsSettings.GetRenderPipelineSettings(); + Debug.Assert(universalRenderPipelineResources != null); - var worldResources = new WorldResourceSet(); - var worldLoadResult = worldResources.LoadFromRenderPipelineResources(); - Debug.Assert(worldLoadResult); + var worldResources = new WorldResourceSet(); + var worldLoadResult = worldResources.LoadFromRenderPipelineResources(); + Debug.Assert(worldLoadResult); - var coreResources = new Rendering.SurfaceCacheResourceSet((uint)SystemInfo.computeSubGroupSize); - var coreResourceLoadResult = coreResources.LoadFromRenderPipelineResources(_rtContext); - Debug.Assert(coreResourceLoadResult); + var coreResources = new Rendering.SurfaceCacheResourceSet((uint)SystemInfo.computeSubGroupSize); + var coreResourceLoadResult = coreResources.LoadFromRenderPipelineResources(_rtContext); + Debug.Assert(coreResourceLoadResult); - var volParams = new SurfaceCacheVolumeParameterSet - { - Resolution = _parameterSet.VolumeParams.Resolution, - Size = _parameterSet.VolumeParams.Size, - CascadeCount = _parameterSet.VolumeParams.CascadeCount - }; + var volParams = new SurfaceCacheVolumeParameterSet + { + Resolution = _parameterSet.VolumeParams.Resolution, + Size = _parameterSet.VolumeParams.Size, + CascadeCount = _parameterSet.VolumeParams.CascadeCount + }; - var estimationParams = new SurfaceCacheEstimationParameterSet - { - MultiBounce = _parameterSet.MultiBounce, - SampleCount = _parameterSet.EstimationParams.SampleCount, - }; + var estimationParams = new SurfaceCacheEstimationParameterSet + { + MultiBounce = _parameterSet.MultiBounce, + SampleCount = _parameterSet.EstimationParams.SampleCount, + }; - var patchFilteringParams = new SurfaceCachePatchFilteringParameterSet - { - TemporalSmoothing = _parameterSet.PatchFilteringParams.TemporalSmoothing, - SpatialFilterEnabled = _parameterSet.PatchFilteringParams.SpatialFilterEnabled, - SpatialFilterSampleCount = _parameterSet.PatchFilteringParams.SpatialFilterSampleCount, - SpatialFilterRadius = _parameterSet.PatchFilteringParams.SpatialFilterRadius, - TemporalPostFilterEnabled = _parameterSet.PatchFilteringParams.TemporalPostFilterEnabled - }; - - _pass = new SurfaceCachePass( - _rtContext, - coreResources, - worldResources, - universalRenderPipelineResources.allocationShader, - universalRenderPipelineResources.screenResolveLookupShader, - universalRenderPipelineResources.screenResolveUpsamplingShader, - universalRenderPipelineResources.debugShader, - universalRenderPipelineResources.flatNormalResolutionShader, - universalRenderPipelineResources.fallbackMaterial, - _parameterSet.DebugEnabled, - _parameterSet.DebugViewMode, - _parameterSet.DebugShowSamplePosition, - _parameterSet.ScreenFilteringParams.LookupSampleCount, - _parameterSet.ScreenFilteringParams.UpsamplingKernelSize, - _parameterSet.ScreenFilteringParams.UpsamplingSampleCount, - _parameterSet.AdvancedParams.DefragCount, - volParams, - estimationParams, - patchFilteringParams, - _parameterSet.VolumeParams.Movement); - - _pass.renderPassEvent = RenderPassEvent.AfterRenderingPrePasses + 1; - } + var patchFilteringParams = new SurfaceCachePatchFilteringParameterSet + { + TemporalSmoothing = _parameterSet.PatchFilteringParams.TemporalSmoothing, + SpatialFilterEnabled = _parameterSet.PatchFilteringParams.SpatialFilterEnabled, + SpatialFilterSampleCount = _parameterSet.PatchFilteringParams.SpatialFilterSampleCount, + SpatialFilterRadius = _parameterSet.PatchFilteringParams.SpatialFilterRadius, + TemporalPostFilterEnabled = _parameterSet.PatchFilteringParams.TemporalPostFilterEnabled + }; + + _pass = new SurfaceCachePass( + _rtContext, + coreResources, + worldResources, + universalRenderPipelineResources.allocationShader, + universalRenderPipelineResources.screenResolveLookupShader, + universalRenderPipelineResources.screenResolveUpsamplingShader, + universalRenderPipelineResources.debugShader, + universalRenderPipelineResources.flatNormalResolutionShader, + universalRenderPipelineResources.fallbackMaterial, + _parameterSet.DebugEnabled, + _parameterSet.DebugViewMode, + _parameterSet.DebugShowSamplePosition, + _parameterSet.ScreenFilteringParams.LookupSampleCount, + _parameterSet.ScreenFilteringParams.UpsamplingKernelSize, + _parameterSet.ScreenFilteringParams.UpsamplingSampleCount, + _parameterSet.AdvancedParams.DefragCount, + volParams, + estimationParams, + patchFilteringParams, + _parameterSet.VolumeParams.Movement); + + _pass.renderPassEvent = RenderPassEvent.AfterRenderingPrePasses + 1; } public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData) { +#if UNITY_EDITOR + if (CheckStaticBatchingStatus()) + return; + + if (!ResourcesCreated()) // can happen if static batching is disabled after the SurfaceCacheGIRendererFeature has been created + Create(); +#endif + ScriptableRenderPassInput inputs = ScriptableRenderPassInput.Depth | ScriptableRenderPassInput.Normal; if (UseMotionVectorPatchSeeding(renderingData.cameraData.cameraType)) { @@ -1554,6 +1572,20 @@ protected override void Dispose(bool disposing) ClearResources(); base.Dispose(disposing); } + +#if UNITY_EDITOR + bool _staticBatchingEnabled; + bool CheckStaticBatchingStatus() + { + bool previousStatus = _staticBatchingEnabled; + _staticBatchingEnabled = UnityEditor.PlayerSettings.GetStaticBatchingForPlatform(UnityEditor.EditorUserBuildSettings.activeBuildTarget); + + if (_staticBatchingEnabled && _staticBatchingEnabled != previousStatus) + Debug.LogError(k_StaticBatchingErrorMesssage); + + return _staticBatchingEnabled; + } +#endif } } From 195af29a07a5ffd218f8bbc521e65fe9ed10ebbe Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Thu, 5 Mar 2026 22:24:56 +0000 Subject: [PATCH 46/95] [Port] [Forward] Show performance warnings on Switch2 for advanced water features --- .../Editor/Water/WaterSurface/WaterSurfaceEditor.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Water/WaterSurface/WaterSurfaceEditor.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Water/WaterSurface/WaterSurfaceEditor.cs index b5e0a5a266d..bae8d83f2fc 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Water/WaterSurface/WaterSurfaceEditor.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Water/WaterSurface/WaterSurfaceEditor.cs @@ -295,6 +295,18 @@ public override void OnInspectorGUI() HDEditorUtils.EnsureVolume((WaterRendering water) => !water.enable.value ? "This Water Surface cannot render properly because Water Rendering override state property in the Volume System is either set to disabled or the current camera is currently not rendering." : null); HDEditorUtils.EnsureFrameSetting(FrameSettingsField.Water); + if (m_Tessellation.boolValue) + HDEditorUtils.ShowPlatformPerformanceWarning(BuildTarget.Switch2, "Water Tessellation"); + + if (m_ScriptInteractions.boolValue) + HDEditorUtils.ShowPlatformPerformanceWarning(BuildTarget.Switch2, "Water Script Interactions"); + + if (m_Caustics.boolValue) + HDEditorUtils.ShowPlatformPerformanceWarning(BuildTarget.Switch2, "Water Caustics"); + + if (m_UnderWater.boolValue) + HDEditorUtils.ShowPlatformPerformanceWarning(BuildTarget.Switch2, "Underwater"); + if (target is WaterSurface surface && surface.surfaceIndex == -1) { EditorGUILayout.HelpBox("Only up to 16 water surfaces are supported simultaneously. This surface will not be rendered.", MessageType.Warning); From 124cfb803cb38eb357e54abcfee169ba6fe5c397 Mon Sep 17 00:00:00 2001 From: Aljosha Demeulemeester Date: Fri, 6 Mar 2026 00:32:40 +0000 Subject: [PATCH 47/95] URP FullScreenPassRendererFeature: fix assert and yflip issues --- .../FullScreenPassRendererFeature.cs | 52 +++++++------------ 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/FullScreenPassRendererFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/FullScreenPassRendererFeature.cs index cb983d4c9d4..8d42aba848a 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/FullScreenPassRendererFeature.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/FullScreenPassRendererFeature.cs @@ -104,7 +104,7 @@ public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingD m_FullScreenPass.SetupMembers(passMaterial, passIndex, fetchColorBuffer, bindDepthStencilAttachment); m_FullScreenPass.requiresIntermediateTexture = fetchColorBuffer; - + renderer.EnqueuePass(m_FullScreenPass); } @@ -131,14 +131,14 @@ public void SetupMembers(Material material, int passIndex, bool fetchActiveColor m_BindDepthStencilAttachment = bindDepthStencilAttachment; } - private static void ExecuteMainPass(RasterCommandBuffer cmd, RTHandle sourceTexture, Material material, int passIndex) + private static void ExecuteMainPass(RasterCommandBuffer cmd, RTHandle sourceTexture, Material material, int passIndex, Vector4 blitScaleBias) { s_SharedPropertyBlock.Clear(); if (sourceTexture != null) s_SharedPropertyBlock.SetTexture(ShaderPropertyId.blitTexture, sourceTexture); // We need to set the "_BlitScaleBias" uniform for user materials with shaders relying on core Blit.hlsl to work - s_SharedPropertyBlock.SetVector(ShaderPropertyId.blitScaleBias, new Vector4(1, 1, 0, 0)); + s_SharedPropertyBlock.SetVector(ShaderPropertyId.blitScaleBias, blitScaleBias); cmd.DrawProcedural(Matrix4x4.identity, material, passIndex, MeshTopology.Triangles, 3, 1, s_SharedPropertyBlock); } @@ -150,20 +150,21 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer TextureHandle source, destination; - Debug.Assert(resourcesData.cameraColor.IsValid()); - if (m_FetchActiveColor) { + // The pass requests the intermediate textures so this should always be valid + Debug.Assert(resourcesData.cameraColor.IsValid()); + var targetDesc = renderGraph.GetTextureDesc(resourcesData.cameraColor); targetDesc.name = "_CameraColorFullScreenPass"; targetDesc.clearBuffer = false; - source = resourcesData.activeColorTexture; + source = resourcesData.cameraColor; destination = renderGraph.CreateTexture(targetDesc); renderGraph.AddBlitPass(source, destination, Vector2.one, Vector2.zero, passName: "Copy Color Full Screen"); - //Swap for next pass; + // Swap for next pass; source = destination; } else @@ -171,21 +172,11 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer source = TextureHandle.nullHandle; } + // If resourcesData.isActiveTargetBackBuffer == true, then the backbuffer is alread written to and this could overwrite it. + // However, the user might want to blend into the backbuffer so we allow it here. destination = resourcesData.activeColorTexture; - - // The AddBlitPass utility is not used when m_BindDepthStencilAttachment is active since SetRenderAttachmentDepth is not available with the returned builder of AddBlitPass. - bool useCustomPass = input != ScriptableRenderPassInput.None || m_BindDepthStencilAttachment; - - if (useCustomPass) - { - AddFullscreenRenderPassInputPass(renderGraph, resourcesData, cameraData, source, destination); - } - else - { - var blitMaterialParameters = new BlitMaterialParameters(source, destination, m_Material, m_PassIndex); - - renderGraph.AddBlitPass(blitMaterialParameters, passName: "Blit Color Full Screen"); - } + + AddFullscreenRenderPassInputPass(renderGraph, resourcesData, cameraData, source, destination); } private void AddFullscreenRenderPassInputPass(RenderGraph renderGraph, UniversalResourceData resourcesData, UniversalCameraData cameraData, in TextureHandle source, in TextureHandle destination) @@ -195,10 +186,11 @@ private void AddFullscreenRenderPassInputPass(RenderGraph renderGraph, Universal passData.material = m_Material; passData.passIndex = m_PassIndex; - passData.inputTexture = source; + passData.source = source; + passData.destination = destination; - if (passData.inputTexture.IsValid()) - builder.UseTexture(passData.inputTexture, AccessFlags.Read); + if (passData.source.IsValid()) + builder.UseTexture(passData.source, AccessFlags.Read); bool needsColor = (input & ScriptableRenderPassInput.Color) != ScriptableRenderPassInput.None; bool needsDepth = (input & ScriptableRenderPassInput.Depth) != ScriptableRenderPassInput.None; @@ -243,21 +235,17 @@ private void AddFullscreenRenderPassInputPass(RenderGraph renderGraph, Universal builder.SetRenderFunc(static (MainPassData data, RasterGraphContext rgContext) => { - ExecuteMainPass(rgContext.cmd, data.inputTexture, data.material, data.passIndex); + Vector4 scaleBias = RenderingUtils.GetFinalBlitScaleBias(rgContext, in data.source, in data.destination); + ExecuteMainPass(rgContext.cmd, data.source, data.material, data.passIndex, scaleBias); }); } } - - private class CopyPassData - { - internal TextureHandle inputTexture; - } - private class MainPassData { internal Material material; internal int passIndex; - internal TextureHandle inputTexture; + internal TextureHandle source; + internal TextureHandle destination; } } } From 3d3adaad063f97d9517a40367cca322b825d6cc2 Mon Sep 17 00:00:00 2001 From: Pema Malling Date: Fri, 6 Mar 2026 05:27:26 +0000 Subject: [PATCH 48/95] Change meaning of bounce count in unified baker in order to support MIS --- .../Editor/PathTracing/LightBakerStrangler.cs | 13 +++++-------- .../Runtime/PathTracing/BakeLightmap.cs | 4 ++-- .../Runtime/PathTracing/LightmapIntegration.cs | 16 ++++++---------- .../Runtime/PathTracing/PathTracingContext.cs | 1 - .../Runtime/PathTracing/PathTracingUtil.cs | 3 --- .../Runtime/PathTracing/ProbeIntegrator.cs | 8 +------- .../Shaders/LightmapAOIntegration.urtshader | 2 +- .../Shaders/LightmapDirectIntegration.urtshader | 2 +- .../LightmapIndirectIntegration.urtshader | 15 ++++++--------- .../LightmapValidityIntegration.urtshader | 2 +- .../Runtime/PathTracing/Shaders/PathTracing.hlsl | 13 +++++-------- .../Shaders/PathTracingMaterials.hlsl | 8 +------- .../PathTracing/Shaders/PathTracingRandom.hlsl | 2 +- .../Shaders/ProbeIntegrationIndirect.urtshader | 15 ++++++--------- .../Shaders/ProbeIntegrationValidity.urtshader | 2 +- .../PathTracing/UnityComputeProbeIntegrator.cs | 4 ++-- .../Runtime/PathTracing/PathIteratorTests.cs | 4 ++-- 17 files changed, 41 insertions(+), 73 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/LightBakerStrangler.cs b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/LightBakerStrangler.cs index e41900588e9..809c8f6f498 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/LightBakerStrangler.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/LightBakerStrangler.cs @@ -345,7 +345,6 @@ internal static bool Bake(string bakeInputPath, string lightmapRequestsPath, str samplingResources.Load((uint)UnityEngine.Rendering.Sampling.SamplingResources.ResourceType.All); // Deserialize BakeInput, inject data into world - const bool useLegacyBakingBehavior = true; const bool autoEstimateLUTRange = true; BakeInputToWorldConversion.InjectBakeInputData(world.PathTracingWorld, autoEstimateLUTRange, in bakeInput, out Bounds sceneBounds, out world.Meshes, out FatInstance[] fatInstances, out world.LightHandles, @@ -367,7 +366,7 @@ internal static bool Bake(string bakeInputPath, string lightmapRequestsPath, str ulong lightmapWorkSteps = CalculateWorkStepsForLightmapRequests(in lightmapRequestData, lightmapDescriptors, lightmapBakeSettings); progressState.SetTotalWorkSteps(probeWorkSteps + lightmapWorkSteps); - if (!ExecuteProbeRequests(in bakeInput, in probeRequestData, deviceContext, useLegacyBakingBehavior, world, progressState, samplingResources)) + if (!ExecuteProbeRequests(in bakeInput, in probeRequestData, deviceContext, world, progressState, samplingResources)) return false; if (lightmapRequestData.requests.Length <= 0) @@ -377,7 +376,7 @@ internal static bool Bake(string bakeInputPath, string lightmapRequestsPath, str LightmapResourceLibrary resources = new(); resources.Load(world.RayTracingContext); - if (ExecuteLightmapRequests(in lightmapRequestData, deviceContext, world, in fatInstances, in lodInstances, in lodgroupToContributorInstances, integrationSettings, useLegacyBakingBehavior, resources, progressState, lightmapDescriptors, lightmapBakeSettings, samplingResources) != Result.Success) + if (ExecuteLightmapRequests(in lightmapRequestData, deviceContext, world, in fatInstances, in lodInstances, in lodgroupToContributorInstances, integrationSettings, resources, progressState, lightmapDescriptors, lightmapBakeSettings, samplingResources) != Result.Success) return false; CoreUtils.Destroy(resources.UVFallbackBufferGenerationMaterial); @@ -878,7 +877,6 @@ internal static Result ExecuteLightmapRequests( in Dictionary> lodInstances, in Dictionary> lodgroupToContributorInstances, IntegrationSettings integrationSettings, - bool useLegacyBakingBehavior, LightmapResourceLibrary lightmapResourceLib, BakeProgressState progressState, LightmapDesc[] lightmapDescriptors, @@ -905,7 +903,7 @@ internal static Result ExecuteLightmapRequests( return Result.InitializeFailure; CommandBuffer cmd = lightmappingContext.GetCommandBuffer(); - lightmappingContext.IntegratorContext.Initialize(samplingResources, lightmapResourceLib, !useLegacyBakingBehavior); + lightmappingContext.IntegratorContext.Initialize(samplingResources, lightmapResourceLib); // Setup keywords only once before accumulation. lightmappingContext.IntegratorContext.LightmapDirectIntegrator.SetupLightSamplingKeywords(cmd, lightmapBakeSettings.DirectLightSamplingMode, lightmapBakeSettings.DirectEmissiveSamplingMode); @@ -1428,8 +1426,7 @@ private static (uint directSampleCount, uint effectiveIndirectSampleCount) GetPr } internal static bool ExecuteProbeRequests(in BakeInput bakeInput, in ProbeRequestData probeRequestData, UnityComputeDeviceContext deviceContext, - bool useLegacyBakingBehavior, UnityComputeWorld world, BakeProgressState progressState, - UnityEngine.Rendering.Sampling.SamplingResources samplingResources) + UnityComputeWorld world, BakeProgressState progressState, UnityEngine.Rendering.Sampling.SamplingResources samplingResources) { if (probeRequestData.requests.Length == 0) return true; @@ -1438,7 +1435,7 @@ internal static bool ExecuteProbeRequests(in BakeInput bakeInput, in ProbeReques integrationResources.Load(world.RayTracingContext); var probeOcclusionLightIndexMappingShader = UnityEditor.AssetDatabase.LoadAssetAtPath("Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeOcclusionLightIndexMapping.compute"); - using UnityComputeProbeIntegrator probeIntegrator = new(!useLegacyBakingBehavior, samplingResources, integrationResources, probeOcclusionLightIndexMappingShader); + using UnityComputeProbeIntegrator probeIntegrator = new(samplingResources, integrationResources, probeOcclusionLightIndexMappingShader); probeIntegrator.SetProgressReporter(progressState); // Create input position buffer diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/BakeLightmap.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/BakeLightmap.cs index a79ef7e5d73..6f35204a40c 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/BakeLightmap.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/BakeLightmap.cs @@ -191,7 +191,7 @@ public void Dispose() CompactedGBufferLength?.Dispose(); } - internal void Initialize(SamplingResources samplingResources, LightmapResourceLibrary lightmapResourceLib, bool countNEERayAsPathSegment) + internal void Initialize(SamplingResources samplingResources, LightmapResourceLibrary lightmapResourceLib) { SamplingResources = samplingResources; _emptyExposureTexture = RTHandles.Alloc(1, 1, enableRandomWrite: true, name: "Empty EV100 Exposure", colorFormat: GraphicsFormat.R8G8B8A8_UNorm); @@ -200,7 +200,7 @@ internal void Initialize(SamplingResources samplingResources, LightmapResourceLi UVFallbackBufferBuilder.Prepare(lightmapResourceLib.UVFallbackBufferGenerationMaterial); LightmapDirectIntegrator = new LightmapDirectIntegrator(); LightmapDirectIntegrator.Prepare(lightmapResourceLib.DirectAccumulationShader, lightmapResourceLib.NormalizationShader, lightmapResourceLib.ExpansionHelpers, SamplingResources, _emptyExposureTexture); - LightmapIndirectIntegrator = new LightmapIndirectIntegrator(countNEERayAsPathSegment); + LightmapIndirectIntegrator = new LightmapIndirectIntegrator(); LightmapIndirectIntegrator.Prepare(lightmapResourceLib.IndirectAccumulationShader, lightmapResourceLib.NormalizationShader, lightmapResourceLib.ExpansionHelpers, SamplingResources, _emptyExposureTexture); LightmapAOIntegrator = new LightmapAOIntegrator(); LightmapAOIntegrator.Prepare(lightmapResourceLib.AOAccumulationShader, lightmapResourceLib.NormalizationShader, lightmapResourceLib.ExpansionHelpers, SamplingResources, _emptyExposureTexture); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/LightmapIntegration.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/LightmapIntegration.cs index 326944730be..423b23e3a68 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/LightmapIntegration.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/LightmapIntegration.cs @@ -176,7 +176,7 @@ public void Accumulate( // path tracing inputs bool preExpose = false; float environmentIntensityMultiplier = 1.0f; - Util.BindPathTracingInputs(cmd, _accumulationShader, false, risCandidateCount, preExpose, 0, environmentIntensityMultiplier, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyTexture); + Util.BindPathTracingInputs(cmd, _accumulationShader, risCandidateCount, preExpose, 0, environmentIntensityMultiplier, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyTexture); Util.BindWorld(cmd, _accumulationShader, world); var requiredSizeInBytes = _accumulationShader.GetTraceScratchBufferRequiredSizeInBytes((uint)expandedOutput.count, 1, 1); @@ -256,7 +256,6 @@ internal class LightmapIndirectIntegrator : System.IDisposable private int _directionalNormalizationKernel; private SamplingResources _samplingResources; private RTHandle _emptyTexture; - private bool _countNEERayAsPathSegment; private GraphicsBuffer _accumulationDispatchBuffer; private ComputeShader _expansionHelpers; private int _populateAccumulationDispatchKernel; @@ -266,10 +265,7 @@ public void Dispose() _accumulationDispatchBuffer?.Dispose(); } - public LightmapIndirectIntegrator(bool countNEERayAsPathSegment) - { - _countNEERayAsPathSegment = countNEERayAsPathSegment; - } + public void SetupLightSamplingKeywords(CommandBuffer cmd, LightSamplingMode lightSamplingMode, EmissiveSamplingMode emissiveSamplingMode) { @@ -328,7 +324,7 @@ public void Accumulate( // path tracing inputs bool preExpose = false; float environmentIntensityMultiplier = 1.0f; - Util.BindPathTracingInputs(cmd, _accumulationShader, _countNEERayAsPathSegment, risCandidateCount, preExpose, (int)bounceCount, environmentIntensityMultiplier, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyTexture); + Util.BindPathTracingInputs(cmd, _accumulationShader, risCandidateCount, preExpose, (int)bounceCount, environmentIntensityMultiplier, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyTexture); Util.BindWorld(cmd, _accumulationShader, world); var requiredSizeInBytes = _accumulationShader.GetTraceScratchBufferRequiredSizeInBytes((uint)expandedOutput.count, 1, 1); @@ -457,7 +453,7 @@ public void Accumulate( uint lightEvaluationsPerBounce = 1; bool preExpose = false; float environmentIntensityMultipler = 1.0f; - Util.BindPathTracingInputs(cmd, _accumulationShader, false, lightEvaluationsPerBounce, preExpose, 0, environmentIntensityMultipler, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyTexture); + Util.BindPathTracingInputs(cmd, _accumulationShader, lightEvaluationsPerBounce, preExpose, 0, environmentIntensityMultipler, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyTexture); Util.BindWorld(cmd, _accumulationShader, world); var requiredSizeInBytes = _accumulationShader.GetTraceScratchBufferRequiredSizeInBytes((uint)expandedOutput.count, 1, 1); @@ -571,7 +567,7 @@ public void Accumulate( uint lightEvaluationsPerBounce = 1; bool preExpose = false; float environmentIntensityMultiplier = 1.0f; - Util.BindPathTracingInputs(cmd, _accumulationShader, false, lightEvaluationsPerBounce, preExpose, 0, environmentIntensityMultiplier, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyTexture); + Util.BindPathTracingInputs(cmd, _accumulationShader, lightEvaluationsPerBounce, preExpose, 0, environmentIntensityMultiplier, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyTexture); Util.BindWorld(cmd, _accumulationShader, world); var requiredSizeInBytes = _accumulationShader.GetTraceScratchBufferRequiredSizeInBytes((uint)expandedOutput.count, 1, 1); @@ -685,7 +681,7 @@ public void Accumulate( // path tracing inputs bool preExpose = false; float environmentIntensityMultiplier = 1.0f; - Util.BindPathTracingInputs(cmd, _accumulationShader, false, 1, preExpose, 0, environmentIntensityMultiplier, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyTexture); + Util.BindPathTracingInputs(cmd, _accumulationShader, 1, preExpose, 0, environmentIntensityMultiplier, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyTexture); Util.BindWorld(cmd, _accumulationShader, world); var requiredSizeInBytes = _accumulationShader.GetTraceScratchBufferRequiredSizeInBytes((uint)expandedOutput.count, 1, 1); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingContext.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingContext.cs index 1df34022fdd..145945f4476 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingContext.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingContext.cs @@ -225,7 +225,6 @@ public void Render(CommandBuffer cmd, Vector2Int scaledSize, Vector4 viewFustum, _rayTracingShader.SetIntParam(cmd, Shader.PropertyToID("g_SampleCount"), settings.sampleCount); _rayTracingShader.SetIntParam(cmd, Shader.PropertyToID("g_LightEvaluations"), settings.lightEvaluations); _rayTracingShader.SetIntParam(cmd, Shader.PropertyToID("g_PathtracerAsGiPreviewMode"), (_pathTracingOutput == PathTracingOutput.GIPreview) ? 1 : 0); - _rayTracingShader.SetIntParam(cmd, Shader.PropertyToID("g_CountNEERayAsPathSegment"), 1); _rayTracingShader.SetIntParam(cmd, Shader.PropertyToID("g_RenderedInstances"), (int)settings.renderedGameObjects); _rayTracingShader.SetIntParam(cmd, Shader.PropertyToID("g_PreExpose"), preExpose ? 1 : 0); _rayTracingShader.SetIntParam(cmd, Shader.PropertyToID("g_MaxIntensity"), settings.maxIntensity > 0 ? settings.maxIntensity : int.MaxValue); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingUtil.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingUtil.cs index dc22106879a..3725bad0831 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingUtil.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/PathTracingUtil.cs @@ -35,7 +35,6 @@ internal static class ShaderProperties public static readonly int EnvTex = Shader.PropertyToID("g_EnvTex"); public static readonly int LightEvaluations = Shader.PropertyToID("g_LightEvaluations"); public static readonly int PathtracerAsGiPreviewMode = Shader.PropertyToID("g_PathtracerAsGiPreviewMode"); - public static readonly int CountNEERayAsPathSegment = Shader.PropertyToID("g_CountNEERayAsPathSegment"); public static readonly int RenderedInstances = Shader.PropertyToID("g_RenderedInstances"); public static readonly int PreExpose = Shader.PropertyToID("g_PreExpose"); public static readonly int BounceCount = Shader.PropertyToID("g_BounceCount"); @@ -128,7 +127,6 @@ internal static void BindWorld(CommandBuffer cmd, IRayTracingShader shader, Worl static internal void BindPathTracingInputs( CommandBuffer cmd, IRayTracingShader shader, - bool countNEERayAsPathSegment, uint risCandidateCount, bool preExpose, int bounces, @@ -139,7 +137,6 @@ static internal void BindPathTracingInputs( { shader.SetIntParam(cmd, ShaderProperties.LightEvaluations, (int)risCandidateCount); shader.SetIntParam(cmd, ShaderProperties.PathtracerAsGiPreviewMode, 0); - shader.SetIntParam(cmd, ShaderProperties.CountNEERayAsPathSegment, countNEERayAsPathSegment ? 1 : 0); shader.SetIntParam(cmd, ShaderProperties.RenderedInstances, (int)renderedGameObjectsFilter); shader.SetIntParam(cmd, ShaderProperties.PreExpose, preExpose ? 1 : 0); shader.SetIntParam(cmd, ShaderProperties.BounceCount, bounces); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/ProbeIntegrator.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/ProbeIntegrator.cs index 19292ffb0d6..d70814b8ab4 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/ProbeIntegrator.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/ProbeIntegrator.cs @@ -37,7 +37,6 @@ internal class ProbeIntegrator : IDisposable ProbeIntegratorResources _resourceLibrary; GraphicsBuffer _traceScratchBuffer; RTHandle _emptyExposureTexture; - bool _countNEERayAsPathSegment; private BakeProgressState _progressState; // This is a magic number, chosen to be a decent balance between performance and memory usage. @@ -63,11 +62,6 @@ private static class ShaderProperties public static readonly int LightIndexInCell = Shader.PropertyToID("g_LightIndexInCell"); } - public ProbeIntegrator(bool countNEERayAsPathSegment) - { - _countNEERayAsPathSegment = countNEERayAsPathSegment; - } - internal void Prepare(GraphicsBuffer positionsBuffer, ProbeIntegratorResources integrationResources, SamplingResources samplingResources) { // First release any previously allocated resources, prepare may be called multiple times @@ -119,7 +113,7 @@ private void DispatchRadianceEstimationKernel( // General path tracing parameters Util.SetLightSamplingKeyword(cmd, shader, lightSamplingMode); bool preExpose = false; - Util.BindPathTracingInputs(cmd, shader, _countNEERayAsPathSegment, risCandidateCount, preExpose, (int)bounceCount, environmentIntensityMultiplier, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyExposureTexture); + Util.BindPathTracingInputs(cmd, shader, risCandidateCount, preExpose, (int)bounceCount, environmentIntensityMultiplier, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyExposureTexture); Util.BindWorld(cmd, shader, world); // Zero initialize the output buffer diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapAOIntegration.urtshader b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapAOIntegration.urtshader index c8b30eaadea..3d188cf049a 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapAOIntegration.urtshader +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapAOIntegration.urtshader @@ -49,7 +49,7 @@ void AccumulateInternal(UnifiedRT::DispatchInfo dispatchInfo) UnifiedRT::InstanceData instance = UnifiedRT::GetInstance(hitResult.instanceID); PTHitGeom geometry = GetHitGeomInfo(instance, hitResult); geometry.FixNormals(direction); - MaterialProperties material = LoadMaterialProperties(instance, false, geometry.uv0, geometry.uv1); + MaterialProperties material = LoadMaterialProperties(instance, geometry.uv0, geometry.uv1); // Transmissive material, continue with a probability if (ShouldTransmitRay(rngState, material)) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapDirectIntegration.urtshader b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapDirectIntegration.urtshader index 2cc29cc2980..67e65d34690 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapDirectIntegration.urtshader +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapDirectIntegration.urtshader @@ -110,7 +110,7 @@ void EstimateMISWeightedIrradianceUsingCosineSampling( UnifiedRT::InstanceData instance = UnifiedRT::GetInstance(hitResult.instanceID); PTHitGeom geometry = GetHitGeomInfo(instance, hitResult); geometry.FixNormals(ray.direction); - MaterialProperties material = LoadMaterialProperties(instance, false, geometry.uv0, geometry.uv1); + MaterialProperties material = LoadMaterialProperties(instance, geometry.uv0, geometry.uv1); // Transmissive material, either continue or terminate ray, then apply attenuation. if (ShouldTransmitRay(rngState, material)) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapIndirectIntegration.urtshader b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapIndirectIntegration.urtshader index 49845e63336..02357c4debf 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapIndirectIntegration.urtshader +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapIndirectIntegration.urtshader @@ -34,17 +34,14 @@ float3 EstimateLightmapRadiance(UnifiedRT::DispatchInfo dispatchInfo, UnifiedRT: uint shadowRayLightmapLodMask = CURRENT_LOD_FOR_LIGHTMAP_INSTANCE_SHADOW; int transparencyBounce = 0; - // We start at bounce index 1, as bounce index is defined relative to the camera for this path tracer. - // Since this function is used for baking, we already implicitly have the first "hit", and are about - // to process the second path segment. - for (int bounceIndex = 1; bounceIndex <= g_BounceCount && transparencyBounce < MAX_TRANSMISSION_BOUNCES; bounceIndex++) + for (int bounceIndex = 0; bounceIndex <= g_BounceCount && transparencyBounce < MAX_TRANSMISSION_BOUNCES; bounceIndex++) { // The first path segment is special for the indirect pass - we should not add radiance from the // environment or emission, as these are already explicitly sampled in the direct pass. - bool isFirstPathSegment = bounceIndex == 1; + bool isFirstPathSegment = bounceIndex == 0; - uint pathRayMask = RayMask(bounceIndex == 0) | rayLightmapLodMask; - uint traceResult = TraceBounceRay(pathIter, bounceIndex, pathRayMask, dispatchInfo, accelStruct, rngState); + uint pathRayMask = RayMask(isFirstPathSegment) | rayLightmapLodMask; + uint traceResult = TraceBounceRay(pathIter, pathRayMask, dispatchInfo, accelStruct, rngState); if (traceResult == TRACE_HIT) { @@ -61,9 +58,9 @@ float3 EstimateLightmapRadiance(UnifiedRT::DispatchInfo dispatchInfo, UnifiedRT: uint shadowRayMask = ShadowRayMask() | shadowRayLightmapLodMask; if (!isFirstPathSegment) AddEmissionRadiance(pathIter, accelStruct, g_AccelStructInstanceList, false); - + // Check if we should do NEE, respecting the max bounce count - if (!g_CountNEERayAsPathSegment || bounceIndex < g_BounceCount) + if (bounceIndex < g_BounceCount) AddRadianceFromDirectIllumination(pathIter, shadowRayMask, dispatchInfo, accelStruct, g_AccelStructInstanceList, rngState, false); } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapValidityIntegration.urtshader b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapValidityIntegration.urtshader index 1b173348c70..4df40f52056 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapValidityIntegration.urtshader +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightmapValidityIntegration.urtshader @@ -48,7 +48,7 @@ void AccumulateInternal(UnifiedRT::DispatchInfo dispatchInfo) // Something was hit UnifiedRT::InstanceData instance = UnifiedRT::GetInstance(hitResult.instanceID); PTHitGeom geometry = GetHitGeomInfo(instance, hitResult); - MaterialProperties material = LoadMaterialProperties(instance, false, geometry.uv0, geometry.uv1); + MaterialProperties material = LoadMaterialProperties(instance, geometry.uv0, geometry.uv1); // Check for transmission if (ShouldTransmitRay(rngState, material)) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracing.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracing.hlsl index e1765e6674e..5c05dee7920 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracing.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracing.hlsl @@ -11,7 +11,6 @@ int g_BounceCount; uint g_LightEvaluations; -int g_CountNEERayAsPathSegment; // This flag must be enabled for MIS to work properly. int g_RenderedInstances; int g_PathtracerAsGiPreviewMode; uint g_PathTermination; @@ -140,13 +139,11 @@ void InitPathIterator(out PathIterator iter, UnifiedRT::Ray primaryRay) iter.ray = primaryRay; } -uint TraceBounceRay(inout PathIterator iterator, int bounceIndex, uint rayMask, UnifiedRT::DispatchInfo dispatchInfo, UnifiedRT::RayTracingAccelStruct accelStruct, inout PathTracingSampler rngState) +uint TraceBounceRay(inout PathIterator iterator, uint rayMask, UnifiedRT::DispatchInfo dispatchInfo, UnifiedRT::RayTracingAccelStruct accelStruct, inout PathTracingSampler rngState) { - bool isFirstRay = (bounceIndex == 0); uint traceResult = TRACE_MISS; - // Trace the ray. For primary rays in LiveGI we want to respect the backfacing culling properties of the material. Bounce rays follow the culling behavior of the baker. - int rayFlags = (bounceIndex == 0) ? UnifiedRT::kRayFlagCullBackFacingTriangles : UnifiedRT::kRayFlagNone; + int rayFlags = UnifiedRT::kRayFlagNone; iterator.hitResult = TraceRayClosestHit(dispatchInfo, accelStruct, rayMask, iterator.ray, rayFlags); iterator.hitGeo = (PTHitGeom) 0; @@ -159,7 +156,7 @@ uint TraceBounceRay(inout PathIterator iterator, int bounceIndex, uint rayMask, iterator.hitGeo.FixNormals(iterator.ray.direction); // Evaluate material properties at hit location - iterator.material = LoadMaterialProperties(instanceInfo, g_PathtracerAsGiPreviewMode && isFirstRay, iterator.hitGeo.uv0, iterator.hitGeo.uv1); + iterator.material = LoadMaterialProperties(instanceInfo, iterator.hitGeo.uv0, iterator.hitGeo.uv1); traceResult = TRACE_HIT; } else @@ -239,7 +236,7 @@ void AddRadianceFromEmissionAndDirectIllumination(inout PathIterator iterator, i } // Check if we should do NEE, respecting the max bounce count - if (!g_CountNEERayAsPathSegment || bounceIndex < g_BounceCount) + if (bounceIndex < g_BounceCount) { AddRadianceFromDirectIllumination(iterator, shadowRayMask, dispatchInfo, accelStruct, instanceList, rngState, g_PathtracerAsGiPreviewMode && isFirstRay); } @@ -248,7 +245,7 @@ void AddRadianceFromEmissionAndDirectIllumination(inout PathIterator iterator, i // Trace the next path segment and accumulate radiance due to directly sampled lights, randomly hit emissive surfaces, and missed rays which sample the environment. uint TraceBounceRayAndAddRadiance(inout PathIterator iterator, int bounceIndex, uint rayMask, uint shadowRayMask, UnifiedRT::DispatchInfo dispatchInfo, UnifiedRT::RayTracingAccelStruct accelStruct, StructuredBuffer instanceList, inout PathTracingSampler rngState) { - uint traceResult = TraceBounceRay(iterator, bounceIndex, rayMask, dispatchInfo, accelStruct, rngState); + uint traceResult = TraceBounceRay(iterator, rayMask, dispatchInfo, accelStruct, rngState); if (traceResult == TRACE_HIT) { diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracingMaterials.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracingMaterials.hlsl index f3f4703aa4d..946a321522b 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracingMaterials.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracingMaterials.hlsl @@ -26,7 +26,7 @@ float4 SampleAtlas(Texture2DArray atlas, SamplerState atlasSampler, uint return MaterialPool::SampleAtlas(atlas, atlasSampler, g_AtlasTexelSize, index, uv, scale, offset, pointFilterMode); } -MaterialProperties LoadMaterialProperties(UnifiedRT::InstanceData instanceInfo, bool useWhiteAsBaseColor, float2 uv0, float2 uv1) +MaterialProperties LoadMaterialProperties(UnifiedRT::InstanceData instanceInfo, float2 uv0, float2 uv1) { MaterialProperties output = MaterialPool::LoadMaterialProperties( g_MaterialList, @@ -42,12 +42,6 @@ MaterialProperties LoadMaterialProperties(UnifiedRT::InstanceData instanceInfo, uv0, uv1); - if (useWhiteAsBaseColor) - { - // override to white albedo, because albedo is multiplied with lightmap color at runtime - output.baseColor = float3(1, 1, 1); - } - return output; } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracingRandom.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracingRandom.hlsl index 7585b1370d4..538b60f5698 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracingRandom.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/PathTracingRandom.hlsl @@ -7,7 +7,7 @@ #define RAND_DIM_JITTERED_SHADOW 4 // Used for jittered shadows, ideally should be removed and the jitter handled in the SampleLightShape code instead but that's a refactor for another day #define RAND_DIM_LIGHT_SELECTION 5 // used for light selection (arbitrarily many dimensions after this point) -#define RUSSIAN_ROULETTE_MIN_BOUNCES 2 // Min bounces for russian roulette. Matches PLM_DEFAULT_MIN_BOUNCES +#define RUSSIAN_ROULETTE_MIN_BOUNCES 1 // Min bounces for russian roulette. Matches PLM_DEFAULT_MIN_BOUNCES - 1 // Currently we use maximum 5 random numbers per light: // 1 number to select a (mesh) light, diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationIndirect.urtshader b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationIndirect.urtshader index 00098408d82..c3f79a2493e 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationIndirect.urtshader +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationIndirect.urtshader @@ -24,27 +24,24 @@ float3 EstimateProbeRadiance(UnifiedRT::DispatchInfo dispatchInfo, UnifiedRT::Ra InitPathIterator(pathIter, ray); int transparencyBounce = 0; - // We start at bounce index 1, as bounce index is defined relative to the camera for this path tracer. - // Since this function is used for baking, we already implicitly have the first "hit", and are about - // to process the second path segment. - for (int bounceIndex = 1; bounceIndex <= g_BounceCount && transparencyBounce < MAX_TRANSMISSION_BOUNCES; bounceIndex++) + for (int bounceIndex = 0; bounceIndex <= g_BounceCount && transparencyBounce < MAX_TRANSMISSION_BOUNCES; bounceIndex++) { // The first path segment is special for the indirect pass - we should not add radiance from the // environment or emission, as these are already explicitly sampled in the direct pass. - bool isFirstPathSegment = bounceIndex == 1; + bool isFirstPathSegment = bounceIndex == 0; - uint pathRayMask = RayMask(bounceIndex == 0); + uint pathRayMask = RayMask(isFirstPathSegment); uint shadowRayMask = ShadowRayMask(); - uint traceResult = TraceBounceRay(pathIter, bounceIndex, pathRayMask, dispatchInfo, accelStruct, rngState); + uint traceResult = TraceBounceRay(pathIter, pathRayMask, dispatchInfo, accelStruct, rngState); if (traceResult == TRACE_HIT) { if (!isFirstPathSegment) AddEmissionRadiance(pathIter, accelStruct, g_AccelStructInstanceList, false); - + // Check if we should do NEE, respecting the max bounce count - if (!g_CountNEERayAsPathSegment || bounceIndex < g_BounceCount) + if (bounceIndex < g_BounceCount) AddRadianceFromDirectIllumination(pathIter, shadowRayMask, dispatchInfo, accelStruct, g_AccelStructInstanceList, rngState, false); } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationValidity.urtshader b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationValidity.urtshader index e331565239e..2455f0181c6 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationValidity.urtshader +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/ProbeIntegrationValidity.urtshader @@ -47,7 +47,7 @@ void IntegrateValidity(UnifiedRT::DispatchInfo dispatchInfo) { UnifiedRT::InstanceData instance = UnifiedRT::GetInstance(hitResult.instanceID); PTHitGeom geometry = GetHitGeomInfo(instance, hitResult); - MaterialProperties material = LoadMaterialProperties(instance, false, geometry.uv0, geometry.uv1); + MaterialProperties material = LoadMaterialProperties(instance, geometry.uv0, geometry.uv1); if (!hitResult.isFrontFace && !material.doubleSidedGI && !material.isTransmissive) invalidHit = true; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/UnityComputeProbeIntegrator.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/UnityComputeProbeIntegrator.cs index 2308dc32a15..04834195fa9 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/UnityComputeProbeIntegrator.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/UnityComputeProbeIntegrator.cs @@ -36,9 +36,9 @@ private static class ShaderProperties private Rendering.Sampling.SamplingResources _samplingResources; private ProbeIntegratorResources _integrationResources; - public UnityComputeProbeIntegrator(bool countNEERayAsPathSegment, Rendering.Sampling.SamplingResources samplingResources, ProbeIntegratorResources integrationResources, ComputeShader probeOcclusionLightIndexMappingShader) + public UnityComputeProbeIntegrator(Rendering.Sampling.SamplingResources samplingResources, ProbeIntegratorResources integrationResources, ComputeShader probeOcclusionLightIndexMappingShader) { - _probeIntegrator = new ProbeIntegrator(countNEERayAsPathSegment); + _probeIntegrator = new ProbeIntegrator(); _samplingResources = samplingResources; _probeOcclusionLightIndexMappingShader = probeOcclusionLightIndexMappingShader; _probeOcclusionLightIndexMappingKernel = _probeOcclusionLightIndexMappingShader.FindKernel("MapIndices"); diff --git a/Packages/com.unity.render-pipelines.core/Tests/Runtime/PathTracing/PathIteratorTests.cs b/Packages/com.unity.render-pipelines.core/Tests/Runtime/PathTracing/PathIteratorTests.cs index 30c9f930c7b..2f1b112882b 100644 --- a/Packages/com.unity.render-pipelines.core/Tests/Runtime/PathTracing/PathIteratorTests.cs +++ b/Packages/com.unity.render-pipelines.core/Tests/Runtime/PathTracing/PathIteratorTests.cs @@ -138,7 +138,7 @@ public void EmptyWorldWithEnvironmentLight_ShouldOutputEnvironmentLight(float en var shader = _rayTracingContext.LoadRayTracingShader("Packages/com.unity.render-pipelines.core/Tests/Runtime/PathTracing/PathIteratorTest.urtshader"); Util.BindWorld(_cmd, shader, _world); - Util.BindPathTracingInputs(_cmd, shader, false, 1, false, 4, 1.0f, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyExposureTexture); + Util.BindPathTracingInputs(_cmd, shader, 1, false, 4, 1.0f, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyExposureTexture); shader.SetIntParam(_cmd, Shader.PropertyToID("g_SampleCount"), (int)sampleCount); shader.SetBufferParam(_cmd, Shader.PropertyToID("_Output"), deviceOutputBuffer); @@ -210,7 +210,7 @@ public void RayHittingPlaneLitByWhiteEnvironmentLight_ShouldMatchAnalyticDerivat var shader = _rayTracingContext.LoadRayTracingShader("Packages/com.unity.render-pipelines.core/Tests/Runtime/PathTracing/PathIteratorTest.urtshader"); Util.BindWorld(_cmd, shader, _world); - Util.BindPathTracingInputs(_cmd, shader, false, 1, false, 4, 1.0f, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyExposureTexture); + Util.BindPathTracingInputs(_cmd, shader, 1, false, 4, 1.0f, RenderedGameObjectsFilter.OnlyStatic, _samplingResources, _emptyExposureTexture); shader.SetIntParam(_cmd, Shader.PropertyToID("g_SampleCount"), (int)sampleCount); shader.SetBufferParam(_cmd, Shader.PropertyToID("_Output"), deviceOutputBuffer); From 35ef7feb580502884837d595bf97673c1230add2 Mon Sep 17 00:00:00 2001 From: Alexandre Thibodeau Date: Fri, 6 Mar 2026 05:27:30 +0000 Subject: [PATCH 49/95] Fixed generated code for preview nodes for UI Toolkit shaders --- .../Data/Nodes/Input/UI/ElementLayoutUVNode.cs | 18 ++++++++++++++++-- .../Nodes/Input/UI/ElementTextureSizeNode.cs | 10 ++++++++++ .../Nodes/Input/UI/ElementTextureUVNode.cs | 18 ++++++++++++++++-- .../Data/Nodes/UI/DefaultBitmapTextNode.cs | 10 +++++++++- .../Data/Nodes/UI/DefaultGradientNode.cs | 5 ++++- .../Editor/Data/Nodes/UI/DefaultSDFTextNode.cs | 10 +++++++++- .../Editor/Data/Nodes/UI/DefaultSolidNode.cs | 5 ++++- .../Editor/Data/Nodes/UI/DefaultTextureNode.cs | 10 +++++++++- .../Editor/Data/Nodes/UI/IsForcedGammaNode.cs | 7 +++++++ .../Data/Nodes/UI/RenderTypeBranchNode.cs | 14 +++++++++++++- .../Editor/Data/Nodes/UI/RenderTypeNode.cs | 12 ++++++++++++ .../Data/Nodes/UI/SampleElementTextureNode.cs | 10 ++++++++++ .../Editor/Drawing/PreviewManager.cs | 4 +++- 13 files changed, 122 insertions(+), 11 deletions(-) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/UI/ElementLayoutUVNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/UI/ElementLayoutUVNode.cs index b03a43168cd..8fb535852f6 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/UI/ElementLayoutUVNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/UI/ElementLayoutUVNode.cs @@ -1,12 +1,13 @@ using UnityEditor.Graphing; using UnityEditor.Rendering.UITK.ShaderGraph; +using UnityEditor.ShaderGraph.Internal; using UnityEngine; namespace UnityEditor.ShaderGraph { [Title("Input", "UI", "Element Layout UV")] [SubTargetFilter(typeof(IUISubTarget))] - class ElementLayoutUV : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireUITK + class ElementLayoutUV : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireUITK, IMayRequireMeshUV { public const int LayoutUVSlotId = 0; @@ -29,12 +30,25 @@ public override void UpdateNodeAfterDeserialization() public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { - if (GetInputNodeFromSlot(LayoutUVSlotId) != null) sb.AppendLine(string.Format("$precision2 {0} = IN.layoutUV.xy;", GetVariableNameForSlot(LayoutUVSlotId))); + if (generationMode == GenerationMode.Preview) + { + // In preview mode, use standard mesh UV0 (will visualize as color: red = u, green = v) + sb.AppendLine("$precision2 {0} = IN.uv0.xy;", GetVariableNameForSlot(LayoutUVSlotId)); + return; + } + + if (GetInputNodeFromSlot(LayoutUVSlotId) != null) sb.AppendLine("$precision2 {0} = IN.layoutUV.xy;", GetVariableNameForSlot(LayoutUVSlotId)); } public bool RequiresUITK(ShaderStageCapability stageCapability) { return true; } + + public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) + { + // Require UV0 in preview mode for visualization + return channel == UVChannel.UV0; + } } } diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/UI/ElementTextureSizeNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/UI/ElementTextureSizeNode.cs index eaa0f19b0f7..8f465d10f12 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/UI/ElementTextureSizeNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/UI/ElementTextureSizeNode.cs @@ -39,6 +39,16 @@ public override void UpdateNodeAfterDeserialization() public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { + if (generationMode == GenerationMode.Preview) + { + // In preview mode, return default values (1.0) + if (GetInputNodeFromSlot(TextureWidthSlotId) != null) sb.AppendLine("$precision1 {0} = 1.0;", GetVariableNameForSlot(TextureWidthSlotId)); + if (GetInputNodeFromSlot(TextureHeightSlotId) != null) sb.AppendLine("$precision1 {0} = 1.0;", GetVariableNameForSlot(TextureHeightSlotId)); + if (GetInputNodeFromSlot(TexelWidthSlotId) != null) sb.AppendLine("$precision1 {0} = 1.0;", GetVariableNameForSlot(TexelWidthSlotId)); + if (GetInputNodeFromSlot(TexelHeightSlotId) != null) sb.AppendLine("$precision1 {0} = 1.0;", GetVariableNameForSlot(TexelHeightSlotId)); + return; + } + if ((GetInputNodeFromSlot(TextureWidthSlotId) != null) || (GetInputNodeFromSlot(TextureHeightSlotId) != null) || (GetInputNodeFromSlot(TexelWidthSlotId) != null) || diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/UI/ElementTextureUVNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/UI/ElementTextureUVNode.cs index 62f4226cdb7..2c6f9125666 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/UI/ElementTextureUVNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/Input/UI/ElementTextureUVNode.cs @@ -1,12 +1,13 @@ using UnityEditor.Graphing; using UnityEditor.Rendering.UITK.ShaderGraph; +using UnityEditor.ShaderGraph.Internal; using UnityEngine; namespace UnityEditor.ShaderGraph { [Title("Input", "UI", "Element Texture UV")] [SubTargetFilter(typeof(IUISubTarget))] - class ElementTextureUVNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireUITK + class ElementTextureUVNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireUITK, IMayRequireMeshUV { public const int TextureUVSlotId = 0; @@ -29,12 +30,25 @@ public override void UpdateNodeAfterDeserialization() public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { - if (GetInputNodeFromSlot(TextureUVSlotId) != null) sb.AppendLine(string.Format("$precision2 {0} = IN.uvClip.xy;", GetVariableNameForSlot(TextureUVSlotId))); + if (generationMode == GenerationMode.Preview) + { + // In preview mode, use standard mesh UV0 (will visualize as color: red = u, green = v) + sb.AppendLine("$precision2 {0} = IN.uv0.xy;", GetVariableNameForSlot(TextureUVSlotId)); + return; + } + + if (GetInputNodeFromSlot(TextureUVSlotId) != null) sb.AppendLine("$precision2 {0} = IN.uvClip.xy;", GetVariableNameForSlot(TextureUVSlotId)); } public bool RequiresUITK(ShaderStageCapability stageCapability) { return true; } + + public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) + { + // Require UV0 in preview mode for visualization + return channel == UVChannel.UV0; + } } } diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultBitmapTextNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultBitmapTextNode.cs index 2d8e4e4b3ef..7acf9e22c6f 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultBitmapTextNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultBitmapTextNode.cs @@ -33,7 +33,15 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo { string outputVarName = GetVariableNameForSlot(k_OutputSlotId); - sb.AppendLine("float4 {0} = float4(1, 1, 0, 1);", outputVarName); + sb.AppendLine("float4 {0} = float4(1, 1, 1, 1);", outputVarName); + + if (generationMode == GenerationMode.Preview) + { + bool hasTint = GetInputNodeFromSlot(k_InputSlotIdTint) != null; + if (hasTint) + sb.AppendLine("{0} = {1};", outputVarName, GetSlotValue(k_InputSlotIdTint, generationMode)); + return; + } sb.AppendLine("[branch] if ((_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && round(IN.typeTexSettings.x) == k_FragTypeText && (!(GetTextureInfo(IN.typeTexSettings.y).sdfScale > 0.0)))"); using (sb.BlockScope()) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultGradientNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultGradientNode.cs index d5c2f7420d7..d94d3f231fb 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultGradientNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultGradientNode.cs @@ -29,7 +29,10 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo { string outputVarName = GetVariableNameForSlot(k_OutputSlotId); - sb.AppendLine("float4 {0} = float4(1, 1, 0, 1);", outputVarName); + sb.AppendLine("float4 {0} = float4(1, 1, 1, 1);", outputVarName); + + if (generationMode == GenerationMode.Preview) + return; sb.AppendLine("[branch] if (_UIE_RENDER_TYPE_GRADIENT || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeSvgGradient)"); using (sb.BlockScope()) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultSDFTextNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultSDFTextNode.cs index 8791c282b74..3c17868952d 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultSDFTextNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultSDFTextNode.cs @@ -33,7 +33,15 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo { string outputVarName = GetVariableNameForSlot(k_OutputSlotId); - sb.AppendLine("float4 {0} = float4(1, 1, 0, 1);", outputVarName); + sb.AppendLine("float4 {0} = float4(1, 1, 1, 1);", outputVarName); + + if (generationMode == GenerationMode.Preview) + { + bool hasTint = GetInputNodeFromSlot(k_InputSlotIdTint) != null; + if (hasTint) + sb.AppendLine("{0} = {1};", outputVarName, GetSlotValue(k_InputSlotIdTint, generationMode)); + return; + } sb.AppendLine("[branch] if ((_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && round(IN.typeTexSettings.x) == k_FragTypeText && (GetTextureInfo(IN.typeTexSettings.y).sdfScale > 0.0))"); using (sb.BlockScope()) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultSolidNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultSolidNode.cs index 2f24f607cd5..d02938ca859 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultSolidNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultSolidNode.cs @@ -29,7 +29,10 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo { string outputVarName = GetVariableNameForSlot(k_OutputSlotId); - sb.AppendLine("float4 {0} = float4(1, 1, 0, 1);", outputVarName); + sb.AppendLine("float4 {0} = float4(1, 1, 1, 1);", outputVarName); + + if (generationMode == GenerationMode.Preview) + return; sb.AppendLine("[branch] if (_UIE_RENDER_TYPE_SOLID || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeSolid)"); using (sb.BlockScope()) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultTextureNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultTextureNode.cs index 64c73d86836..fdbb5b0405d 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultTextureNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultTextureNode.cs @@ -36,7 +36,15 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo { string outputVarName = GetVariableNameForSlot(k_OutputSlotId); - sb.AppendLine("float4 {0} = float4(1, 1, 0, 1);", outputVarName); + sb.AppendLine("float4 {0} = float4(1, 1, 1, 1);", outputVarName); + + if (generationMode == GenerationMode.Preview) + { + bool hasTint = GetInputNodeFromSlot(k_InputSlotIdTint) != null; + if (hasTint) + sb.AppendLine("{0} = {1};", outputVarName, GetSlotValue(k_InputSlotIdTint, generationMode)); + return; + } sb.AppendLine("[branch] if (_UIE_RENDER_TYPE_TEXTURE || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeTexture)"); using (sb.BlockScope()) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/IsForcedGammaNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/IsForcedGammaNode.cs index 1c812950f37..f46ac45e640 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/IsForcedGammaNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/IsForcedGammaNode.cs @@ -26,6 +26,13 @@ public sealed override void UpdateNodeAfterDeserialization() public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { + if (generationMode == GenerationMode.Preview) + { + // In preview mode, return false by default + sb.AppendLine("bool {0} = false;", GetVariableNameForSlot(k_OutputSlotId)); + return; + } + sb.AppendLine("bool {0} = _UIE_FORCE_GAMMA;", GetVariableNameForSlot(k_OutputSlotId)); } diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeBranchNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeBranchNode.cs index 44769e90f34..566185ff83b 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeBranchNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeBranchNode.cs @@ -49,9 +49,21 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo string outputVarNameColor = GetVariableNameForSlot(k_OutputSlotIdColor); string outputVarNameAlpha = GetVariableNameForSlot(k_OutputSlotIdAlpha); - sb.AppendLine("float3 {0} = float3(0, 0, 0);", outputVarNameColor); + sb.AppendLine("float3 {0} = float3(1, 1, 1);", outputVarNameColor); sb.AppendLine("float {0} = 1.0;", outputVarNameAlpha); + if (generationMode == GenerationMode.Preview) + { + // In preview mode the UITK render-type macros don't exist. + // Output the Solid input if connected. + if (GetInputNodeFromSlot(k_InputSlotIdSolid) != null) + { + sb.AppendLine("{0} = {1}.rgb;", outputVarNameColor, GetSlotValue(k_InputSlotIdSolid, generationMode)); + sb.AppendLine("{0} = {1}.a;", outputVarNameAlpha, GetSlotValue(k_InputSlotIdSolid, generationMode)); + } + return; + } + sb.AppendLine("[branch] if (_UIE_RENDER_TYPE_SOLID || _UIE_RENDER_TYPE_ANY && TestType(IN.typeTexSettings.x, k_FragTypeSolid))"); using (sb.BlockScope()) { diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeNode.cs index 3aaed5f3bcf..45a7663a8f7 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeNode.cs @@ -39,6 +39,18 @@ public sealed override void UpdateNodeAfterDeserialization() public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { + if (generationMode == GenerationMode.Preview) + { + // In preview mode the UITK render-type macros don't exist. + // Default to Solid render type. + sb.AppendLine("bool {0} = true;", GetVariableNameForSlot(k_OutputSlotIdSolid)); + sb.AppendLine("bool {0} = false;", GetVariableNameForSlot(k_OutputSlotIdTexture)); + sb.AppendLine("bool {0} = false;", GetVariableNameForSlot(k_OutputSlotIdSDFText)); + sb.AppendLine("bool {0} = false;", GetVariableNameForSlot(k_OutputSlotIdBitmapText)); + sb.AppendLine("bool {0} = false;", GetVariableNameForSlot(k_OutputSlotIdGradient)); + return; + } + sb.AppendLine("bool {0} = _UIE_RENDER_TYPE_SOLID || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeSolid;", GetVariableNameForSlot(k_OutputSlotIdSolid)); sb.AppendLine("bool {0} = _UIE_RENDER_TYPE_TEXTURE || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeTexture;", GetVariableNameForSlot(k_OutputSlotIdTexture)); sb.AppendLine("bool {0} = (_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && round(IN.typeTexSettings.x) == k_FragTypeText && (GetTextureInfo(IN.typeTexSettings.y).sdfScale > 0.0);", GetVariableNameForSlot(k_OutputSlotIdSDFText)); diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/SampleElementTextureNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/SampleElementTextureNode.cs index 24f2be454ac..eb6b8e6b159 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/SampleElementTextureNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/SampleElementTextureNode.cs @@ -82,6 +82,16 @@ public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode gener public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { + if (generationMode == GenerationMode.Preview) + { + // In preview mode, return white + sb.AppendLine("$precision4 {0} = $precision4(1, 1, 1, 1);", GetVariableNameForSlot(Color0SlotId)); + sb.AppendLine("$precision4 {0} = $precision4(1, 1, 1, 1);", GetVariableNameForSlot(Color1SlotId)); + sb.AppendLine("$precision4 {0} = $precision4(1, 1, 1, 1);", GetVariableNameForSlot(Color2SlotId)); + sb.AppendLine("$precision4 {0} = $precision4(1, 1, 1, 1);", GetVariableNameForSlot(Color3SlotId)); + return; + } + sb.AppendLine("$precision4 {0};", GetVariableNameForSlot(Color0SlotId)); sb.AppendLine("$precision4 {0};", GetVariableNameForSlot(Color1SlotId)); sb.AppendLine("$precision4 {0};", GetVariableNameForSlot(Color2SlotId)); diff --git a/Packages/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs b/Packages/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs index c27307bd2bd..faf6197fdf8 100644 --- a/Packages/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs +++ b/Packages/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs @@ -1402,7 +1402,9 @@ void CompileMasterNodeShader() // Skip generation for VFXTarget if (!m_Graph.isOnlyVFXTarget) { - var generator = new Generator(m_Graph, m_Graph.outputNode, GenerationMode.Preview, "Master"); + // UITK shaders need ForReals mode to have access to UITK macros for proper rendering + var mode = prefersUITKPreview ? GenerationMode.ForReals : GenerationMode.Preview; + var generator = new Generator(m_Graph, m_Graph.outputNode, mode, "Master"); shaderData.shaderString = generator.generatedShader; // record the blocks temporarily created for missing stack blocks From 1d2aa06e8ebacca8d2d5e25d6582065d23b1a817 Mon Sep 17 00:00:00 2001 From: Esmeralda Salamone Date: Fri, 6 Mar 2026 14:32:16 +0000 Subject: [PATCH 50/95] [ShaderGraph] Reference and Precision hints and improved strong hint processing --- .../Data/Graphs/ShaderGraphRequirements.cs | 84 + .../Editor/Data/Graphs/SpaceMaterialSlot.cs | 3 + .../Editor/Data/Nodes/AbstractMaterialNode.cs | 8 +- .../Model/Header/CommonHints.cs | 14 +- .../Model/Header/FunctionHeader.cs | 8 + .../Model/Header/FunctionHints.cs | 17 +- .../Model/Header/HeaderUtils.cs | 272 +++- .../Model/Header/ParameterHeader.cs | 27 +- .../Model/Header/ParameterHints.cs | 248 ++- .../ProviderSystem/Model/ProviderNode.cs | 62 +- .../Model/ProviderNodePropertyDrawer.cs | 2 +- .../Provider/ExpressionProvider.cs | 8 +- .../Provider/ReflectedFunctionProvider.cs | 1 - .../ShaderObjects/ShaderObjectUtils.cs | 30 +- .../ShaderObjects/StrongHint.cs | 129 +- .../Editor/ProviderTests/StrongHintTests.cs | 68 +- .../Graphs/ProviderSystem/AllHints.hlsl | 110 +- .../ShouldCompileProperlyOnImport.shadergraph | 1371 ++++++++++++++++- 18 files changed, 2196 insertions(+), 266 deletions(-) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Graphs/ShaderGraphRequirements.cs b/Packages/com.unity.shadergraph/Editor/Data/Graphs/ShaderGraphRequirements.cs index 2bb1efa905b..feb6713b6ae 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Graphs/ShaderGraphRequirements.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Graphs/ShaderGraphRequirements.cs @@ -215,6 +215,81 @@ internal ShaderGraphRequirements Union(ShaderGraphRequirements other) return newReqs; } + private static void FromSlot(MaterialSlot node, ref ShaderGraphRequirements reqs, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool[] texCoordNeedsDerivs = null) + { + if (node is IMayRequireTransform a) + reqs.m_RequiresTransforms.AddRange(a.RequiresTransform()); + + if (node is IMayRequireNormal b) + reqs.m_RequiresNormal |= b.RequiresNormal(stageCapability); + + if (node is IMayRequireBitangent c) + reqs.m_RequiresBitangent |= c.RequiresBitangent(stageCapability); + + if (node is IMayRequireTangent d) + reqs.m_RequiresTangent |= d.RequiresTangent(stageCapability); + + if (node is IMayRequireViewDirection e) + reqs.m_RequiresViewDir |= e.RequiresViewDirection(stageCapability); + + if (node is IMayRequirePosition f) + reqs.m_RequiresPosition |= f.RequiresPosition(stageCapability); + + if (node is IMayRequirePositionPredisplacement g) + reqs.m_RequiresPositionPredisplacement |= g.RequiresPositionPredisplacement(stageCapability); + + if (!reqs.m_RequiresScreenPosition && node is IMayRequireScreenPosition h) + reqs.m_RequiresScreenPosition = h.RequiresScreenPosition(stageCapability); + + if (!reqs.m_RequiresNDCPosition && node is IMayRequireNDCPosition i) + reqs.m_RequiresNDCPosition = i.RequiresNDCPosition(stageCapability); + + if (!reqs.m_RequiresPixelPosition && node is IMayRequirePixelPosition j) + reqs.m_RequiresPixelPosition = j.RequiresPixelPosition(stageCapability); + + if (!reqs.m_RequiresVertexColor && node is IMayRequireVertexColor k) + reqs.m_RequiresVertexColor = k.RequiresVertexColor(stageCapability); + + if (!reqs.m_RequiresFaceSign && node is IMayRequireFaceSign l) + reqs.m_RequiresFaceSign = l.RequiresFaceSign(stageCapability); + + if (!reqs.m_RequiresDepthTexture && node is IMayRequireDepthTexture m) + reqs.m_RequiresDepthTexture = m.RequiresDepthTexture(stageCapability); + + if (!reqs.m_RequiresCameraOpaqueTexture && node is IMayRequireCameraOpaqueTexture n) + reqs.m_RequiresCameraOpaqueTexture = n.RequiresCameraOpaqueTexture(stageCapability); + + if (!reqs.m_RequiresVertexSkinning && node is IMayRequireVertexSkinning o) + reqs.m_RequiresVertexSkinning = o.RequiresVertexSkinning(stageCapability); + + if (!reqs.m_RequiresVertexID && node is IMayRequireVertexID p) + reqs.m_RequiresVertexID = p.RequiresVertexID(stageCapability); + + if (node is IMayRequireMeshUV q) + { + for (int uvIndex = 0; uvIndex < ShaderGeneratorNames.UVCount; ++uvIndex) + { + var channel = (UVChannel)uvIndex; + if (q.RequiresMeshUV(channel)) + { + reqs.m_RequiresMeshUVs.Add(channel); + if (texCoordNeedsDerivs is not null && + uvIndex < texCoordNeedsDerivs.Length && + texCoordNeedsDerivs[uvIndex]) + { + reqs.m_RequiresMeshUVDerivatives.Add(channel); + } + } + } + } + + if (!reqs.m_RequiresInstanceID && node is IMayRequireInstanceID r) + reqs.m_RequiresInstanceID = r.RequiresInstanceID(stageCapability); + + if (!reqs.m_RequiresUITK && node is IMayRequireUITK w) + reqs.m_RequiresUITK = w.RequiresUITK(stageCapability); + } + internal static ShaderGraphRequirements FromNodes(IEnumerable nodes, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool includeIntermediateSpaces = true, bool[] texCoordNeedsDerivs = null) where T : AbstractMaterialNode { @@ -226,6 +301,13 @@ internal static ShaderGraphRequirements FromNodes(IEnumerable nodes, Shade foreach (var node in nodes) { + using (UnityEngine.Pool.ListPool.Get(out var inputSlots)) + { + node.GetInputSlots(inputSlots); + foreach (var slot in inputSlots) + FromSlot(slot, ref reqs, stageCapability, texCoordNeedsDerivs); + } + if (node is IMayRequireTransform a) reqs.m_RequiresTransforms.AddRange(a.RequiresTransform()); @@ -303,6 +385,8 @@ internal static ShaderGraphRequirements FromNodes(IEnumerable nodes, Shade } reqs.m_RequiresTransforms = reqs.m_RequiresTransforms.Distinct().ToList(); + reqs.m_RequiresMeshUVDerivatives = reqs.m_RequiresMeshUVDerivatives.Distinct().ToList(); + reqs.m_RequiresMeshUVs = reqs.m_RequiresMeshUVs.Distinct().ToList(); // if anything needs tangentspace we have make // sure to have our othonormal basis! diff --git a/Packages/com.unity.shadergraph/Editor/Data/Graphs/SpaceMaterialSlot.cs b/Packages/com.unity.shadergraph/Editor/Data/Graphs/SpaceMaterialSlot.cs index bc63e160b52..f9759d1c12e 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Graphs/SpaceMaterialSlot.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Graphs/SpaceMaterialSlot.cs @@ -31,7 +31,10 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) { var slot = foundSlot as SpaceMaterialSlot; if (slot != null) + { space = slot.space; + owner?.Dirty(ModificationScope.Topological); + } } } } diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs index 89ef46ec708..6d281935cd1 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs @@ -673,6 +673,7 @@ public virtual void PropagateFloatLiteral(List inputSlots, List inputSlots, List outputSlots) { var dynamicInputSlotsToCompare = DictionaryPool.Get(); @@ -732,6 +733,8 @@ public virtual void EvaluateDynamicMaterialSlots(List inputSlots, // we can now figure out the dynamic slotType // from here set all the var dynamicType = ConvertDynamicVectorInputTypeToConcrete(dynamicInputSlotsToCompare.Values); + lastKnownDynamicVectorLength = dynamicType.GetChannelCount(); + foreach (var dynamicKvP in dynamicInputSlotsToCompare) dynamicKvP.Key.SetConcreteType(dynamicType); foreach (var skippedSlot in skippedDynamicSlots) @@ -893,7 +896,7 @@ public virtual string GetVariableNameForNode() return defaultVariableName; } - public MaterialSlot AddSlot(MaterialSlot slot, bool attemptToModifyExistingInstance = true) + public MaterialSlot AddSlot(MaterialSlot slot, bool attemptToModifyExistingInstance = true, bool copyExistingValue = true) { if (slot == null) { @@ -956,7 +959,8 @@ public MaterialSlot AddSlot(MaterialSlot slot, bool attemptToModifyExistingInsta // foundSlot is of a different type; try to copy values // I think this is to support casting if implemented in CopyValuesFrom ? - slot.CopyValuesFrom(foundSlot); + if (copyExistingValue) + slot.CopyValuesFrom(foundSlot); foundSlot.owner = null; diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/CommonHints.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/CommonHints.cs index 4ea5d386988..c394c2a9f94 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/CommonHints.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/CommonHints.cs @@ -11,10 +11,11 @@ internal static class Common internal class DisplayName : IStrongHint where T : IShaderObject { public string Key { get; private set; } + public bool AlwaysProcess => true; public IReadOnlyCollection Synonyms { get; } = new string[] { "Label", "Title" }; string fallback; internal DisplayName(string name = Common.kDisplayName, string fallback = null) { Key = name; this.fallback = fallback; } - public bool Process(bool found, string rawValue, T obj, IProvider provider, out object value, out string msg) + public bool Process(bool found, string rawValue, T obj, IProvider provider, out object value, out string msg, string actualHintKey) { msg = null; value = found ? rawValue : fallback ?? obj.Name; @@ -27,7 +28,7 @@ internal class Tooltip : IStrongHint where T : IShaderObject public string Key { get; private set; } public IReadOnlyCollection Synonyms { get; } = new [] { "summary" }; internal Tooltip(string name = Common.kTooltip) { Key = name; } - public bool Process(bool found, string rawValue, T obj, IProvider provider, out object value, out string msg) + public bool Process(bool found, string rawValue, T obj, IProvider provider, out object value, out string msg, string actualHintKey) { msg = null; value = rawValue; @@ -39,12 +40,19 @@ internal class Flag : IStrongHint where T : IShaderObject { public string Key { get; private set; } public IReadOnlyCollection Conflicts { get; private set; } + public IReadOnlyCollection Synonyms { get; private set; } internal Flag(string name) { Key = name; Conflicts = null; } internal Flag(string name, string conflict) { Key = name; Conflicts = new[] { conflict }; } internal Flag(string name, string[] conflicts) { Key = name; Conflicts = conflicts; } + internal Flag(string name, string[] conflicts, string[] synonyms) + { + Key = name; + Conflicts = conflicts; + Synonyms = synonyms; + } - public bool Process(bool found, string rawValue, T obj, IProvider provider, out object value, out string msg) + public bool Process(bool found, string rawValue, T obj, IProvider provider, out object value, out string msg, string actualHintKey) { msg = null; value = rawValue; diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHeader.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHeader.cs index 4601233d9d7..fb10ff4331b 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHeader.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHeader.cs @@ -18,6 +18,8 @@ internal class FunctionHeader : StrongHeader internal ParameterHeader returnHeader { get; private set; } + internal bool allowPrecision { get; private set; } + private static HintRegistry s_HintRegistry; protected override HintRegistry GetHintRegistry() { @@ -29,12 +31,16 @@ protected override HintRegistry GetHintRegistry() s_HintRegistry.RegisterStrongHint(new Hints.DisplayName()); s_HintRegistry.RegisterStrongHint(new Hints.Tooltip()); + // Duplicate Synonyms are getting registered and we aren't handling conflicts; + // but we should allow multimapping! s_HintRegistry.RegisterStrongHint(new Hints.DisplayName(Hints.Func.kReturnDisplayName, "Out")); s_HintRegistry.RegisterStrongHint(new Hints.Tooltip(Hints.Func.kReturnTooltip)); s_HintRegistry.RegisterStrongHint(new Hints.SearchName()); s_HintRegistry.RegisterStrongHint(new Hints.SearchTerms()); s_HintRegistry.RegisterStrongHint(new Hints.SearchCategory()); + + s_HintRegistry.RegisterStrongHint(new Hints.Flag(Hints.Func.kPrecision, null, new string[] { "Precision" })); } return s_HintRegistry; } @@ -55,6 +61,8 @@ protected override void OnProcess(IShaderFunction func, IProvider provider) searchTerms = Get(Hints.Func.kSearchTerms); searchCategory = Get(Hints.Func.kSearchCategory); + allowPrecision = Has(Hints.Func.kPrecision); + returnHeader = new ParameterHeader(returnDisplayName, func.ReturnType, returnTooltip, provider); } } diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHints.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHints.cs index b6164c30cc4..f907fc18b36 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHints.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/FunctionHints.cs @@ -13,6 +13,8 @@ internal static class Func internal const string kSearchName = "sg:SearchName"; internal const string kSearchCategory = "sg:SearchCategory"; + internal const string kPrecision = "sg:DynamicPrecision"; + // Not yet implemented. internal const string kGroupKey = "sg:GroupKey"; internal const string kReturnTooltip = "sg:ReturnTooltip"; @@ -27,12 +29,14 @@ internal static class Func class ProviderKey : IStrongHint { public string Key => Func.kProviderKey; - public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider provider, out object value, out string msg) + public bool AlwaysProcess => true; + public bool AllowDisqualifiedSynonyms => false; + public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider provider, out object value, out string msg, string actualHintKey) { string sourcePath = AssetDatabase.GUIDToAssetPath(provider.AssetID); value = provider.ProviderKey; - msg = !found // The defaulted ProviderKey is the fully qualified signature. + msg = !found ? $"Expected; but none found for '{provider.ProviderKey}' in '{sourcePath}'." : null; @@ -43,7 +47,8 @@ public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider class SearchName : IStrongHint { public string Key => Func.kSearchName; - public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider provider, out object value, out string msg) + public bool AlwaysProcess => true; + public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider provider, out object value, out string msg, string actualHintKey) { msg = null; value = found ? rawValue : ShaderObjectUtils.QualifySignature(obj, false, true); @@ -54,7 +59,8 @@ public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider class SearchTerms : IStrongHint { public string Key => Func.kSearchTerms; - public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider provider, out object value, out string msg) + public bool AlwaysProcess => true; + public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider provider, out object value, out string msg, string actualHintKey) { msg = null; value = found ? HeaderUtils.LazyTokenString(rawValue) : new string[] { obj.Name }; @@ -65,8 +71,9 @@ public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider class SearchCategory : IStrongHint { public string Key => Func.kSearchCategory; + public bool AlwaysProcess => true; public IReadOnlyCollection Synonyms { get; } = new[] { "Category" }; - public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider provider, out object value, out string msg) + public bool Process(bool found, string rawValue, IShaderFunction obj, IProvider provider, out object value, out string msg, string actualHintKey) { msg = null; if (found) diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/HeaderUtils.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/HeaderUtils.cs index 1fa81eb54ac..d979523cd44 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/HeaderUtils.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/HeaderUtils.cs @@ -1,6 +1,7 @@ using UnityEngine; using UnityEditor.Graphing; using System.Collections.Generic; +using System; namespace UnityEditor.ShaderGraph.ProviderSystem { @@ -138,94 +139,145 @@ private static bool Cast(string shaderType, float[] values, out T value, T fa internal static MaterialSlot MakeSlotFromParameter(ParameterHeader header, int slotId, SlotType dir) { - MaterialSlot slot; + MaterialSlot slot = null; - if (header.isDropdown) - { - HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asIdx, 0.0f); - slot = new Vector1MaterialEnumSlot(slotId, header.displayName, header.referenceName, dir, header.options, asIdx); - } - else if (header.isSlider) + Enum.TryParse(header.defaultString, true, out var defaultUVChannel); + if (!Enum.TryParse(header.defaultString, true, out var defaultCoordinateSpace)) + defaultCoordinateSpace = Internal.CoordinateSpace.Object; + Enum.TryParse(header.defaultString, true, out var defaultScreenSpaceType); + + // absolute world only works for position. + if (defaultCoordinateSpace == Internal.CoordinateSpace.AbsoluteWorld && header.Referable != Hints.Param.Ref.kPosition) + defaultCoordinateSpace = Internal.CoordinateSpace.Object; + + // Screen doesn't work for any of the Space Slots-- _why do they use this enum?_ + if (defaultCoordinateSpace == Internal.CoordinateSpace.Screen) + defaultCoordinateSpace = Internal.CoordinateSpace.Object; + + if (header.isReferable && dir == SlotType.Input) { - HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asRng, 0); - slot = new Vector1MaterialRangeSlot(slotId, header.displayName, header.referenceName, dir, asRng, new Vector2(header.sliderMin, header.sliderMax)); - } - else switch (header.typeName) + switch(header.Referable) { - case "uint1": - case "uint": - HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asUint, 0u); - slot = new Vector1MaterialIntegerSlot(slotId, header.displayName, header.referenceName, dir, asUint, unsigned: true); break; - case "int1": - case "int": - HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asInt, 0); - slot = new Vector1MaterialIntegerSlot(slotId, header.displayName, header.referenceName, dir, asInt); break; - case "half": - case "half1": - case "float1": - case "float": - HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asFloat, 0.0f); - slot = new Vector1MaterialSlot(slotId, header.displayName, header.referenceName, dir, asFloat); break; - case "bool1": - case "bool": - HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asBool, false); - slot = new BooleanMaterialSlot(slotId, header.displayName, header.referenceName, dir, asBool); break; - case "half2": - case "float2": - HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asV2, Vector2.zero); - slot = new Vector2MaterialSlot(slotId, header.displayName, header.referenceName, dir, asV2); break; - case "half3": - case "float3": - HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asV3, Vector3.zero); - slot = !header.isColor - ? new Vector3MaterialSlot(slotId, header.displayName, header.referenceName, dir, asV3) - : new ColorRGBMaterialSlot(slotId, header.displayName, header.referenceName, dir, new Vector4(asV3.x, asV3.y, asV3.z, 1), Internal.ColorMode.Default); + case Hints.Param.Ref.kUV: + slot = new UVMaterialSlot(slotId, header.displayName, header.referenceName, defaultUVChannel); break; - case "half4": - case "float4": - HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asV4, header.isColor ? new Vector4(0, 0, 0, 1) : Vector4.zero); - - slot = header.isColor - ? new ColorRGBAMaterialSlot(slotId, header.displayName, header.referenceName, dir, asV4) - : new Vector4MaterialSlot(slotId, header.displayName, header.referenceName, dir, asV4); - + case Hints.Param.Ref.kPosition: + slot = new PositionMaterialSlot(slotId, header.displayName, header.referenceName, defaultCoordinateSpace); + break; + case Hints.Param.Ref.kNormal: + slot = new NormalMaterialSlot(slotId, header.displayName, header.referenceName, defaultCoordinateSpace); + break; + case Hints.Param.Ref.kTangent: + slot = new TangentMaterialSlot(slotId, header.displayName, header.referenceName, defaultCoordinateSpace); break; - case "half2x2": - case "float2x2": slot = new Matrix2MaterialSlot(slotId, header.displayName, header.referenceName, dir); break; - case "half3x3": - case "float3x3": slot = new Matrix3MaterialSlot(slotId, header.displayName, header.referenceName, dir); break; - case "half4x4": - case "float4x4": slot = new Matrix4MaterialSlot(slotId, header.displayName, header.referenceName, dir); break; - - case "SamplerState": - case "UnitySamplerState": slot = new SamplerStateMaterialSlot(slotId, header.displayName, header.referenceName, dir); break; - case "Texture2D": - case "UnityTexture2D": - slot = dir == SlotType.Input - ? new Texture2DInputMaterialSlot(slotId, header.displayName, header.referenceName) - : new Texture2DMaterialSlot(slotId, header.displayName, header.referenceName, dir); + case Hints.Param.Ref.kBitangent: + slot = new BitangentMaterialSlot(slotId, header.displayName, header.referenceName, defaultCoordinateSpace); break; - case "Texture2DArray": - case "UnityTexture2DArray": - slot = dir == SlotType.Input - ? new Texture2DArrayInputMaterialSlot(slotId, header.displayName, header.referenceName) - : new Texture2DArrayMaterialSlot(slotId, header.displayName, header.referenceName, dir); break; - case "TextureCube": - case "UnityTextureCube": - slot = dir == SlotType.Input - ? new CubemapInputMaterialSlot(slotId, header.displayName, header.referenceName) - : new CubemapMaterialSlot(slotId, header.displayName, header.referenceName, dir); break; - case "Texture3D": - case "UnityTexture3D": - slot = dir == SlotType.Input - ? new Texture3DInputMaterialSlot(slotId, header.displayName, header.referenceName) - : new Texture3DMaterialSlot(slotId, header.displayName, header.referenceName, dir); break; - default: - slot = new ExternalMaterialSlot(slotId, header.displayName, header.referenceName, header.externalQualifiedTypeName, dir, header.defaultString); + case Hints.Param.Ref.kVertexColor: + slot = new VertexColorMaterialSlot(slotId, header.displayName, header.referenceName); break; + case Hints.Param.Ref.kViewDirection: + slot = new ViewDirectionMaterialSlot(slotId, header.displayName, header.referenceName, defaultCoordinateSpace); + break; + case Hints.Param.Ref.kScreenPosition: + slot = new ScreenPositionMaterialSlot(slotId, header.displayName, header.referenceName, defaultScreenSpaceType); + break; + } + } + if (slot == null) + { + if (header.isDynamic) + { + HeaderUtils.TryCast(header.typeName, header.defaultValue, out var v4, Vector4.zero); + slot = new DynamicVectorMaterialSlot(slotId, header.displayName, header.referenceName, dir, v4); + } + else if (header.isDropdown && dir == SlotType.Input) + { + HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asIdx, 0.0f); + slot = new Vector1MaterialEnumSlot(slotId, header.displayName, header.referenceName, dir, header.options, asIdx); + } + else if (header.isSlider && dir == SlotType.Input) + { + HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asRng, 0); + slot = new Vector1MaterialRangeSlot(slotId, header.displayName, header.referenceName, dir, asRng, new Vector2(header.sliderMin, header.sliderMax)); + } + else switch (header.typeName) + { + case "uint1": + case "uint": + HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asUint, 0u); + slot = new Vector1MaterialIntegerSlot(slotId, header.displayName, header.referenceName, dir, asUint, unsigned: true); break; + case "int1": + case "int": + HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asInt, 0); + slot = new Vector1MaterialIntegerSlot(slotId, header.displayName, header.referenceName, dir, asInt); break; + case "half": + case "half1": + case "float1": + case "float": + HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asFloat, 0.0f); + slot = new Vector1MaterialSlot(slotId, header.displayName, header.referenceName, dir, asFloat); break; + case "bool1": + case "bool": + HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asBool, false); + slot = new BooleanMaterialSlot(slotId, header.displayName, header.referenceName, dir, asBool); break; + case "half2": + case "float2": + HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asV2, Vector2.zero); + slot = new Vector2MaterialSlot(slotId, header.displayName, header.referenceName, dir, asV2); break; + case "half3": + case "float3": + HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asV3, Vector3.zero); + slot = !header.isColor + ? new Vector3MaterialSlot(slotId, header.displayName, header.referenceName, dir, asV3) + : new ColorRGBMaterialSlot(slotId, header.displayName, header.referenceName, dir, new Vector4(asV3.x, asV3.y, asV3.z, 1), Internal.ColorMode.Default); + break; + case "half4": + case "float4": + HeaderUtils.TryCast(header.typeName, header.defaultValue, out var asV4, header.isColor ? new Vector4(0, 0, 0, 1) : Vector4.zero); + + slot = header.isColor + ? new ColorRGBAMaterialSlot(slotId, header.displayName, header.referenceName, dir, asV4) + : new Vector4MaterialSlot(slotId, header.displayName, header.referenceName, dir, asV4); + + break; + case "half2x2": + case "float2x2": slot = new Matrix2MaterialSlot(slotId, header.displayName, header.referenceName, dir); break; + case "half3x3": + case "float3x3": slot = new Matrix3MaterialSlot(slotId, header.displayName, header.referenceName, dir); break; + case "half4x4": + case "float4x4": slot = new Matrix4MaterialSlot(slotId, header.displayName, header.referenceName, dir); break; - slot.hideConnector = header.isStatic && header.isInput; + case "SamplerState": + case "UnitySamplerState": slot = new SamplerStateMaterialSlot(slotId, header.displayName, header.referenceName, dir); break; + case "Texture2D": + case "UnityTexture2D": + slot = dir == SlotType.Input + ? new Texture2DInputMaterialSlot(slotId, header.displayName, header.referenceName) + : new Texture2DMaterialSlot(slotId, header.displayName, header.referenceName, dir); + break; + case "Texture2DArray": + case "UnityTexture2DArray": + slot = dir == SlotType.Input + ? new Texture2DArrayInputMaterialSlot(slotId, header.displayName, header.referenceName) + : new Texture2DArrayMaterialSlot(slotId, header.displayName, header.referenceName, dir); break; + case "TextureCube": + case "UnityTextureCube": + slot = dir == SlotType.Input + ? new CubemapInputMaterialSlot(slotId, header.displayName, header.referenceName) + : new CubemapMaterialSlot(slotId, header.displayName, header.referenceName, dir); break; + case "Texture3D": + case "UnityTexture3D": + slot = dir == SlotType.Input + ? new Texture3DInputMaterialSlot(slotId, header.displayName, header.referenceName) + : new Texture3DMaterialSlot(slotId, header.displayName, header.referenceName, dir); break; + default: + slot = new ExternalMaterialSlot(slotId, header.displayName, header.referenceName, header.externalQualifiedTypeName, dir, header.defaultString); + break; + } + } + slot.hideConnector = header.isStatic && dir == SlotType.Input; slot.hidden = header.isLocal; slot.bareResource = header.isBareResource; return slot; @@ -258,5 +310,67 @@ private static IEnumerable LazyTokenize(string arg) yield return e.Trim(); } } + + private static IShaderType ApplyLegacy(IShaderType type, string precisionToken, int dynamicLength) + { + var baseType = type.Name.Split('[')[0]; + + var newType = baseType; + + // TODO: DYNAMIC HINT only supports float, float2, float3, float4 and half, half2, half3, half4 + if (dynamicLength >= 1 && dynamicLength <= 4) + { + string halfType = $"half{(dynamicLength == 1 ? null : dynamicLength)}"; + string floatType = $"float{(dynamicLength == 1 ? null : dynamicLength)}"; + newType = System.Text.RegularExpressions.Regex.Replace(newType, "half[1-4]|half", halfType); + newType = System.Text.RegularExpressions.Regex.Replace(newType, "float[1-4]|float", floatType); + } + + if (precisionToken != null) + newType = newType.Replace("float", precisionToken).Replace("half", precisionToken); + + return new ShaderType(type.Name.Replace(baseType, newType)); + } + + internal static bool TryApplyLegacy(IShaderFunction func, FunctionHeader funcHeader, IReadOnlyDictionary paramHeaders, string precisionToken, int dynamicLength, out IShaderFunction result) + { + List fields = new(); + result = null; + + bool applyPrecision = funcHeader.allowPrecision; + bool anyDynamics = false; + + Debug.Assert(dynamicLength >= 0); + + foreach(var param in func.Parameters) + { + bool applyDynamics = paramHeaders.TryGetValue(param.Name, out var paramHeader) && paramHeader.isDynamic; + anyDynamics |= applyDynamics; + + var legacyType = ApplyLegacy(param.ShaderType, applyPrecision ? precisionToken : null, applyDynamics ? dynamicLength : 0); + + var field = new ShaderField(param.Name, param.IsInput, param.IsOutput, legacyType, param.Hints); + + fields.Add(field); + } + + if (!anyDynamics && !applyPrecision) + { + result = func; + return false; + } + + List namespaces = new(); + namespaces.AddRange(func.Namespace); + if (applyPrecision || anyDynamics) + namespaces.Add("unity_sg_generated"); + + string funcName = $"{func.Name}{(applyPrecision ? $"_{precisionToken}" : null)}{(anyDynamics ? dynamicLength : null)}"; + + // Dynamic typing isn't supported on return values. + IShaderType returnType = ApplyLegacy(func.ReturnType, applyPrecision ? precisionToken : null, 0); + result = new ShaderFunction(funcName, namespaces, fields, returnType, func.FunctionBody, func.Hints); + return true; + } } } diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHeader.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHeader.cs index a4019880265..7728955f292 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHeader.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHeader.cs @@ -33,8 +33,16 @@ internal class ParameterHeader : StrongHeader internal bool isLiteral { get; private set; } + internal bool isDynamic { get; private set; } + internal bool isBareResource { get; private set; } + internal bool isReferable { get; private set; } + internal string Referable { get; private set; } + + internal bool isLinkage { get; private set; } + internal string linkTarget { get; private set; } + private static HintRegistry s_HintRegistry; protected override HintRegistry GetHintRegistry() { @@ -44,7 +52,7 @@ protected override HintRegistry GetHintRegistry() s_HintRegistry.RegisterStrongHint(new Hints.DisplayName()); s_HintRegistry.RegisterStrongHint(new Hints.Tooltip()); - s_HintRegistry.RegisterStrongHint(new Hints.Flag(Hints.Param.kLocal, new string[] { Hints.Param.kAccessModifier, Hints.Param.kCustomEditor })); + s_HintRegistry.RegisterStrongHint(new Hints.Flag(Hints.Param.kLocal, new string[] { Hints.Param.kAccessModifier })); s_HintRegistry.RegisterStrongHint(new Hints.Literal()); s_HintRegistry.RegisterStrongHint(new Hints.Static()); @@ -53,6 +61,9 @@ protected override HintRegistry GetHintRegistry() s_HintRegistry.RegisterStrongHint(new Hints.Dropdown()); s_HintRegistry.RegisterStrongHint(new Hints.Default()); s_HintRegistry.RegisterStrongHint(new Hints.External()); + s_HintRegistry.RegisterStrongHint(new Hints.Referable()); + s_HintRegistry.RegisterStrongHint(new Hints.Dynamic()); + s_HintRegistry.RegisterStrongHint(new Hints.Linkage()); } return s_HintRegistry; } @@ -102,6 +113,20 @@ protected override void OnProcess(IShaderField param, IProvider provider) externalQualifiedTypeName = $"{externalNamespace}::{typeName}"; isLiteral = Has(Hints.Param.kLiteral); + + if (isReferable = Has(Hints.Param.kReferable)) + { + Referable = Get(Hints.Param.kReferable); + } + + isDynamic = Has(Hints.Param.kDynamic); + + if (isLinkage = Has(Hints.Param.kLinkage)) + { + linkTarget = Get(Hints.Param.kLinkage); + isLocal = true; + } + } internal ParameterHeader(IShaderField param, IProvider provider) diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHints.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHints.cs index 212d2616a12..2ffb77fb2db 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHints.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/Header/ParameterHints.cs @@ -17,22 +17,22 @@ internal static class Param internal const string kDefault = "sg:Default"; internal const string kExternal = "sg:External"; - // Not yet implemented. internal const string kSetting = "sg:Setting"; internal const string kLinkage = "sg:Linkage"; - internal const string kPrecision = "sg:Precision"; - internal const string kDynamic = "sg:Dynamic"; - internal const string kReferable = "sg:Referable"; - - // Hard coded referables, not yet implemented. - internal const string kUV = "sg:ref:UV"; - internal const string kPosition = "sg:ref:Position"; - internal const string kNormal = "sg:ref:Normal"; - internal const string kBitangent = "sg:ref:Bitangent"; - internal const string kTangent = "sg:ref:Tangent"; - internal const string kViewDirection = "sg:ref:ViewDirection"; - internal const string kScreenPosition = "sg:ref:ScreenPosition"; - internal const string kVertexColor = "sg:ref:VertexColor"; + internal const string kDynamic = "sg:DynamicVector"; + internal const string kReferable = "sg:Referable"; + + internal static class Ref + { + internal const string kUV = "UV"; + internal const string kPosition = "Position"; + internal const string kNormal = "Normal"; + internal const string kBitangent = "Bitangent"; + internal const string kTangent = "Tangent"; + internal const string kViewDirection = "ViewDirection"; + internal const string kScreenPosition = "ScreenPosition"; + internal const string kVertexColor = "VertexColor"; + } } internal class Range : IStrongHint @@ -41,13 +41,19 @@ internal class Range : IStrongHint public IReadOnlyCollection Conflicts { get; } = new string[] { Param.kCustomEditor }; public IReadOnlyCollection Synonyms { get; } = new string[] { "Slider" }; - public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg, string actualHintKey) { msg = null; value = rawValue; if (!found) return false; + if (!obj.IsInput) + { + msg = $"Expected input parameter."; + return false; + } + if (obj.ShaderType.Name != "half" && obj.ShaderType.Name != "float") { msg = $"Expected floating point scalar, but found '{obj.ShaderType.Name}'."; @@ -104,16 +110,20 @@ internal class Dropdown : IStrongHint public IReadOnlyCollection Conflicts { get; } = new string[] { Param.kCustomEditor }; public IReadOnlyCollection Synonyms { get; } = new string[] { "Enum" }; - public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg, string actualHintKey) { msg = null; value = rawValue; if (!found) + return false; + + if (!obj.IsInput) { + msg = $"Expected input parameter."; return false; } - switch(obj.ShaderType.Name) + switch (obj.ShaderType.Name) { case "int": case "uint": case "float": case "half": break; default: @@ -139,13 +149,19 @@ internal class Color : IStrongHint public string Key => Param.kColor; public IReadOnlyCollection Conflicts { get; } = new string[] { Param.kCustomEditor }; - public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg, string actualHintKey) { msg = null; value = rawValue; if (found) { - switch(obj.ShaderType.Name) + if (!obj.IsInput) + { + msg = $"Expected input parameter."; + return false; + } + + switch (obj.ShaderType.Name) { case "float3": case "float4": case "half3": case "half4": return true; default: @@ -160,7 +176,7 @@ public bool Process(bool found, string rawValue, IShaderField obj, IProvider pro internal class Literal : IStrongHint { public string Key => Param.kLiteral; - public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg, string actualHintKey) { msg = null; value = rawValue; @@ -184,14 +200,20 @@ internal class Static : IStrongHint public string Key => Param.kStatic; public IReadOnlyCollection Conflicts { get; } = new string[] { Param.kAccessModifier }; - public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg, string actualHintKey) { msg = null; value = rawValue; if (!found) return false; - switch(obj.ShaderType.Name) + if (!obj.IsInput) + { + msg = $"Expected input parameter."; + return false; + } + + switch (obj.ShaderType.Name) { case "float": case "half": case "int": case "uint": case "bool": return true; @@ -215,7 +237,7 @@ internal class External : IStrongHint public string Key => Param.kExternal; public IReadOnlyCollection Synonyms { get; } = new string[] { "ExternalNamespace" }; - public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg, string actualHintKey) { msg = null; value = rawValue; @@ -227,13 +249,191 @@ internal class Default : IStrongHint { public string Key => Param.kDefault; - public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg) + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg, string actualHintKey) { // TODO(SVFXG-868): This is tricky because there are multiple formats we need to support. // for now, we can pass along the raw value and allow the header to process it. msg = null; value = rawValue; + + if (!obj.IsInput) + { + msg = $"Expected input parameter."; + return false; + } + return found; } } + + internal class Dynamic : IStrongHint + { + public string Key => Param.kDynamic; + + public IReadOnlyCollection Conflicts { get; } = new string[] { Param.kCustomEditor }; + public IReadOnlyCollection Synonyms { get; } = new string[] { "Dynamic" }; + + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg, string actualHintKey) + { + msg = null; + value = rawValue; + if (!found) + return false; + + switch(obj.ShaderType.Name) + { + case "float": case "float2": case "float3": case "float4": + case "half": case "half2": case "half3": case "half4": + return true; + default: + msg = $"Expected floating point vector or scalar, but found {obj.ShaderType.Name}."; + return false; + } + } + } + + internal class Linkage : IStrongHint + { + public string Key => Param.kLinkage; + public IReadOnlyCollection Conflicts { get; } = new string[] { Param.kAccessModifier }; + + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg, string actualHintKey) + { + value = rawValue; + msg = null; + if (!found) + return false; + + if (!obj.IsInput) + { + msg = $"Expected input parameter."; + return false; + } + + if (obj.ShaderType.Name != "bool") + { + msg = $"Expected type bool, but found '{obj.ShaderType.Name}'."; + return false; + } + + var funcProvider = provider as IProvider; + if (funcProvider == null) + { + msg = "Expected to be associated with a function."; + return false; + } + + if (rawValue == obj.Name) + { + msg = $"Cannot check linkage state against itself."; + return false; + } + + var func = funcProvider.Definition; + + bool hasMatch = false; + foreach(var param in func.Parameters) + if (param.Name == rawValue) + { + hasMatch = true; + break; + } + + if (!hasMatch) + { + msg = $"Could not find expected parameter '{rawValue}'."; + return false; + } + return true; + } + } + + internal class Referable : IStrongHint + { + public string Key => Param.kReferable; + + static HashSet s_commonReferables; + + private static HashSet GetCommonReferables() + { + if (s_commonReferables == null) + { + s_commonReferables = new HashSet() { + Param.Ref.kUV, // only supports vec2 + + // vec3 only + Param.Ref.kPosition, + Param.Ref.kTangent, + Param.Ref.kNormal, + Param.Ref.kBitangent, + Param.Ref.kViewDirection, + + // vec4 only + Param.Ref.kVertexColor, + Param.Ref.kScreenPosition, + }; + } + return s_commonReferables; + } + + public IReadOnlyCollection Synonyms => GetCommonReferables(); + public IReadOnlyCollection Conflicts { get; } = new string[] { Param.kCustomEditor }; + + // This hint allows `sg:Referable(UV)` or just `UV`; this is a case where the synonym is _functional_. + // Note also that this hint relies on the Default hint to be used in tandem to set the initial referable value (ie. space or channel); + // When we move to GTK, we should allow the default value to be handled as well. + + // Another note: we would rather query the Interface/Target for available referables and their possible values. + // We'd need a way to push that information down (ie. an untyped context object that can be passed). + public bool Process(bool found, string rawValue, IShaderField obj, IProvider provider, out object value, out string msg, string actualHintKey) + { + msg = null; + value = Key == actualHintKey ? rawValue : actualHintKey; + + if (!obj.IsInput) + { + msg = $"Expected input parameter."; + return false; + } + + if (value == null) + { + msg = $"Could not resolve a referable type."; + return false; + } + else if (!GetCommonReferables().Contains((string)value)) + { + msg = $"'{value}' is not a supported referable key."; + return false; + } + + // TODO: The underlying type shouldn't matter, but SG only supports these configurations at the moment. + switch ((string)value) + { + case Param.Ref.kUV: + if (obj.ShaderType.Name != "half2" && obj.ShaderType.Name != "float2") + { + msg = $"'{(string)value}' expects floating point vector of length 2, but found '{obj.ShaderType.Name}'."; + return false; + } + break; + case Param.Ref.kVertexColor: + case Param.Ref.kScreenPosition: + if (obj.ShaderType.Name != "half4" && obj.ShaderType.Name != "float4") + { + msg = $"'{(string)value}' expects floating point vector of length 4, but found '{obj.ShaderType.Name}'."; + return false; + } + break; + default: + if (obj.ShaderType.Name != "half3" && obj.ShaderType.Name != "float3") + { + msg = $"'{(string)value}' expects floating point vector of length 3, but found '{obj.ShaderType.Name}'."; + return false; + } + break; + } + return true; + } + } } diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNode.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNode.cs index 841810f7c5a..5752a05e8fd 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNode.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNode.cs @@ -34,7 +34,7 @@ public void GetSourceAssetDependencies(AssetCollection assetCollection) internal FunctionHeader Header { get; private set; } - internal List ParamHeaders { get; private set; } + internal Dictionary ParamHeaders { get; private set; } internal IProvider Provider => m_provider; @@ -42,7 +42,7 @@ public void GetSourceAssetDependencies(AssetCollection assetCollection) public override bool hasPreview => true; - public override bool canSetPrecision => false; + public override bool canSetPrecision => Header?.allowPrecision ?? false; internal override bool ExposeToSearcher => false; @@ -121,6 +121,7 @@ internal void UpdateModel() } ParamHeaders = new(); + List paramOrder = new(); List desiredSlotOrder = new(); // return type is a special case, because it has no parameter but still needs a slot @@ -135,17 +136,21 @@ internal void UpdateModel() // build the header data for our parameters and mark which slot ids are being reused. foreach(var param in parameters) { - ParamHeaders.Add(new ParameterHeader(param, Provider)); + var paramHeader = new ParameterHeader(param, Provider); + ParamHeaders.Add(param.Name, paramHeader); + paramOrder.Add(paramHeader); if (oldSlotMap.TryGetValue(param.Name, out var idTuple)) { - if (idTuple.inputId > -1) usedSlotIds.Add(idTuple.inputId); - if (idTuple.outputId > -1) usedSlotIds.Add(idTuple.outputId); + if (idTuple.inputId > -1 && param.IsInput) + usedSlotIds.Add(idTuple.inputId); + if (idTuple.outputId > -1 && param.IsOutput) + usedSlotIds.Add(idTuple.outputId); } } // walk through our header data and build the actual slots. int nextSlot = kReservedOutputSlot; - foreach (var paramHeader in ParamHeaders) + foreach (var paramHeader in paramOrder) { if (!oldSlotMap.TryGetValue(paramHeader.referenceName, out var idTuple)) idTuple = (-1, -1); @@ -175,7 +180,11 @@ void AddSlotFromParameter(ParameterHeader header, int slotId, SlotType dir) { var slot = HeaderUtils.MakeSlotFromParameter(header, slotId, dir); if (slot != null) - AddSlot(slot); + // Slots that use label control have no indication in the Model that they use them. + // However, the only _existing_ case where they'd meaningfully change are SpaceMaterialSlots, + // which also don't handle default values well either. In this case, we go nuclear and completely + // rebuild the slot. + AddSlot(slot, slot is not SpaceMaterialSlot, slot is not SpaceMaterialSlot); } public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) @@ -183,6 +192,9 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo if (this.Provider == null || this.Provider.Definition == null) return; + // Apply legacy precision/dynamic only before code generation/usage. + HeaderUtils.TryApplyLegacy(Provider.Definition, this.Header, this.ParamHeaders, PrecisionUtil.Token, lastKnownDynamicVectorLength, out var func); + using (UnityEngine.Pool.ListPool.Get(out var slots)) { GetSlots(slots); @@ -215,7 +227,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo } bool first = true; - foreach (var param in Provider.Definition.Parameters) + foreach (var param in func.Parameters) { var inputSlot = paramSlotMap[param.Name].input; var outputSlot = paramSlotMap[param.Name].output; @@ -230,6 +242,21 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo var argument = valueString; // assume it's an input, in which case the arg will be the upstream value/connection. + // apply linkage override + if (ParamHeaders.TryGetValue(param.Name, out var ph) && ph.isLinkage) + { + var targetSlots = paramSlotMap[ph.linkTarget]; + + // this concept is awkward for inout slots, but that could be improved in the future. + // ie. add support for int and set it to 0 = none, 1 = in, 2 = out, 3 = both. + if (targetSlots.input != null && targetSlots.input.isConnected + || targetSlots.output != null && targetSlots.output.isConnected) + { + argument = "true"; + } + else argument = "false"; + } + if (outputSlot != null) { // inout and out define a variable to be used as the argument. @@ -245,30 +272,25 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo args.Append(argument); } - foreach (var name in Provider.Definition.Namespace) - call.Append($"{name}::"); - call.Append(Provider.Definition.Name); - call.Append("("); - call.Append(args.ToString()); - call.Append(");"); - - + call.Append(ShaderObjectUtils.GenerateCall(func, args.ToString())); sb.AddLine(call.ToString()); } } public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode generationMode) { + if (Provider == null || !Provider.IsValid || Provider.Definition == null) + return; + if (Provider.AssetID != default) { var includePath = AssetDatabase.GUIDToAssetPath(Provider.AssetID); registry.RequiresIncludePath(includePath, false); } - if (requiresGeneration) + if (HeaderUtils.TryApplyLegacy(Provider.Definition, Header, ParamHeaders, PrecisionUtil.Token, lastKnownDynamicVectorLength, out var func) || requiresGeneration) { - var func = Provider.Definition; - string code = ShaderObjectUtils.GenerateCode(func, false, false); + string code = ShaderObjectUtils.GenerateCode(func, false, false, true); registry.ProvideFunction(func.Name, s => s.AppendLine(code)); } } @@ -293,7 +315,7 @@ public override void ValidateNode() { owner?.AddValidationError(this.objectId, msg, Rendering.ShaderCompilerMessageSeverity.Warning); } - foreach(var param in ParamHeaders) + foreach(var param in ParamHeaders.Values) { foreach(var msg in param.Messages) { diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNodePropertyDrawer.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNodePropertyDrawer.cs index f765eb937d8..91e9fc549ee 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNodePropertyDrawer.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Model/ProviderNodePropertyDrawer.cs @@ -59,7 +59,7 @@ internal override void AddCustomNodeProperties(VisualElement parentElement, Abst } // Parameters - foreach (var paramHeader in node.ParamHeaders) + foreach (var paramHeader in node.ParamHeaders.Values) { hasMsg = false; sb.Clear(); diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ExpressionProvider.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ExpressionProvider.cs index 84b2f68e8df..b535d1ef9cc 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ExpressionProvider.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ExpressionProvider.cs @@ -14,7 +14,7 @@ internal class ExpressionProvider : IProvider public string ProviderKey => kExpressionProviderKey; public GUID AssetID => default; public bool RequiresGeneration => true; - private static readonly string[] kNamespace = { "unity", "shadergraph", "expression" }; + private static readonly string[] kNamespace = { "unity_sg_expression" }; internal string Expression => m_expression; internal string ShaderType => m_type; @@ -43,7 +43,7 @@ public IShaderFunction Definition [NonSerialized] IShaderFunction m_definition; - internal ExpressionProvider() : this("Expression", "", "float") { } + internal ExpressionProvider() : this("Expression", "A", "float") { } internal ExpressionProvider(string name, string expression, string type) { @@ -61,7 +61,8 @@ public void Reload() { Hints.Func.kProviderKey, kExpressionProviderKey }, { Hints.Func.kSearchName, "Expression" }, { Hints.Func.kSearchCategory, "Utility" }, - { Hints.Func.kSearchTerms, "equation, calculation, inline, code" } + { Hints.Func.kSearchTerms, "equation, calculation, inline, code" }, + { Hints.Func.kPrecision, "" } }; internal void UpdateExpression(string name, string expression, string type) @@ -113,6 +114,7 @@ string HandleName(string name) IShaderType shaderType = new ShaderType(type); List parameters = new(); + foreach (var paramName in orderedNames) parameters.Add(new ShaderField(paramName, true, false, shaderType, null)); diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ReflectedFunctionProvider.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ReflectedFunctionProvider.cs index a3c63f5b550..47cb1aa3f88 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ReflectedFunctionProvider.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/Provider/ReflectedFunctionProvider.cs @@ -9,7 +9,6 @@ internal class ReflectedFunctionProvider : IProvider { public string ProviderKey => m_providerKey; public GUID AssetID => m_sourceAssetId; - public bool RequiresGeneration => false; // TODO: Becomes true with dynamic/precision. public IShaderFunction Definition { diff --git a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/ShaderObjectUtils.cs b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/ShaderObjectUtils.cs index 0cdf9984bd3..0d0f77bddf9 100644 --- a/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/ShaderObjectUtils.cs +++ b/Packages/com.unity.shadergraph/Editor/ProviderSystem/ShaderObjects/ShaderObjectUtils.cs @@ -70,7 +70,11 @@ private static string DeclareField(IShaderField a) } var t = SplitTypeName(a.ShaderType.Name); - return $"{t.typeName} {a.Name}{t.arraySpec}"; + var typeName = t.typeName; + + string access = a.IsInput && a.IsOutput ? "inout " : a.IsOutput ? "out " : ""; + + return $"{access}{typeName} {a.Name}{t.arraySpec}"; } private static string GenerateHints(string closure, IReadOnlyDictionary hints, string name = null) @@ -88,13 +92,30 @@ private static string GenerateHints(string closure, IReadOnlyDictionary where T : IShaderObject { string Key { get; } + + // Indicate that this hint should attempt to be processed even if it wasn't found; + // this allows hints like 'DisplayName' to be able to handle determining a fallback. + bool AlwaysProcess => false; + bool AllowDisqualifiedSynonyms => true; + IReadOnlyCollection Synonyms => null; IReadOnlyCollection Conflicts => null; - bool Process(bool found, string rawValue, T obj, IProvider provider, out object value, out string msg); + bool Process(bool found, string rawValue, T obj, IProvider provider, out object value, out string msg, string actualHintKey); } internal class HintRegistry where T : IShaderObject { - List> m_hints = new(); - Dictionary> m_alternates = new(); + Dictionary> m_hintsByKey = new(); + Dictionary> m_synonymMap = new(); internal void RegisterStrongHint(IStrongHint hint) { - m_hints.Add(hint); + // add the new hint; + m_hintsByKey.Add(hint.Key, hint); + + // add the hint's actual key as a synonym with highest priority + int priority = 0; + if (!m_synonymMap.TryAdd(hint.Key, new() { (hint.Key, priority) })) + m_synonymMap[hint.Key].Add((hint.Key, priority)); + + if (!hint.AllowDisqualifiedSynonyms) + return; + + // build a list of alternates by disqualifying the hint.key. var alternates = new List(DisqualifyKey(hint.Key)); + // Look through the hints synonyms and also add them and their disqualifications. if (hint.Synonyms != null) foreach(var synonym in hint.Synonyms) alternates.AddRange(DisqualifyKey(synonym, true)); - if (alternates.Count > 0) - m_alternates.Add(hint.Key, alternates); + // for each subsequent alternate, the priority decreases. + foreach(var alternate in alternates) + { + priority++; + // Since a single synonym could be used by multiple hints, we need to register + // each StrongHint.Key to the synonym. + if (!m_synonymMap.TryAdd(alternate, new() { (hint.Key, priority) })) + m_synonymMap[alternate].Add((hint.Key, priority)); + } } // eg. (unity:engine:sg:HintKey) => engine:sg:HintKey, sg:HintKey, HintKey - private static IEnumerable DisqualifyKey(string key, bool inclusive = false) + internal static IEnumerable DisqualifyKey(string key, bool inclusive = false) { if (inclusive) yield return key; @@ -55,62 +80,86 @@ internal void ProcessObject(T obj, IProvider provider, out Dictionary> conflictCases = new(); - // this is run per the registered hint types and not the hints on the object. - foreach (var hint in m_hints) - { - // assess whether the object has the hint. - bool hintFound = obj.Hints.TryGetValue(hint.Key, out var hintRawValue); - bool hintValid = false; - - // try the alternate keys. It isn't strictly erroneous to have alternates also be present. - if (!hintFound && m_alternates.ContainsKey(hint.Key)) - foreach (var alternateKey in m_alternates[hint.Key]) - if (hintFound = obj.Hints.TryGetValue(alternateKey, out hintRawValue)) - break; - - // some hints may have default values and need to be processed whether they are found or not. - if (hintValid = hint.Process(hintFound, hintRawValue, obj, provider, out var value, out var msg)) - { - values.Add(hint.Key, value); - } + Dictionary foundHints = new(); + Dictionary> conflictCases = new(); + HashSet conflictedHints = new(); - if (!string.IsNullOrWhiteSpace(msg)) - msgs.Add($"{hint.Key}: {msg}"); - - // if they were processed or existed previously, we need to consider their conflict classes. - if ((hintFound || hintValid) && hint.Conflicts != null && hint.Conflicts.Count > 0) + // prepass, match the discovered hints to strong hint keys- this allows us to determine which strong hints shouldn't be skipped. + foreach(var rawHintKey in obj.Hints.Keys) + { + if (m_synonymMap.TryGetValue(rawHintKey, out var matches)) { - foreach(var conflict in hint.Conflicts) + foreach(var hint in matches) { - conflictCases.TryAdd(conflict, new()); - conflictCases[conflict].Add(hint.Key); + // track priority so that we don't accidentally match a a synonym over the actual key. + if (!foundHints.TryAdd(hint.StrongHintKey, (rawHintKey, hint.Priority))) + { + // newly found synonym is higher priority (lower number), so use that instead. + if (hint.Priority < foundHints[hint.StrongHintKey].Priority) + foundHints[hint.StrongHintKey] = (rawHintKey, hint.Priority); + } + + // we can also determine which conflict classes we'll run into here. + if (m_hintsByKey[hint.StrongHintKey].Conflicts != null) + foreach (var conflictClass in m_hintsByKey[hint.StrongHintKey].Conflicts) + if (!conflictCases.TryAdd(conflictClass, new HashSet() { hint.StrongHintKey })) + conflictCases[conflictClass].Add(hint.StrongHintKey); } } } + // Conflict cases allow us to early out processing hints. foreach(var caseKV in conflictCases) { - // if there is only one hint in a conflict case, it isn't conflicted. - if (caseKV.Value.Count <= 1) + if (caseKV.Value.Count == 1) continue; - // otherwise it'll need a message and for the conflicting hints to be removed from the values. + // Aggregate conflicted hints so that we know which aren't being processed because they are in conflict. + conflictedHints.UnionWith(caseKV.Value); + + // Build conflict message. StringBuilder sb = new(); bool first = true; sb.Append($"Conflicting hints of class '{caseKV.Key}' found, ignoring: "); foreach (var conflictKey in caseKV.Value) { - // Any key in conflict is removed and ignored. - values.Remove(conflictKey); if (!first) sb.Append(", "); - sb.Append($"{conflictKey}"); + sb.Append($"'{conflictKey}'"); first = false; } msgs.Add(sb.ToString()); } + + // Now that we know which hints are both in use and valid, we can skip the ones not in use. + foreach (var strongHint in m_hintsByKey.Values) + { + if (conflictedHints.Contains(strongHint.Key)) + continue; + + string synonymUsed = null; + string rawHintValue = null; + bool found; + bool shouldProcess = strongHint.AlwaysProcess; + + + if (found = foundHints.TryGetValue(strongHint.Key, out var rawHintData)) + { + shouldProcess = true; + synonymUsed = rawHintData.Synonym; + rawHintValue = obj.Hints[synonymUsed]; + } + + if (!shouldProcess) + continue; + + if (strongHint.Process(found, rawHintValue, obj, provider, out var value, out var msg, synonymUsed)) + values.Add(strongHint.Key, value); + + if (!string.IsNullOrWhiteSpace(msg)) + msgs.Add($"{strongHint.Key}: {msg}"); + } } } } diff --git a/Packages/com.unity.shadergraph/Tests/Editor/ProviderTests/StrongHintTests.cs b/Packages/com.unity.shadergraph/Tests/Editor/ProviderTests/StrongHintTests.cs index 0d30514ba7f..08d016e1e19 100644 --- a/Packages/com.unity.shadergraph/Tests/Editor/ProviderTests/StrongHintTests.cs +++ b/Packages/com.unity.shadergraph/Tests/Editor/ProviderTests/StrongHintTests.cs @@ -12,6 +12,12 @@ class TestProvider : IProvider public GUID AssetID { get; private set; } public IShaderFunction Definition { get; private set; } + internal TestProvider(string testName, IShaderFunction func) + { + ProviderKey = testName; + Definition = func; + } + internal TestProvider(string testName, string path = null, IEnumerable namespaces = null) { ProviderKey = testName; @@ -50,7 +56,7 @@ private static void DoConflictTest(HintRegistry reg, string testN private static void DoDisplayNameTest(HintRegistry reg, string referenceName, string displayName, Dictionary values, List messages) { - + if (displayName == null) displayName = referenceName; @@ -67,7 +73,7 @@ private static void DoDisplayNameTest(HintRegistry reg, string re private static IShaderField Param(string testName, IShaderType shaderType, string hintKey, string hintValueRaw) { var hints = new Dictionary() { { hintKey, hintValueRaw } }; - return new ShaderField(testName, false, false, shaderType, hints); + return new ShaderField(testName, true, false, shaderType, hints); } private static void DoOneHintTest(HintRegistry reg, IProvider provider, bool expectsValue, V expectedValue, bool expectsMessage, Dictionary values, List messages, string hintKey = null) where T : IShaderObject @@ -147,7 +153,7 @@ public void DisplayName() { HintRegistry reg = new(); reg.RegisterStrongHint(new Hints.DisplayName()); - + Dictionary values = new(); List messages = new(); @@ -155,7 +161,7 @@ public void DisplayName() DoDisplayNameTest(reg, "TestObject", "Test Object DisplayName", values, messages); } - + [Test] public void TestRange() { @@ -242,5 +248,59 @@ public void CheckAllHints() AssetDatabase.ImportAsset(kAllHintsPath, ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate); AssetDatabase.ImportAsset(kAllHintsGraphPath, ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate); } + + [Test] + public void LegacyPrecisionAndDynamics() + { + Dictionary DynamicHint = new() { { Hints.Param.kDynamic, "" } }; + Dictionary PrecisionHint = new() { { Hints.Func.kPrecision, "" } }; + List generated = new() { "unity_sg_generated" }; + + ShaderType f = new("float"); + ShaderType h = new("half"); + ShaderType f2 = new("float2"); + ShaderType h2 = new("half2"); + ShaderType f3 = new("float3"); + ShaderType h3 = new("half3"); + ShaderType f4 = new("float4"); + ShaderType h4 = new("half4"); + + ShaderFunction testFunc = new("TestFunc", null, new IShaderField[] { + new ShaderField("A", true, true, f, DynamicHint), + new ShaderField("B", true, true, h3, DynamicHint), + new ShaderField("C", true, true, h2, null), + new ShaderField("D", true, true, f2, null) + }, f, "", PrecisionHint); + + var provider = new TestProvider("TestProvider", testFunc); + + var funcHeader = new FunctionHeader(); + var paramHeaders = new Dictionary(); + + funcHeader.Process(provider.Definition, provider); + foreach(var param in provider.Definition.Parameters) + paramHeaders.Add(param.Name, new ParameterHeader(param, provider)); + + + ShaderFunction expectedFunc = new("TestFunc_half4", generated, new IShaderField[] { + new ShaderField("A", true, true, h4, DynamicHint), + new ShaderField("B", true, true, h4, DynamicHint), + new ShaderField("C", true, true, h2, null), + new ShaderField("D", true, true, h2, null) + }, h, "", PrecisionHint); + + HeaderUtils.TryApplyLegacy(provider.Definition, funcHeader, paramHeaders, "half", 4, out var resultFunc); + Assert.IsTrue(TestUtils.CompareFunction(expectedFunc, resultFunc)); + + expectedFunc = new("TestFunc_float1", generated, new IShaderField[] { + new ShaderField("A", true, true, f, DynamicHint), + new ShaderField("B", true, true, f, DynamicHint), + new ShaderField("C", true, true, f2, null), + new ShaderField("D", true, true, f2, null) + }, f, "", PrecisionHint); + + HeaderUtils.TryApplyLegacy(provider.Definition, funcHeader, paramHeaders, "float", 1, out resultFunc); + Assert.IsTrue(TestUtils.CompareFunction(expectedFunc, resultFunc)); + } } } diff --git a/Tests/SRPTests/Projects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/ProviderSystem/AllHints.hlsl b/Tests/SRPTests/Projects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/ProviderSystem/AllHints.hlsl index 3a8ae21cc50..0ed7ee70a5e 100644 --- a/Tests/SRPTests/Projects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/ProviderSystem/AllHints.hlsl +++ b/Tests/SRPTests/Projects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/ProviderSystem/AllHints.hlsl @@ -91,6 +91,9 @@ UNITY_EXPORT_REFLECTION float3 AllHints( return float3(a.Value, sr, sc4.r); } +/// +/// MakeCustomStruct +/// /// /// Namespace /// @@ -107,4 +110,109 @@ namespace NamespaceAsCategory } } -} // Namespace \ No newline at end of file +} // Namespace + + +/// + /// + /// + /// + /// + /// +/// +/// + /// + /// +/// +UNITY_EXPORT_REFLECTION float3 Confliction(float2 input, float input2) +{ + return input.xxy; +} + +/// +/// GoodReferables +/// +/// + /// + /// UV2 +/// +/// + /// UV + /// UV1 +/// +/// + /// + /// AbsoluteWorld +/// +/// + /// + /// World +/// +/// + /// + /// Object +/// +/// + /// + /// Tangent +/// +/// + /// + /// Screen +/// +/// + /// +/// +/// + /// + /// Pixel +/// +/// + /// 1,0,0 +/// +UNITY_EXPORT_REFLECTION float3 ReferableGood(float2 UV, + float2 alsoUV, + float3 Position, + float3 Normal, + float3 Tangent, + float3 Bitangent, + float3 ViewDirection, + float4 VertColor, + float4 ScreenPosition, + float3 defaultValue) +{ + return float3(1,1,0); +} + +/// +/// PrecisionTest + /// +/// +/// + /// +/// +/// + /// +/// +/// + /// +/// +UNITY_EXPORT_REFLECTION float2 PrecisionTest(float a, half b, out float c) +{ + c = a + b; + return (a,b); +} + +/// +/// LinkageExample +/// +/// + /// other +/// +UNITY_EXPORT_REFLECTION float3 LinkageExample(bool test, float other) +{ + if (test) + return float3(other, 0, 0); + else + return float3(0, other, 0); +} diff --git a/Tests/SRPTests/Projects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/ProviderSystem/ShouldCompileProperlyOnImport.shadergraph b/Tests/SRPTests/Projects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/ProviderSystem/ShouldCompileProperlyOnImport.shadergraph index cf755427f6e..eb337ee7936 100644 --- a/Tests/SRPTests/Projects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/ProviderSystem/ShouldCompileProperlyOnImport.shadergraph +++ b/Tests/SRPTests/Projects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/ProviderSystem/ShouldCompileProperlyOnImport.shadergraph @@ -42,7 +42,28 @@ "m_Id": "abc179ee5107447ca5495532006b435e" }, { - "m_Id": "d715a4d08d6e4e77b8fe8c816d434bac" + "m_Id": "54ecd16e4f3a4769acff60f8e1fa4561" + }, + { + "m_Id": "8471c0b0e06e47298a8e63ec27429f71" + }, + { + "m_Id": "16562914ee954a78b4c48dc54f3791a6" + }, + { + "m_Id": "e851a1e8cd9746fdbbffc6f9393607d5" + }, + { + "m_Id": "81338ea6d0b24c0bbfea38bae2b666f5" + }, + { + "m_Id": "f53eaf070cea497ebfcd033bb49167a6" + }, + { + "m_Id": "e4db13fab4214c6d99fb67be2bfcc373" + }, + { + "m_Id": "496d1a14709347849f99960c0b07afad" } ], "m_GroupDatas": [], @@ -50,14 +71,56 @@ "m_Edges": [ { "m_OutputSlot": { + "m_Node": { + "m_Id": "16562914ee954a78b4c48dc54f3791a6" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { "m_Node": { "m_Id": "abc179ee5107447ca5495532006b435e" }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "496d1a14709347849f99960c0b07afad" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8471c0b0e06e47298a8e63ec27429f71" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "54ecd16e4f3a4769acff60f8e1fa4561" + }, "m_SlotId": 0 }, "m_InputSlot": { "m_Node": { - "m_Id": "5784e5f7edb64ab6a719b6f7dccea574" + "m_Id": "e851a1e8cd9746fdbbffc6f9393607d5" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "81338ea6d0b24c0bbfea38bae2b666f5" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "496d1a14709347849f99960c0b07afad" }, "m_SlotId": 0 } @@ -65,16 +128,72 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "d715a4d08d6e4e77b8fe8c816d434bac" + "m_Id": "8471c0b0e06e47298a8e63ec27429f71" }, - "m_SlotId": 2 + "m_SlotId": 0 }, "m_InputSlot": { + "m_Node": { + "m_Id": "de69fe023db044b588133cac8130c0a5" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { "m_Node": { "m_Id": "abc179ee5107447ca5495532006b435e" }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5784e5f7edb64ab6a719b6f7dccea574" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e4db13fab4214c6d99fb67be2bfcc373" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "496d1a14709347849f99960c0b07afad" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e851a1e8cd9746fdbbffc6f9393607d5" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8471c0b0e06e47298a8e63ec27429f71" + }, "m_SlotId": 1 } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f53eaf070cea497ebfcd033bb49167a6" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "81338ea6d0b24c0bbfea38bae2b666f5" + }, + "m_SlotId": 2 + } } ], "m_VertexContext": { @@ -143,17 +262,52 @@ { "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.ProviderSystem.ExternalMaterialSlot", - "m_ObjectId": "0754487883424571af380987bf510ff7", + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "022a425f482d4dbf898b9f81b0b9692d", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "__UNITY_SHADERGRAPH_UNUSED", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "04bb471f2dd34932befa6ff13c355b19", "m_Id": 2, - "m_DisplayName": "Result", + "m_DisplayName": "Out", "m_SlotType": 1, "m_Hidden": false, "m_HideConnector": false, - "m_ShaderOutputName": "result", + "m_ShaderOutputName": "Out", "m_StageCapability": 3, - "m_typeName": "Namespace::CustomStruct", - "m_rawDefaultValueString": "0" + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_LiteralMode": false } { @@ -197,6 +351,141 @@ "m_SupportVFX": false } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.VertexColorMaterialSlot", + "m_ObjectId": "11b5db3b5d55423ca7566d8d08ffb325", + "m_Id": 8, + "m_DisplayName": "VertColor", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "VertColor", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "11ba3798f1974a5f8aed972e950287fb", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_LiteralMode": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ProviderSystem.ProviderNode", + "m_ObjectId": "16562914ee954a78b4c48dc54f3791a6", + "m_Group": { + "m_Id": "" + }, + "m_Name": "MakeCustomStruct", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -830.9999389648438, + "y": -805.4999389648438, + "width": 155.5, + "height": 103.0 + } + }, + "m_Slots": [ + { + "m_Id": "a891172a6aaf46d686e6147451ca04a7" + }, + { + "m_Id": "4056709938b649c994044422398d0ca5" + } + ], + "synonyms": [ + "MakeCustomStruct" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_provider": { + "rid": 1000 + }, + "references": { + "version": 2, + "RefIds": [ + { + "rid": 1000, + "type": { + "class": "ReflectedFunctionProvider", + "ns": "UnityEditor.ShaderGraph.ProviderSystem", + "asm": "Unity.ShaderGraph.Editor" + }, + "data": { + "m_providerKey": "MakeCustomStruct", + "m_sourceAssetId": "4060428cd4c114edab3647f50d95506a" + } + } + ] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "1c7ee3ac76c7480c88c78c0f36267973", + "m_Id": 4, + "m_DisplayName": "Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "Normal", + "m_StageCapability": 3, + "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": 2 +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -317,11 +606,26 @@ { "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", - "m_ObjectId": "4552d16fd3154640b455494b60d7728a", - "m_Id": 0, - "m_DisplayName": "Emission", - "m_SlotType": 0, + "m_Type": "UnityEditor.ShaderGraph.ProviderSystem.ExternalMaterialSlot", + "m_ObjectId": "4056709938b649c994044422398d0ca5", + "m_Id": 2, + "m_DisplayName": "result", + "m_SlotType": 1, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "result", + "m_StageCapability": 3, + "m_typeName": "Namespace::CustomStruct", + "m_rawDefaultValueString": "0" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "4552d16fd3154640b455494b60d7728a", + "m_Id": 0, + "m_DisplayName": "Emission", + "m_SlotType": 0, "m_Hidden": false, "m_HideConnector": false, "m_ShaderOutputName": "Emission", @@ -346,6 +650,66 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AddNode", + "m_ObjectId": "496d1a14709347849f99960c0b07afad", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Add", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -344.5, + "y": 189.50001525878907, + "width": 207.99996948242188, + "height": 302.00006103515627 + } + }, + "m_Slots": [ + { + "m_Id": "11ba3798f1974a5f8aed972e950287fb" + }, + { + "m_Id": "72550332b34a43919ea726978e1cf1ab" + }, + { + "m_Id": "04bb471f2dd34932befa6ff13c355b19" + } + ], + "synonyms": [ + "addition", + "sum", + "plus" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "4b67b353ee994263a39a6955f79f963e", + "m_Id": 2, + "m_DisplayName": "other", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "other", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 0.0, + "m_Labels": [], + "m_LiteralMode": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialEnumSlot", @@ -373,6 +737,108 @@ ] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "52fb2af0d3974c8ea04981aacbf14b75", + "m_Id": 1, + "m_DisplayName": "X", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "X", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 0.0, + "m_Labels": [], + "m_LiteralMode": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ProviderSystem.ProviderNode", + "m_ObjectId": "54ecd16e4f3a4769acff60f8e1fa4561", + "m_Group": { + "m_Id": "" + }, + "m_Name": "ReferableGood", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1043.0, + "y": -307.0, + "width": 207.99993896484376, + "height": 503.0000305175781 + } + }, + "m_Slots": [ + { + "m_Id": "691ef22016654270ba6b5f53e3b0adea" + }, + { + "m_Id": "d289e7b7e0084fe6b93d01a8f595ec7f" + }, + { + "m_Id": "7579bb9d8c3e422b8dc6976766e1e1d1" + }, + { + "m_Id": "b30783fff6514bfb95f6aad03dd1d269" + }, + { + "m_Id": "1c7ee3ac76c7480c88c78c0f36267973" + }, + { + "m_Id": "802b094bbf4f4f71b9803dd9c6daf635" + }, + { + "m_Id": "813d831817f246de943a34b9a86b8ae7" + }, + { + "m_Id": "c381c56ba50f437293136249303c6051" + }, + { + "m_Id": "11b5db3b5d55423ca7566d8d08ffb325" + }, + { + "m_Id": "efc7bacc806043a0a3f03caa2dc3d8e2" + }, + { + "m_Id": "8091809399c349289ababeaa3eae638c" + } + ], + "synonyms": [ + "ReferableGood" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_provider": { + "rid": 1000 + }, + "references": { + "version": 2, + "RefIds": [ + { + "rid": 1000, + "type": { + "class": "ReflectedFunctionProvider", + "ns": "UnityEditor.ShaderGraph.ProviderSystem", + "asm": "Unity.ShaderGraph.Editor" + }, + "data": { + "m_providerKey": "GoodReferables", + "m_sourceAssetId": "4060428cd4c114edab3647f50d95506a" + } + } + ] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", @@ -449,6 +915,30 @@ "m_ChildObjectList": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "691ef22016654270ba6b5f53e3b0adea", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "__UNITY_SHADERGRAPH_UNUSED", + "m_StageCapability": 3, + "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_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", @@ -508,6 +998,32 @@ "m_SerializedDescriptor": "VertexDescription.Tangent" } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "72550332b34a43919ea726978e1cf1ab", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_LiteralMode": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", @@ -533,6 +1049,30 @@ "m_Space": 3 } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "72fb37a0064241b1955cb39f9c237a57", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "__UNITY_SHADERGRAPH_UNUSED", + "m_StageCapability": 3, + "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_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.ProviderSystem.ExternalMaterialSlot", @@ -548,6 +1088,70 @@ "m_rawDefaultValueString": "0.5" } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "73bb949abaf74b4d8e8f83e7e5fc5cae", + "m_Id": 1, + "m_DisplayName": "test", + "m_SlotType": 0, + "m_Hidden": true, + "m_HideConnector": false, + "m_ShaderOutputName": "test", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "744720fd232b4aa08bc60e8570917d40", + "m_Id": 1, + "m_DisplayName": "a", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "a", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_LiteralMode": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "7579bb9d8c3e422b8dc6976766e1e1d1", + "m_Id": 2, + "m_DisplayName": "alsoUV", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "alsoUV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 1 +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", @@ -633,12 +1237,38 @@ { "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialEnumSlot", - "m_ObjectId": "7c920fa72c7e4e2eafbe4cf0aaabb426", - "m_Id": 10, - "m_DisplayName": "Dropdown", - "m_SlotType": 0, - "m_Hidden": false, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "7b370f0683f443dcabad3d009333ae41", + "m_Id": 3, + "m_DisplayName": "c", + "m_SlotType": 1, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "c", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_LiteralMode": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialEnumSlot", + "m_ObjectId": "7c920fa72c7e4e2eafbe4cf0aaabb426", + "m_Id": 10, + "m_DisplayName": "Dropdown", + "m_SlotType": 0, + "m_Hidden": false, "m_HideConnector": true, "m_ShaderOutputName": "sd", "m_StageCapability": 3, @@ -658,6 +1288,230 @@ ] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "802b094bbf4f4f71b9803dd9c6daf635", + "m_Id": 5, + "m_DisplayName": "Tangent", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "Tangent", + "m_StageCapability": 3, + "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.Vector3MaterialSlot", + "m_ObjectId": "8091809399c349289ababeaa3eae638c", + "m_Id": 10, + "m_DisplayName": "defaultValue", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "defaultValue", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 1.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ProviderSystem.ProviderNode", + "m_ObjectId": "81338ea6d0b24c0bbfea38bae2b666f5", + "m_Group": { + "m_Id": "" + }, + "m_Name": "LinkageExample", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -636.5, + "y": 162.00001525878907, + "width": 208.0, + "height": 287.00006103515627 + } + }, + "m_Slots": [ + { + "m_Id": "72fb37a0064241b1955cb39f9c237a57" + }, + { + "m_Id": "73bb949abaf74b4d8e8f83e7e5fc5cae" + }, + { + "m_Id": "c5b35142dd564eec922e30ed2712cec4" + } + ], + "synonyms": [ + "LinkageExample" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_provider": { + "rid": 1000 + }, + "references": { + "version": 2, + "RefIds": [ + { + "rid": 1000, + "type": { + "class": "ReflectedFunctionProvider", + "ns": "UnityEditor.ShaderGraph.ProviderSystem", + "asm": "Unity.ShaderGraph.Editor" + }, + "data": { + "m_providerKey": "LinkageExample", + "m_sourceAssetId": "4060428cd4c114edab3647f50d95506a" + } + } + ] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BitangentMaterialSlot", + "m_ObjectId": "813d831817f246de943a34b9a86b8ae7", + "m_Id": 6, + "m_DisplayName": "Bitangent", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "Bitangent", + "m_StageCapability": 3, + "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": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "8406260725c14a678e866072fffa1d18", + "m_Id": 1, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ProviderSystem.ExpressionNode", + "m_ObjectId": "8471c0b0e06e47298a8e63ec27429f71", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Expression", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -355.5000305175781, + "y": -168.5, + "width": 145.00003051757813, + "height": 170.0 + } + }, + "m_Slots": [ + { + "m_Id": "022a425f482d4dbf898b9f81b0b9692d" + }, + { + "m_Id": "8406260725c14a678e866072fffa1d18" + }, + { + "m_Id": "93508d0f5af2494186ea84526f57a449" + } + ], + "synonyms": [ + "equation", + "calculation", + "inline", + "code" + ], + "m_Precision": 2, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_provider": { + "rid": 1000 + }, + "references": { + "version": 2, + "RefIds": [ + { + "rid": 1000, + "type": { + "class": "ExpressionProvider", + "ns": "UnityEditor.ShaderGraph.ProviderSystem", + "asm": "Unity.ShaderGraph.Editor" + }, + "data": { + "m_name": "ExpressionNode_8471c0b0e06e47298a8e63ec27429f71", + "m_expression": "A+B", + "m_type": "float3" + } + } + ] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", @@ -691,19 +1545,26 @@ { "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", - "m_ObjectId": "9aeaec8d58e742e6874131e1d39c8aa6", - "m_Id": 1, - "m_DisplayName": "A", + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "93508d0f5af2494186ea84526f57a449", + "m_Id": 2, + "m_DisplayName": "B", "m_SlotType": 0, "m_Hidden": false, "m_HideConnector": false, - "m_ShaderOutputName": "a", + "m_ShaderOutputName": "B", "m_StageCapability": 3, - "m_Value": 0.0, - "m_DefaultValue": 0.0, - "m_Labels": [], - "m_LiteralMode": false + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] } { @@ -766,6 +1627,23 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a891172a6aaf46d686e6147451ca04a7", + "m_Id": 1, + "m_DisplayName": "a", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "a", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [], + "m_LiteralMode": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.ProviderSystem.ProviderNode", @@ -778,10 +1656,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -489.5, - "y": -353.9999694824219, + "x": -583.4999389648438, + "y": -768.9999389648438, "width": 316.0, - "height": 491.5000305175781 + "height": 491.49993896484377 } }, "m_Slots": [ @@ -832,7 +1710,10 @@ } ], "synonyms": [ - "All Hints Search Name" + "Features", + "Reflected", + "Every", + "Hint" ], "m_Precision": 0, "m_PreviewExpanded": true, @@ -888,16 +1769,41 @@ { "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.BlockNode", - "m_ObjectId": "b3455fdb91704dd2b4d6498433e11a3f", - "m_Group": { - "m_Id": "" - }, - "m_Name": "SurfaceDescription.Smoothness", - "m_DrawState": { - "m_Expanded": true, - "m_Position": { - "serializedVersion": "2", + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "b30783fff6514bfb95f6aad03dd1d269", + "m_Id": 3, + "m_DisplayName": "Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 3, + "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": 4 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "b3455fdb91704dd2b4d6498433e11a3f", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Smoothness", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", "x": 0.0, "y": 0.0, "width": 0.0, @@ -977,6 +1883,21 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "bae3057ef17f4e0d8a77b47f6d83c1dd", + "m_Id": 1, + "m_DisplayName": "test", + "m_SlotType": 0, + "m_Hidden": true, + "m_HideConnector": false, + "m_ShaderOutputName": "test", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -1028,6 +1949,70 @@ "m_SerializedDescriptor": "VertexDescription.Position" } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ViewDirectionMaterialSlot", + "m_ObjectId": "c381c56ba50f437293136249303c6051", + "m_Id": 7, + "m_DisplayName": "ViewDirection", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "ViewDirection", + "m_StageCapability": 3, + "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.Vector2MaterialSlot", + "m_ObjectId": "c389b91ae0d74d99b233f56d7dacb6be", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "__UNITY_SHADERGRAPH_UNUSED", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c5b35142dd564eec922e30ed2712cec4", + "m_Id": 2, + "m_DisplayName": "other", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "other", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 0.0, + "m_Labels": [], + "m_LiteralMode": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", @@ -1070,6 +2055,29 @@ "m_LiteralMode": false } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "d289e7b7e0084fe6b93d01a8f595ec7f", + "m_Id": 1, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 2 +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", @@ -1079,7 +2087,7 @@ "m_SlotType": 1, "m_Hidden": false, "m_HideConnector": false, - "m_ShaderOutputName": "Final Result", + "m_ShaderOutputName": "__UNITY_SHADERGRAPH_UNUSED", "m_StageCapability": 3, "m_Value": { "x": 0.0, @@ -1104,37 +2112,100 @@ "m_BlendModePreserveSpecular": true } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBAMaterialSlot", + "m_ObjectId": "db491031d1f647e09b27504acb2d0c93", + "m_Id": 5, + "m_DisplayName": "Color 4", + "m_SlotType": 1, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "c4", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 0.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 1.0, + "y": 1.0, + "z": 0.0, + "w": 1.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "de69fe023db044b588133cac8130c0a5", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.NormalTS", + "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": "7296f28828ef48e8a03494f77532d2d8" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.NormalTS" +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.ProviderSystem.ProviderNode", - "m_ObjectId": "d715a4d08d6e4e77b8fe8c816d434bac", + "m_ObjectId": "e4db13fab4214c6d99fb67be2bfcc373", "m_Group": { "m_Id": "" }, - "m_Name": "Make Custom Struct", + "m_Name": "LinkageExample", "m_DrawState": { "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -742.5, - "y": -414.9999694824219, - "width": 162.0, - "height": 86.0 + "x": -694.0000610351563, + "y": 301.4999694824219, + "width": 208.00006103515626, + "height": 287.0000305175781 } }, "m_Slots": [ { - "m_Id": "9aeaec8d58e742e6874131e1d39c8aa6" + "m_Id": "f8c277640957465aaea395d0fd9eadfc" + }, + { + "m_Id": "bae3057ef17f4e0d8a77b47f6d83c1dd" }, { - "m_Id": "0754487883424571af380987bf510ff7" + "m_Id": "4b67b353ee994263a39a6955f79f963e" } ], "synonyms": [ - "MakeCustomStruct" + "LinkageExample" ], "m_Precision": 0, - "m_PreviewExpanded": false, + "m_PreviewExpanded": true, "m_DismissedVersion": 0, "m_PreviewMode": 0, "m_CustomColors": { @@ -1154,7 +2225,7 @@ "asm": "Unity.ShaderGraph.Editor" }, "data": { - "m_providerKey": "Namespace::MakeCustomStruct(float,CustomStruct)", + "m_providerKey": "LinkageExample", "m_sourceAssetId": "4060428cd4c114edab3647f50d95506a" } } @@ -1164,54 +2235,65 @@ { "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.ColorRGBAMaterialSlot", - "m_ObjectId": "db491031d1f647e09b27504acb2d0c93", - "m_Id": 5, - "m_DisplayName": "Color 4", - "m_SlotType": 1, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "e65170c3e27e4ea1918b88aa498fb62c", + "m_Id": 2, + "m_DisplayName": "b", + "m_SlotType": 0, "m_Hidden": false, "m_HideConnector": false, - "m_ShaderOutputName": "c4", + "m_ShaderOutputName": "b", "m_StageCapability": 3, "m_Value": { - "x": 1.0, - "y": 1.0, + "x": 0.0, + "y": 0.0, "z": 0.0, - "w": 1.0 + "w": 0.0 }, "m_DefaultValue": { - "x": 1.0, - "y": 1.0, + "x": 0.0, + "y": 0.0, "z": 0.0, - "w": 1.0 + "w": 0.0 }, - "m_Labels": [] + "m_LiteralMode": false } { "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.BlockNode", - "m_ObjectId": "de69fe023db044b588133cac8130c0a5", + "m_Type": "UnityEditor.ShaderGraph.ProviderSystem.ProviderNode", + "m_ObjectId": "e851a1e8cd9746fdbbffc6f9393607d5", "m_Group": { "m_Id": "" }, - "m_Name": "SurfaceDescription.NormalTS", + "m_Name": "PrecisionTest", "m_DrawState": { "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 0.0, - "y": 0.0, - "width": 0.0, - "height": 0.0 + "x": -659.5, + "y": -207.0, + "width": 208.0, + "height": 311.0000305175781 } }, "m_Slots": [ { - "m_Id": "7296f28828ef48e8a03494f77532d2d8" + "m_Id": "c389b91ae0d74d99b233f56d7dacb6be" + }, + { + "m_Id": "744720fd232b4aa08bc60e8570917d40" + }, + { + "m_Id": "e65170c3e27e4ea1918b88aa498fb62c" + }, + { + "m_Id": "7b370f0683f443dcabad3d009333ae41" } ], - "synonyms": [], + "synonyms": [ + "PrecisionTest" + ], "m_Precision": 0, "m_PreviewExpanded": true, "m_DismissedVersion": 0, @@ -1219,7 +2301,26 @@ "m_CustomColors": { "m_SerializableColors": [] }, - "m_SerializedDescriptor": "SurfaceDescription.NormalTS" + "m_provider": { + "rid": 1000 + }, + "references": { + "version": 2, + "RefIds": [ + { + "rid": 1000, + "type": { + "class": "ReflectedFunctionProvider", + "ns": "UnityEditor.ShaderGraph.ProviderSystem", + "asm": "Unity.ShaderGraph.Editor" + }, + "data": { + "m_providerKey": "PrecisionTest", + "m_sourceAssetId": "4060428cd4c114edab3647f50d95506a" + } + } + ] + } } { @@ -1245,3 +2346,115 @@ "m_SliderPower": 3.0 } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionMaterialSlot", + "m_ObjectId": "efc7bacc806043a0a3f03caa2dc3d8e2", + "m_Id": 9, + "m_DisplayName": "ScreenPosition", + "m_SlotType": 0, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "ScreenPosition", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [], + "m_ScreenSpaceType": 4 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "f061f94f0d54484eafb40e8ecf8db7ba", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [], + "m_LiteralMode": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1Node", + "m_ObjectId": "f53eaf070cea497ebfcd033bb49167a6", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Float", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -798.0, + "y": 140.5, + "width": 125.49993896484375, + "height": 76.99998474121094 + } + }, + "m_Slots": [ + { + "m_Id": "52fb2af0d3974c8ea04981aacbf14b75" + }, + { + "m_Id": "f061f94f0d54484eafb40e8ecf8db7ba" + } + ], + "synonyms": [ + "Vector 1", + "1", + "v1", + "vec1", + "scalar" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Value": 0.0, + "m_ConstIntMode": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "f8c277640957465aaea395d0fd9eadfc", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_HideConnector": false, + "m_ShaderOutputName": "__UNITY_SHADERGRAPH_UNUSED", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + From 2f0b7efdfdf11ac05dbaaa8b214c297cc884273c Mon Sep 17 00:00:00 2001 From: Brendan Duncan Date: Fri, 6 Mar 2026 14:32:17 +0000 Subject: [PATCH 51/95] WebGPU updates to fix Fantasy Kingdom --- .../Runtime/STP/StpPreTaa.compute | 2 +- .../Runtime/STP/StpSetup.compute | 2 +- .../com.unity.render-pipelines.core/Runtime/STP/StpTaa.compute | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/STP/StpPreTaa.compute b/Packages/com.unity.render-pipelines.core/Runtime/STP/StpPreTaa.compute index 5e5286ffffd..4b9c9513365 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/STP/StpPreTaa.compute +++ b/Packages/com.unity.render-pipelines.core/Runtime/STP/StpPreTaa.compute @@ -7,7 +7,7 @@ #pragma multi_compile _ DISABLE_TEXTURE2D_X_ARRAY -#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch switch2 glcore +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch switch2 glcore webgpu #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" diff --git a/Packages/com.unity.render-pipelines.core/Runtime/STP/StpSetup.compute b/Packages/com.unity.render-pipelines.core/Runtime/STP/StpSetup.compute index c0614aabcc7..3ab3e751301 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/STP/StpSetup.compute +++ b/Packages/com.unity.render-pipelines.core/Runtime/STP/StpSetup.compute @@ -14,7 +14,7 @@ #pragma multi_compile _ DISABLE_TEXTURE2D_X_ARRAY -#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch switch2 glcore +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch switch2 glcore webgpu #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" diff --git a/Packages/com.unity.render-pipelines.core/Runtime/STP/StpTaa.compute b/Packages/com.unity.render-pipelines.core/Runtime/STP/StpTaa.compute index 7e26bd633de..46cd4a1bee7 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/STP/StpTaa.compute +++ b/Packages/com.unity.render-pipelines.core/Runtime/STP/StpTaa.compute @@ -7,7 +7,7 @@ #pragma multi_compile _ DISABLE_TEXTURE2D_X_ARRAY -#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch switch2 glcore +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch switch2 glcore webgpu #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" From 38e3a6de7540655f7ce69a02bee828944f33c9d1 Mon Sep 17 00:00:00 2001 From: Roland Kindermann Date: Fri, 6 Mar 2026 22:09:00 +0000 Subject: [PATCH 52/95] =?UTF-8?q?Fixed:=20opening=20the=20Volume=20Profile?= =?UTF-8?q?=20Menu=20before=20Volume=20Profile=20Drawer=20h=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DefaultVolumeProfileSettingsPropertyDrawer.cs | 4 ++-- .../Editor/Volume/VolumeProfileUtils.cs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Editor/Settings/PropertyDrawers/DefaultVolumeProfileSettingsPropertyDrawer.cs b/Packages/com.unity.render-pipelines.core/Editor/Settings/PropertyDrawers/DefaultVolumeProfileSettingsPropertyDrawer.cs index bd307155ce0..3e1a845611b 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Settings/PropertyDrawers/DefaultVolumeProfileSettingsPropertyDrawer.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Settings/PropertyDrawers/DefaultVolumeProfileSettingsPropertyDrawer.cs @@ -132,7 +132,7 @@ void IRenderPipelineGraphicsSettingsContextMenu2.PopulateContextMenu(T bool canCreateNewAsset = RenderPipelineManager.currentPipeline is TRenderPipeline; VolumeProfileUtils.AddVolumeProfileContextMenuItems(ref menu, setting.volumeProfile, - s_DefaultVolumeProfileEditor.allEditors, + s_DefaultVolumeProfileEditor == null ? null : s_DefaultVolumeProfileEditor.allEditors, overrideStateOnReset: true, defaultVolumeProfilePath: defaultVolumeProfilePath, onNewVolumeProfileCreated: createdProfile => @@ -151,7 +151,7 @@ void IRenderPipelineGraphicsSettingsContextMenu2.PopulateContextMenu(T } VolumeProfileUtils.UpdateGlobalDefaultVolumeProfile(createdProfile, initialAsset); }, - onComponentEditorsExpandedCollapsed: s_DefaultVolumeProfileEditor.RebuildListViews, + onComponentEditorsExpandedCollapsed: s_DefaultVolumeProfileEditor == null ? null : s_DefaultVolumeProfileEditor.RebuildListViews, canCreateNewAsset); } } diff --git a/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileUtils.cs b/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileUtils.cs index f1e43c43019..b1368c76eb0 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileUtils.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileUtils.cs @@ -300,12 +300,14 @@ public static void AddVolumeProfileContextMenuItems( menu.AddItem(Styles.collapseAll, false, () => { - SetComponentEditorsExpanded(componentEditors, false); + if (componentEditors != null) + SetComponentEditorsExpanded(componentEditors, false); onComponentEditorsExpandedCollapsed?.Invoke(); }); menu.AddItem(Styles.expandAll, false, () => { - SetComponentEditorsExpanded(componentEditors, true); + if (componentEditors != null) + SetComponentEditorsExpanded(componentEditors, true); onComponentEditorsExpandedCollapsed?.Invoke(); }); } From dcd20b0fe5c0a6dba0b9818ca46494e1c9ef2e5c Mon Sep 17 00:00:00 2001 From: Nicola Cerone Date: Sat, 7 Mar 2026 03:57:29 +0000 Subject: [PATCH 53/95] Correctly support UITKPreview without affecting other preview --- .../Editor/Data/Graphs/GraphData.cs | 11 ++ .../Editor/Drawing/Views/MaterialGraphView.cs | 1 + .../Editor/Generation/Processors/Generator.cs | 2 +- .../ShaderLibrary/Shim/UIShimPreview.hlsl | 3 + .../Shim/UIShimPreview.hlsl.meta | 7 + .../Generation/Targets/PreviewTarget.cs | 134 +++++++++++------- .../Generation/Targets/UITK/UISubTarget.cs | 35 +++-- .../Generation/Targets/UITKPreviewTarget.cs | 89 ------------ .../Targets/UITKPreviewTarget.cs.meta | 2 - .../Editor/Util/MessageManager.cs | 18 +++ .../Editor/UnitTests/MessageManagerTests.cs | 21 +++ 11 files changed, 165 insertions(+), 158 deletions(-) create mode 100644 Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShimPreview.hlsl create mode 100644 Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShimPreview.hlsl.meta delete mode 100644 Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs delete mode 100644 Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs.meta diff --git a/Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs b/Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs index 213e6003680..1999d6e6447 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs @@ -887,6 +887,17 @@ public List GetActiveBlocksForAllActiveTargets() return context.activeBlocks; } + public void RefreshBadgesAndPreviews() + { + foreach (var node in this.m_Nodes) + { + if (node.value != null) + { + node.value.Dirty(ModificationScope.Graph); + } + } + } + public void UpdateActiveBlocks(List activeBlockDescriptors) { // Set Blocks as active based on supported Block list diff --git a/Packages/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs b/Packages/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs index af1ca07c061..b4ca6e04f5f 100644 --- a/Packages/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs +++ b/Packages/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs @@ -138,6 +138,7 @@ void ChangeTargetSettings() graph.AddRemoveBlocksFromActiveList(activeBlocks); } + graph.RefreshBadgesAndPreviews(); graph.UpdateActiveBlocks(activeBlocks); this.m_PreviewManagerUpdateDelegate(); this.m_InspectorUpdateDelegate(); diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs b/Packages/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs index 9a0cba250ae..166bc223f47 100644 --- a/Packages/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs +++ b/Packages/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs @@ -198,7 +198,7 @@ Target[] GetTargetImplementations() { if (target.activeSubTarget is IUISubTarget) { - return new Target[] { new UITKPreviewTarget() }; + return new Target[] { new PreviewTarget(true) }; } } return new Target[] { new PreviewTarget() }; diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShimPreview.hlsl b/Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShimPreview.hlsl new file mode 100644 index 00000000000..5a1bca85b00 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShimPreview.hlsl @@ -0,0 +1,3 @@ +#ifdef UITK_PREVIEW +#include "UIShim.hlsl" +#endif diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShimPreview.hlsl.meta b/Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShimPreview.hlsl.meta new file mode 100644 index 00000000000..021fe44fc02 --- /dev/null +++ b/Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShimPreview.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9f12249d09c77224c8a6d6fad6e252b5 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Targets/PreviewTarget.cs b/Packages/com.unity.shadergraph/Editor/Generation/Targets/PreviewTarget.cs index b3738da3d72..a86514ba488 100644 --- a/Packages/com.unity.shadergraph/Editor/Generation/Targets/PreviewTarget.cs +++ b/Packages/com.unity.shadergraph/Editor/Generation/Targets/PreviewTarget.cs @@ -10,10 +10,17 @@ class PreviewTarget : Target { static readonly GUID kSourceCodeGuid = new GUID("7464b9fcde08e5645a16b9b8ae1e573c"); // PreviewTarget.cs - public PreviewTarget() + private bool isUITKPreview = false; + + public PreviewTarget() : this(false) + { + } + + public PreviewTarget(bool isUITKPreview) { displayName = "Preview"; isHidden = true; + this.isUITKPreview = isUITKPreview; } public override bool IsActive() => false; @@ -22,7 +29,7 @@ public PreviewTarget() public override void Setup(ref TargetSetupContext context) { context.AddAssetDependency(kSourceCodeGuid, AssetCollection.Flags.SourceDependency); - context.AddSubShader(SubShaders.Preview); + context.AddSubShader(SubShaders.GetPreview(isUITKPreview)); } public override void GetFields(ref TargetFieldContext context) @@ -41,65 +48,77 @@ public override void GetPropertiesGUI(ref TargetPropertyGUIContext context, Acti static class SubShaders { - public static SubShaderDescriptor Preview = new SubShaderDescriptor() + public static SubShaderDescriptor GetPreview(bool isUITKPreview) { - renderQueue = "Geometry", - renderType = "Opaque", - generatesPreview = true, - passes = new PassCollection { Passes.Preview }, - }; + var preview = new SubShaderDescriptor() + { + renderQueue = "Geometry", + renderType = "Opaque", + generatesPreview = true, + passes = new PassCollection { Passes.GetPreview(isUITKPreview) }, + }; + + return preview; + } } static class Passes { - public static PassDescriptor Preview = new PassDescriptor() + public static PassDescriptor GetPreview(bool isUITKPreview) { - // Definition - referenceName = "SHADERPASS_PREVIEW", - useInPreview = true, + var pass = new PassDescriptor() + { + // Definition + referenceName = "SHADERPASS_PREVIEW", + useInPreview = true, - // Templates - passTemplatePath = GenerationUtils.GetDefaultTemplatePath("PassMesh.template"), - sharedTemplateDirectories = GenerationUtils.GetDefaultSharedTemplateDirectories(), + // Templates + passTemplatePath = GenerationUtils.GetDefaultTemplatePath("PassMesh.template"), + sharedTemplateDirectories = GenerationUtils.GetDefaultSharedTemplateDirectories(), - // Collections - structs = new StructCollection - { - { Structs.Attributes }, - { StructDescriptors.PreviewVaryings }, - { Structs.SurfaceDescriptionInputs }, - { Structs.VertexDescriptionInputs }, - }, - fieldDependencies = FieldDependencies.Default, - pragmas = new PragmaCollection - { - { Pragma.Vertex("vert") }, - { Pragma.Fragment("frag") }, - }, - defines = new DefineCollection - { - { KeywordDescriptors.PreviewKeyword, 1 }, - }, - includes = new IncludeCollection - { - // Pre-graph - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl", IncludeLocation.Pregraph }, // TODO: put this on a conditional - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariables.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl", IncludeLocation.Pregraph }, - - // Post-graph - { "Packages/com.unity.shadergraph/ShaderGraphLibrary/PreviewVaryings.hlsl", IncludeLocation.Postgraph }, - { "Packages/com.unity.shadergraph/ShaderGraphLibrary/PreviewPass.hlsl", IncludeLocation.Postgraph }, - } - }; + // Collections + structs = new StructCollection + { + { Structs.Attributes }, + { StructDescriptors.PreviewVaryings }, + { Structs.SurfaceDescriptionInputs }, + { Structs.VertexDescriptionInputs }, + }, + fieldDependencies = FieldDependencies.Default, + pragmas = new PragmaCollection + { + { Pragma.Vertex("vert") }, + { Pragma.Fragment("frag") }, + }, + defines = new DefineCollection + { + { KeywordDescriptors.PreviewKeyword, 1 }, + { KeywordDescriptors.UITKPreviewKeyword, isUITKPreview ? 1 : 0 } + }, + includes = new IncludeCollection + { + // Pre-graph + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl", IncludeLocation.Pregraph }, // TODO: put this on a conditional + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariables.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShimPreview.hlsl", IncludeLocation.Pregraph }, + + // Post-graph + { "Packages/com.unity.shadergraph/ShaderGraphLibrary/PreviewVaryings.hlsl", IncludeLocation.Postgraph }, + { "Packages/com.unity.shadergraph/ShaderGraphLibrary/PreviewPass.hlsl", IncludeLocation.Postgraph }, + } + }; + + return pass; + } } protected static class StructDescriptors @@ -143,6 +162,15 @@ protected static class KeywordDescriptors scope = KeywordScope.Global, stages = KeywordShaderStage.All, }; + public static KeywordDescriptor UITKPreviewKeyword = new KeywordDescriptor() + { + displayName = "UITK Preview", + referenceName = "UITK_PREVIEW", + type = KeywordType.Boolean, + definition = KeywordDefinition.MultiCompile, + scope = KeywordScope.Global, + stages = KeywordShaderStage.All, + }; } } } diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITK/UISubTarget.cs b/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITK/UISubTarget.cs index 321ad95f8be..d69a5deb115 100644 --- a/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITK/UISubTarget.cs +++ b/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITK/UISubTarget.cs @@ -218,6 +218,9 @@ public string GetValidatorKey() return "UISubTarget"; } + const string kUVErrorMessageNode = "UI Material does not support UV1-7. Consider using 'UV0'."; + const string kUVErrorMessageSubGraph = "UI Material does not support UV1-7. Consider using 'UV0' in the subgraph."; + public INodeValidationExtension.Status GetValidationStatus(AbstractMaterialNode node, out string msg) { // Make sure node is in our graph first @@ -227,6 +230,12 @@ public INodeValidationExtension.Status GetValidationStatus(AbstractMaterialNode return INodeValidationExtension.Status.None; } + // Clear all Warning/Error message from other providers. + // The message from the graph (when loading the graph) will not be removed + // since it's not the same provider as the UISubTarget. It then stays present + // even if the UV0 is selected. + node.owner.messageManager.ClearNodeFromOtherProvider(this, new[] { node }); + foreach (var item in node.owner.activeTargets) { if (item.prefersUITKPreview) @@ -235,16 +244,6 @@ public INodeValidationExtension.Status GetValidationStatus(AbstractMaterialNode { return INodeValidationExtension.Status.Warning; } - - UVNode uvNode = node as UVNode; - if (uvNode != null) - { - if (uvNode.uvChannel != UnityEditor.ShaderGraph.Internal.UVChannel.UV0) - { - msg = "UI Material does not support UV1-7. Consider using 'UV0'."; - return INodeValidationExtension.Status.Warning; - } - } } } @@ -261,7 +260,17 @@ private bool ValidateUV(AbstractMaterialNode node, out string warningMessage) { if (uvSlot.channel != UnityEditor.ShaderGraph.Internal.UVChannel.UV0) { - warningMessage = "UI Material does not support UV1-7. Consider using 'UV0'."; + warningMessage = kUVErrorMessageNode; + return true; + } + } + + UVNode uvNode = node as UVNode; + if (uvNode != null) + { + if (uvNode.uvChannel != UnityEditor.ShaderGraph.Internal.UVChannel.UV0) + { + warningMessage = kUVErrorMessageNode; return true; } } @@ -283,7 +292,7 @@ public override bool ValidateNodeCompatibility(AbstractMaterialNode node, out st { if (uvSlot.channel != UnityEditor.ShaderGraph.Internal.UVChannel.UV0) { - warningMessage = "UI Material does not support UV1-7. Consider using 'UV0'."; + warningMessage = kUVErrorMessageNode; return true; } } @@ -303,7 +312,7 @@ public override bool ValidateNodeCompatibility(AbstractMaterialNode node, out st { if (item != UnityEditor.ShaderGraph.Internal.UVChannel.UV0) { - warningMessage = "UI Material does not support UV1-7. Consider using 'UV0' in the subgraph."; + warningMessage = kUVErrorMessageSubGraph; return true; } } diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs b/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs deleted file mode 100644 index 21ddab3750e..00000000000 --- a/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.UIElements; - -namespace UnityEditor.ShaderGraph -{ - class UITKPreviewTarget : PreviewTarget - { - static readonly GUID kSourceCodeGuid = new GUID("25a52015b0f83494a824ccc98f1854d1"); // UITKPreviewTarget.cs - - public UITKPreviewTarget() - { - displayName = "Preview"; - isHidden = true; - } - - public override void Setup(ref TargetSetupContext context) - { - context.AddAssetDependency(kSourceCodeGuid, AssetCollection.Flags.SourceDependency); - context.AddSubShader(SubShaders.Preview); - } - - static class SubShaders - { - public static SubShaderDescriptor Preview = new SubShaderDescriptor() - { - renderQueue = "Geometry", - renderType = "Opaque", - generatesPreview = true, - passes = new PassCollection { Passes.Preview }, - }; - } - - static class Passes - { - public static PassDescriptor Preview = new PassDescriptor() - { - // Definition - referenceName = "SHADERPASS_PREVIEW", - useInPreview = true, - - // Templates - passTemplatePath = GenerationUtils.GetDefaultTemplatePath("PassMesh.template"), - sharedTemplateDirectories = GenerationUtils.GetDefaultSharedTemplateDirectories(), - - // Collections - structs = new StructCollection - { - { Structs.Attributes }, - { StructDescriptors.PreviewVaryings }, - { Structs.SurfaceDescriptionInputs }, - { Structs.VertexDescriptionInputs }, - }, - fieldDependencies = FieldDependencies.Default, - pragmas = new PragmaCollection - { - { Pragma.Vertex("vert") }, - { Pragma.Fragment("frag") }, - }, - defines = new DefineCollection - { - { KeywordDescriptors.PreviewKeyword, 1 }, - }, - includes = new IncludeCollection - { - // Pre-graph - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl", IncludeLocation.Pregraph }, // TODO: put this on a conditional - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariables.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl", IncludeLocation.Pregraph }, - { "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShim.hlsl", IncludeLocation.Pregraph }, - - // Post-graph - { "Packages/com.unity.shadergraph/ShaderGraphLibrary/PreviewVaryings.hlsl", IncludeLocation.Postgraph }, - { "Packages/com.unity.shadergraph/ShaderGraphLibrary/PreviewPass.hlsl", IncludeLocation.Postgraph }, - } - }; - } - } -} diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs.meta b/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs.meta deleted file mode 100644 index 02e7412621a..00000000000 --- a/Packages/com.unity.shadergraph/Editor/Generation/Targets/UITKPreviewTarget.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 25a52015b0f83494a824ccc98f1854d1 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Editor/Util/MessageManager.cs b/Packages/com.unity.shadergraph/Editor/Util/MessageManager.cs index 2878744ae55..90d75b39bb4 100644 --- a/Packages/com.unity.shadergraph/Editor/Util/MessageManager.cs +++ b/Packages/com.unity.shadergraph/Editor/Util/MessageManager.cs @@ -124,6 +124,24 @@ public void ClearNodesFromProvider(object messageProvider, IEnumerable nodes) + { + foreach (var key in m_Messages.Keys) + { + if (key != messageProvider) + { + foreach (var node in nodes) + { + if (m_Messages[key].TryGetValue(node.objectId, out var messages)) + { + nodeMessagesChanged |= messages.Count > 0; + messages.Clear(); + } + } + } + } + } + public void ClearAll() { m_Messages.Clear(); diff --git a/Packages/com.unity.shadergraph/Tests/Editor/UnitTests/MessageManagerTests.cs b/Packages/com.unity.shadergraph/Tests/Editor/UnitTests/MessageManagerTests.cs index 9ff8a425902..98d777c11a5 100644 --- a/Packages/com.unity.shadergraph/Tests/Editor/UnitTests/MessageManagerTests.cs +++ b/Packages/com.unity.shadergraph/Tests/Editor/UnitTests/MessageManagerTests.cs @@ -320,6 +320,27 @@ public void ReportAnyErrors_EmptyManager_ErrorOneProvider() var ret = m_EmptyMgr.HasSeverity(); Assert.IsTrue(ret); } + + [Test] + public void ClearNodesFromOtherProvider() + { + m_ComplexMgr.ClearNodeFromOtherProvider(p0, new List { node1 }); + + // Verify node1 is still in provider0 + Assert.IsTrue(m_ComplexMgr.Messages.ContainsKey(p0)); + Assert.IsTrue(m_ComplexMgr.Messages[p0].ContainsKey(node1.objectId)); + Assert.AreEqual(1, m_ComplexMgr.Messages[p0][node1.objectId].Count); + Assert.AreEqual(e2, m_ComplexMgr.Messages[p0][node1.objectId][0]); + + // Verify node1 is cleared from provider1 + Assert.IsTrue(m_ComplexMgr.Messages.ContainsKey(p1)); + Assert.IsTrue(m_ComplexMgr.Messages[p1].ContainsKey(node1.objectId)); + Assert.AreEqual(0, m_ComplexMgr.Messages[p1][node1.objectId].Count); + + // Verify other nodes in provider1 are unchanged + Assert.AreEqual(1, m_ComplexMgr.Messages[p1][node0.objectId].Count); + Assert.AreEqual(1, m_ComplexMgr.Messages[p1][node2.objectId].Count); + } } } From bbb363eb7dfc1ffb81c45b187b71372fb1f09c65 Mon Sep 17 00:00:00 2001 From: Rasmus Roenn Nielsen Date: Sat, 7 Mar 2026 03:57:33 +0000 Subject: [PATCH 54/95] Add support for punctual light range and spot light angle attenuation in Surface Cache. --- .../Lighting/SurfaceCache/Estimation.hlsl | 36 ++++-- .../Lighting/SurfaceCache/PathTracing.hlsl | 103 ++++++++++++++++-- .../SurfaceCache/PunctualLightSampling.hlsl | 15 ++- .../Lighting/SurfaceCache/PunctualLights.hlsl | 11 +- .../Lighting/SurfaceCache/SurfaceCache.cs | 3 +- .../SurfaceCache/SurfaceCacheWorld.cs | 37 ++++++- .../SurfaceCacheGIRendererFeature.cs | 2 +- 7 files changed, 168 insertions(+), 39 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/Estimation.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/Estimation.hlsl index 3025dc2dc7a..8a30e8c730d 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/Estimation.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/Estimation.hlsl @@ -17,6 +17,7 @@ StructuredBuffer _CellPatchIndices; StructuredBuffer _CascadeOffsets; StructuredBuffer _MaterialEntries; StructuredBuffer _PunctualLightSamples; +StructuredBuffer _PunctualLights; Texture2DArray _AlbedoTextures; Texture2DArray _TransmissionTextures; Texture2DArray _EmissionTextures; @@ -83,10 +84,24 @@ void ProjectAndAccumulate(inout SphericalHarmonics::RGBL1 accumulator, float3 sa accumulator.l1s[2] += sampleRadiance * SphericalHarmonics::y1Constant * sampleDirection.x; } +float GetAdditionalRayOffset(float volumeVoxelMinSize) +{ + // We currently use the OffsetRayOrigin() heuristic to offset ray origins to avoid self-intersections. While this + // helps for Surface Cache it is not enough since the ray origins are relatively imprecise because they are derived + // from output of the rasterizer (as opposed to being reconstructed via barycentrics). + // We fix this by adding an additional offset. This offset is a percentage of the min voxel size to keep it + // somewhat proportional to the scene scale. + return volumeVoxelMinSize * 0.001; +} + void SamplePunctualLightBounceRadiance( inout QrngKronecker2D rng, UnifiedRT::RayTracingAccelStruct accelStruct, UnifiedRT::DispatchInfo dispatchInfo, + StructuredBuffer lights, + StructuredBuffer punctualLightSamples, + uint punctualLightSampleCount, + float volumeVoxelMinSize, PatchUtil::PatchGeometry patchGeo, inout SphericalHarmonics::RGBL1 accumulator, inout bool gotValidSamples) @@ -100,11 +115,13 @@ void SamplePunctualLightBounceRadiance( PunctualLightBounceRadianceSample sample_ = SamplePunctualLightBounceRadiance( dispatchInfo, accelStruct, - _PunctualLightSamples, - _PunctualLightSampleCount, + lights, + punctualLightSamples, + punctualLightSampleCount, rng.GetSample(0).x, patchGeo.position, - patchGeo.normal); + patchGeo.normal, + GetAdditionalRayOffset(volumeVoxelMinSize)); if (!sample_.IsValid()) continue; @@ -129,16 +146,12 @@ void SampleEnvironmentAndDirectionalBounceAndMultiBounceRadiance( UnifiedRT::DispatchInfo dispatchInfo, MaterialPoolParamSet matPoolParams, PatchUtil::PatchGeometry patchGeo, + float volumeVoxelMinSize, inout SphericalHarmonics::RGBL1 accumulator, inout bool gotValidSamples) { UnifiedRT::Ray ray; - // Offset ray origin to avoid self-intersections - // This offset is a percentage of the min voxel width (to keep it proportional to the scene scale) and is combined with OffsetRayOrigin - // Note: OffsetRayOrigin is not a perfect fit for a patchGeo.position that comes from the rasterization pipeline, as its heuristic is designed - // for positions computed via triangle vertices interpolation of a previous ray hit. We use it here nonetheless because its scaling with the distance - // to the world origin also helps to counter floating-point precision issues. - ray.origin = OffsetRayOrigin(patchGeo.position, patchGeo.normal, _VolumeVoxelMinSize * 0.001); + ray.origin = OffsetRayOrigin(patchGeo.position, patchGeo.normal, GetAdditionalRayOffset(volumeVoxelMinSize)); ray.tMin = 0; ray.tMax = FLT_MAX; @@ -220,6 +233,7 @@ void Estimate(UnifiedRT::DispatchInfo dispatchInfo) dispatchInfo, matPoolParams, patchGeo, + _VolumeVoxelMinSize, radianceSampleMean, gotValidSamples); @@ -230,6 +244,10 @@ void Estimate(UnifiedRT::DispatchInfo dispatchInfo) rng, accelStruct, dispatchInfo, + _PunctualLights, + _PunctualLightSamples, + _PunctualLightSampleCount, + _VolumeVoxelMinSize, patchGeo, radianceSampleMean, gotValidSamples); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/PathTracing.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/PathTracing.hlsl index b8da6e6796a..40a0ce21214 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/PathTracing.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/PathTracing.hlsl @@ -70,14 +70,77 @@ struct PunctualLightBounceRadianceSample } }; +float Square(float x) +{ + return x * x; +} + +// Many distance window functions are possible. This one is the square root of +// the one currently used in URP: (1.0 - saturate((distanceSqr * 1.0 / rangeSqr)^2)). +float SharpPunctualLightRangeWindow(float range, float distanceSquared) +{ + const float lightRangeSquared = Square(range); + const float distanceSquaredOverRangeSquared = distanceSquared / lightRangeSquared; + const float window = 1.0f - saturate(distanceSquaredOverRangeSquared * distanceSquaredOverRangeSquared); + return window; +} + +// Many distance window functions are possible. This one matches the one currently +// used in URP: (1.0 - saturate((distanceSqr * 1.0 / rangeSqr)^2))^2. +float SmoothPunctualLightRangeWindow(float range, float distanceSquared) +{ + const float window = SharpPunctualLightRangeWindow(range, distanceSquared); + return Square(window); +} + +// Sharp spot light angle attenuation function: +// f(cosHitAngle) = saturate((cosHitAngle - cosOuterAngle) / (cosOuterAngle - cosInnerAngle)). +// This function is linear in cosHitAngle and satisfies f(cosOuterAngle) = 0 and +// f(cosInnerAngle) = 1. +// For perf reasons, the implementation assumes cosHitAngle <= cosOuterAngle. +// angleAttenuationValue1: If innerAngle != outerAngle then 1/(cosInnerAngle-cosOuterAngle), otherwise 0. +// angleAttenuationValue2: If innerAngle != outerAngle then cosOuterAngle/(cosOuterAngle-cosInnerAngle), otherwise 1. +float SharpSpotLightAngleAttenuation(float3 spotDirection, float3 hitDirection, float angleAttenuationValue1, float angleAttenuationValue2) +{ + // Note that + // (cosHitAngle - cosOuterAngle) / (cosOuterAngle - cosInnerAngle) = + // (cosHitAngle) * 1/(cosOuterAngle - cosInnerAngle) + cosOuterAngle / (cosInnerAngle - cosOuterAngle) + // a * b + c + // where + // a = cosHitAngle, + // b = 1/(cosOuterAngle - cosInnerAngle), + // c = cosOuterAngle / (cosInnerAngle - cosOuterAngle). + // We exploit this to reduce a fused multiply-add. + const float cosHitAngle = dot(spotDirection, hitDirection); + const float attenuation = saturate(cosHitAngle * angleAttenuationValue1 + angleAttenuationValue2); + return attenuation; +} + +// Smooth spot light angle attenuation linear in cos(hitAngle), then clamped, then squared for smoothing. +// More precisely: saturate((cosHitAngle - cosOuterAngle) / (cosOuterAngle - cosInnerAngle))^2. +// This matches URP's current behaviour (see AngleAttenuation in RealtimeLights.hlsl). +float SmoothSpotLightAngleAttenuation(float3 spotDirection, float3 hitDirection, float angleAttenuationValue1, float angleAttenuationValue2) +{ + const float attenuation = SharpSpotLightAngleAttenuation(spotDirection, hitDirection, angleAttenuationValue1, angleAttenuationValue2); + return Square(attenuation); // Square to smoothen fade-out. +} + +bool IsSpotLight(float cosOuterAngle) +{ + // Here we assume that spot lights are not allowed to have an outer angle of PI or larger. + return cosOuterAngle != -1.0f; +} + PunctualLightBounceRadianceSample SamplePunctualLightBounceRadiance( UnifiedRT::DispatchInfo dispatchInfo, UnifiedRT::RayTracingAccelStruct accelStruct, + StructuredBuffer lights, StructuredBuffer punctualLightSamples, uint punctualLightSampleCount, float uniformRand, float3 position, - float3 normal) + float3 normal, + float additionalRayOffset) { PunctualLightBounceRadianceSample result = (PunctualLightBounceRadianceSample)0; @@ -89,7 +152,7 @@ PunctualLightBounceRadianceSample SamplePunctualLightBounceRadiance( if (epsilon < planeDistance) // Light sample hit point must be "in front" of the patch. { UnifiedRT::Ray reconnectionRay; - reconnectionRay.origin = OffsetRayOrigin(position, normal); + reconnectionRay.origin = OffsetRayOrigin(position, normal, additionalRayOffset); reconnectionRay.direction = normalize(punctualLightSample.hitPos - position); reconnectionRay.tMin = 0; reconnectionRay.tMax = FLT_MAX; @@ -105,32 +168,50 @@ PunctualLightBounceRadianceSample SamplePunctualLightBounceRadiance( reconnectionResult.instanceID == punctualLightSample.hitInstanceId && reconnectionResult.primitiveIndex == punctualLightSample.hitPrimitiveIndex) { + const PunctualLight light = lights[punctualLightSample.lightIndex]; result.direction = reconnectionRay.direction; #if 0 // readable version - const float bounceCosTerm = dot(-punctualLightSample.dir, punctualLightSample.hitNormal); - const float bounceSolidAngleToAreaJacobian = 1.0f / (punctualLightSample.distance * punctualLightSample.distance); // To integrate over punctual light we must switch to area measure. + const float distanceSquared = Square(punctualLightSample.distance); + const float rangeWindow = SmoothPunctualLightRangeWindow(light.range, distanceSquared); + float angularAttenuation = 1.0f; + if (IsSpotLight(light.cosOuterAngle)) + angularAttenuation = SmoothSpotLightAngleAttenuation(light.direction, punctualLightSample.rayDirection, light.angleAttenuationValue1, light.angleAttenuationValue2); + + const float bounceCosTerm = dot(-punctualLightSample.rayDirection, punctualLightSample.hitNormal); + const float bounceSolidAngleToAreaJacobian = 1.0f / distanceSquared; // To integrate over punctual light we must switch to area measure. const float3 brdf = punctualLightSample.hitAlbedo * INV_PI; - const float3 punctualLightBouncedRadiance = bounceCosTerm * bounceSolidAngleToAreaJacobian * punctualLightSample.intensity * brdf; + const float3 punctualLightBouncedRadiance = bounceCosTerm * bounceSolidAngleToAreaJacobian * light.intensity * brdf; // We transform from patch solid angle measure to (common) surface area measure to punctual light solid angle measure. const float patchSolidAngleToBounceAreaJacobian = dot(-reconnectionRay.direction, punctualLightSample.hitNormal) / (reconnectionResult.hitDistance * reconnectionResult.hitDistance); - const float bounceAreaToLightSolidAngleJacobian = punctualLightSample.distance * punctualLightSample.distance / dot(-punctualLightSample.dir, punctualLightSample.hitNormal); + const float bounceAreaToLightSolidAngleJacobian = distanceSquared / dot(-punctualLightSample.rayDirection, punctualLightSample.hitNormal); const float patchSolidAngleToLightSolidAngleJacobian = patchSolidAngleToBounceAreaJacobian * bounceAreaToLightSolidAngleJacobian; if (isfinite(bounceSolidAngleToAreaJacobian) && isfinite(patchSolidAngleToBounceAreaJacobian)) - result.radianceOverDensity = punctualLightBouncedRadiance * patchSolidAngleToLightSolidAngleJacobian * punctualLightSample.reciprocalDensity; + result.radianceOverDensity = punctualLightBouncedRadiance * patchSolidAngleToLightSolidAngleJacobian * punctualLightSample.reciprocalDensity * rangeWindow * angularAttenuation; else result.MarkInvalid(); #else // optimized version - const float reciprocalSquaredDistance = rcp(reconnectionResult.hitDistance * reconnectionResult.hitDistance); - if (isfinite(reciprocalSquaredDistance)) + const float reciprocalReconnectionDistance = rcp(reconnectionResult.hitDistance); + if (isfinite(reciprocalReconnectionDistance)) + { + const float distanceSquared = Square(punctualLightSample.distance); + const float rangeWindow = SharpPunctualLightRangeWindow(light.range, distanceSquared); + + float angularAttenuation = 1.0f; + if (IsSpotLight(light.cosOuterAngle)) + angularAttenuation = SharpSpotLightAngleAttenuation(light.direction, punctualLightSample.rayDirection, light.angleAttenuationValue1, light.angleAttenuationValue2); + result.radianceOverDensity = INV_PI * dot(-reconnectionRay.direction, punctualLightSample.hitNormal) * punctualLightSample.reciprocalDensity * - reciprocalSquaredDistance * - punctualLightSample.intensity * punctualLightSample.hitAlbedo; + light.intensity * punctualLightSample.hitAlbedo * + Square(reciprocalReconnectionDistance * rangeWindow * angularAttenuation); + } else + { result.MarkInvalid(); + } #endif } } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/PunctualLightSampling.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/PunctualLightSampling.hlsl index a31b89b63c1..3412dfee708 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/PunctualLightSampling.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/PunctualLightSampling.hlsl @@ -1,4 +1,3 @@ -#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Macros.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Sampling.hlsl" #include "Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Bindings.hlsl" @@ -44,22 +43,22 @@ void SamplePunctualLights(UnifiedRT::DispatchInfo dispatchInfo) QrngKronecker2D rng; rng.Init(dispatchInfo.globalThreadIndex.x, _FrameIdx); - const uint spotLightIndex = min(rng.GetSample(0).x * _PunctualLightCount, _PunctualLightCount - 1); - const PunctualLight light = _PunctualLights[spotLightIndex]; + const uint punctualLightIndex = min(rng.GetSample(0).x * _PunctualLightCount, _PunctualLightCount - 1); + const PunctualLight light = _PunctualLights[punctualLightIndex]; UnifiedRT::Ray ray; ray.tMin = 0; - ray.tMax = FLT_MAX; + ray.tMax = light.range; ray.origin = light.position; { float2 coneSample = rng.GetSample(1); - float3 localDir = SampleConeUniform(coneSample.x, coneSample.y, light.cosAngle); + float3 localDir = SampleConeUniform(coneSample.x, coneSample.y, light.cosOuterAngle); float3x3 spotBasis = OrthoBasisFromVector(light.direction); ray.direction = mul(spotBasis, localDir); } PunctualLightSample lightSample = (PunctualLightSample)0; - lightSample.dir = ray.direction; + lightSample.rayDirection = ray.direction; UnifiedRT::Hit hitResult = UnifiedRT::TraceRayClosestHit(dispatchInfo, accelStruct, 0xFFFFFFFF, ray, UnifiedRT::kRayFlagNone); if (hitResult.IsValid() && hitResult.isFrontFace) @@ -84,10 +83,10 @@ void SamplePunctualLights(UnifiedRT::DispatchInfo dispatchInfo) lightSample.hitNormal = hitGeo.normal; lightSample.distance = hitResult.hitDistance; lightSample.hitAlbedo = hitMat.baseColor; - lightSample.reciprocalDensity = AreaOfSphericalCapWithRadiusOne(light.cosAngle) * _PunctualLightCount; + lightSample.reciprocalDensity = AreaOfSphericalCapWithRadiusOne(light.cosOuterAngle) * _PunctualLightCount; lightSample.hitInstanceId = hitResult.instanceID; lightSample.hitPrimitiveIndex = hitResult.primitiveIndex; - lightSample.intensity = light.intensity; + lightSample.lightIndex = punctualLightIndex; } else { diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/PunctualLights.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/PunctualLights.hlsl index 28f07e6fb19..6728a7e0450 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/PunctualLights.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/PunctualLights.hlsl @@ -6,7 +6,12 @@ struct PunctualLight float3 position; float3 direction; float3 intensity; - float cosAngle; + float cosOuterAngle; + float range; + // If innerAngle != outerAngle then 1/(cosInnerAngle-cosOuterAngle), otherwise 0. + float angleAttenuationValue1; + // If innerAngle != outerAngle then cosOuterAngle/(cosOuterAngle-cosInnerAngle), otherwise 1. + float angleAttenuationValue2; }; // This represents a sample ray shot from the light. @@ -15,11 +20,11 @@ struct PunctualLightSample float3 hitPos; float3 hitNormal; float3 hitAlbedo; - float3 dir; - float3 intensity; + float3 rayDirection; float distance; uint hitInstanceId; uint hitPrimitiveIndex; + uint lightIndex; float reciprocalDensity; void MarkNoHit() diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCache.cs b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCache.cs index 6a753935de2..a0ddb1ee7eb 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCache.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCache.cs @@ -451,7 +451,7 @@ public SurfaceCache( _volume = new SurfaceCacheVolume(volParams.Resolution, volParams.CascadeCount, volParams.Size); _ringConfig = new SurfaceCacheRingConfig(); _patches = new SurfaceCachePatchList(patchCapacity); - _punctualLightSamples = new GraphicsBuffer(GraphicsBuffer.Target.Structured, (int)punctualLightSampleCount, sizeof(float) * 19); + _punctualLightSamples = new GraphicsBuffer(GraphicsBuffer.Target.Structured, (int)punctualLightSampleCount, sizeof(float) * 17); _estimationParams = estimationParams; _patchFilteringParams = patchFilteringParams; @@ -682,6 +682,7 @@ static void Estimate(EstimationPassData data, UnsafeGraphContext graphCtx) { var shader = data.EstimationShader; + shader.SetBufferParam(cmd, ShaderIDs._PunctualLights, punctualLightBuffer); shader.SetBufferParam(cmd, ShaderIDs._RingConfigBuffer, data.RingConfigBuffer); shader.SetBufferParam(cmd, ShaderIDs._PunctualLightSamples, data.PunctualLightSamples); shader.SetBufferParam(cmd, ShaderIDs._PatchIrradiances, data.PatchIrradiances); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCacheWorld.cs b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCacheWorld.cs index 99738a0694f..5b1819a2979 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCacheWorld.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/SurfaceCache/SurfaceCacheWorld.cs @@ -28,7 +28,7 @@ internal struct LightDescriptor public Vector3 LinearLightColor; public Matrix4x4 Transform; public float ColorTemperature; - public float SpotAngle; + public float OuterSpotAngle; public float InnerSpotAngle; public float Range; } @@ -44,7 +44,12 @@ internal struct PunctualLight internal Vector3 Position; internal Vector3 Direction; internal Vector3 Intensity; - internal float CosAngle; + internal float CosOuterAngle; + internal float Range; + // If innerAngle = outerAngle then 1/(cosInnerAngle-cosOuterAngle), otherwise 0. + internal float AngleAttenuationValue1; + // If innerAngle = outerAngle then cosOuterAngle/(cosOuterAngle-cosInnerAngle), otherwise 1. + internal float AngleAttenuationValue2; } internal class LightSet : IDisposable @@ -57,7 +62,7 @@ class LightList : IDisposable where T : struct private List _list = new(); private Dictionary, int> _handleToIndex = new(); private Dictionary> _indexToHandle = new(); - private bool _gpuDirty = false; + private bool _gpuDirty = true; private GraphicsBuffer _buffer; internal uint Count => (uint)_list.Count; @@ -106,7 +111,7 @@ internal void Commit(CommandBuffer cmd) if (_buffer == null || _buffer.count < _list.Count) { _buffer?.Dispose(); - _buffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured, _list.Count, UnsafeUtility.SizeOf()); + _buffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured, Math.Max(1, _list.Count), UnsafeUtility.SizeOf()); } cmd.SetBufferData(_buffer, _list); } @@ -173,12 +178,31 @@ static DirectionalLight ConvertDirectionalLight(LightDescriptor desc) static PunctualLight ConvertSpotLight(LightDescriptor desc) { + float cosOuterAngle = Mathf.Cos(desc.OuterSpotAngle * Mathf.Deg2Rad * 0.5f); + float cosInnerAngle = Mathf.Cos(desc.InnerSpotAngle * Mathf.Deg2Rad * 0.5f); + + float angleAttenuationValue1; + float angleAttenuationValue2; + if (desc.InnerSpotAngle != desc.OuterSpotAngle) + { + angleAttenuationValue1 = 1.0f / (cosInnerAngle - cosOuterAngle); + angleAttenuationValue2 = cosOuterAngle * -angleAttenuationValue1; + } + else + { + angleAttenuationValue1 = 0; + angleAttenuationValue2 = 1; + } + return new PunctualLight() { Position = desc.Transform.GetPosition(), Direction = GetLightDirection(desc), Intensity = desc.LinearLightColor, - CosAngle = Mathf.Cos(desc.SpotAngle / 360.0f * 2.0f * Mathf.PI * 0.5f) + CosOuterAngle = cosOuterAngle, + AngleAttenuationValue1 = angleAttenuationValue1, + AngleAttenuationValue2 = angleAttenuationValue2, + Range = desc.Range }; } @@ -189,7 +213,8 @@ static PunctualLight ConvertPointLight(LightDescriptor desc) Position = desc.Transform.GetPosition(), Direction = Vector3.up, // doesn't matter Intensity = desc.LinearLightColor, - CosAngle = -1.0f // cos(pi) = -1 + CosOuterAngle = -1.0f, // cos(pi) = -1 + Range = desc.Range }; } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs index 006660bd47a..3280f26fd14 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs @@ -1386,7 +1386,7 @@ internal static SurfaceCacheWorld.LightDescriptor[] ConvertUnityLightsToLightDes descriptor.LinearLightColor *= Mathf.PI; descriptor.Transform = light.transform.localToWorldMatrix; descriptor.ColorTemperature = light.colorTemperature; - descriptor.SpotAngle = light.spotAngle; + descriptor.OuterSpotAngle = light.spotAngle; descriptor.InnerSpotAngle = light.innerSpotAngle; descriptor.Range = light.range; } From 48d2c37b96d8cc326c6ed8231ff9d38a3a9854c8 Mon Sep 17 00:00:00 2001 From: Cian Noonan Date: Sat, 7 Mar 2026 03:57:37 +0000 Subject: [PATCH 55/95] Improve VolumeProfile inspector performance --- .../Editor/Volume/VolumeComponentEditor.cs | 9 ++++--- .../Volume/VolumeComponentListEditor.cs | 26 ++++++++++++++++--- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs b/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs index e003810517d..faf442d8768 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs @@ -428,6 +428,7 @@ public override void OnInspectorGUI() } } + GUIContent m_DisplayTitle; /// /// Sets the label for the component header. Override this method to provide /// a custom label. If you don't, Unity automatically obtains one from the class name. @@ -435,17 +436,19 @@ public override void OnInspectorGUI() /// A label to display in the component header. public virtual GUIContent GetDisplayTitle() { + if (m_DisplayTitle != null) return m_DisplayTitle; + var volumeComponentType = volumeComponent.GetType(); var displayInfo = volumeComponentType.GetCustomAttribute(); if (displayInfo != null && !string.IsNullOrWhiteSpace(displayInfo.name)) - return EditorGUIUtility.TrTextContent(displayInfo.name, string.Empty); + return m_DisplayTitle = EditorGUIUtility.TrTextContent(displayInfo.name, string.Empty); #pragma warning disable CS0618 if (!string.IsNullOrWhiteSpace(volumeComponent.displayName)) - return EditorGUIUtility.TrTextContent(volumeComponent.displayName, string.Empty); + return m_DisplayTitle = EditorGUIUtility.TrTextContent(volumeComponent.displayName, string.Empty); #pragma warning restore CS0618 - return EditorGUIUtility.TrTextContent(ObjectNames.NicifyVariableName(volumeComponentType.Name) , string.Empty); + return m_DisplayTitle = EditorGUIUtility.TrTextContent(ObjectNames.NicifyVariableName(volumeComponentType.Name), string.Empty); } void AddToggleState(GUIContent content, bool state) diff --git a/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs b/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs index 8dafa09cd61..06e40d35659 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs @@ -155,6 +155,8 @@ void CreateEditor(VolumeComponent component, SerializedProperty property, int in else m_Editors[index] = editor; + FilterEditorsBySearch(); + DocumentationUtils.TryGetHelpURL(component.GetType(), out string helpUrl); helpUrl ??= string.Empty; m_VolumeComponentHelpUrls[editor] = helpUrl; @@ -222,9 +224,22 @@ public void Clear() asset = null; } + readonly HashSet m_CurrentSearchFilteredEditors = new(); + void FilterEditorsBySearch() + { + m_CurrentSearchFilteredEditors.Clear(); + if (string.IsNullOrEmpty(m_SearchString)) return; + + foreach (var editor in m_Editors) + { + if (MatchesSearchString(editor.GetDisplayTitle().text)) + m_CurrentSearchFilteredEditors.Add(editor); + } + } + bool EditorIsIncludedInCurrentSearch(VolumeComponentEditor editor) => string.IsNullOrEmpty(m_SearchString) || m_CurrentSearchFilteredEditors.Contains(editor); bool MatchesSearchString(string title) { - return m_SearchString.Length == 0 || title.Contains(m_SearchString, StringComparison.OrdinalIgnoreCase); + return string.IsNullOrEmpty(m_SearchString) || title.Contains(m_SearchString, StringComparison.OrdinalIgnoreCase); } /// @@ -263,7 +278,7 @@ bool ShouldDrawEditor(VolumeComponentEditor editor) { if (!editor.visible) return false; - return MatchesSearchString(editor.GetDisplayTitle().text); + return EditorIsIncludedInCurrentSearch(editor); } void DrawEditor(VolumeComponentEditor editor, int index = -1) @@ -310,7 +325,11 @@ void DrawEditor(VolumeComponentEditor editor, int index = -1) { Rect searchRect = GUILayoutUtility.GetRect(50, EditorGUIUtility.singleLineHeight); searchRect.width -= 2; - m_SearchString = m_SearchField.OnGUI(searchRect, m_SearchString); + using (var check = new EditorGUI.ChangeCheckScope()) + { + m_SearchString = m_SearchField.OnGUI(searchRect, m_SearchString); + if (check.changed) FilterEditorsBySearch(); + } GUILayout.Space(2); EditorGUILayout.HelpBox( @@ -346,7 +365,6 @@ void DrawEditor(VolumeComponentEditor editor, int index = -1) for (int i = 0; i < editors.Count; i++) DrawEditor(editors[i]); - GUILayout.Space(8); } } From 18ece0dbd8d39c668b2572b7f0a116c7338b8064 Mon Sep 17 00:00:00 2001 From: Yvain Raeymaekers Date: Sat, 7 Mar 2026 03:57:38 +0000 Subject: [PATCH 56/95] [SurfaceCacheGI] Fix static batching assert condition changed by mistake when adding a message to it (PR #96151) --- .../SurfaceCacheGIRendererFeature.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs index 3280f26fd14..27a806ce095 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/SurfaceCacheGIRendererFeature/SurfaceCacheGIRendererFeature.cs @@ -1032,8 +1032,8 @@ private static void UpdateMeshRenderers( foreach (var meshRenderer in addedMeshRenderers) { - Debug.Assert(meshRenderer.isPartOfStaticBatch, "Static Batching is not supported by Surface Cache GI."); - + Debug.Assert(!meshRenderer.isPartOfStaticBatch, "Static Batching is not supported by Surface Cache GI."); + var mesh = meshRenderer.GetComponent().sharedMesh; if (mesh == null || mesh.vertexCount == 0) From d7aac9079b01e754d3a998c168bde179e7e978b6 Mon Sep 17 00:00:00 2001 From: Kasper Storm Engelstoft Date: Mon, 9 Mar 2026 15:54:27 +0000 Subject: [PATCH 57/95] Support texture filtermode for albedo and emission in unified baker --- .../Editor/PathTracing/BakeInputSerialization.cs | 6 +++++- .../Editor/PathTracing/BakeInputToWorldConversion.cs | 12 ++++++++++++ .../Runtime/PathTracing/MaterialPool/MaterialPool.cs | 12 +++++++++++- .../PathTracing/MaterialPool/MaterialPool.hlsl | 6 ++++-- .../Runtime/PathTracing/Shaders/LightSampling.hlsl | 3 ++- 5 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputSerialization.cs b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputSerialization.cs index 0d0adc7a101..cb1340dc443 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputSerialization.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputSerialization.cs @@ -913,7 +913,9 @@ internal struct BakeInput : IBakeInputVisitable public UInt32[] instanceToTextureDataIndex; // Index into albedoData and emissiveData for each instance public Int32[] materialToTransmissionDataIndex; // Index into transmissionData and transmissionDataProperties for each material public TextureData[] albedoData; + public TextureProperties[] albedoDataProperties; // Same size as albedoData public TextureData[] emissiveData; + public TextureProperties[] emissiveDataProperties; // Same size as emissiveData public TextureData[] transmissionData; // Same size as transmissionDataProperties public TextureProperties[] transmissionDataProperties; // Same size as transmissionData // Cookie data @@ -934,7 +936,9 @@ public void Transfer(IBakeInputVisitor visitor) visitor.TransferBlittableArray(ref instanceToTextureDataIndex); visitor.TransferBlittableArray(ref materialToTransmissionDataIndex); visitor.TransferArray(ref albedoData); + visitor.TransferArray(ref albedoDataProperties); visitor.TransferArray(ref emissiveData); + visitor.TransferArray(ref emissiveDataProperties); visitor.TransferArray(ref transmissionData); visitor.TransferArray(ref transmissionDataProperties); visitor.TransferArray(ref cookieData); @@ -947,7 +951,7 @@ internal static class BakeInputSerialization { // Should match BakeInputSerialization::kCurrentFileVersion in BakeInputSerialization.h. // If these are out of sync, the implementation in this file probably needs to be updated. - const UInt64 CurrentFileVersion = 202601301; + const UInt64 CurrentFileVersion = 202603061; public static bool Deserialize(string path, out BakeInput bakeInput) { diff --git a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs index a3c4ecffb0d..90586c42c6c 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs @@ -269,15 +269,27 @@ internal static void InjectMaterials( // Create albedo and emission textures from materials var perTexturePairMaterials = new MaterialPool.MaterialDescriptor[bakeInput.albedoData.Length]; Debug.Assert(bakeInput.albedoData.Length == bakeInput.emissiveData.Length); + Debug.Assert(bakeInput.albedoData.Length == bakeInput.albedoDataProperties.Length); + Debug.Assert(bakeInput.emissiveData.Length == bakeInput.emissiveDataProperties.Length); for (int i = 0; i < bakeInput.albedoData.Length; i++) { ref var material = ref perTexturePairMaterials[i]; var baseTexture = CreateTexture2DFromTextureData(in bakeInput.albedoData[i], $"World (albedo) {i}"); + ref readonly TextureProperties albedoProperties = ref bakeInput.albedoDataProperties[i]; + baseTexture.wrapModeU = albedoProperties.wrapModeU; + baseTexture.wrapModeV = albedoProperties.wrapModeV; + baseTexture.filterMode = albedoProperties.filterMode; allocatedObjects.Add(baseTexture); var emissiveTexture = CreateTexture2DFromTextureData(in bakeInput.emissiveData[i], $"World (emissive) {i}"); + ref readonly TextureProperties emissiveProperties = ref bakeInput.emissiveDataProperties[i]; + emissiveTexture.wrapModeU = emissiveProperties.wrapModeU; + emissiveTexture.wrapModeV = emissiveProperties.wrapModeV; + emissiveTexture.filterMode = emissiveProperties.filterMode; allocatedObjects.Add(emissiveTexture); material.Albedo = baseTexture; material.Emission = emissiveTexture; + material.PointSampleAlbedo = albedoProperties.filterMode == FilterMode.Point; + material.PointSampleEmission = emissiveProperties.filterMode == FilterMode.Point; // Only mark emissive if it isn't the default black texture bool isEmissiveSinglePixel = bakeInput.emissiveData[i].data.Length == 1; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/MaterialPool/MaterialPool.cs b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/MaterialPool/MaterialPool.cs index c3ce9111f17..83f940d18c6 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/MaterialPool/MaterialPool.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/MaterialPool/MaterialPool.cs @@ -38,6 +38,8 @@ internal struct MaterialDescriptor public bool DoubleSidedGI; public bool PointSampleTransmission; + public bool PointSampleAlbedo; + public bool PointSampleEmission; } [Flags] @@ -47,6 +49,8 @@ private enum MaterialFlags : uint IsTransmissive = 1 << 0, DoubleSidedGI = 1 << 1, PointSampleTransmission = 1 << 2, + PointSampleAlbedo = 1 << 3, + PointSampleEmission = 1 << 4, } private struct GpuMaterialEntry @@ -83,6 +87,8 @@ public MaterialEntry(BlockAllocator.Allocation indexInBufferAlloc) public bool DoubleSidedGI; public bool IsTransmissive; public bool PointSampleTransmission; + public bool PointSampleAlbedo; + public bool PointSampleEmission; }; private readonly Dictionary _materialMap = new(); @@ -275,6 +281,8 @@ private void UpdateMaterial(in MaterialDescriptor material, UVChannel albedoAndE materialEntry.DoubleSidedGI = material.DoubleSidedGI; materialEntry.IsTransmissive = material.TransmissionChannels != TransmissionChannels.None; materialEntry.PointSampleTransmission = material.PointSampleTransmission; + materialEntry.PointSampleAlbedo = material.PointSampleAlbedo; + materialEntry.PointSampleEmission = material.PointSampleEmission; var emissionType = material.EmissionType; if (emissionType == MaterialPropertyType.Texture) @@ -326,7 +334,9 @@ private void UpdateMaterialList(MaterialEntry entry) AlbedoAndEmissionUVChannel = entry.AlbedoAndEmissionUVChannel, Flags = (entry.IsTransmissive ? MaterialFlags.IsTransmissive : MaterialFlags.None) | (entry.DoubleSidedGI ? MaterialFlags.DoubleSidedGI : MaterialFlags.None) | - (entry.PointSampleTransmission ? MaterialFlags.PointSampleTransmission : MaterialFlags.None), + (entry.PointSampleTransmission ? MaterialFlags.PointSampleTransmission : MaterialFlags.None) | + (entry.PointSampleAlbedo ? MaterialFlags.PointSampleAlbedo : MaterialFlags.None) | + (entry.PointSampleEmission ? MaterialFlags.PointSampleEmission : MaterialFlags.None), }; if (entry.AlbedoTextureLocation.IsValid) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/MaterialPool/MaterialPool.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/MaterialPool/MaterialPool.hlsl index 5f54b8e5dd5..a7d9bd814b2 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/MaterialPool/MaterialPool.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/MaterialPool/MaterialPool.hlsl @@ -77,7 +77,8 @@ namespace MaterialPool if (matEntry.albedoTextureIndex != -1) { float2 textureUV = matEntry.albedoAndEmissionUVChannel == 1 ? uv1 : uv0; - float4 texColor = SampleAtlas(albedoTextures, albedoSamplerState, atlasTexelSize, matEntry.albedoTextureIndex, textureUV, matEntry.albedoScale, matEntry.albedoOffset, false); + bool pointSampleAlbedo = (matEntry.flags & 8) != 0; + float4 texColor = SampleAtlas(albedoTextures, albedoSamplerState, atlasTexelSize, matEntry.albedoTextureIndex, textureUV, matEntry.albedoScale, matEntry.albedoOffset, pointSampleAlbedo); material.baseColor = texColor.rgb; // apply albedo boost, but still keep the reflectance at maximum 100% material.baseColor = min(albedoBoost * material.baseColor, float3(1.0, 1.0, 1.0)); @@ -87,7 +88,8 @@ namespace MaterialPool if (matEntry.emissionTextureIndex != -1) { float2 textureUV = matEntry.albedoAndEmissionUVChannel == 1 ? uv1 : uv0; - material.emissive = SampleAtlas(emissionTextures, emissionSamplerState, atlasTexelSize, matEntry.emissionTextureIndex, textureUV, matEntry.emissionScale, matEntry.emissionOffset, false).rgb; + bool pointSampleEmission = (matEntry.flags & 16) != 0; + material.emissive = SampleAtlas(emissionTextures, emissionSamplerState, atlasTexelSize, matEntry.emissionTextureIndex, textureUV, matEntry.emissionScale, matEntry.emissionOffset, pointSampleEmission).rgb; } else { diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightSampling.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightSampling.hlsl index 01150c50a32..b78e6b2a702 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightSampling.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/PathTracing/Shaders/LightSampling.hlsl @@ -752,7 +752,8 @@ float3 GetEmissiveMeshEmission(LightShapeSample lightSample) float3 emission = 0; if (matInfo.emissionTextureIndex != -1) { - emission = SampleAtlas(g_EmissionTextures, sampler_g_EmissionTextures, matInfo.emissionTextureIndex, lightSample.uv, matInfo.emissionScale, matInfo.emissionOffset, false).rgb; + bool pointSampleEmission = (matInfo.flags & 16) != 0; + emission = SampleAtlas(g_EmissionTextures, sampler_g_EmissionTextures, matInfo.emissionTextureIndex, lightSample.uv, matInfo.emissionScale, matInfo.emissionOffset, pointSampleEmission).rgb; } else { From 5ede923dd4ca3007302ef0a0d91c39d47ce774d5 Mon Sep 17 00:00:00 2001 From: Guillaume Levasseur Date: Mon, 9 Mar 2026 15:54:31 +0000 Subject: [PATCH 58/95] Prevent test resolution inconsistencies --- .../Scripts/Runtime/UniversalGraphicsTestBase.cs | 3 +++ .../Assets/Tests/HDRP_DXR_Graphics_Tests.cs | 11 +++++++++-- .../Assets/Tests/HDRP_Runtime_Graphics_Tests.cs | 10 ++++++++-- .../GraphicTests/Tests/HDRP_Graphics_Tests.cs | 14 +++++++++++--- 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Tests/SRPTests/Packages/com.unity.testing.urp/Scripts/Runtime/UniversalGraphicsTestBase.cs b/Tests/SRPTests/Packages/com.unity.testing.urp/Scripts/Runtime/UniversalGraphicsTestBase.cs index a6a8590eb5b..06183d2f119 100644 --- a/Tests/SRPTests/Packages/com.unity.testing.urp/Scripts/Runtime/UniversalGraphicsTestBase.cs +++ b/Tests/SRPTests/Packages/com.unity.testing.urp/Scripts/Runtime/UniversalGraphicsTestBase.cs @@ -57,6 +57,9 @@ public void OneTimeSetUp() [UnityOneTimeSetUp] public IEnumerator OneTimeSetup() { + // Necessary because of inconsistencies on some platforms + yield return GlobalResolutionSetter.SetResolutionWithRetry(1920, 1080, true); + yield return TestContentLoader.WaitForContentLoadAsync(TimeSpan.FromSeconds(240)); } diff --git a/Tests/SRPTests/Projects/HDRP_DXR_Tests/Assets/Tests/HDRP_DXR_Graphics_Tests.cs b/Tests/SRPTests/Projects/HDRP_DXR_Tests/Assets/Tests/HDRP_DXR_Graphics_Tests.cs index 858aa5b31ea..77f329c1d7d 100644 --- a/Tests/SRPTests/Projects/HDRP_DXR_Tests/Assets/Tests/HDRP_DXR_Graphics_Tests.cs +++ b/Tests/SRPTests/Projects/HDRP_DXR_Tests/Assets/Tests/HDRP_DXR_Graphics_Tests.cs @@ -116,15 +116,22 @@ public IEnumerator Run(SceneGraphicsTestCase testCase) [OneTimeSetUp] public void OneTimeSetUp() - { - // Standard resolution for backbuffer capture is 1080p + { Screen.SetResolution(1920, 1080, true); + // Standard resolution for backbuffer capture is 1080p #if UNITY_EDITOR GameViewSize.SetGameViewSize(1920, 1080); #endif } + [UnityOneTimeSetUp] + public IEnumerable UnityOneTimeSetUp() + { + // Some platforms seem to require setting the resolution after play mode, otherwise resolution is not consistently set. + yield return GlobalResolutionSetter.SetResolutionWithRetry(1920, 1080, true); + } + #if UNITY_EDITOR public void Setup() diff --git a/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Tests/HDRP_Runtime_Graphics_Tests.cs b/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Tests/HDRP_Runtime_Graphics_Tests.cs index a8e906fa010..316a1350247 100644 --- a/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Tests/HDRP_Runtime_Graphics_Tests.cs +++ b/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Tests/HDRP_Runtime_Graphics_Tests.cs @@ -20,14 +20,20 @@ public class HDRP_Runtime_Graphics_Tests [OneTimeSetUp] public void SetDefaultResolution() { - // Standard resolution for backbuffer capture is 1080p Screen.SetResolution(1920, 1080, true); - + // Standard resolution for backbuffer capture is 1080p #if UNITY_EDITOR GameViewSize.SetGameViewSize(1920, 1080); #endif } + [UnityOneTimeSetUp] + public IEnumerable UnityOneTimeSetUp() + { + // Required because of resolution inconsistencies on some platforms + yield return GlobalResolutionSetter.SetResolutionWithRetry(1920, 1080, true); + } + [UnityTest] [SceneGraphicsTest(@"Assets/Scenes/^[0-9]+")] [Timeout(450 * 1000)] // Set timeout to 450 sec. to handle complex scenes with many shaders (previous timeout was 300s) diff --git a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Tests/HDRP_Graphics_Tests.cs b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Tests/HDRP_Graphics_Tests.cs index 0760b8f8031..383f060bded 100644 --- a/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Tests/HDRP_Graphics_Tests.cs +++ b/Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Tests/HDRP_Graphics_Tests.cs @@ -57,16 +57,24 @@ public HDRP_Graphics_Tests(GpuResidentDrawerContext grdContext) [OneTimeSetUp] public void OneTimeSetUp() - { - // Standard resolution for backbuffer capture is 1080p - Screen.SetResolution(1920, 1080, true); + { SceneManager.LoadScene("GraphicsTestTransitionScene", LoadSceneMode.Single); + // Standard resolution for backbuffer capture is 1080p + Screen.SetResolution(1920, 1080, true); + #if UNITY_EDITOR GameViewSize.SetGameViewSize(1920, 1080); #endif } + [UnityOneTimeSetUp] + public IEnumerable UnityOneTimeSetUp() + { + // Required to fix inconsistencies on some platforms + yield return GlobalResolutionSetter.SetResolutionWithRetry(1920, 1080, true); + } + [SetUp] public void SetUpContext() { From e20af431e735265ea790ee402e36d29d10050995 Mon Sep 17 00:00:00 2001 From: Cal Chiu Date: Mon, 9 Mar 2026 15:54:35 +0000 Subject: [PATCH 59/95] [UUM-135718] Fixed HDRP wizard button label alignment --- .../Editor/Wizard/USS/Wizard.uss | 1 + 1 file changed, 1 insertion(+) diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Wizard/USS/Wizard.uss b/Packages/com.unity.render-pipelines.high-definition/Editor/Wizard/USS/Wizard.uss index 438cada5109..ef1e2917d8d 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Wizard/USS/Wizard.uss +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Wizard/USS/Wizard.uss @@ -142,6 +142,7 @@ #WizardCheckbox { + margin-top: 4px; overflow: hidden; } From ca2f5338d26972d1e55e49a4fcc4117c8d6d1c58 Mon Sep 17 00:00:00 2001 From: Fatimah Mohd Fauzi Date: Tue, 10 Mar 2026 09:24:45 +0000 Subject: [PATCH 60/95] DOCG-8437 Add BIRP deprecation notices to the relevant core package pages --- .../Documentation~/Branch-On-Input-Connection-Node.md | 4 ---- .../Calculate-Level-Of-Detail-Texture-2D-Node.md | 4 +--- .../Documentation~/Custom-Function-Node.md | 2 ++ .../Documentation~/Custom-Interpolators.md | 2 ++ .../com.unity.shadergraph/Documentation~/Dropdown-Node.md | 4 ---- .../Documentation~/Gather-Texture-2D-Node.md | 4 +--- .../Documentation~/Graph-Settings-Tab.md | 2 ++ Packages/com.unity.shadergraph/Documentation~/Graph-Target.md | 2 ++ .../Documentation~/Sample-Texture-2D-Array-Node.md | 4 +--- .../Documentation~/Sample-Texture-2D-Node.md | 4 +--- .../Documentation~/Sample-Texture-3D-Node.md | 4 +--- .../Documentation~/Shader-Graph-Sample-Feature-Examples.md | 2 ++ .../Documentation~/Transformation-Matrix-Node.md | 1 + .../Documentation~/install-shader-graph.md | 2 ++ .../Documentation~/snippets/birp-deprecation-message.md | 3 +++ .../com.unity.shadergraph/Documentation~/surface-options.md | 2 ++ 16 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 Packages/com.unity.shadergraph/Documentation~/snippets/birp-deprecation-message.md diff --git a/Packages/com.unity.shadergraph/Documentation~/Branch-On-Input-Connection-Node.md b/Packages/com.unity.shadergraph/Documentation~/Branch-On-Input-Connection-Node.md index a4091e64296..90e1c4a2d16 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Branch-On-Input-Connection-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Branch-On-Input-Connection-Node.md @@ -6,10 +6,6 @@ For more information, refer to [Set default inputs for a Sub Graph](Sub-Graph-De The node generates branching HLSL source code, but during compilation Unity optimizes the branch out of your shader. -## Compatibility - -The Branch On Input Connection [!include[nodes-compatibility-all](./snippets/nodes-compatibility-all.md)] - You can only use a Branch on Input Connection node in a [Sub Graph](Sub-graphs.md). ## Inputs diff --git a/Packages/com.unity.shadergraph/Documentation~/Calculate-Level-Of-Detail-Texture-2D-Node.md b/Packages/com.unity.shadergraph/Documentation~/Calculate-Level-Of-Detail-Texture-2D-Node.md index 313e7481c60..b9f844708d1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Calculate-Level-Of-Detail-Texture-2D-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Calculate-Level-Of-Detail-Texture-2D-Node.md @@ -19,9 +19,7 @@ For example, a Texture might only have 3 mips: a 64×64 mip, a 32×32 mip, and a The Calculate Level of Detail Texture 2D node is under the **Input** > **Texture** category in the Create Node menu. -## Compatibility - -The Calculate Level of Detail Texture 2D [!include[nodes-compatibility-all](./snippets/nodes-compatibility-all.md)] +## Limitations The Calculate Level of Detail Texture 2D [!include[nodes-fragment-only](./snippets/nodes-fragment-only.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Function-Node.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Function-Node.md index 909746678c6..38580a49ede 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Custom-Function-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Function-Node.md @@ -165,6 +165,8 @@ However, be aware of the following: * The Shader Graph node and main previews can't access Unity's Render Pipeline libraries in the Editor. This generates compile errors in the Editor even though the shader works correctly in your project. To prevent this issue, you have to isolate the code with an `#ifdef SHADERGRAPH_PREVIEW` condition and also define default values for the variables in the Shader Graph preview context. * The code in libraries might change over time from one Unity version to another. You need to make sure to regularly test and update your custom functions in your projects. +[!include[birp-deprecation-message](snippets/birp-deprecation-message.md)] + Here is an example with URP library function calls and the above-mentioned conditional protections set up: ``` diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators.md index 507a3921bfb..7712e282b53 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators.md +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators.md @@ -9,6 +9,8 @@ There are two target audiences for custom interpolators: **Note:** If you use the Built-In Render Pipeline, refer to [Input vertex data into a shader](https://docs.unity3d.com/Manual/SL-VertexProgramInputs.html) instead. +[!include[birp-deprecation-message](snippets/birp-deprecation-message.md)] + ## Supported data types Custom interpolators support float, vector 2, vector 3, and vector 4 types. diff --git a/Packages/com.unity.shadergraph/Documentation~/Dropdown-Node.md b/Packages/com.unity.shadergraph/Documentation~/Dropdown-Node.md index 4cb0a75b264..673a8da0249 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Dropdown-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Dropdown-Node.md @@ -31,10 +31,6 @@ To add a Subgraph Dropdown node to a Subgraph: ![An image of the Graph window, that displays a Dropdown node in the Graph Editor. The Dropdown property is selected in the Blackboard and the Graph Inspector shows the available options for configuring the Dropdown property.](images/sg-subgraph-dropdown-node.png) -## Compatibility - -The Subgraph Dropdown [!include[nodes-compatibility-all](./snippets/nodes-compatibility-all.md)] - ## Ports > [!NOTE] diff --git a/Packages/com.unity.shadergraph/Documentation~/Gather-Texture-2D-Node.md b/Packages/com.unity.shadergraph/Documentation~/Gather-Texture-2D-Node.md index 1861ccd516e..f77bf8dca0b 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Gather-Texture-2D-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Gather-Texture-2D-Node.md @@ -19,9 +19,7 @@ The pixels that the Gather Texture 2D samples are always from the top mip level The Gather Texture 2D node is under the **Input** > **Texture** category in the Create Node menu. -## Compatibility - -The Gather Texture 2D [!include[nodes-compatibility-all](./snippets/nodes-compatibility-all.md)] +## Limitations The Gather Texture 2D [!include[nodes-fragment-only](./snippets/nodes-fragment-only.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Graph-Settings-Tab.md b/Packages/com.unity.shadergraph/Documentation~/Graph-Settings-Tab.md index 86443d00ade..dd6e7f15457 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Graph-Settings-Tab.md +++ b/Packages/com.unity.shadergraph/Documentation~/Graph-Settings-Tab.md @@ -23,6 +23,8 @@ Shader Graph supports the following target types: * **Universal**: Shaders for the [Universal Render Pipeline (URP)](xref:um-universal-render-pipeline), available only if your project uses URP. * **HDRP**: Shaders for the [High Definition Render Pipeline (HDRP)](xref:high-definition-render-pipeline), available only if your project uses HDRP. +[!include[birp-deprecation-message](snippets/birp-deprecation-message.md)] + ### Target properties Each graph target added in the list of **Active Targets** has its own set of properties. diff --git a/Packages/com.unity.shadergraph/Documentation~/Graph-Target.md b/Packages/com.unity.shadergraph/Documentation~/Graph-Target.md index d843d493b6f..5fa2cf26467 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Graph-Target.md +++ b/Packages/com.unity.shadergraph/Documentation~/Graph-Target.md @@ -10,6 +10,8 @@ Typically, each Target you select generates a valid subshader from the graph. Fo Shader Graph supports three targets: the [Universal Render Pipeline](https://docs.unity3d.com/Manual/urp/urp-introduction.html), the [High Definition Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/), and the [Built-In Render Pipeline](https://docs.unity3d.com/Documentation/Manual/built-in-render-pipeline.html). +[!include[birp-deprecation-message](snippets/birp-deprecation-message.md)] + Not all blocks are compatible with all targets. If a block in your graph becomes inactive when you choose a target, that block is not compatible with that target. The visual results of a graph are not the same in all render pipelines. This is because of the technical differences between URP, Built-In, and HDRP. diff --git a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Array-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Array-Node.md index 7551dc32f7e..252e045e532 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Array-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Array-Node.md @@ -12,9 +12,7 @@ For more information about Texture 2D Arrays, see [Texture Arrays](https://docs. The Sample Texture 2D Array node is under the **Input** > **Texture** category in the Create Node menu. -## Compatibility - -The Sample Texture 3D [!include[nodes-compatibility-all](./snippets/nodes-compatibility-all.md)] +## Limitations [!include[nodes-sample-fragment-lod](./snippets/sample-nodes/nodes-sample-fragment-lod.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Node.md index f07eee8dea4..cf1225c6931 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Node.md @@ -12,9 +12,7 @@ A Sample Texture 2D node can also sample a normal map. For more information, ref The Sample Texture 2D node is under the **Input** > **Texture** category in the Create Node menu. -## Compatibility - -The Sample Texture 2D [!include[nodes-compatibility-all](./snippets/nodes-compatibility-all.md)] +## Limitations [!include[nodes-sample-fragment-lod](./snippets/sample-nodes/nodes-sample-fragment-lod.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-3D-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-3D-Node.md index ef4fc4c031f..b54d4f2a934 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-3D-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-3D-Node.md @@ -12,9 +12,7 @@ For more information about Texture 3D assets, refer to [3D textures](https://doc The Sample Texture 2D node is under the **Input** > **Texture** category in the Create Node menu. -## Compatibility - -The Sample Texture 3D [!include[nodes-compatibility-all](./snippets/nodes-compatibility-all.md)] +## Limitations [!include[nodes-sample-fragment-lod](./snippets/sample-nodes/nodes-sample-fragment-lod.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Sample-Feature-Examples.md b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Sample-Feature-Examples.md index 22acfdf41d5..3d55aace82f 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Sample-Feature-Examples.md +++ b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Sample-Feature-Examples.md @@ -241,6 +241,8 @@ This section illustrates two ways to branch your shader. #### Branch On Render Pipeline Shader Graph allows you to create shaders that can be used in multiple render pipelines- Built-In, URP, and HDRP. This can be done by opening the shader in Shader Graph and adding the targets for all of the pipelines you want the shader to support in the Active Targets section under Graph Settings in the Graph Inspector window. +[!include[birp-deprecation-message](snippets/birp-deprecation-message.md)] + When supporting multiple render pipelines, it’s occasionally necessary to do different things in the graph depending on which pipeline is being used. In order to do that, you need to branch the shader based on the active render pipeline. There isn’t an official node in Shader Graph for performing that branching operation, but it is possible to create a subgraph that contains a Custom Function node that does the branch. In this example, we use that Branch On RP to create a different outcome depending which render pipeline is active. In our simple example, we just make the cube a different color - green for URP, blue for HDRP, and yellow for the Built-In render pipeline - but you can do much more complex operations that are specific to each render pipeline using this same technique. diff --git a/Packages/com.unity.shadergraph/Documentation~/Transformation-Matrix-Node.md b/Packages/com.unity.shadergraph/Documentation~/Transformation-Matrix-Node.md index 6031cfed947..fc69c20004f 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Transformation-Matrix-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Transformation-Matrix-Node.md @@ -6,6 +6,7 @@ Defines a constant **Matrix 4x4** value for a common **Transformation Matrix** i Two output value options for this node, **Inverse Projection** and **Inverse View Projection**, are not compatible with the Built-In Render Pipeline target. When you choose either of these options and target the Built-In Render Pipeline, this node produces an entirely black result. +[!include[birp-deprecation-message](snippets/birp-deprecation-message.md)] ## Ports diff --git a/Packages/com.unity.shadergraph/Documentation~/install-shader-graph.md b/Packages/com.unity.shadergraph/Documentation~/install-shader-graph.md index fabdd054ab7..6a4ff4a7ef6 100644 --- a/Packages/com.unity.shadergraph/Documentation~/install-shader-graph.md +++ b/Packages/com.unity.shadergraph/Documentation~/install-shader-graph.md @@ -11,6 +11,8 @@ Use Shader Graph with either of the Scriptable Render Pipelines (SRPs) available As of Unity version 2021.2, you can also use Shader Graph with the [Built-In Render Pipeline](https://docs.unity3d.com/Documentation/Manual/built-in-render-pipeline.html). +[!include[birp-deprecation-message](snippets/birp-deprecation-message.md)] + > [!NOTE] > - Shader Graph support for the Built-In Render Pipeline is for compatibility purposes only. Shader Graph doesn't receive updates for Built-In Render Pipeline support, aside from bug fixes for existing features. It's recommended to use Shader Graph with the Scriptable Render Pipelines. > - In the Built-In Render Pipeline, Shader Graph doesn't support XR. diff --git a/Packages/com.unity.shadergraph/Documentation~/snippets/birp-deprecation-message.md b/Packages/com.unity.shadergraph/Documentation~/snippets/birp-deprecation-message.md new file mode 100644 index 00000000000..43add6ecaae --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/snippets/birp-deprecation-message.md @@ -0,0 +1,3 @@ +> [!IMPORTANT] +> The Built-In Render Pipeline is deprecated and will be made obsolete in a future release.
It remains supported, including bug fixes and maintenance, through the full Unity 6.7 LTS lifecycle.
For more information on migration, refer to [Migrating from the Built-In Render Pipeline to URP](https://docs.unity3d.com/6000.5/Documentation/Manual/urp/upgrading-from-birp.html) and [Render pipeline feature comparison](https://docs.unity3d.com/6000.5/Documentation/Manual/render-pipelines-feature-comparison.html). + diff --git a/Packages/com.unity.shadergraph/Documentation~/surface-options.md b/Packages/com.unity.shadergraph/Documentation~/surface-options.md index 6c668cef842..19564a60656 100644 --- a/Packages/com.unity.shadergraph/Documentation~/surface-options.md +++ b/Packages/com.unity.shadergraph/Documentation~/surface-options.md @@ -4,6 +4,8 @@ Enable **Allow Material Override** to modify a specific set of properties for Universal Render Pipeline Lit and Unlit Shader Graphs and for Built-In Render Pipeline Shader Graphs in the Material Inspector. +[!include[birp-deprecation-message](snippets/birp-deprecation-message.md)] + | Property | Behavior | | :--- | :--- | | **Workflow Mode** | Refer to the URP documentation for the [Lit URP](https://docs.unity3d.com/Manual/urp/lit-shader) Shader.
**Note**: Not applicable to URP Unlit and the Built-In Render Pipeline. | From 2a3418e81fb60111b660928ee708f23416d143bd Mon Sep 17 00:00:00 2001 From: Aljosha Demeulemeester Date: Tue, 10 Mar 2026 09:24:47 +0000 Subject: [PATCH 61/95] Improve UI/UX of Renderer Features with the Tile-Only Mode and bugfixes --- .../Compiler/NativePassCompiler.cs | 2 +- .../FullScreenPassRendererFeatureEditor.cs | 46 ++++++++++-- .../OnTilePostProcessFeatureEditor.cs | 17 +++-- .../ScreenSpaceAmbientOcclusionEditor.cs | 21 +++++- .../Editor/ScriptableRendererDataEditor.cs | 15 ++++ .../Passes/ScreenSpaceAmbientOcclusionPass.cs | 44 ++---------- .../Runtime/PostProcessUtils.cs | 19 +++++ .../FullScreenPassRendererFeature.cs | 19 +++++ .../RendererFeatures/OnTilePostProcessPass.cs | 25 ++++--- .../ScreenSpaceAmbientOcclusion.cs | 45 +++++++++++- .../RendererFeatures/ScreenSpaceShadows.cs | 63 ++++++++++++++-- .../Runtime/RenderingUtils.cs | 72 ++++++++++++++++++- .../Runtime/ScriptableRenderer.cs | 2 + .../Runtime/UniversalRenderer.cs | 1 + 14 files changed, 318 insertions(+), 73 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.cs index f7aed503c56..7a2f498a412 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.cs @@ -1130,7 +1130,7 @@ void PropagateTextureUVOrigin() var firstStoreAttachmentName = graph.m_ResourcesForDebugOnly.GetRenderGraphResourceName(firstStoreNativePassAttachment.handle); var name = graph.m_ResourcesForDebugOnly.GetRenderGraphResourceName(nativePassAttachment.handle); - throw new InvalidOperationException($"From pass '{contextData.passNames[nativePassData.firstGraphPass]}' to pass '{contextData.passNames[nativePassData.lastGraphPass]}' when trying to store resource '{name}' of type {nativePassAttachment.handle.type} at index {nativePassAttachment.handle.index} - " + throw new InvalidOperationException($"From pass '{contextData.GetPassName(nativePassData.firstGraphPass)}' to pass '{contextData.GetPassName(nativePassData.lastGraphPass)}' when trying to store resource '{name}' of type {nativePassAttachment.handle.type} at index {nativePassAttachment.handle.index} - " + RenderGraph.RenderGraphExceptionMessages.IncompatibleTextureUVOriginStore(firstStoreAttachmentName, storeUVOrigin, name, resData.textureUVOrigin)); } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/FullScreenPassRendererFeatureEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/FullScreenPassRendererFeatureEditor.cs index 7430d138af3..a1d0867d464 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/FullScreenPassRendererFeatureEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/FullScreenPassRendererFeatureEditor.cs @@ -2,8 +2,8 @@ using UnityEditor.RenderPipelines.Core; using UnityEditor.ShaderGraph; using UnityEngine; +using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; -using static UnityEditor.Rendering.InspectorCurveEditor; namespace UnityEditor.Rendering.Universal { @@ -13,7 +13,7 @@ namespace UnityEditor.Rendering.Universal ///
[UnityEngine.Scripting.APIUpdating.MovedFrom("")] [CustomEditor(typeof(FullScreenPassRendererFeature))] - public class FullScreenPassRendererFeatureEditor : Editor + public class FullScreenPassRendererFeatureEditor : Editor, IOwningRendererDataConsumer { private SerializedProperty m_InjectionPointProperty; private SerializedProperty m_RequirementsProperty; @@ -22,6 +22,10 @@ public class FullScreenPassRendererFeatureEditor : Editor private SerializedProperty m_PassMaterialProperty; private SerializedProperty m_PassIndexProperty; private bool m_ShowDuplicateColorCopyWarning; + private bool m_ShowFetchColorBufferTileOnlyError; + private bool m_ShowRequirementsColorTileOnlyError; + private bool m_ShowRequirementsDepthWithoutNormalTileOnlyError; + private bool m_ShowRequirementsMotionWithoutNormalTileOnlyError; private static readonly GUIContent k_InjectionPointGuiContent = new GUIContent("Injection Point", "Specifies where in the frame this pass will be injected."); private static readonly GUIContent k_RequirementsGuiContent = new GUIContent("Requirements", "A mask of URP internal textures that will need to be generated and bound for sampling.\n\nNote that 'Color' here corresponds to '_CameraOpaqueTexture' so most of the time you will want to use the 'Fetch Color Buffer' option instead."); @@ -29,6 +33,15 @@ public class FullScreenPassRendererFeatureEditor : Editor private static readonly GUIContent k_BindDepthStencilAttachmentGuiContent = new GUIContent("Bind Depth-Stencil", "Enable this to bind the active camera's depth-stencil attachment to the framebuffer (only use this if depth-stencil ops are used by the assigned material as this could have a performance impact)."); private static readonly GUIContent k_PassMaterialGuiContent = new GUIContent("Pass Material", "The material used to render the full screen pass."); private static readonly GUIContent k_PassGuiContent = new GUIContent("Pass", "The name of the shader pass to use from the assigned material."); + private static readonly string k_FetchColorBufferIncompatibleWithTileOnlyMode = L10n.Tr("Fetch Color Buffer is incompatible with the enabled 'Tile-Only Mode'. Disable this setting."); + private static readonly string k_RequirementsColorIncompatibleWithTileOnlyMode = L10n.Tr("Color is incompatible with the enabled 'Tile-Only Mode'. Clear Color from Requirements."); + private static readonly string k_RequirementsDepthWithoutNormalIncompatibleWithTileOnlyMode = L10n.Tr("Depth without Normal is incompatible with the enabled 'Tile-Only Mode'. Add Normal to Requirements or clear Depth."); + private static readonly string k_RequirementsMotionWithoutNormalIncompatibleWithTileOnlyMode = L10n.Tr("Motion without Normal is incompatible with the enabled 'Tile-Only Mode'. Add Normal to Requirements or clear Motion."); + + /// + /// The renderer data that owns the feature when the inspector is drawn. + /// + public ScriptableRendererData owningRendererData { get; set; } static readonly GUIContent k_NewFullscreenMaterialButtonText = EditorGUIUtility.TrTextContent("New", "Creates a new Fullscreen material."); static readonly string k_NewBlitShaderText = "SRP Blit Shader"; @@ -58,19 +71,38 @@ public override void OnInspectorGUI() currentFeature.passIndex = 0; EditorGUILayout.PropertyField(m_InjectionPointProperty, k_InjectionPointGuiContent); - EditorGUILayout.PropertyField(m_RequirementsProperty, k_RequirementsGuiContent); + EditorGUILayout.PropertyField(m_RequirementsProperty, k_RequirementsGuiContent); + + var requirements = m_RequirementsProperty.GetEnumValue(); + var rendererData = (this as IOwningRendererDataConsumer).owningRendererData as UniversalRendererData; + + if (Event.current.type == EventType.Layout) + { + bool tileOnlyMode = rendererData != null && rendererData.tileOnlyMode; + m_ShowFetchColorBufferTileOnlyError = tileOnlyMode && m_FetchColorBufferProperty.boolValue; + m_ShowRequirementsColorTileOnlyError = tileOnlyMode && (requirements & ScriptableRenderPassInput.Color) != ScriptableRenderPassInput.None; + // Depth without Normal triggers a depth copy; with Normal, URP does a prepass instead (see comment on k_RequirementsDepthWithoutNormalIncompatibleWithTileOnlyMode). + m_ShowRequirementsDepthWithoutNormalTileOnlyError = tileOnlyMode && (requirements & ScriptableRenderPassInput.Depth) != ScriptableRenderPassInput.None && (requirements & ScriptableRenderPassInput.Normal) == ScriptableRenderPassInput.None; + m_ShowRequirementsMotionWithoutNormalTileOnlyError = tileOnlyMode && (requirements & ScriptableRenderPassInput.Motion) != ScriptableRenderPassInput.None && (requirements & ScriptableRenderPassInput.Normal) == ScriptableRenderPassInput.None; + } + if (m_ShowFetchColorBufferTileOnlyError) + EditorGUILayout.HelpBox(k_FetchColorBufferIncompatibleWithTileOnlyMode, MessageType.Error, true); + if (m_ShowRequirementsColorTileOnlyError) + EditorGUILayout.HelpBox(k_RequirementsColorIncompatibleWithTileOnlyMode, MessageType.Error, true); + if (m_ShowRequirementsDepthWithoutNormalTileOnlyError) + EditorGUILayout.HelpBox(k_RequirementsDepthWithoutNormalIncompatibleWithTileOnlyMode, MessageType.Error, true); + if (m_ShowRequirementsMotionWithoutNormalTileOnlyError) + EditorGUILayout.HelpBox(k_RequirementsMotionWithoutNormalIncompatibleWithTileOnlyMode, MessageType.Error, true); + EditorGUILayout.PropertyField(m_FetchColorBufferProperty, k_FetchColorBufferGuiContent); if (Event.current.type == EventType.Layout) { - bool requestedColor = (m_RequirementsProperty.GetEnumValue() & ScriptableRenderPassInput.Color) != ScriptableRenderPassInput.None; - m_ShowDuplicateColorCopyWarning = requestedColor && m_FetchColorBufferProperty.boolValue; + m_ShowDuplicateColorCopyWarning = (requirements & ScriptableRenderPassInput.Color) != ScriptableRenderPassInput.None && m_FetchColorBufferProperty.boolValue; } if (m_ShowDuplicateColorCopyWarning) - { EditorGUILayout.HelpBox("You request two different color textures: the opaque color texture via \"Requirements: Color\", and the current camera attachment via \"Fetch Color Buffer\". While this is allowed, we recommend disabling one of these two options for optimal performance.", MessageType.Warning, true); - } EditorGUILayout.PropertyField(m_BindDepthStencilAttachmentProperty, k_BindDepthStencilAttachmentGuiContent); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/OnTilePostProcessFeatureEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/OnTilePostProcessFeatureEditor.cs index 8d22e63b6fb..bb841663482 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/OnTilePostProcessFeatureEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/OnTilePostProcessFeatureEditor.cs @@ -1,7 +1,9 @@ +using UnityEngine.Rendering.Universal; + namespace UnityEditor.Rendering.Universal { [CustomEditor(typeof(OnTilePostProcessFeature))] - internal class OnTilePostProcessFeatureEditor : Editor + internal class OnTilePostProcessFeatureEditor : Editor, IOwningRendererDataConsumer { #region Serialized Properties private SerializedProperty m_UseFallbackProperty; @@ -9,17 +11,24 @@ internal class OnTilePostProcessFeatureEditor : Editor static class Styles { - public static readonly string k_NoSettingsHelpBox = L10n.Tr("This feature performs post-processing operation in tile memory. There are currently no available settings, they might be added later."); - public static readonly string k_NeedsTileOnlyMode = L10n.Tr("On Tile PostProcessing feature needs 'Tile-Only Mode' set on the Renderer. Otherwise, this render feature will fallback to texture sampling mode (slow off-tile rendering)"); + public static readonly string k_NoSettingsHelpBox = L10n.Tr("Only pixel local post-processing effects are supported. For example color adjustments, vignette or film grain. There are currently no available settings."); + public static readonly string k_TileOnlyModeOffWarning = L10n.Tr("Tile-Only Mode is not enabled on this Renderer. This feature will fallback to texture sampling mode. This uses more GPU bandwidth and can reduce performance."); } private void OnEnable() { } + /// + /// The renderer data that owns the feature when the inspector is drawn. + /// + public ScriptableRendererData owningRendererData { get; set; } + public override void OnInspectorGUI() { - EditorGUILayout.HelpBox(Styles.k_NeedsTileOnlyMode, MessageType.Info); + var rendererData = (this as IOwningRendererDataConsumer).owningRendererData as UniversalRendererData; + if (rendererData == null || !rendererData.tileOnlyMode) + EditorGUILayout.HelpBox(Styles.k_TileOnlyModeOffWarning, MessageType.Warning); EditorGUILayout.HelpBox(Styles.k_NoSettingsHelpBox, MessageType.Info); } } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/ScreenSpaceAmbientOcclusionEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/ScreenSpaceAmbientOcclusionEditor.cs index 2ea26a3a23b..c85ff3eea52 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/ScreenSpaceAmbientOcclusionEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/RendererFeatures/ScreenSpaceAmbientOcclusionEditor.cs @@ -5,7 +5,7 @@ namespace UnityEditor.Rendering.Universal { [CustomEditor(typeof(ScreenSpaceAmbientOcclusion))] - internal class ScreenSpaceAmbientOcclusionEditor : Editor + internal class ScreenSpaceAmbientOcclusionEditor : Editor, IOwningRendererDataConsumer { #region Serialized Properties private SerializedProperty m_AOMethod; @@ -23,6 +23,14 @@ internal class ScreenSpaceAmbientOcclusionEditor : Editor private bool m_IsInitialized = false; private HeaderBool m_ShowQualitySettings; + private bool m_ShowAfterOpaqueTileOnlyError; + + private static readonly string k_AfterOpaqueIncompatibleWithTileOnlyMode = L10n.Tr("'After Opaque' is incompatible with the enabled 'Tile-Only Mode'. Disable After Opaque."); + + /// + /// The renderer data that owns the feature when the inspector is drawn. + /// + public ScriptableRendererData owningRendererData { get; set; } class HeaderBool { @@ -123,6 +131,17 @@ public override void OnInspectorGUI() EditorGUILayout.PropertyField(m_Downsample, Styles.Downsample); EditorGUILayout.PropertyField(m_AfterOpaque, Styles.AfterOpaque); + + if (Event.current.type == EventType.Layout) + { + var rendererData = (this as IOwningRendererDataConsumer).owningRendererData as UniversalRendererData; + bool tileOnlyMode = rendererData != null && rendererData.tileOnlyMode; + bool afterOpaque = m_AfterOpaque.boolValue; + m_ShowAfterOpaqueTileOnlyError = tileOnlyMode && afterOpaque; + } + if (m_ShowAfterOpaqueTileOnlyError) + EditorGUILayout.HelpBox(k_AfterOpaqueIncompatibleWithTileOnlyMode, MessageType.Error, true); + EditorGUILayout.PropertyField(m_BlurQuality, Styles.BlurQuality); EditorGUILayout.PropertyField(m_Samples, Styles.Samples); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ScriptableRendererDataEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/ScriptableRendererDataEditor.cs index 34a0980abeb..8d86be0f8fb 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ScriptableRendererDataEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ScriptableRendererDataEditor.cs @@ -194,7 +194,13 @@ private void DrawRendererFeature(int index, ref SerializedProperty renderFeature } EditorGUI.BeginChangeCheck(); + if (rendererFeatureEditor is IOwningRendererDataConsumer consumer) + { + consumer.owningRendererData = target as ScriptableRendererData; + } + rendererFeatureEditor.OnInspectorGUI(); + hasChangedProperties |= EditorGUI.EndChangeCheck(); EditorGUILayout.Space(EditorGUIUtility.singleLineHeight); @@ -361,4 +367,13 @@ private void ForceSave() EditorUtility.SetDirty(target); } } + + /// + /// Implement this interface on a custom Editor for a ScriptableRendererFeature to receive the renderer data that owns the feature when the inspector is drawn. + /// + internal interface IOwningRendererDataConsumer + { + /// The renderer data that contains this feature. Set by the drawer before OnInspectorGUI, cleared after. + public ScriptableRendererData owningRendererData { get; set; } + } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/ScreenSpaceAmbientOcclusionPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/ScreenSpaceAmbientOcclusionPass.cs index e2b2c9a7927..3c10ff53bc7 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/ScreenSpaceAmbientOcclusionPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/ScreenSpaceAmbientOcclusionPass.cs @@ -127,39 +127,12 @@ internal ScreenSpaceAmbientOcclusionPass() m_CurrentSettings = new ScreenSpaceAmbientOcclusionSettings(); } - internal bool Setup(ScreenSpaceAmbientOcclusionSettings featureSettings, ScriptableRenderer renderer, Material material, Texture2D[] blueNoiseTextures) + internal bool Setup(ScreenSpaceAmbientOcclusionSettings featureSettings, ScreenSpaceAmbientOcclusionSettings.DepthSource depthSource, Material material, Texture2D[] blueNoiseTextures) { m_BlueNoiseTextures = blueNoiseTextures; m_Material = material; m_CurrentSettings = featureSettings; - - // RenderPass Event + Source Settings (Depth / Depth&Normals - if (renderer is UniversalRenderer { usesDeferredLighting: true }) - { - renderPassEvent = m_CurrentSettings.AfterOpaque ? RenderPassEvent.AfterRenderingOpaques : RenderPassEvent.AfterRenderingPrePasses; - - m_CurrentSettings.Source = ScreenSpaceAmbientOcclusionSettings.DepthSource.DepthNormals; - } - else - { - // Rendering after PrePasses is usually correct except when depth priming is in play: - // then we rely on a depth resolve taking place after the PrePasses in order to have it ready for SSAO. - // Hence we set the event to RenderPassEvent.AfterRenderingPrePasses + 1 at the earliest. - renderPassEvent = m_CurrentSettings.AfterOpaque ? RenderPassEvent.BeforeRenderingTransparents : RenderPassEvent.AfterRenderingPrePasses + 1; - } - - // Ask for a Depth or Depth + Normals textures - switch (m_CurrentSettings.Source) - { - case ScreenSpaceAmbientOcclusionSettings.DepthSource.Depth: - ConfigureInput(ScriptableRenderPassInput.Depth); - break; - case ScreenSpaceAmbientOcclusionSettings.DepthSource.DepthNormals: - ConfigureInput(ScriptableRenderPassInput.Depth | ScriptableRenderPassInput.Normal); // need depthNormal prepass for forward-only geometry - break; - default: - throw new ArgumentOutOfRangeException(); - } + m_CurrentSettings.Source = depthSource; // Blur settings switch (m_CurrentSettings.BlurQuality) @@ -277,7 +250,6 @@ private class SSAOPassData internal MaterialPropertyBlock materialPropertyBlock; internal Material material; internal float directLightingStrength; - internal TextureHandle cameraColor; internal TextureHandle AOTexture; internal TextureHandle finalTexture; internal TextureHandle blurTexture; @@ -399,7 +371,6 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer // Fill in the Pass data... InitSSAOPassData(passData); - passData.cameraColor = resourceData.cameraColor; passData.AOTexture = aoTexture; passData.finalTexture = finalTexture; passData.blurTexture = blurTexture; @@ -409,13 +380,6 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer // Declare input textures builder.SetRenderAttachment(passData.AOTexture, 0, AccessFlags.WriteAll); - // TODO: Refactor to eliminate the need for 'UseTexture'. - // Currently required only because 'PostProcessUtils.SetSourceSize' allocates an RTHandle, - // which expects a valid graphicsResource. Without this call, 'cameraColor.graphicsResource' - // may be null if it wasn't initialized in an earlier pass (e.g., DrawOpaque). - if (passData.cameraColor.IsValid()) - builder.UseTexture(passData.cameraColor, AccessFlags.Read); - if (cameraDepthTexture.IsValid()) builder.UseTexture(cameraDepthTexture, AccessFlags.Read); @@ -427,8 +391,8 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer builder.SetRenderFunc(static (SSAOPassData data, RasterGraphContext ctx) => { - // Setup - PostProcessUtils.SetGlobalShaderSourceSize(ctx.cmd, data.cameraData.cameraTargetDescriptor.width, data.cameraData.cameraTargetDescriptor.height, data.cameraColor); + var desc = data.cameraData.cameraTargetDescriptor; + PostProcessUtils.SetGlobalShaderSourceSize(ctx.cmd, desc.width, desc.height, desc.useDynamicScale); if (data.cameraNormalsTexture.IsValid()) data.materialPropertyBlock.SetTexture(s_CameraNormalsTextureID, data.cameraNormalsTexture); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/PostProcessUtils.cs b/Packages/com.unity.render-pipelines.universal/Runtime/PostProcessUtils.cs index c8911530336..b3016bb3ca2 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/PostProcessUtils.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/PostProcessUtils.cs @@ -284,6 +284,17 @@ internal static Vector4 CalcShaderSourceSize(float width, float height, RenderTe return new Vector4(width, height, 1.0f / width, 1.0f / height); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector4 CalcShaderSourceSize(float width, float height, bool useDynamicScale) + { + if (useDynamicScale) + { + width *= ScalableBufferManager.widthScaleFactor; + height *= ScalableBufferManager.heightScaleFactor; + } + return new Vector4(width, height, 1.0f / width, 1.0f / height); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector4 CalcShaderSourceSize(RTHandle source) { @@ -295,6 +306,14 @@ internal static void SetGlobalShaderSourceSize(RasterCommandBuffer cmd, float wi cmd.SetGlobalVector(ShaderConstants._SourceSize, CalcShaderSourceSize(width, height, rt)); } + /// + /// Sets the global shader _SourceSize vector from width, height and dynamic scale flag. Use this when no texture/RTHandle is available (e.g. in Render Graph to avoid UseTexture on camera color). + /// + internal static void SetGlobalShaderSourceSize(RasterCommandBuffer cmd, float width, float height, bool useDynamicScale) + { + cmd.SetGlobalVector(ShaderConstants._SourceSize, CalcShaderSourceSize(width, height, useDynamicScale)); + } + internal static void SetGlobalShaderSourceSize(CommandBuffer cmd, float width, float height, RenderTexture rt) { SetGlobalShaderSourceSize(CommandBufferHelpers.GetRasterCommandBuffer(cmd), width, height, rt); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/FullScreenPassRendererFeature.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/FullScreenPassRendererFeature.cs index 8d42aba848a..a127ee66a2a 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/FullScreenPassRendererFeature.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/FullScreenPassRendererFeature.cs @@ -82,6 +82,17 @@ internal override bool RequireRenderingLayers(bool isDeferred, bool needsGBuffer return false; } + /// + /// Returns true if the combination of settings is compatible with Tile-Only Mode on the Universal Renderer. + /// + internal bool IsCompatibleWithTileOnlyMode() + { + // These checks must match the Tile-Only Mode validation in FullScreenPassRendererFeatureEditor. + if (fetchColorBuffer) + return false; + return RenderingUtils.IsCompatibleWithTileOnlyMode(requirements, (RenderPassEvent)injectionPoint); + } + /// public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData) { @@ -99,6 +110,14 @@ public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingD return; } + if (renderer is UniversalRenderer universalRenderer && universalRenderer.useTileOnlyMode && !IsCompatibleWithTileOnlyMode()) + { + Debug.LogErrorFormat( + "Full Screen Renderer Feature \"{0}\": the current settings are not compatible with Tile-Only Mode. Open the Universal Renderer \"{1}\" in the Inspector for more information.", + name, universalRenderer.name); + return; + } + m_FullScreenPass.renderPassEvent = (RenderPassEvent)injectionPoint; m_FullScreenPass.ConfigureInput(requirements); m_FullScreenPass.SetupMembers(passMaterial, passIndex, fetchColorBuffer, bindDepthStencilAttachment); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs index f238c9d5287..56ac604ee9e 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/OnTilePostProcessPass.cs @@ -107,9 +107,6 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer // The code below can then also use resourceData.isActiveTargetBackBuffer correctly for robustness. resourceData.SwitchActiveTexturesToBackbuffer(); - // Reset keywords - m_OnTileUberMaterial.shaderKeywords = null; - SetupVignette(m_OnTileUberMaterial, cameraData.xr, srcDesc.width, srcDesc.height, vignette); SetupLut(m_OnTileUberMaterial, colorLookup, colorAdjustments, lutSize); SetupTonemapping(m_OnTileUberMaterial, tonemapping, isHdrGrading: postProcessingData.gradingMode == ColorGradingMode.HighDynamicRange); @@ -359,24 +356,29 @@ void SetupVignette(Material material, XRPass xrPass, int width, int height, Vign private void SetupTonemapping(Material onTileUberMaterial, Tonemapping tonemapping, bool isHdrGrading) { - if (isHdrGrading) - { - CoreUtils.SetKeyword(m_OnTileUberMaterial, ShaderKeywordStrings.HDRGrading, isHdrGrading); - } - else + CoreUtils.SetKeyword(m_OnTileUberMaterial, ShaderKeywordStrings.HDRGrading, isHdrGrading); + + if (!isHdrGrading) { CoreUtils.SetKeyword(m_OnTileUberMaterial, ShaderKeywordStrings.TonemapNeutral, tonemapping.mode.value == TonemappingMode.Neutral); CoreUtils.SetKeyword(m_OnTileUberMaterial, ShaderKeywordStrings.TonemapACES, tonemapping.mode.value == TonemappingMode.ACES); } + else + { + CoreUtils.SetKeyword(m_OnTileUberMaterial, ShaderKeywordStrings.TonemapNeutral, false); + CoreUtils.SetKeyword(m_OnTileUberMaterial, ShaderKeywordStrings.TonemapACES, false); + } } void SetupGrain(Material onTileUberMaterial, UniversalCameraData cameraData, FilmGrain filmgrain, PostProcessData data) { - if (filmgrain.IsActive()) + bool isActive = filmgrain.IsActive(); + CoreUtils.SetKeyword(onTileUberMaterial, ShaderKeywordStrings.FilmGrain, isActive); + + if (isActive) { - onTileUberMaterial.EnableKeyword(ShaderKeywordStrings.FilmGrain); PostProcessUtils.ConfigureFilmGrain( data, filmgrain, @@ -388,9 +390,10 @@ void SetupGrain(Material onTileUberMaterial, UniversalCameraData cameraData, Fil void SetupDithering(Material onTileUberMaterial, UniversalCameraData cameraData, PostProcessData data) { + CoreUtils.SetKeyword(onTileUberMaterial, ShaderKeywordStrings.Dithering, cameraData.isDitheringEnabled); + if (cameraData.isDitheringEnabled) { - onTileUberMaterial.EnableKeyword(ShaderKeywordStrings.Dithering); m_DitheringTextureIndex = PostProcessUtils.ConfigureDithering( data, m_DitheringTextureIndex, diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceAmbientOcclusion.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceAmbientOcclusion.cs index aeb93976adf..cd756e945d8 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceAmbientOcclusion.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceAmbientOcclusion.cs @@ -171,7 +171,50 @@ public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingD if (!TryPrepareResources()) return; - bool shouldAdd = m_SSAOPass.Setup(m_Settings, renderer, m_Material, m_BlueNoise256Textures); + bool usesDeferred = renderer is UniversalRenderer { usesDeferredLighting: true }; + ScriptableRenderPassInput requirements; + RenderPassEvent passEvent; + if (usesDeferred) + { + passEvent = m_Settings.AfterOpaque ? RenderPassEvent.AfterRenderingOpaques : RenderPassEvent.AfterRenderingPrePasses; + requirements = ScriptableRenderPassInput.Depth | ScriptableRenderPassInput.Normal; + } + else + { + passEvent = m_Settings.AfterOpaque ? RenderPassEvent.BeforeRenderingTransparents : RenderPassEvent.AfterRenderingPrePasses + 1; + requirements = m_Settings.Source == ScreenSpaceAmbientOcclusionSettings.DepthSource.Depth ? ScriptableRenderPassInput.Depth : ScriptableRenderPassInput.Depth | ScriptableRenderPassInput.Normal; + } + + if (renderer is UniversalRenderer universalRenderer && universalRenderer.useTileOnlyMode) + { + if (!RenderingUtils.IsCompatibleWithTileOnlyMode(requirements, passEvent)) + { + Debug.LogErrorFormat( + "Screen Space Ambient Occlusion \"{0}\": the current settings are not compatible with Tile-Only Mode. Open the Universal Renderer \"{1}\" in the Inspector for more information.", + name, renderer.name); + return; + } + + // SSAO-specific: In Tile-Only Mode with After Opaque, Render Graph merges the Blit SSAO pass with + // earlier passes that use the backbuffer (e.g. TopLeft UV origin). The merged pass then stores the + // SSAO occlusion texture with that same origin. Later, the occlusion texture is sampled as a texture + // (blur, etc.) which expects a different UV origin (e.g. BottomLeft), causing "Texture attachment + // Backbuffer depth with uv origin X does not match with texture attachment _SSAO_OcclusionTexture0 + // with uv origin Y". Pass merging is currently too aggressive here, so disallow After Opaque with + // Depth Normals in Tile-Only Mode. + if (m_Settings.AfterOpaque && m_Settings.Source == ScreenSpaceAmbientOcclusionSettings.DepthSource.DepthNormals) + { + Debug.LogErrorFormat( + "Screen Space Ambient Occlusion \"{0}\": the current settings are not compatible with Tile-Only Mode. Open the Universal Renderer \"{1}\" in the Inspector for more information.", + name, renderer.name); + return; + } + } + + m_SSAOPass.renderPassEvent = passEvent; + m_SSAOPass.ConfigureInput(requirements); + var effectiveDepthSource = usesDeferred ? ScreenSpaceAmbientOcclusionSettings.DepthSource.DepthNormals : m_Settings.Source; + bool shouldAdd = m_SSAOPass.Setup(m_Settings, effectiveDepthSource, m_Material, m_BlueNoise256Textures); if (shouldAdd) renderer.EnqueuePass(m_SSAOPass); } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceShadows.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceShadows.cs index 29010dd6f13..281158c7aeb 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceShadows.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceShadows.cs @@ -104,6 +104,18 @@ private bool LoadMaterial() return m_Material != null; } + /// + /// Pass that renders screen-space shadows by sampling the main light shadow map. + /// + /// This pass reconstructs world positions from the depth prepass (cameraDepthTexture), + /// transforms them to shadow space, and samples the shadow map to produce a screen-space + /// shadow texture. This is more efficient than traditional forward shadow sampling per-pixel. + /// + /// IMPORTANT: World position reconstruction from depth requires the inverse view-projection matrix + /// (unity_MatrixInvVP) to match the UV origin of the depth texture. In Tile-Only Mode and + /// direct-to-backbuffer scenarios, the depth texture orientation may differ from the active + /// render target, requiring explicit matrix setup. See ExecutePass for details. + /// private class ScreenSpaceShadowsPass : ScriptableRenderPass { // Private Variables @@ -126,20 +138,26 @@ internal bool Setup(ScreenSpaceShadowsSettings featureSettings, Material materia return m_Material != null; } - + private class PassData { internal TextureHandle target; + internal TextureHandle cameraDepthTexture; + internal TextureHandle activeTarget; internal Material material; + internal UniversalCameraData cameraData; } /// /// Initialize the shared pass data. /// /// - private void InitPassData(ref PassData passData) + private void InitPassData(ref PassData passData, in TextureHandle cameraDepthTexture, in TextureHandle activeTarget, UniversalCameraData cameraData) { passData.material = m_Material; + passData.cameraDepthTexture = cameraDepthTexture; + passData.activeTarget = activeTarget; + passData.cameraData = cameraData; } public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData) @@ -149,7 +167,9 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer Debug.LogErrorFormat("{0}.Execute(): Missing material. ScreenSpaceShadows pass will not execute. Check for missing reference in the renderer resources.", GetType().Name); return; } - UniversalCameraData cameraData = frameData.Get(); + var cameraData = frameData.Get(); + var resourceData = frameData.Get(); + var desc = cameraData.cameraTargetDescriptor; desc.depthStencilFormat = GraphicsFormat.None; desc.msaaSamples = 1; @@ -170,8 +190,10 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer { passData.target = color; builder.UseTexture(color, AccessFlags.WriteAll); + builder.UseTexture(resourceData.cameraDepthTexture); - InitPassData(ref passData); + // activeColorTexture is always valid here since AddRenderPasses returns early for offscreen depth cameras + InitPassData(ref passData, resourceData.cameraDepthTexture, resourceData.activeColorTexture, cameraData); builder.AllowGlobalStateModification(true); if (color.IsValid()) @@ -179,17 +201,44 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer builder.SetRenderFunc(static (PassData data, UnsafeGraphContext rgContext) => { - ExecutePass(rgContext.cmd, data, data.target); + ExecutePass(rgContext, data); }); } } - private static void ExecutePass(UnsafeCommandBuffer cmd, PassData data, RTHandle target) + private static void ExecutePass(UnsafeGraphContext rgContext, PassData data) { - Blitter.BlitTexture(cmd, target, Vector2.one, data.material, 0); + var cmd = rgContext.cmd; + + // CRITICAL FIX for Tile-Only Mode and direct-to-backbuffer rendering: + // + // The shader reconstructs world positions from depth using: + // float3 wpos = ComputeWorldSpacePosition(uv, depth, unity_MatrixInvVP); + // + // The global unity_MatrixInvVP might be set for the active render target's orientation (e.g., TopLeft in Tile-Only Mode), + // but cameraDepthTexture was rendered with a potentially different orientation (always BottomLeft - it's an intermediate texture). + // + // When orientations don't match, the Y-coordinate in world-space reconstruction is inverted, causing shadow lookups + // to sample from the wrong world positions → shadows appear upside down. + // + // FIX: Temporarily set unity_MatrixInvVP to match cameraDepthTexture's orientation for correct position reconstruction. + TextureUVOrigin depthOrigin = rgContext.GetTextureUVOrigin(data.cameraDepthTexture); + Matrix4x4 depthInvVP = RenderingUtils.ComputeInverseViewProjectionMatrix(depthOrigin, data.cameraData); + cmd.SetGlobalMatrix(ShaderPropertyId.inverseViewAndProjectionMatrix, depthInvVP); + + // Perform the shadow sampling blit + Blitter.BlitTexture(cmd, data.target, Vector2.one, data.material, 0); + + // Set shadow keywords cmd.SetKeyword(ShaderGlobalKeywords.MainLightShadows, false); cmd.SetKeyword(ShaderGlobalKeywords.MainLightShadowCascades, false); cmd.SetKeyword(ShaderGlobalKeywords.MainLightShadowScreen, true); + + // Restore unity_MatrixInvVP to match the active target's orientation for subsequent passes. + // Without this, later passes that rely on the global matrix might get incorrect results. + TextureUVOrigin activeOrigin = rgContext.GetTextureUVOrigin(data.activeTarget); + Matrix4x4 activeInvVP = RenderingUtils.ComputeInverseViewProjectionMatrix(activeOrigin, data.cameraData); + cmd.SetGlobalMatrix(ShaderPropertyId.inverseViewAndProjectionMatrix, activeInvVP); } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs index 89f7d252cd7..3daca3a2cd4 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs @@ -3,6 +3,7 @@ using Unity.Collections; using Unity.Collections.LowLevel.Unsafe; using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; using UnityEngine.Rendering.RenderGraphModule; using System.Diagnostics; using System.Runtime.CompilerServices; @@ -95,6 +96,35 @@ internal static bool SupportsLightLayers(GraphicsDeviceType type) return true; } + /// + /// Returns true if the given ScriptableRenderPassInput requirements are compatible with Tile-Only Mode on the Universal Renderer. + /// Reusable for any ScriptableRenderPass. + /// + /// The pass input requirements. + /// The event at which the pass runs. When only Depth (or Motion) is requested without Normal, a pass before or at BeforeRenderingOpaques gets a prepass instead of a depth copy, so it remains compatible. + /// + /// This method mirrors how the render pipeline fulfills pass input requirements. Keep it in sync with pipeline behavior: + /// + /// Color: The pipeline adds a copy color pass and exposes the result as a global texture. That store/load cannot stay on tile and triggers Tile-Only validation. + /// Depth without Normal: The pipeline fulfills depth-only by adding a depth copy pass when the pass runs after opaque. When the pass runs at or before BeforeRenderingOpaques, the pipeline adds a prepass instead, which is compatible. + /// Motion without Normal: Motion implies depth; same as Depth without Normal with respect to prepass vs copy and renderPassEvent. + /// + /// When adding or changing requirements or pipeline behavior, update this method and the corresponding editor validation (e.g. FullScreenPassRendererFeatureEditor) so they stay consistent. + /// + internal static bool IsCompatibleWithTileOnlyMode(ScriptableRenderPassInput requirements, RenderPassEvent renderPassEvent) + { + if ((requirements & ScriptableRenderPassInput.Color) != ScriptableRenderPassInput.None) + return false; + // Depth without Normal: pipeline uses a depth copy when the pass runs after opaque; when pass is before or at opaque, pipeline adds a prepass instead (compatible). + if ((requirements & ScriptableRenderPassInput.Depth) != ScriptableRenderPassInput.None && (requirements & ScriptableRenderPassInput.Normal) == ScriptableRenderPassInput.None + && renderPassEvent > RenderPassEvent.BeforeRenderingOpaques) + return false; + if ((requirements & ScriptableRenderPassInput.Motion) != ScriptableRenderPassInput.None && (requirements & ScriptableRenderPassInput.Normal) == ScriptableRenderPassInput.None + && renderPassEvent > RenderPassEvent.BeforeRenderingOpaques) + return false; + return true; + } + static Material s_ErrorMaterial; static Material errorMaterial { @@ -852,7 +882,7 @@ internal static TextureUVOrigin GetCameraTargetsUVOrientation(UniversalCameraDat if (onTileRenderer) { // The On-Tile renderer guarantees that the backbuffer orientation is propagated to - // the camera targets. + // the camera targets. return GetBackBufferUVOrientation(cameraData); } else @@ -861,6 +891,46 @@ internal static TextureUVOrigin GetCameraTargetsUVOrientation(UniversalCameraDat } } + /// + /// Computes the inverse view-projection matrix for a given texture UV origin. + /// This is critical for passes that reconstruct world positions from depth textures. + /// + /// THE PROBLEM: + /// Many rendering passes (ScreenSpaceShadows, SSAO, SSR, etc.) need to reconstruct world positions from screen-space depth. + /// The reconstruction process uses screen UVs [0,1] and depth to build clip-space coordinates [-1,1], then transforms + /// them to world space using the inverse view-projection matrix (unity_MatrixInvVP). + /// + /// However, the Y-axis direction in clip space depends on the texture's UV origin: + /// - BottomLeft (standard texture): UV(0,0) is bottom-left → clip(-1,-1) is bottom-left → Y increases upward + /// - TopLeft (backbuffer on modern APIs): UV(0,0) is top-left → clip(-1,+1) is top-left → Y increases downward + /// + /// The inverse VP matrix encodes this Y-flip assumption via _ProjectionParams.x. If the matrix was computed for TopLeft + /// but you're reconstructing from a BottomLeft depth texture, the Y-coordinate is inverted, resulting in incorrect + /// world positions (and thus wrong shadow lookups, SSAO samples, etc.). + /// + /// WHEN IT BREAKS: + /// - Tile-Only Mode: The active render target can be TopLeft (backbuffer), so unity_MatrixInvVP is set for TopLeft. + /// But cameraDepthTexture is always BottomLeft (intermediate texture). Mismatch → broken. + /// - Direct-to-backbuffer: Similar issue when rendering directly to a TopLeft backbuffer but sampling BottomLeft depth. + /// - After prepass: Camera properties are restored for the active target, overwriting the matrix that was correct + /// during the prepass. + /// + /// THE FIX: + /// Query the texture's actual UV origin (via GetTextureUVOrigin) and compute the inverse VP matrix that matches + /// how that texture was rendered. This ensures the reconstruction math is consistent with the source data. + /// + /// The UV origin of the texture (typically from GetTextureUVOrigin) + /// Camera data containing view and projection matrices + /// The inverse view-projection matrix matching the texture orientation + internal static Matrix4x4 ComputeInverseViewProjectionMatrix(TextureUVOrigin textureUVOrigin, UniversalCameraData cameraData) + { + bool isFlipped = (textureUVOrigin == TextureUVOrigin.BottomLeft); + Matrix4x4 projection = cameraData.GetGPUProjectionMatrix(isFlipped); + Matrix4x4 view = cameraData.GetViewMatrix(); + Matrix4x4 viewProj = CoreMatrixUtils.MultiplyProjectionMatrix(projection, view, cameraData.camera.orthographic); + return Matrix4x4.Inverse(viewProj); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static RTHandleAllocInfo CreateRTHandleAllocInfo(in RenderTextureDescriptor descriptor, FilterMode filterMode, TextureWrapMode wrapMode, int anisoLevel, float mipMapBias, string name) { diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs index 54f925c8b18..45d2f28b029 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs @@ -57,6 +57,8 @@ private static class Profiling internal static readonly ProfilingSampler setEditorTarget = new ProfilingSampler($"Set Editor Target"); } + internal string name { get; set; } + /// /// This setting controls if the camera editor should display the camera stack category. /// If your scriptable renderer is not supporting stacking this one should return 0. diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs index 3827697d92e..f40e9b9f26e 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs @@ -307,6 +307,7 @@ public UniversalRenderer(UniversalRendererData data) : base(data) this.m_CameraDepthAttachmentFormat = data.depthAttachmentFormat; this.m_CameraDepthTextureFormat = data.depthTextureFormat; this.postProcessEnabled = data.postProcessData != null; + this.name = data.name; UpdateSupportedRenderingFeatures(); From c25716b4b71b7cee0a18e25f94a3adcdc6e9b09c Mon Sep 17 00:00:00 2001 From: Olga Belavina Date: Tue, 10 Mar 2026 09:24:50 +0000 Subject: [PATCH 62/95] UUM-134685 Add documentation buttons to rendering debugger panel headers --- .../Runtime/Debugging/DebugUI.Panel.cs | 38 ++++++++++++++++++- .../DebugWindowCommon.uss | 35 +++++++++++++++++ .../Debug/DebugDisplaySettingsLighting.cs | 2 +- 3 files changed, 72 insertions(+), 3 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Panel.cs b/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Panel.cs index f3d85d97b6c..928070bb71d 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Panel.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Panel.cs @@ -4,6 +4,10 @@ using System; +#if UNITY_EDITOR +using UnityEditor; +#endif + #if ENABLE_RENDERING_DEBUGGER_UI using UnityEngine.UIElements; #endif @@ -20,6 +24,8 @@ public partial class DebugUI public class Panel : IContainer, IComparable { #if ENABLE_RENDERING_DEBUGGER_UI + private VisualElement m_HelpButton; + /// public VisualElement Create(DebugUI.Context context) { @@ -29,9 +35,23 @@ public VisualElement Create(DebugUI.Context context) name = displayName + "_Content" }; - var label = container.Q