From fbd37c540eb1f3e3ba50d7bb090d8c454c4843a8 Mon Sep 17 00:00:00 2001 From: alelievr Date: Wed, 5 Feb 2020 14:15:07 +0100 Subject: [PATCH 01/37] Begin to write the new custom pass API --- .../RenderPass/CustomPass/CustomPass.cs | 32 ++++- .../CustomPass/CustomPassContext.cs | 60 +++++++++ .../CustomPass/CustomPassContext.cs.meta | 11 ++ .../RenderPass/CustomPass/CustomPassUtils.cs | 125 ++++++++++++++++++ .../CustomPass/CustomPassUtils.cs.meta | 11 ++ .../RenderPass/DrawRenderersCustomPass.cs | 8 +- .../RenderPass/FullScreenCustomPass.cs | 8 +- 7 files changed, 244 insertions(+), 11 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs create mode 100644 com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs.meta create mode 100644 com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs create mode 100644 com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs.meta diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs index 491836533e8..1b5849c0322 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs @@ -1,6 +1,4 @@ using System.Collections.Generic; -using UnityEngine.Rendering; -using UnityEngine.Experimental.Rendering; using System; using UnityEngine.Serialization; @@ -162,8 +160,25 @@ internal void ExecuteInternal(ScriptableRenderContext renderContext, CommandBuff SetCustomPassTarget(cmd); + // Create the custom pass context: + CustomPassContext ctx = new CustomPassContext + { + renderContext = renderContext, + cmd = cmd, + hdCamera = hdCamera, + cullingResult = cullingResult, + cameraColorBuffer = targets.cameraColorBuffer, + cameraDepthBuffer = rtManager.GetDepthStencilBuffer(IsMSAAEnabled(hdCamera)), + cameraNormalBuffer = rtManager.GetNormalBuffer(IsMSAAEnabled(hdCamera)), + customColorBuffer = targets.customColorBuffer, + customDepthBuffer = targets.customDepthBuffer, + }; + isExecuting = true; +#pragma warning disable CS0618 // Member is obsolete Execute(renderContext, cmd, hdCamera, cullingResult); +#pragma warning restore CS0618 + Execute(ctx); isExecuting = false; // Set back the camera color buffer if we were using a custom buffer as target @@ -233,7 +248,15 @@ protected virtual void AggregateCullingParameters(ref ScriptableCullingParameter /// /// /// - protected abstract void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera hdCamera, CullingResults cullingResult); + [Obsolete("This Execute signature is obsolete and will be removed in the future. Please use Execute(CustomPassContext) instead")] + protected virtual void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera hdCamera, CullingResults cullingResult) {} + + /// + /// Called when your pass needs to be executed by a camera + /// + /// Custom Pass Context. + // TODO: move this function to abstract when we deprecate the method above + protected virtual void Execute(CustomPassContext ctx) {} /// /// Called before the first execution of the pass occurs. @@ -310,6 +333,7 @@ protected void ResolveMSAAColorBuffer(CommandBuffer cmd, HDCamera hdCamera) /// /// outputs the camera color buffer /// outputs the camera depth buffer + [Obsolete("GetCameraBuffers is obsolete and will be removed in the future. All camera buffers are now avaliable directly in the CustomPassContext in parameter of the Execute function")] protected void GetCameraBuffers(out RTHandle colorBuffer, out RTHandle depthBuffer) { if (!isExecuting) @@ -325,6 +349,7 @@ protected void GetCameraBuffers(out RTHandle colorBuffer, out RTHandle depthBuff /// /// outputs the custom color buffer /// outputs the custom depth buffer + [Obsolete("GetCustomBuffers is obsolete and will be removed in the future. All custom buffers are now avaliable directly in the CustomPassContext in parameter of the Execute function")] protected void GetCustomBuffers(out RTHandle colorBuffer, out RTHandle depthBuffer) { if (!isExecuting) @@ -338,6 +363,7 @@ protected void GetCustomBuffers(out RTHandle colorBuffer, out RTHandle depthBuff /// Get the current normal buffer (can be MSAA) /// /// + [Obsolete("GetNormalBuffer is obsolete and will be removed in the future. Normal buffer is now avaliable directly in the CustomPassContext in parameter of the Execute function")] protected RTHandle GetNormalBuffer() { if (!isExecuting) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs new file mode 100644 index 00000000000..8b8f57c249c --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs @@ -0,0 +1,60 @@ +using System; + +namespace UnityEngine.Rendering.HighDefinition +{ + /// + /// Context used when executing custom passes + /// + public struct CustomPassContext + { + /// + /// Scriptable Render Context, used for any SRP related operations. + /// + public ScriptableRenderContext renderContext; + + /// + /// Command Buffer, used to enqueue graphic commands to the GPU. + /// + public CommandBuffer cmd; + + /// + /// HDCamera, HDRP data related to the rendering camera. Use the camera property to access the Camera class. + /// + public HDCamera hdCamera; + + /// + /// Result of the culling either of the camera or the custom pass if AggregateCullingParameters is used. + /// + public CullingResults cullingResult; + + /// + /// Camera color buffer. + /// + public RTHandle cameraColorBuffer; + + /// + /// Camera depth buffer. + /// + public RTHandle cameraDepthBuffer; + + /// + /// Camera normal buffer. + /// + public RTHandle cameraNormalBuffer; + + /// + /// Lazy handle to the custom color buffer, not allocated if not used. + /// + public Lazy customColorBuffer; + + /// + /// Lazy handle to the custom depth buffer, not allocated if not used. + /// + public Lazy customDepthBuffer; + + /// + /// Material Property Block, unique for each custom pass instance. + /// + public MaterialPropertyBlock propertyBlock; + } +} \ No newline at end of file diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs.meta b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs.meta new file mode 100644 index 00000000000..c5815717ec9 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb1cfe339cbc2ac47bd24e22cc1cd976 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs new file mode 100644 index 00000000000..ae31d798eab --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs @@ -0,0 +1,125 @@ +using System; +using UnityEngine.Rendering; +using UnityEngine.Experimental.Rendering; + +namespace UnityEngine.Rendering.HighDefinition +{ + /// + /// A set of custom pass utility function to help you build your effects + /// + public class CustomPassUtils + { + public static Vector4 fullScreenScaleBias = new Vector4(1, 1, 0, 0); + + static ShaderTagId[] litForwardTags = { + HDShaderPassNames.s_ForwardOnlyName, HDShaderPassNames.s_ForwardName, HDShaderPassNames.s_SRPDefaultUnlitName + }; + static ShaderTagId[] depthTags = { HDShaderPassNames.s_DepthForwardOnlyName, HDShaderPassNames.s_DepthOnlyName }; + + static ProfilingSampler downSampleSampler = new ProfilingSampler("DownSample"); + static ProfilingSampler verticalBlurSampler = new ProfilingSampler("Vertical Blur"); + static ProfilingSampler horizontalBlurSampler = new ProfilingSampler("Horizontal Blur"); + static ProfilingSampler gaussianblurSampler = new ProfilingSampler("Gaussian Blur"); + + /// + /// Convert the source buffer to an half resolution buffer and output it to the destination buffer. + /// + /// Custom Pass Context + /// + /// + /// + /// + /// + public static void DownSample(CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 1, int sourceMip = 0, int destMip = 0) + { + Debug.Log("TODO"); + } + + // Do we provide an upsample function ? + // public static void UpSample(CustomPassContext ctx, RTHandle source, RTHandle destination) + // { + // Debug.Log("TODO"); + // } + + public static void Copy(CustomPassContext ctx, RTHandle source, RTHandle destination, int sourceMip = 0, int destMip = 0, bool bilinear = true) + => Copy(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sourceMip, destMip, bilinear); + + public static void Copy(CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sourceMip = 0, int destMip = 0, bool bilinear = true) + { + CoreUtils.SetRenderTarget(ctx.cmd, destination, ClearFlag.None, Color.black, destMip); + HDUtils.BlitQuad(ctx.cmd, source, sourceScaleBias, fullScreenScaleBias, sourceMip, bilinear); + } + + public static void GaussianBlurVertical(CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, int sourceMip = 0, int destMip = 0) + => GaussianBlurVertical(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sampleCount, sourceMip, destMip); + + public static void GaussianBlurVertical(CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, int sourceMip = 0, int destMip = 0) + { + using (new ProfilingScope(ctx.cmd, verticalBlurSampler)) + { + + } + } + + public static void GaussianBlurHorizontal(CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, int sourceMip = 0, int destMip = 0) + => GaussianBlurHorizontal(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sampleCount, sourceMip, destMip); + + public static void GaussianBlurHorizontal(CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, int sourceMip = 0, int destMip = 0) + { + using (new ProfilingScope(ctx.cmd, horizontalBlurSampler)) + { + + } + } + + public static void GaussianBlur(CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, int sampleCount = 8, float radius = 1, int sourceMip = 0, int destMip = 0) + => GaussianBlur(ctx, source, destination, tempTarget, sampleCount); + + public static void GaussianBlur(CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, float radius = 1, int sourceMip = 0, int destMip = 0) + { + using (new ProfilingScope(ctx.cmd, gaussianblurSampler)) + { + // Downsample to half res + DownSample(ctx, source, destination, 1, sourceMip, destMip); + // Vertical blur + GaussianBlurVertical(ctx, destination, tempTarget); + // Horizontal blur + GaussianBlurHorizontal(ctx, tempTarget, destination); + } + } + + public static void DrawRenderers(CustomPassContext ctx, LayerMask layerMask, Material overrideMaterial = null, int overideMaterialIndex = 0) + { + var result = new RendererListDesc(litForwardTags, ctx.cullingResult, ctx.hdCamera.camera) + { + rendererConfiguration = PerObjectData.None, + renderQueueRange = RenderQueueRange.all, + sortingCriteria = SortingCriteria.BackToFront, + excludeObjectMotionVectors = false, + layerMask = layerMask, + stateBlock = new RenderStateBlock(RenderStateMask.Depth){ depthState = new DepthState(true, CompareFunction.LessEqual)}, + }; + + HDUtils.DrawRendererList(ctx.renderContext, ctx.cmd, RendererList.Create(result)); + } + + public static void DrawShadow(CustomPassContext ctx, RTHandle destination, Camera view, LayerMask layerMask) + { + var result = new RendererListDesc(litForwardTags, ctx.cullingResult, ctx.hdCamera.camera) + { + rendererConfiguration = PerObjectData.None, + renderQueueRange = RenderQueueRange.all, + sortingCriteria = SortingCriteria.BackToFront, + excludeObjectMotionVectors = false, + layerMask = layerMask, + // stateBlock = new RenderStateBlock(RenderStateMask.Depth){ depthState = new DepthState(true, CompareFunction.LessEqual)}, + }; + + var hdrp = HDRenderPipeline.currentPipeline; + ctx.hdCamera.SetupGlobalParams(ctx.cmd, hdrp.m_) + + CoreUtils.SetRenderTarget(ctx.cmd, destination, ClearFlag.Depth); + HDUtils.DrawRendererList(ctx.renderContext, ctx.cmd, RendererList.Create(result)); + } + } +} \ No newline at end of file diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs.meta b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs.meta new file mode 100644 index 00000000000..dd9eed530bc --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1da4e5df446e0e54cb8da8eb449b4ddb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs index 4b831a7cc5b..3ad3ac4ba34 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs @@ -95,7 +95,7 @@ protected ShaderTagId[] GetShaderTagIds() /// /// /// - protected override void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera hdCamera, CullingResults cullingResult) + protected override void Execute(CustomPassContext ctx) { var shaderPasses = GetShaderTagIds(); if (overrideMaterial != null) @@ -115,9 +115,9 @@ protected override void Execute(ScriptableRenderContext renderContext, CommandBu depthState = new DepthState(depthWrite, depthCompareFunction), }; - PerObjectData renderConfig = hdCamera.frameSettings.IsEnabled(FrameSettingsField.Shadowmask) ? HDUtils.k_RendererConfigurationBakedLightingWithShadowMask : HDUtils.k_RendererConfigurationBakedLighting; + PerObjectData renderConfig = ctx.hdCamera.frameSettings.IsEnabled(FrameSettingsField.Shadowmask) ? HDUtils.k_RendererConfigurationBakedLightingWithShadowMask : HDUtils.k_RendererConfigurationBakedLighting; - var result = new RendererListDesc(shaderPasses, cullingResult, hdCamera.camera) + var result = new RendererListDesc(shaderPasses, ctx.cullingResult, ctx.hdCamera.camera) { rendererConfiguration = renderConfig, renderQueueRange = GetRenderQueueRange(renderQueueType), @@ -129,7 +129,7 @@ protected override void Execute(ScriptableRenderContext renderContext, CommandBu layerMask = layerMask, }; - HDUtils.DrawRendererList(renderContext, cmd, RendererList.Create(result)); + HDUtils.DrawRendererList(ctx.renderContext, ctx.cmd, RendererList.Create(result)); } /// diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/FullScreenCustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/FullScreenCustomPass.cs index 7e8df43f049..04164ad3fbb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/FullScreenCustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/FullScreenCustomPass.cs @@ -34,19 +34,19 @@ protected override void Setup(ScriptableRenderContext renderContext, CommandBuff /// Execute the pass with the fullscreen setup /// /// - protected override void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera hdCamera, CullingResults cullingResult) + protected override void Execute(CustomPassContext ctx) { if (fullscreenPassMaterial != null) { if (fetchColorBuffer) { - ResolveMSAAColorBuffer(cmd, hdCamera); + ResolveMSAAColorBuffer(ctx.cmd, ctx.hdCamera); // reset the render target to the UI - SetRenderTargetAuto(cmd); + SetRenderTargetAuto(ctx.cmd); } fullscreenPassMaterial.SetFloat(fadeValueId, fadeValue); - CoreUtils.DrawFullScreen(cmd, fullscreenPassMaterial, shaderPassId: fullscreenPassMaterial.FindPass(materialPassName)); + CoreUtils.DrawFullScreen(ctx.cmd, fullscreenPassMaterial, shaderPassId: fullscreenPassMaterial.FindPass(materialPassName)); } } From 09f3faa14de0f8159122c5880c1d8ca155f67300 Mon Sep 17 00:00:00 2001 From: alelievr Date: Mon, 17 Feb 2020 10:31:43 +0100 Subject: [PATCH 02/37] Begin to add custom pass utils shader --- .../RenderPass/CustomPass/CustomPassUtils.cs | 52 +++++- .../CustomPass/CustomPassUtils.shader | 161 ++++++++++++++++++ .../CustomPass/CustomPassUtils.shader.meta | 9 + .../RenderPipeline/RenderPipelineResources.cs | 2 + .../HDRenderPipelineResources.asset | 1 + 5 files changed, 222 insertions(+), 3 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader create mode 100644 com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader.meta diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs index ae31d798eab..7a7d68b9c88 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs @@ -1,6 +1,7 @@ using System; using UnityEngine.Rendering; using UnityEngine.Experimental.Rendering; +using System.Collections.Generic; namespace UnityEngine.Rendering.HighDefinition { @@ -21,6 +22,11 @@ public class CustomPassUtils static ProfilingSampler horizontalBlurSampler = new ProfilingSampler("Horizontal Blur"); static ProfilingSampler gaussianblurSampler = new ProfilingSampler("Gaussian Blur"); + static MaterialPropertyBlock blurPropertyBlock = new MaterialPropertyBlock(); + static Material customPassUtilsMaterial = new Material(HDRenderPipeline.defaultAsset.renderPipelineResources.shaders.customPassUtils); + + static Dictionary gaussianWeightsCache = new Dictionary(); + /// /// Convert the source buffer to an half resolution buffer and output it to the destination buffer. /// @@ -73,7 +79,7 @@ public static void GaussianBlurHorizontal(CustomPassContext ctx, RTHandle source } public static void GaussianBlur(CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, int sampleCount = 8, float radius = 1, int sourceMip = 0, int destMip = 0) - => GaussianBlur(ctx, source, destination, tempTarget, sampleCount); + => GaussianBlur(ctx, source, destination, tempTarget, fullScreenScaleBias, fullScreenScaleBias, sampleCount, radius, sourceMip, destMip); public static void GaussianBlur(CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, float radius = 1, int sourceMip = 0, int destMip = 0) { @@ -103,7 +109,7 @@ public static void DrawRenderers(CustomPassContext ctx, LayerMask layerMask, Mat HDUtils.DrawRendererList(ctx.renderContext, ctx.cmd, RendererList.Create(result)); } - public static void DrawShadow(CustomPassContext ctx, RTHandle destination, Camera view, LayerMask layerMask) + public static void DrawShadowMap(CustomPassContext ctx, RTHandle destination, Camera view, LayerMask layerMask) { var result = new RendererListDesc(litForwardTags, ctx.cullingResult, ctx.hdCamera.camera) { @@ -116,10 +122,50 @@ public static void DrawShadow(CustomPassContext ctx, RTHandle destination, Camer }; var hdrp = HDRenderPipeline.currentPipeline; - ctx.hdCamera.SetupGlobalParams(ctx.cmd, hdrp.m_) + // ctx.hdCamera.SetupGlobalParams(ctx.cmd, hdrp.m_) CoreUtils.SetRenderTarget(ctx.cmd, destination, ClearFlag.Depth); HDUtils.DrawRendererList(ctx.renderContext, ctx.cmd, RendererList.Create(result)); } + + // Render objects from the view in parameter + public static void RenderFrom(CustomPassContext ctx, RTHandle destination, Camera view, LayerMask layerMask) + { + + } + + /// + /// Generate gaussian weights for a given number of samples + /// + /// + /// + internal static float[] GetGaussianWeights(int weightCount) + { + float[] weights; + + if (gaussianWeightsCache.TryGetValue(weightCount, out weights)) + return weights; + + weights = new float[weightCount]; + float p = 0; + float integrationBound = 3; + for (int i = 0; i < weightCount; i++) + { + float w = (Gaussian(p) / (float)weightCount) * integrationBound; + p += 1.0f / (float)weightCount * integrationBound; + weights[i] = w; + } + gaussianWeightsCache[weightCount] = weights; + + // Gaussian function + float Gaussian(float x, float sigma = 1) + { + float a = 1.0f / Mathf.Sqrt(2 * Mathf.PI * sigma * sigma); + float b = Mathf.Exp(-(x * x) / (2 * sigma * sigma)); + return a * b; + } + + return weights; + } } } \ No newline at end of file diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader new file mode 100644 index 00000000000..ab9bac495d0 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader @@ -0,0 +1,161 @@ +Shader "Hidden/FullScreen/Blur" +{ + HLSLINCLUDE + + #pragma vertex Vert + + #pragma target 4.5 + #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + // #pragma enable_d3d11_debug_symbols + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassCommon.hlsl" + + TEXTURE2D_X(_Source); + float _SourceMip; + float _Radius; + float _SampleCount; + float4 _ViewPortSize; // We need the viewport size because we have a non fullscreen render target (blur buffers are downsampled in half res) + + float4 Copy(Varyings varyings) : SV_Target + { + return LOAD_TEXTURE2D_X_LOD(_Source, varyings.positionCS.xy, _SourceMip); + } + + float3 BlurPixels(float3 taps[9]) + { + return 0.27343750 * (taps[4] ) + + 0.21875000 * (taps[3] + taps[5]) + + 0.10937500 * (taps[2] + taps[6]) + + 0.03125000 * (taps[1] + taps[7]) + + 0.00390625 * (taps[0] + taps[8]); + } + + // We need to clamp the UVs to avoid bleeding from bigger render tragets (when we have multiple cameras) + float2 ClampUVs(float2 uv) + { + uv = clamp(uv, 0, _RTHandleScale.xy - _ViewPortSize.zw); // clamp UV to 1 pixel to avoid bleeding + return uv; + } + + float2 GetSampleUVs(Varyings varyings) + { + float depth = LoadCameraDepth(varyings.positionCS.xy); + PositionInputs posInput = GetPositionInput(varyings.positionCS.xy, _ViewPortSize.zw, depth, UNITY_MATRIX_I_VP, UNITY_MATRIX_V); + return posInput.positionNDC.xy * _RTHandleScale; + } + + float4 HorizontalBlur(Varyings varyings) : SV_Target + { + float2 texcoord = GetSampleUVs(varyings); + + // Horizontal blur from the camera color buffer + float2 offset = _ScreenSize.zw * _Radius; // We don't use _ViewPortSize here because we want the offset to be the same between all the blur passes. + float3 taps[9]; + for (int i = -4; i <= 4; i++) + { + float2 uv = ClampUVs(texcoord + float2(i, 0) * offset); + taps[i + 4] = SAMPLE_TEXTURE2D_X_LOD(_Source, s_linear_clamp_sampler, uv, 0).rgb; + } + + return float4(BlurPixels(taps), 1); + } + + float4 VerticalBlur(Varyings varyings) : SV_Target + { + float2 texcoord = GetSampleUVs(varyings); + + // Vertical blur from the blur color buffer + float2 offset = _ScreenSize.zw * _Radius; + float3 taps[9]; + for (int i = -4; i <= 4; i++) + { + float2 uv = ClampUVs(texcoord + float2(0, i) * offset); + taps[i + 4] = SAMPLE_TEXTURE2D_X_LOD(_Source, s_linear_clamp_sampler, uv, 0).rgb; + } + + return float4(BlurPixels(taps), 1); + } + + float4 CompositeMaskedBlur(Varyings varyings) : SV_Target + { + float depth = LoadCameraDepth(varyings.positionCS.xy); + float2 uv = ClampUVs(GetSampleUVs(varyings)); + + float4 colorBuffer = SAMPLE_TEXTURE2D_X_LOD(_ColorBufferCopy, s_linear_clamp_sampler, uv, 0).rgba; + float4 blurredBuffer = SAMPLE_TEXTURE2D_X_LOD(_Source, s_linear_clamp_sampler, uv, 0).rgba; + float4 mask = SAMPLE_TEXTURE2D_X_LOD(_Mask, s_linear_clamp_sampler, uv, 0); + float maskDepth = SAMPLE_TEXTURE2D_X_LOD(_MaskDepth, s_linear_clamp_sampler, uv, 0).r; + float maskValue = 0; + + maskValue = any(mask.rgb > 0.1) || (maskDepth > depth - 0.0001); + + if (_InvertMask > 0.5) + maskValue = !maskValue; + + return float4(lerp(blurredBuffer.rgb, colorBuffer.rgb, maskValue), colorBuffer.a); + } + + ENDHLSL + + SubShader + { + Pass + { + Name "Copy" + + ZWrite Off + ZTest Always + Blend Off + Cull Off + + HLSLPROGRAM + #pragma fragment Copy + ENDHLSL + } + + Pass + { + Name "Downsample" + + ZWrite Off + ZTest Always + Blend Off + Cull Off + + HLSLPROGRAM + #pragma fragment DownSample + ENDHLSL + } + + Pass + { + // Horizontal Blur + Name "Horizontal Blur" + + ZWrite Off + ZTest Always + Blend Off + Cull Off + + HLSLPROGRAM + #pragma fragment HorizontalBlur + ENDHLSL + } + + Pass + { + // Vertical Blur + Name "Vertical Blur" + + ZWrite Off + ZTest Always + Blend Off + Cull Off + + HLSLPROGRAM + #pragma fragment VerticalBlur + ENDHLSL + } + } + Fallback Off +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader.meta b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader.meta new file mode 100644 index 00000000000..30206b98272 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7e3722d0388000848acb25fd3cc8c088 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPipelineResources.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPipelineResources.cs index 7bacb14bfc9..8d5a4ccc90b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPipelineResources.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPipelineResources.cs @@ -148,6 +148,8 @@ public sealed class ShaderResources public Shader filterAreaLightCookiesPS; [Reload("Runtime/Core/CoreResources/ClearUIntTextureArray.compute")] public ComputeShader clearUIntTextureCS; + [Reload("Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader")] + public Shader customPassUtils; // XR [Reload("Runtime/ShaderLibrary/XRMirrorView.shader")] diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineResources.asset b/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineResources.asset index 28086098826..2249ca04dd8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineResources.asset +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineResources.asset @@ -108,6 +108,7 @@ MonoBehaviour: type: 3} clearUIntTextureCS: {fileID: 7200000, guid: d067ad4b88af51c498875426894aef76, type: 3} + customPassUtils: {fileID: 4800000, guid: 7e3722d0388000848acb25fd3cc8c088, type: 3} xrMirrorViewPS: {fileID: 4800000, guid: e6255f98cf405eb45ab6f9006cf11e1f, type: 3} xrOcclusionMeshPS: {fileID: 4800000, guid: 46a45b32bb110604fb36216b63bcdb81, type: 3} shadowClearPS: {fileID: 4800000, guid: e3cab24f27741f44d8af1e94d006267c, type: 3} From c68a4d96f579c6cbe0ab751d64a7a37d8c81d305 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Tue, 7 Apr 2020 14:52:47 +0200 Subject: [PATCH 03/37] Begin to add custom pass API test scenes --- .../9x_Other/9700_CustomPass_FullScreen.unity | 175 +- .../9701.renderTexture | 37 + .../9701.renderTexture.meta | 8 + .../Outline/Outline.cs | 41 +- .../9700_CustomPass_FullScreen/Unlit.mat | 267 ++ .../9700_CustomPass_FullScreen/Unlit.mat.meta | 8 + .../9701_CustomPass_DrawRenderers.unity | 3636 +++++++++++++++-- .../Scenes/9x_Other/9702_CustomPass_API.meta | 8 + .../Scenes/9x_Other/9702_CustomPass_API.unity | 1502 +++++++ .../9x_Other/9702_CustomPass_API.unity.meta | 7 + .../9702_CustomPass_API/9702.renderTexture | 37 + .../9702.renderTexture.meta | 8 + .../9x_Other/9702_CustomPass_API/Blur.cs | 31 + .../9x_Other/9702_CustomPass_API/Blur.cs.meta | 11 + .../Scene Settings Profile.asset | 15 + .../Scene Settings Profile.asset.meta | 8 + .../CustomPassCSharpScript.template | 5 +- .../DrawRenderersCustomPassDrawer.cs | 2 +- .../RenderPipeline/HDStringConstants.cs | 3 + .../RenderPass/CustomPass/CustomPass.cs | 56 +- .../CustomPass/CustomPassContext.cs | 41 +- .../RenderPass/CustomPass/CustomPassUtils.cs | 103 +- .../CustomPass/CustomPassUtils.shader | 47 +- .../RenderPass/DrawRenderersCustomPass.cs | 65 +- .../RenderPass/FullScreenCustomPass.cs | 27 +- 25 files changed, 5537 insertions(+), 611 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/9701.renderTexture create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/9701.renderTexture.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Unlit.mat create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Unlit.mat.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702.renderTexture create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702.renderTexture.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Scene Settings Profile.asset create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Scene Settings Profile.asset.meta diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen.unity index 311105d2679..5d3dd897127 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen.unity +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen.unity @@ -119,6 +119,8 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 debug: m_Flags: 0 m_NavMeshData: {fileID: 0} @@ -368,6 +370,7 @@ MonoBehaviour: m_EditorClassIdentifier: isGlobal: 1 fadeRadius: 0 + priority: 0 customPasses: - id: 0 injectionPoint: 4 @@ -403,6 +406,85 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &317630009 +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: 3df29e7cc05fbec4aa43e06ea875565d, type: 3} + m_Name: + m_EditorClassIdentifier: + active: 1 + m_AdvancedMode: 0 + rotation: + m_OverrideState: 0 + m_Value: 0 + min: 0 + max: 360 + skyIntensityMode: + m_OverrideState: 0 + m_Value: 0 + exposure: + m_OverrideState: 0 + m_Value: 0 + multiplier: + m_OverrideState: 0 + m_Value: 1 + min: 0 + upperHemisphereLuxValue: + m_OverrideState: 0 + m_Value: 1 + min: 0 + upperHemisphereLuxColor: + m_OverrideState: 0 + m_Value: {x: 0, y: 0, z: 0} + desiredLuxValue: + m_OverrideState: 0 + m_Value: 20000 + updateMode: + m_OverrideState: 0 + m_Value: 0 + updatePeriod: + m_OverrideState: 0 + m_Value: 0 + min: 0 + includeSunInBaking: + m_OverrideState: 0 + m_Value: 0 + sunSize: + m_OverrideState: 0 + m_Value: 0.04 + min: 0 + max: 1 + sunSizeConvergence: + m_OverrideState: 0 + m_Value: 5 + min: 1 + max: 10 + atmosphereThickness: + m_OverrideState: 0 + m_Value: 1 + min: 0 + max: 5 + skyTint: + m_OverrideState: 0 + m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} + hdr: 0 + showAlpha: 1 + showEyeDropper: 1 + groundColor: + m_OverrideState: 0 + m_Value: {r: 0.369, g: 0.349, b: 0.341, a: 1} + hdr: 0 + showAlpha: 1 + showEyeDropper: 1 + enableSunDisk: + m_OverrideState: 0 + m_Value: 1 --- !u!1 &402875804 GameObject: m_ObjectHideFlags: 0 @@ -529,6 +611,7 @@ MonoBehaviour: m_EditorClassIdentifier: isGlobal: 1 fadeRadius: 0 + priority: 0 customPasses: - id: 0 injectionPoint: 3 @@ -595,6 +678,7 @@ MonoBehaviour: m_EditorClassIdentifier: isGlobal: 1 fadeRadius: 0 + priority: 0 customPasses: - id: 0 - id: 1 @@ -825,6 +909,7 @@ MonoBehaviour: captureRotationProxySpace: {x: 0, y: 0, z: 0, w: 1} mirrorPositionProxySpace: {x: 0, y: 0, z: 0} mirrorRotationProxySpace: {x: -0.70710677, y: 0, z: 0, w: 0.70710677} + resolution: 512 cameraSettings: customRenderingSettings: 1 renderingPathCustomFrameSettings: @@ -854,8 +939,8 @@ MonoBehaviour: frustum: mode: 0 aspect: 1 - farClipPlane: 1000 - nearClipPlane: 0.3 + farClipPlaneRaw: 1000 + nearClipPlaneRaw: 0.3 fieldOfView: 90 projectionMatrix: e00: 1 @@ -1075,7 +1160,7 @@ MeshCollider: m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 - serializedVersion: 3 + serializedVersion: 4 m_Convex: 0 m_CookingOptions: 30 m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} @@ -1227,6 +1312,7 @@ MonoBehaviour: m_EditorClassIdentifier: isGlobal: 1 fadeRadius: 0 + priority: 0 customPasses: - id: 0 injectionPoint: 2 @@ -1424,7 +1510,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Profile: {fileID: 11400000, guid: 864689173ea47a14399cb0eb9a1d6e0e, type: 2} m_StaticLightingSkyUniqueID: 2 - m_SkySettings: {fileID: 1871786828} + m_SkySettings: {fileID: 317630009} m_SkySettingsFromProfile: {fileID: 7974066123450201752, guid: 864689173ea47a14399cb0eb9a1d6e0e, type: 2} --- !u!114 &1551760952 @@ -1489,6 +1575,7 @@ MonoBehaviour: m_EditorClassIdentifier: isGlobal: 1 fadeRadius: 0 + priority: 0 customPasses: - id: 0 injectionPoint: 0 @@ -1554,6 +1641,7 @@ MonoBehaviour: m_EditorClassIdentifier: isGlobal: 1 fadeRadius: 0 + priority: 0 customPasses: - id: 0 injectionPoint: 5 @@ -1589,85 +1677,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1871786828 -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: 3df29e7cc05fbec4aa43e06ea875565d, type: 3} - m_Name: - m_EditorClassIdentifier: - active: 1 - m_AdvancedMode: 0 - rotation: - m_OverrideState: 0 - m_Value: 0 - min: 0 - max: 360 - skyIntensityMode: - m_OverrideState: 0 - m_Value: 0 - exposure: - m_OverrideState: 0 - m_Value: 0 - multiplier: - m_OverrideState: 0 - m_Value: 1 - min: 0 - upperHemisphereLuxValue: - m_OverrideState: 0 - m_Value: 1 - min: 0 - upperHemisphereLuxColor: - m_OverrideState: 0 - m_Value: {x: 0, y: 0, z: 0} - desiredLuxValue: - m_OverrideState: 0 - m_Value: 20000 - updateMode: - m_OverrideState: 0 - m_Value: 0 - updatePeriod: - m_OverrideState: 0 - m_Value: 0 - min: 0 - includeSunInBaking: - m_OverrideState: 0 - m_Value: 0 - sunSize: - m_OverrideState: 0 - m_Value: 0.04 - min: 0 - max: 1 - sunSizeConvergence: - m_OverrideState: 0 - m_Value: 5 - min: 1 - max: 10 - atmosphereThickness: - m_OverrideState: 0 - m_Value: 1 - min: 0 - max: 5 - skyTint: - m_OverrideState: 0 - m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} - hdr: 0 - showAlpha: 1 - showEyeDropper: 1 - groundColor: - m_OverrideState: 0 - m_Value: {r: 0.369, g: 0.349, b: 0.341, a: 1} - hdr: 0 - showAlpha: 1 - showEyeDropper: 1 - enableSunDisk: - m_OverrideState: 0 - m_Value: 1 --- !u!1 &2130596026 GameObject: m_ObjectHideFlags: 0 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/9701.renderTexture b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/9701.renderTexture new file mode 100644 index 00000000000..a8d6e591028 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/9701.renderTexture @@ -0,0 +1,37 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!84 &8400000 +RenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 9701 + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + serializedVersion: 3 + m_Width: 640 + m_Height: 360 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthFormat: 2 + m_ColorFormat: 8 + m_MipMap: 0 + m_GenerateMips: 1 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + 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 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/9701.renderTexture.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/9701.renderTexture.meta new file mode 100644 index 00000000000..319de26183a --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/9701.renderTexture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b6b9dcb98c600534fa4922b259aac581 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Outline/Outline.cs b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Outline/Outline.cs index 78b7db9e7f1..bd181a5be64 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Outline/Outline.cs +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Outline/Outline.cs @@ -16,7 +16,6 @@ class Outline : CustomPass Material fullscreenOutline; MaterialPropertyBlock outlineProperties; - ShaderTagId[] shaderTags; RTHandle outlineBuffer; protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) @@ -25,47 +24,27 @@ protected override void Setup(ScriptableRenderContext renderContext, CommandBuff fullscreenOutline = CoreUtils.CreateEngineMaterial(outlineShader); outlineProperties = new MaterialPropertyBlock(); - // List all the materials that will be replaced in the frame - shaderTags = new ShaderTagId[3] - { - new ShaderTagId("Forward"), - new ShaderTagId("ForwardOnly"), - new ShaderTagId("SRPDefaultUnlit"), - }; - outlineBuffer = RTHandles.Alloc( Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, - colorFormat: GraphicsFormat.B10G11R11_UFloatPack32, + colorFormat: GraphicsFormat.B10G11R11_UFloatPack32, // We don't need alpha for this effect useDynamicScale: true, name: "Outline Buffer" ); } - void DrawOutlineMeshes(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera hdCamera, CullingResults cullingResult) + protected override void Execute(CustomPassContext ctx) { - var result = new RendererListDesc(shaderTags, cullingResult, hdCamera.camera) - { - // We need the lighting render configuration to support rendering lit objects - rendererConfiguration = PerObjectData.LightProbe | PerObjectData.LightProbeProxyVolume | PerObjectData.Lightmaps, - renderQueueRange = RenderQueueRange.all, - sortingCriteria = SortingCriteria.BackToFront, - excludeObjectMotionVectors = false, - layerMask = outlineLayer, - }; - - CoreUtils.SetRenderTarget(cmd, outlineBuffer, ClearFlag.Color); - HDUtils.DrawRendererList(renderContext, cmd, RendererList.Create(result)); - } - - protected override void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera camera, CullingResults cullingResult) - { - DrawOutlineMeshes(renderContext, cmd, camera, cullingResult); - - SetCameraRenderTarget(cmd); + // Render meshes we want to outline in the outline buffer + CoreUtils.SetRenderTarget(ctx.cmd, outlineBuffer, ClearFlag.Color); + CustomPassUtils.DrawRenderers(ctx, outlineLayer); + // Setup outline effect properties outlineProperties.SetColor("_OutlineColor", outlineColor); outlineProperties.SetTexture("_OutlineBuffer", outlineBuffer); outlineProperties.SetFloat("_Threshold", threshold); - CoreUtils.DrawFullScreen(cmd, fullscreenOutline, outlineProperties, shaderPassId: 0); + + // Render the outline as a fullscreen alpha-blended pass on top of the camera color + CoreUtils.SetRenderTarget(ctx.cmd, ctx.cameraColorBuffer, ClearFlag.None); + CoreUtils.DrawFullScreen(ctx.cmd, fullscreenOutline, outlineProperties, shaderPassId: 0); } protected override void Cleanup() diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Unlit.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Unlit.mat new file mode 100644 index 00000000000..fdf08e1db0b --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Unlit.mat @@ -0,0 +1,267 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-1541268656524681272 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 3 +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Unlit + m_Shader: {fileID: 4800000, guid: c4edd00ff2db5b24391a4fcb1762e459, type: 3} + m_ShaderKeywords: _DISABLE_SSR_TRANSPARENT _NORMALMAP_TANGENT_SPACE + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: {} + disabledShaderPasses: + - DistortionVectors + - MOTIONVECTORS + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AnisotropyMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _CoatMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortionVectorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissiveColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HeightMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceThicknessMap: + 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} + - _MaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecularColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SubsurfaceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TransmittanceColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _UnlitColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _AORemapMax: 1 + - _AORemapMin: 0 + - _ATDistance: 1 + - _AddPrecomputedVelocity: 0 + - _AlbedoAffectEmissive: 0 + - _AlphaCutoff: 0.5 + - _AlphaCutoffEnable: 0 + - _AlphaCutoffPostpass: 0.5 + - _AlphaCutoffPrepass: 0.5 + - _AlphaCutoffShadow: 0.5 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _Anisotropy: 0 + - _BlendMode: 0 + - _CoatMask: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoScale: 1 + - _DetailNormalScale: 1 + - _DetailSmoothnessScale: 1 + - _DiffusionProfile: 0 + - _DiffusionProfileHash: 0 + - _DisplacementLockObjectScale: 1 + - _DisplacementLockTilingScale: 1 + - _DisplacementMode: 0 + - _DistortionBlendMode: 0 + - _DistortionBlurBlendMode: 0 + - _DistortionBlurDstBlend: 1 + - _DistortionBlurRemapMax: 1 + - _DistortionBlurRemapMin: 0 + - _DistortionBlurScale: 1 + - _DistortionBlurSrcBlend: 1 + - _DistortionDepthTest: 1 + - _DistortionDstBlend: 1 + - _DistortionEnable: 0 + - _DistortionOnly: 0 + - _DistortionScale: 1 + - _DistortionSrcBlend: 1 + - _DistortionVectorBias: -1 + - _DistortionVectorScale: 2 + - _DoubleSidedEnable: 0 + - _DoubleSidedNormalMode: 1 + - _DstBlend: 0 + - _EmissiveColorMode: 1 + - _EmissiveExposureWeight: 1 + - _EmissiveIntensity: 1 + - _EmissiveIntensityUnit: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _EnableGeometricSpecularAA: 0 + - _EnergyConservingSpecularColor: 1 + - _HeightAmplitude: 0.02 + - _HeightCenter: 0.5 + - _HeightMapParametrization: 0 + - _HeightMax: 1 + - _HeightMin: -1 + - _HeightOffset: 0 + - _HeightPoMAmplitude: 2 + - _HeightTessAmplitude: 2 + - _HeightTessCenter: 0.5 + - _IncludeIndirectLighting: 1 + - _InvTilingScale: 1 + - _Ior: 1.5 + - _IridescenceMask: 1 + - _IridescenceThickness: 1 + - _LinkDetailsWithBase: 1 + - _MaterialID: 1 + - _Metallic: 0 + - _NormalMapSpace: 0 + - _NormalScale: 1 + - _PPDLodThreshold: 5 + - _PPDMaxSamples: 15 + - _PPDMinSamples: 5 + - _PPDPrimitiveLength: 1 + - _PPDPrimitiveWidth: 1 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _SSRefractionProjectionModel: 0 + - _Smoothness: 0.5 + - _SmoothnessRemapMax: 1 + - _SmoothnessRemapMin: 0 + - _SpecularAAScreenSpaceVariance: 0.1 + - _SpecularAAThreshold: 0.2 + - _SpecularOcclusionMode: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 0 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 32 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SubsurfaceMask: 1 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TexWorldScale: 1 + - _TexWorldScaleEmissive: 1 + - _Thickness: 1 + - _TransmissionEnable: 1 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVBase: 0 + - _UVDetail: 0 + - _UVEmissive: 0 + - _UseEmissiveIntensity: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestModeDistortion: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} + - _Color: {r: 0, g: 0, b: 0, a: 1} + - _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1} + - _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} + - _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} + - _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1} + - _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0} + - _UnlitColor: {r: 1, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Unlit.mat.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Unlit.mat.meta new file mode 100644 index 00000000000..6dbb717a5e7 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Unlit.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3519774ed36188e44b17adb192f1a441 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9701_CustomPass_DrawRenderers.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9701_CustomPass_DrawRenderers.unity index 3d4e9626a75..037eb100c90 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9701_CustomPass_DrawRenderers.unity +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9701_CustomPass_DrawRenderers.unity @@ -119,6 +119,8 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 debug: m_Flags: 0 m_NavMeshData: {fileID: 0} @@ -217,7 +219,7 @@ Transform: m_Father: {fileID: 110938678} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &63262726 +--- !u!114 &38172260 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -313,7 +315,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} propertyPath: m_LocalPosition.x - value: 0 + value: 16.75 objectReference: {fileID: 0} - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} propertyPath: m_LocalPosition.y @@ -341,7 +343,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} propertyPath: m_RootOrder - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -358,12 +360,12 @@ PrefabInstance: - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} propertyPath: field of view - value: 1.8 + value: 60 objectReference: {fileID: 0} - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} propertyPath: far clip plane - value: 220 + value: 5 objectReference: {fileID: 0} - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} @@ -373,7 +375,7 @@ PrefabInstance: - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} propertyPath: near clip plane - value: 180 + value: 0.01 objectReference: {fileID: 0} - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} @@ -412,6 +414,18 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} +--- !u!20 &65093928 stripped +Camera: + m_CorrespondingSourceObject: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + m_PrefabInstance: {fileID: 65093927} + m_PrefabAsset: {fileID: 0} +--- !u!4 &65093929 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + m_PrefabInstance: {fileID: 65093927} + m_PrefabAsset: {fileID: 0} --- !u!1 &65093930 stripped GameObject: m_CorrespondingSourceObject: {fileID: 1132393308280272, guid: c07ace9ab142ca9469fa377877c2f1e7, @@ -431,6 +445,101 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: targetPipeline: {fileID: 0} +--- !u!1 &67493247 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 67493248} + - component: {fileID: 67493251} + - component: {fileID: 67493250} + - component: {fileID: 67493249} + m_Layer: 12 + m_Name: Sphere (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &67493248 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 67493247} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.5273832, y: 0.8020843, z: -0.4328437} + m_LocalScale: {x: 1.6663209, y: 1.6663209, z: 1.6663209} + m_Children: [] + m_Father: {fileID: 1484942372} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!135 &67493249 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 67493247} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &67493250 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 67493247} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 93021a2d1a5c4484c840177b21af6d45, 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &67493251 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 67493247} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &85208909 GameObject: m_ObjectHideFlags: 0 @@ -461,7 +570,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} m_Name: m_EditorClassIdentifier: - m_Version: 9 + m_Version: 10 m_ObsoleteShadowResolutionTier: 1 m_ObsoleteUseShadowQualitySettings: 0 m_ObsoleteCustomShadowResolution: 512 @@ -507,7 +616,9 @@ MonoBehaviour: m_FilterSizeTraced: 16 m_SunLightConeAngle: 0.5 m_LightShadowRadius: 0.5 + m_SemiTransparentShadow: 0 m_ColorShadow: 1 + m_DistanceBasedFiltering: 0 m_EvsmExponent: 15 m_EvsmLightLeakBias: 0 m_EvsmVarianceBias: 0.00001 @@ -556,6 +667,8 @@ MonoBehaviour: useVolumetric: 1 featuresFoldout: 1 showAdditionalSettings: 1 + m_AreaLightEmissiveMeshShadowCastingMode: 0 + m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 --- !u!108 &85208911 Light: m_ObjectHideFlags: 0 @@ -654,8 +767,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 110938677} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.6702242, y: -2.49, z: -0.95} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.6702242, y: -2.49, z: 199.05} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 2130596030} @@ -665,8 +778,8 @@ Transform: - {fileID: 1527043437} - {fileID: 85208912} - {fileID: 1003382855} - m_Father: {fileID: 0} - m_RootOrder: 9 + m_Father: {fileID: 2301058368061906180} + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &202184535 GameObject: @@ -699,6 +812,7 @@ MonoBehaviour: m_EditorClassIdentifier: isGlobal: 1 fadeRadius: 0 + priority: 0 customPasses: - id: 0 injectionPoint: 4 @@ -718,8 +832,6 @@ MonoBehaviour: filterFoldout: 1 rendererFoldout: 1 renderQueueType: 5 - passNames: - - Forward layerMask: serializedVersion: 2 m_Bits: 8192 @@ -727,9 +839,9 @@ MonoBehaviour: overrideMaterial: {fileID: 0} overrideMaterialPassIndex: 0 overrideMaterialPassName: Forward - overrideDepthState: 0 - depthCompareFunction: 5 - depthWrite: 0 + overrideDepthState: 1 + depthCompareFunction: 4 + depthWrite: 1 shaderPass: 0 --- !u!4 &202184537 Transform: @@ -739,12 +851,202 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 202184535} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 1.29, y: 0, z: 0} + m_LocalPosition: {x: 1.29, y: 0, z: 200} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 4 + m_Father: {fileID: 2301058368061906180} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &206488783 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 206488784} + - component: {fileID: 206488786} + - component: {fileID: 206488785} + m_Layer: 5 + m_Name: New Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &206488784 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 206488783} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -2.43, y: -3.84, z: 193.89} + m_LocalScale: {x: 0.06005256, y: 0.06005256, z: 0.06005256} + m_Children: [] + m_Father: {fileID: 2301058368061906180} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &206488785 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 206488783} + m_Text: Deferred + m_OffsetZ: 0 + m_CharacterSize: 1 + m_LineSpacing: 1 + m_Anchor: 0 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 189 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &206488786 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 206488783} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &247671010 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 247671011} + - component: {fileID: 247671013} + - component: {fileID: 247671012} + m_Layer: 5 + m_Name: New Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &247671011 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 247671010} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2.28, y: -3.84, z: 193.89} + m_LocalScale: {x: 0.06005, y: 0.06005, z: 0.06005} + m_Children: [] + m_Father: {fileID: 1938177837} + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &247671012 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 247671010} + m_Text: Forward + m_OffsetZ: 0 + m_CharacterSize: 1 + m_LineSpacing: 1 + m_Anchor: 0 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 189 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &247671013 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 247671010} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!1 &402875804 GameObject: m_ObjectHideFlags: 0 @@ -782,7 +1084,7 @@ MeshRenderer: m_RenderingLayerMask: 2 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 244483c682187d347a6e44dbe4ba06c0, type: 2} + - {fileID: 2100000, guid: 3519774ed36188e44b17adb192f1a441, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -857,6 +1159,7 @@ MonoBehaviour: m_EditorClassIdentifier: isGlobal: 1 fadeRadius: 0 + priority: 0 customPasses: - id: 0 injectionPoint: 3 @@ -876,8 +1179,6 @@ MonoBehaviour: filterFoldout: 1 rendererFoldout: 1 renderQueueType: 10 - passNames: - - Forward layerMask: serializedVersion: 2 m_Bits: 1024 @@ -896,12 +1197,12 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 474315044} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1.29, y: 0, z: 0} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.29, y: 0, z: 200} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 7 + m_Father: {fileID: 2301058368061906180} + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &546121084 GameObject: @@ -934,6 +1235,7 @@ MonoBehaviour: m_EditorClassIdentifier: isGlobal: 1 fadeRadius: 0 + priority: 0 customPasses: - id: 0 injectionPoint: 1 @@ -953,8 +1255,6 @@ MonoBehaviour: filterFoldout: 1 rendererFoldout: 1 renderQueueType: 5 - passNames: - - Forward layerMask: serializedVersion: 2 m_Bits: 4096 @@ -975,11 +1275,11 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 546121084} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 1.29, y: 0, z: 0} + m_LocalPosition: {x: 1.29, y: 0, z: 200} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 5 + m_Father: {fileID: 2301058368061906180} + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &617007116 GameObject: @@ -1160,6 +1460,7 @@ MonoBehaviour: captureRotationProxySpace: {x: 0, y: 0, z: 0, w: 1} mirrorPositionProxySpace: {x: 0, y: 0, z: 0} mirrorRotationProxySpace: {x: -0.70710677, y: 0, z: 0, w: 0.70710677} + resolution: 512 cameraSettings: customRenderingSettings: 1 renderingPathCustomFrameSettings: @@ -1189,8 +1490,8 @@ MonoBehaviour: frustum: mode: 0 aspect: 1 - farClipPlane: 1000 - nearClipPlane: 0.3 + farClipPlaneRaw: 1000 + nearClipPlaneRaw: 0.3 fieldOfView: 90 projectionMatrix: e00: 1 @@ -1410,7 +1711,7 @@ MeshCollider: m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 - serializedVersion: 3 + serializedVersion: 4 m_Convex: 0 m_CookingOptions: 30 m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} @@ -1430,13 +1731,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 617007116} m_LocalRotation: {x: -0.9238796, y: -0, z: -0, w: 0.3826834} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 200} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 8 + m_Father: {fileID: 2301058368061906180} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: -135, y: 0, z: 0} ---- !u!1 &1003382852 +--- !u!1 &639989339 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1444,23 +1745,274 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1003382855} - - component: {fileID: 1003382854} - - component: {fileID: 1003382853} + - component: {fileID: 639989340} + - component: {fileID: 639989342} + - component: {fileID: 639989341} m_Layer: 0 - m_Name: Reflection Probe + m_Name: EventSystem m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &1003382853 +--- !u!4 &639989340 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 639989339} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -16.749998, y: 0, z: 200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 65093929} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &639989341 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1003382852} + m_GameObject: {fileID: 639989339} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &639989342 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 639989339} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!1 &698970437 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 698970438} + - component: {fileID: 698970439} + m_Layer: 0 + m_Name: CustomPass_BeforeRendering + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &698970438 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 698970437} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.29, y: 0, z: 200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1938177837} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &698970439 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 698970437} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 1 + fadeRadius: 0 + priority: 0 + customPasses: + - id: 0 + injectionPoint: 0 + references: + version: 1 + 00000000: + type: {class: DrawRenderersCustomPass, ns: UnityEngine.Rendering.HighDefinition, + asm: Unity.RenderPipelines.HighDefinition.Runtime} + data: + m_Name: Custom Pass + enabled: 1 + targetColorBuffer: 0 + targetDepthBuffer: 0 + clearFlags: 0 + passFoldout: 0 + m_Version: 0 + filterFoldout: 0 + rendererFoldout: 0 + renderQueueType: 2 + layerMask: + serializedVersion: 2 + m_Bits: 1 + sortingCriteria: 59 + overrideMaterial: {fileID: 0} + overrideMaterialPassIndex: 0 + overrideMaterialPassName: Forward + overrideDepthState: 0 + depthCompareFunction: 4 + depthWrite: 1 + shaderPass: 0 +--- !u!1 &782038390 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 782038391} + - component: {fileID: 782038394} + - component: {fileID: 782038393} + - component: {fileID: 782038392} + m_Layer: 13 + m_Name: Sphere (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &782038391 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 782038390} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -1.3953757, y: 0.8020843, z: -0.4328437} + m_LocalScale: {x: 1.6663209, y: 1.6663209, z: 1.6663209} + m_Children: [] + m_Father: {fileID: 1484942372} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!135 &782038392 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 782038390} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &782038393 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 782038390} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 2 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 93021a2d1a5c4484c840177b21af6d45, 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &782038394 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 782038390} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &918385722 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 918385723} + - component: {fileID: 918385725} + - component: {fileID: 918385724} + m_Layer: 0 + m_Name: Reflection Probe + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &918385723 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 918385722} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.4912243, y: 0.9100001, z: -0.5319977} + m_LocalScale: {x: 0.94253, y: 0.94253, z: 0.94253} + m_Children: [] + m_Father: {fileID: 1484942372} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &918385724 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 918385722} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d0ef8dc2c2eabfa4e8cb77be57a837c0, type: 3} @@ -1613,6 +2165,7 @@ MonoBehaviour: captureRotationProxySpace: {x: 0, y: 0, z: 0, w: 1} mirrorPositionProxySpace: {x: 0, y: 0, z: 0} mirrorRotationProxySpace: {x: 0, y: 0, z: 0, w: 0} + resolution: 512 cameraSettings: customRenderingSettings: 0 renderingPathCustomFrameSettings: @@ -1642,8 +2195,8 @@ MonoBehaviour: frustum: mode: 0 aspect: 1 - farClipPlane: 1000 - nearClipPlane: 0.3 + farClipPlaneRaw: 1000 + nearClipPlaneRaw: 0.3 fieldOfView: 90 projectionMatrix: e00: 1 @@ -1815,18 +2368,18 @@ MonoBehaviour: m_ObsoleteBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} m_ObsoleteBoxSideFadePositive: {x: 1, y: 1, z: 1} m_ObsoleteBoxSideFadeNegative: {x: 1, y: 1, z: 1} ---- !u!215 &1003382854 +--- !u!215 &918385725 ReflectionProbe: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1003382852} + m_GameObject: {fileID: 918385722} m_Enabled: 1 serializedVersion: 2 m_Type: 0 - m_Mode: 1 - m_RefreshMode: 0 + m_Mode: 2 + m_RefreshMode: 2 m_TimeSlicingMode: 0 m_Resolution: 128 m_UpdateFrequency: 0 @@ -1848,21 +2401,7 @@ ReflectionProbe: m_UseOcclusionCulling: 1 m_Importance: 1 m_CustomBakedTexture: {fileID: 0} ---- !u!4 &1003382855 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1003382852} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 2.4912243, y: 0.9100001, z: -0.532} - m_LocalScale: {x: 0.94253, y: 0.94253, z: 0.94253} - m_Children: [] - m_Father: {fileID: 110938678} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1388312406 +--- !u!1 &1003382852 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1870,209 +2409,2385 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1388312410} - - component: {fileID: 1388312409} - - component: {fileID: 1388312408} - - component: {fileID: 1388312407} - m_Layer: 11 - m_Name: Sphere (1) + - component: {fileID: 1003382855} + - component: {fileID: 1003382854} + - component: {fileID: 1003382853} + m_Layer: 0 + m_Name: Reflection Probe m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!135 &1388312407 -SphereCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1388312406} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.5 - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1388312408 -MeshRenderer: +--- !u!114 &1003382853 +MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1388312406} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 93021a2d1a5c4484c840177b21af6d45, 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_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1388312409 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1388312406} - m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &1388312410 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1388312406} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 2.4502242, y: 0.8020843, z: -0.4328437} - m_LocalScale: {x: 1.6663209, y: 1.6663209, z: 1.6663209} - m_Children: [] - m_Father: {fileID: 110938678} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1497430085 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1497430087} - - component: {fileID: 1497430086} - m_Layer: 0 - m_Name: CustomPass_BeforePostProcess - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1497430086 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1497430085} + m_GameObject: {fileID: 1003382852} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} + m_Script: {fileID: 11500000, guid: d0ef8dc2c2eabfa4e8cb77be57a837c0, type: 3} m_Name: m_EditorClassIdentifier: - isGlobal: 1 - fadeRadius: 0 - customPasses: - - id: 0 - injectionPoint: 2 - references: - version: 1 - 00000000: - type: {class: DrawRenderersCustomPass, ns: UnityEngine.Rendering.HighDefinition, - asm: Unity.RenderPipelines.HighDefinition.Runtime} - data: - m_Name: Custom Pass - enabled: 1 - targetColorBuffer: 0 - targetDepthBuffer: 0 - clearFlags: 0 - passFoldout: 0 - m_Version: 0 - filterFoldout: 1 - rendererFoldout: 1 - renderQueueType: 5 - passNames: - - Forward - layerMask: - serializedVersion: 2 - m_Bits: 2048 - sortingCriteria: 4 - overrideMaterial: {fileID: 0} - overrideMaterialPassIndex: 0 - overrideMaterialPassName: Forward - overrideDepthState: 0 - depthCompareFunction: 4 - depthWrite: 1 - shaderPass: 0 ---- !u!4 &1497430087 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1497430085} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 1.29, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1527043433 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1527043437} - - component: {fileID: 1527043436} - - component: {fileID: 1527043435} - - component: {fileID: 1527043434} - m_Layer: 13 - m_Name: Sphere (4) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!135 &1527043434 -SphereCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1527043433} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.5 - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1527043435 + m_HDProbeVersion: 3 + 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: 1, y: 1, z: 1} + m_BoxBlendDistanceNegative: {x: 1, y: 1, z: 1} + 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 + fixedValue: 90 + automaticScale: 1 + viewerScale: 1 + type: 0 + mode: 2 + realtimeMode: 1 + lighting: + multiplier: 27.67 + weight: 1 + lightLayer: 1 + fadeDistance: 10000 + rangeCompressionFactor: 1 + influence: + m_EditorAdvancedModeBlendDistancePositive: {x: 1, y: 1, z: 1} + m_EditorAdvancedModeBlendDistanceNegative: {x: 1, y: 1, z: 1} + 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: 2, y: 2, z: 2} + 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: 1 + 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} + captureRotationProxySpace: {x: 0, y: 0, z: 0, w: 1} + mirrorPositionProxySpace: {x: 0, y: 0, z: 0} + mirrorRotationProxySpace: {x: 0, y: 0, z: 0, w: 0} + resolution: 512 + cameraSettings: + customRenderingSettings: 0 + renderingPathCustomFrameSettings: + bitDatas: + data1: 70280697347917 + data2: 4539628425463136256 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 0 + data2: 0 + bufferClearing: + clearColorMode: 0 + backgroundColorHDR: {r: 0.023529412, g: 0.07058824, b: 0.1882353, a: 0} + clearDepth: 1 + volumes: + layerMask: + serializedVersion: 2 + m_Bits: 1 + anchorOverride: {fileID: 0} + frustum: + mode: 0 + aspect: 1 + farClipPlaneRaw: 1000 + nearClipPlaneRaw: 0.3 + fieldOfView: 90 + projectionMatrix: + 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 + culling: + useOcclusionCulling: 1 + cullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + sceneCullingMaskOverride: 0 + invertFaceCulling: 0 + flipYMode: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + defaultFrameSettings: 0 + 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 + m_ProbeSettingsOverride: + probe: 0 + camera: + camera: 0 + m_ProxyVolume: {fileID: 0} + m_BakedTexture: {fileID: 0} + m_CustomTexture: {fileID: 8900000, guid: bcd1d60980af623478368e9455ea5689, type: 3} + m_BakedRenderData: + m_WorldToCameraRHS: + e00: 0 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 0 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 0 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 0 + m_ProjectionMatrix: + e00: 0 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 0 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 0 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 0 + m_CapturePosition: {x: 0, y: 0, z: 0} + m_CaptureRotation: {x: 0, y: 0, z: 0, w: 0} + m_FieldOfView: 0 + m_Aspect: 0 + m_CustomRenderData: + m_WorldToCameraRHS: + e00: 0 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 0 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 0 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 0 + m_ProjectionMatrix: + e00: 0 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 0 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 0 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 0 + m_CapturePosition: {x: 0, y: 0, z: 0} + m_CaptureRotation: {x: 0, y: 0, z: 0, w: 0} + m_FieldOfView: 0 + m_Aspect: 0 + m_EditorOnlyData: 0 + m_ReflectionProbeVersion: 9 + m_ObsoleteInfluenceShape: 0 + m_ObsoleteInfluenceSphereRadius: 3 + m_ObsoleteBlendDistancePositive: {x: 1, y: 1, z: 1} + m_ObsoleteBlendDistanceNegative: {x: 1, y: 1, z: 1} + m_ObsoleteBlendNormalDistancePositive: {x: 0, y: 0, z: 0} + m_ObsoleteBlendNormalDistanceNegative: {x: 0, y: 0, z: 0} + m_ObsoleteBoxSideFadePositive: {x: 1, y: 1, z: 1} + m_ObsoleteBoxSideFadeNegative: {x: 1, y: 1, z: 1} +--- !u!215 &1003382854 +ReflectionProbe: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1003382852} + m_Enabled: 1 + serializedVersion: 2 + m_Type: 0 + m_Mode: 2 + m_RefreshMode: 2 + m_TimeSlicingMode: 0 + m_Resolution: 128 + m_UpdateFrequency: 0 + m_BoxSize: {x: 2, y: 2, z: 2} + m_BoxOffset: {x: 0, y: 0, z: 0} + m_NearClip: 0.3 + m_FarClip: 1000 + m_ShadowDistance: 100 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_IntensityMultiplier: 1 + m_BlendDistance: 0 + m_HDR: 1 + m_BoxProjection: 0 + m_RenderDynamicObjects: 0 + m_UseOcclusionCulling: 1 + m_Importance: 1 + m_CustomBakedTexture: {fileID: 0} +--- !u!4 &1003382855 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1003382852} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.4912243, y: 0.9100001, z: -0.5319977} + m_LocalScale: {x: 0.94253, y: 0.94253, z: 0.94253} + m_Children: [] + m_Father: {fileID: 110938678} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1175589554 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1175589555} + - component: {fileID: 1175589556} + m_Layer: 0 + m_Name: CustomPass_BeforeTransparent + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1175589555 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1175589554} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.29, y: 0, z: 200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1938177837} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1175589556 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1175589554} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 1 + fadeRadius: 0 + priority: 0 + customPasses: + - id: 0 + injectionPoint: 1 + references: + version: 1 + 00000000: + type: {class: DrawRenderersCustomPass, ns: UnityEngine.Rendering.HighDefinition, + asm: Unity.RenderPipelines.HighDefinition.Runtime} + data: + m_Name: Custom Pass + enabled: 1 + targetColorBuffer: 0 + targetDepthBuffer: 0 + clearFlags: 0 + passFoldout: 0 + m_Version: 0 + filterFoldout: 1 + rendererFoldout: 1 + renderQueueType: 5 + layerMask: + serializedVersion: 2 + m_Bits: 4096 + sortingCriteria: 59 + overrideMaterial: {fileID: 2100000, guid: 92c17825c88bbfc489881d74a0c59d3d, + type: 2} + overrideMaterialPassIndex: 0 + overrideMaterialPassName: FirstPass + overrideDepthState: 1 + depthCompareFunction: 4 + depthWrite: 1 + shaderPass: 0 +--- !u!1 &1234943212 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1234943213} + - component: {fileID: 1234943214} + m_Layer: 0 + m_Name: CustomPass_BeforePreRefraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1234943213 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1234943212} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.29, y: 0, z: 200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1938177837} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1234943214 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1234943212} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 1 + fadeRadius: 0 + priority: 0 + customPasses: + - id: 0 + injectionPoint: 4 + references: + version: 1 + 00000000: + type: {class: DrawRenderersCustomPass, ns: UnityEngine.Rendering.HighDefinition, + asm: Unity.RenderPipelines.HighDefinition.Runtime} + data: + m_Name: Custom Pass + enabled: 1 + targetColorBuffer: 0 + targetDepthBuffer: 0 + clearFlags: 0 + passFoldout: 0 + m_Version: 0 + filterFoldout: 1 + rendererFoldout: 1 + renderQueueType: 5 + layerMask: + serializedVersion: 2 + m_Bits: 8192 + sortingCriteria: 59 + overrideMaterial: {fileID: 0} + overrideMaterialPassIndex: 0 + overrideMaterialPassName: Forward + overrideDepthState: 1 + depthCompareFunction: 4 + depthWrite: 1 + shaderPass: 0 +--- !u!1 &1309071044 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1309071045} + - component: {fileID: 1309071047} + - component: {fileID: 1309071046} + m_Layer: 0 + m_Name: Point Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1309071045 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309071044} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.4572242, y: 3.4220843, z: -2.3758435} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1484942372} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1309071046 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309071044} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 10 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 + m_PointlightHDType: 0 + m_SpotLightShape: 0 + m_AreaLightShape: 0 + m_Intensity: 600 + m_EnableSpotReflector: 0 + m_LuxAtDistance: 1 + m_InnerSpotPercent: 0 + m_LightDimmer: 1 + m_VolumetricDimmer: 1 + m_LightUnit: 0 + m_FadeDistance: 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 + m_MaxSmoothness: 0.99 + m_ApplyRangeAttenuation: 1 + m_DisplayAreaLightEmissiveMesh: 0 + m_AreaLightCookie: {fileID: 0} + m_AreaLightShadowCone: 120 + m_UseScreenSpaceShadows: 0 + m_InteractsWithSky: 1 + m_AngularDiameter: 0.5 + m_FlareSize: 2 + m_FlareTint: {r: 1, g: 1, b: 1, a: 1} + m_FlareFalloff: 4 + m_SurfaceTexture: {fileID: 0} + m_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 + 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: 16 + m_MinFilterSize: 1 + m_KernelSize: 5 + m_LightAngle: 1 + m_MaxDepthBias: 0.001 + m_ShadowResolution: + m_Override: 512 + m_UseOverride: 1 + m_Level: 0 + m_ShadowDimmer: 1 + m_VolumetricShadowDimmer: 1 + m_ShadowFadeDistance: 10000 + m_UseContactShadow: + m_Override: 0 + 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_BarnDoorAngle: 90 + m_BarnDoorLength: 0.05 + m_ShadowCascadeRatios: + - 0.05 + - 0.2 + - 0.3 + m_ShadowCascadeBorders: + - 0.2 + - 0.2 + - 0.2 + - 0.2 + m_ShadowAlgorithm: 0 + m_ShadowVariant: 0 + m_ShadowPrecision: 0 + useOldInspector: 0 + useVolumetric: 1 + featuresFoldout: 1 + showAdditionalSettings: 1 + m_AreaLightEmissiveMeshShadowCastingMode: 0 + m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 +--- !u!108 &1309071047 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309071044} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 2 + m_Shape: 0 + m_Color: {r: 0, g: 1, b: 0.027679205, a: 1} + m_Intensity: 47.746483 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + 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_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!1 &1388312406 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1388312410} + - component: {fileID: 1388312409} + - component: {fileID: 1388312408} + - component: {fileID: 1388312407} + m_Layer: 11 + m_Name: Sphere (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &1388312407 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1388312406} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1388312408 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1388312406} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 93021a2d1a5c4484c840177b21af6d45, 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1388312409 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1388312406} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1388312410 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1388312406} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.4502242, y: 0.8020843, z: -0.4328437} + m_LocalScale: {x: 1.6663209, y: 1.6663209, z: 1.6663209} + m_Children: [] + m_Father: {fileID: 110938678} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1420011183 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1420011184} + - component: {fileID: 1420011186} + - component: {fileID: 1420011185} + m_Layer: 14 + m_Name: Sphere (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1420011184 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1420011183} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -3.3181758, y: 0.8020843, z: -0.4328437} + m_LocalScale: {x: 1.6663209, y: 1.6663209, z: 1.6663209} + m_Children: [] + m_Father: {fileID: 1484942372} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1420011185 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1420011183} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 2 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 3519774ed36188e44b17adb192f1a441, 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1420011186 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1420011183} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1423207873 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1423207874} + - component: {fileID: 1423207877} + - component: {fileID: 1423207876} + - component: {fileID: 1423207875} + m_Layer: 10 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1423207874 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1423207873} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 4.647624, y: 0.8020843, z: -0.4328437} + m_LocalScale: {x: 1.6663209, y: 1.6663209, z: 1.6663209} + m_Children: [] + m_Father: {fileID: 1484942372} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!135 &1423207875 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1423207873} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1423207876 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1423207873} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 93021a2d1a5c4484c840177b21af6d45, 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1423207877 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1423207873} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1484942371 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1484942372} + m_Layer: 0 + m_Name: Objects + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1484942372 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1484942371} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.6702242, y: -2.49, z: 199.05} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1423207874} + - {fileID: 1855762443} + - {fileID: 1420011184} + - {fileID: 67493248} + - {fileID: 782038391} + - {fileID: 1309071045} + - {fileID: 918385723} + m_Father: {fileID: 1938177837} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1497430085 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1497430087} + - component: {fileID: 1497430086} + m_Layer: 0 + m_Name: CustomPass_BeforePostProcess + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1497430086 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1497430085} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 1 + fadeRadius: 0 + priority: 0 + customPasses: + - id: 0 + injectionPoint: 2 + references: + version: 1 + 00000000: + type: {class: DrawRenderersCustomPass, ns: UnityEngine.Rendering.HighDefinition, + asm: Unity.RenderPipelines.HighDefinition.Runtime} + data: + m_Name: Custom Pass + enabled: 1 + targetColorBuffer: 0 + targetDepthBuffer: 0 + clearFlags: 0 + passFoldout: 0 + m_Version: 0 + filterFoldout: 1 + rendererFoldout: 1 + renderQueueType: 5 + layerMask: + serializedVersion: 2 + m_Bits: 2048 + sortingCriteria: 4 + overrideMaterial: {fileID: 0} + overrideMaterialPassIndex: 0 + overrideMaterialPassName: Forward + overrideDepthState: 0 + depthCompareFunction: 4 + depthWrite: 1 + shaderPass: 0 +--- !u!4 &1497430087 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1497430085} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.29, y: 0, z: 200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2301058368061906180} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1527043433 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1527043437} + - component: {fileID: 1527043436} + - component: {fileID: 1527043435} + - component: {fileID: 1527043434} + m_Layer: 13 + m_Name: Sphere (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &1527043434 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1527043433} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1527043435 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1527043433} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 2 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 93021a2d1a5c4484c840177b21af6d45, 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1527043436 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1527043433} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1527043437 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1527043433} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -1.3953757, y: 0.8020843, z: -0.4328437} + m_LocalScale: {x: 1.6663209, y: 1.6663209, z: 1.6663209} + m_Children: [] + m_Father: {fileID: 110938678} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1551760950 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1551760953} + - component: {fileID: 1551760952} + - component: {fileID: 1551760951} + 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 &1551760951 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1551760950} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 441482e8936e35048a1dffac814e3ef8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Profile: {fileID: 11400000, guid: 864689173ea47a14399cb0eb9a1d6e0e, type: 2} + m_StaticLightingSkyUniqueID: 2 + m_SkySettings: {fileID: 38172260} + m_SkySettingsFromProfile: {fileID: 7974066123450201752, guid: 864689173ea47a14399cb0eb9a1d6e0e, + type: 2} +--- !u!114 &1551760952 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1551760950} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: 7da351043c6bf6741b155d0286b6ffdd, type: 2} +--- !u!4 &1551760953 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1551760950} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.87, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1604822126 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1604822127} + - component: {fileID: 1604822128} + m_Layer: 0 + m_Name: CustomPass_BeforePostProcess + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1604822127 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1604822126} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.29, y: 0, z: 200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1938177837} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1604822128 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1604822126} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 1 + fadeRadius: 0 + priority: 0 + customPasses: + - id: 0 + injectionPoint: 2 + references: + version: 1 + 00000000: + type: {class: DrawRenderersCustomPass, ns: UnityEngine.Rendering.HighDefinition, + asm: Unity.RenderPipelines.HighDefinition.Runtime} + data: + m_Name: Custom Pass + enabled: 1 + targetColorBuffer: 0 + targetDepthBuffer: 0 + clearFlags: 0 + passFoldout: 0 + m_Version: 0 + filterFoldout: 1 + rendererFoldout: 1 + renderQueueType: 5 + layerMask: + serializedVersion: 2 + m_Bits: 2048 + sortingCriteria: 4 + overrideMaterial: {fileID: 0} + overrideMaterialPassIndex: 0 + overrideMaterialPassName: Forward + overrideDepthState: 0 + depthCompareFunction: 4 + depthWrite: 1 + shaderPass: 0 +--- !u!1 &1609657390 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1609657392} + - component: {fileID: 1609657391} + m_Layer: 0 + m_Name: CustomPass_BeforeRendering + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1609657391 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1609657390} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 1 + fadeRadius: 0 + priority: 0 + customPasses: + - id: 0 + injectionPoint: 0 + references: + version: 1 + 00000000: + type: {class: DrawRenderersCustomPass, ns: UnityEngine.Rendering.HighDefinition, + asm: Unity.RenderPipelines.HighDefinition.Runtime} + data: + m_Name: Custom Pass + enabled: 1 + targetColorBuffer: 0 + targetDepthBuffer: 0 + clearFlags: 0 + passFoldout: 0 + m_Version: 0 + filterFoldout: 0 + rendererFoldout: 0 + renderQueueType: 2 + layerMask: + serializedVersion: 2 + m_Bits: 1 + sortingCriteria: 59 + overrideMaterial: {fileID: 0} + overrideMaterialPassIndex: 0 + overrideMaterialPassName: Forward + overrideDepthState: 0 + depthCompareFunction: 4 + depthWrite: 1 + shaderPass: 0 +--- !u!4 &1609657392 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1609657390} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.29, y: 0, z: 200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2301058368061906180} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1623078032 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1623078033} + - component: {fileID: 1623078035} + - component: {fileID: 1623078034} + m_Layer: 0 + m_Name: RawImage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1623078033 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1623078032} + 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_Children: [] + m_Father: {fileID: 2037303555} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1623078034 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1623078032} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 8400000, guid: b6b9dcb98c600534fa4922b259aac581, type: 2} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!222 &1623078035 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1623078032} + m_CullTransparentMesh: 0 +--- !u!1 &1675087327 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1675087329} + - component: {fileID: 1675087328} + m_Layer: 0 + m_Name: CustomPass_AfterOpaqueDepthAndNormal + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1675087328 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1675087327} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 1 + fadeRadius: 0 + priority: 0 + customPasses: + - id: 0 + injectionPoint: 5 + references: + version: 1 + 00000000: + type: {class: DrawRenderersCustomPass, ns: UnityEngine.Rendering.HighDefinition, + asm: Unity.RenderPipelines.HighDefinition.Runtime} + data: + m_Name: Custom Pass + enabled: 1 + targetColorBuffer: 0 + targetDepthBuffer: 0 + clearFlags: 0 + passFoldout: 0 + m_Version: 0 + filterFoldout: 1 + rendererFoldout: 1 + renderQueueType: 2 + layerMask: + serializedVersion: 2 + m_Bits: 16384 + sortingCriteria: 59 + overrideMaterial: {fileID: 0} + overrideMaterialPassIndex: 0 + overrideMaterialPassName: Forward + overrideDepthState: 1 + depthCompareFunction: 4 + depthWrite: 1 + shaderPass: 0 +--- !u!4 &1675087329 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1675087327} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.29, y: 0, z: 200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2301058368061906180} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1798352551 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1798352552} + - component: {fileID: 1798352553} + m_Layer: 0 + m_Name: CustomPass_AfterPostProcess + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1798352552 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1798352551} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.29, y: 0, z: 200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1938177837} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1798352553 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1798352551} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 1 + fadeRadius: 0 + priority: 0 + customPasses: + - id: 0 + injectionPoint: 3 + references: + version: 1 + 00000000: + type: {class: DrawRenderersCustomPass, ns: UnityEngine.Rendering.HighDefinition, + asm: Unity.RenderPipelines.HighDefinition.Runtime} + data: + m_Name: Custom Pass + enabled: 1 + targetColorBuffer: 0 + targetDepthBuffer: 0 + clearFlags: 0 + passFoldout: 0 + m_Version: 0 + filterFoldout: 1 + rendererFoldout: 1 + renderQueueType: 10 + layerMask: + serializedVersion: 2 + m_Bits: 1024 + sortingCriteria: 59 + overrideMaterial: {fileID: 0} + overrideMaterialPassIndex: 0 + overrideMaterialPassName: Forward + overrideDepthState: 1 + depthCompareFunction: 4 + depthWrite: 1 + shaderPass: 0 +--- !u!1 &1855762442 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1855762443} + - component: {fileID: 1855762446} + - component: {fileID: 1855762445} + - component: {fileID: 1855762444} + m_Layer: 11 + m_Name: Sphere (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1855762443 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1855762442} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.4502242, y: 0.8020843, z: -0.4328437} + m_LocalScale: {x: 1.6663209, y: 1.6663209, z: 1.6663209} + m_Children: [] + m_Father: {fileID: 1484942372} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!135 &1855762444 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1855762442} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1855762445 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1855762442} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 93021a2d1a5c4484c840177b21af6d45, 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1855762446 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1855762442} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1938177834 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1938177837} + - component: {fileID: 1938177836} + - component: {fileID: 1938177835} + m_Layer: 0 + m_Name: Forward + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1938177835 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1938177834} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 7 + 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.147, g: 0.08628003, b: 0.056594998, a: 0} + clearDepth: 1 + volumeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + volumeAnchorOverride: {fileID: 0} + antialiasing: 0 + SMAAQuality: 2 + dithering: 0 + stopNaNs: 0 + taaSharpenStrength: 0.5 + physicalParameters: + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + flipYMode: 0 + fullscreenPassthrough: 0 + allowDynamicResolution: 0 + customRenderingSettings: 1 + invertFaceCulling: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + hasPersistentHistory: 0 + m_RenderingPathCustomFrameSettings: + bitDatas: + data1: 70005818916700 + data2: 4539628424389459968 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 1 + data2: 0 + defaultFrameSettings: 0 +--- !u!20 &1938177836 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1938177834} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.2509804, g: 0.2509804, b: 0.2509804, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 763.8809 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.5 + height: 1 + near clip plane: 180 + far clip plane: 220 + field of view: 3.3 + orthographic: 0 + orthographic size: 1.2 + m_Depth: 1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 32 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 8400000, guid: b6b9dcb98c600534fa4922b259aac581, type: 2} + 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 &1938177837 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1938177834} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 11.84, y: 0, z: -200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1998635869} + - {fileID: 698970438} + - {fileID: 2041699444} + - {fileID: 1234943213} + - {fileID: 1175589555} + - {fileID: 1604822127} + - {fileID: 1798352552} + - {fileID: 1484942372} + - {fileID: 247671011} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1998635868 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1998635869} + - component: {fileID: 1998635873} + - component: {fileID: 1998635872} + - component: {fileID: 1998635871} + - component: {fileID: 1998635870} + m_Layer: 5 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1998635869 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1998635868} + m_LocalRotation: {x: -0.9238796, y: -0, z: -0, w: 0.3826834} + m_LocalPosition: {x: 0, y: 0, z: 200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1938177837} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: -135, y: 0, z: 0} +--- !u!114 &1998635870 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1998635868} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a4ee7c3a3b205a14a94094d01ff91d6b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HDProbeVersion: 3 + 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 + fixedValue: 90 + automaticScale: 1 + viewerScale: 1 + type: 1 + mode: 1 + realtimeMode: 0 + lighting: + multiplier: 1 + weight: 1 + lightLayer: 1 + fadeDistance: 10000 + rangeCompressionFactor: 1 + influence: + 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: 0.01, 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 + proxy: + m_CSVersion: 1 + 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} + captureRotationProxySpace: {x: 0, y: 0, z: 0, w: 1} + mirrorPositionProxySpace: {x: 0, y: 0, z: 0} + mirrorRotationProxySpace: {x: -0.70710677, y: 0, z: 0, w: 0.70710677} + resolution: 512 + cameraSettings: + customRenderingSettings: 1 + renderingPathCustomFrameSettings: + bitDatas: + data1: 70280697347917 + data2: 4539628425463136256 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 64 + data2: 0 + bufferClearing: + clearColorMode: 0 + backgroundColorHDR: {r: 0.023529412, g: 0.07058824, b: 0.1882353, a: 0} + clearDepth: 1 + volumes: + layerMask: + serializedVersion: 2 + m_Bits: 1 + anchorOverride: {fileID: 0} + frustum: + mode: 0 + aspect: 1 + farClipPlaneRaw: 1000 + nearClipPlaneRaw: 0.3 + fieldOfView: 90 + projectionMatrix: + 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 + culling: + useOcclusionCulling: 1 + cullingMask: + serializedVersion: 2 + m_Bits: 32 + sceneCullingMaskOverride: 0 + invertFaceCulling: 0 + flipYMode: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + defaultFrameSettings: 0 + 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 + m_ProbeSettingsOverride: + probe: 0 + camera: + camera: 0 + m_ProxyVolume: {fileID: 0} + m_BakedTexture: {fileID: 0} + m_CustomTexture: {fileID: 0} + m_BakedRenderData: + m_WorldToCameraRHS: + e00: 0 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 0 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 0 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 0 + m_ProjectionMatrix: + e00: 0 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 0 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 0 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 0 + m_CapturePosition: {x: 0, y: 0, z: 0} + m_CaptureRotation: {x: 0, y: 0, z: 0, w: 0} + m_FieldOfView: 0 + m_Aspect: 0 + m_CustomRenderData: + m_WorldToCameraRHS: + e00: 0 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 0 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 0 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 0 + m_ProjectionMatrix: + e00: 0 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 0 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 0 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 0 + m_CapturePosition: {x: 0, y: 0, z: 0} + m_CaptureRotation: {x: 0, y: 0, z: 0, w: 0} + m_FieldOfView: 0 + m_Aspect: 0 + m_EditorOnlyData: 0 + m_PlanarProbeVersion: 6 + m_ObsoleteCaptureNearPlane: 0.3 + m_ObsoleteCaptureFarPlane: 1000 + m_ObsoleteOverrideFieldOfView: 0 + m_ObsoleteFieldOfViewOverride: 90 + m_LocalReferencePosition: {x: 0, y: 0.99999994, z: 0.000000059604645} +--- !u!23 &1998635871 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1527043433} + m_GameObject: {fileID: 1998635868} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -2082,10 +4797,10 @@ MeshRenderer: m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 m_RayTraceProcedural: 0 - m_RenderingLayerMask: 2 + m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 93021a2d1a5c4484c840177b21af6d45, type: 2} + - {fileID: 2100000, guid: 6b17274157b33bc45b6a40e7d4ff51fe, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2094,7 +4809,7 @@ MeshRenderer: m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_ReceiveGI: 1 - m_PreserveUVs: 0 + m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 m_StitchLightmapSeams: 1 @@ -2107,29 +4822,29 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1527043436 -MeshFilter: +--- !u!64 &1998635872 +MeshCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1527043433} - m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &1527043437 -Transform: + m_GameObject: {fileID: 1998635868} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &1998635873 +MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1527043433} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -1.3953757, y: 0.8020843, z: -0.4328437} - m_LocalScale: {x: 1.6663209, y: 1.6663209, z: 1.6663209} - m_Children: [] - m_Father: {fileID: 110938678} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1551760950 + m_GameObject: {fileID: 1998635868} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &2037303554 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -2137,65 +4852,98 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1551760953} - - component: {fileID: 1551760952} - - component: {fileID: 1551760951} + - component: {fileID: 2037303555} + - component: {fileID: 2037303558} + - component: {fileID: 2037303557} + - component: {fileID: 2037303556} m_Layer: 0 - m_Name: Scene Settings + m_Name: Canvas m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &1551760951 +--- !u!224 &2037303555 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2037303554} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 1623078033} + m_Father: {fileID: 65093929} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &2037303556 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551760950} + m_GameObject: {fileID: 2037303554} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 441482e8936e35048a1dffac814e3ef8, type: 3} + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} m_Name: m_EditorClassIdentifier: - m_Profile: {fileID: 11400000, guid: 864689173ea47a14399cb0eb9a1d6e0e, type: 2} - m_StaticLightingSkyUniqueID: 2 - m_SkySettings: {fileID: 63262726} - m_SkySettingsFromProfile: {fileID: 7974066123450201752, guid: 864689173ea47a14399cb0eb9a1d6e0e, - type: 2} ---- !u!114 &1551760952 + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &2037303557 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551760950} + m_GameObject: {fileID: 2037303554} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} m_Name: m_EditorClassIdentifier: - isGlobal: 1 - priority: 0 - blendDistance: 0 - weight: 1 - sharedProfile: {fileID: 11400000, guid: 7da351043c6bf6741b155d0286b6ffdd, type: 2} ---- !u!4 &1551760953 -Transform: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &2037303558 +Canvas: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551760950} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.87, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1609657390 + m_GameObject: {fileID: 2037303554} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 65093928} + m_PlaneDistance: 2 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!1 &2041699443 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -2203,99 +4951,36 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1609657392} - - component: {fileID: 1609657391} + - component: {fileID: 2041699444} + - component: {fileID: 2041699445} m_Layer: 0 - m_Name: CustomPass_BeforeRendering + m_Name: CustomPass_AfterOpaqueDepthAndNormal m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &1609657391 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1609657390} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} - m_Name: - m_EditorClassIdentifier: - isGlobal: 1 - fadeRadius: 0 - customPasses: - - id: 0 - injectionPoint: 0 - references: - version: 1 - 00000000: - type: {class: DrawRenderersCustomPass, ns: UnityEngine.Rendering.HighDefinition, - asm: Unity.RenderPipelines.HighDefinition.Runtime} - data: - m_Name: Custom Pass - enabled: 1 - targetColorBuffer: 0 - targetDepthBuffer: 0 - clearFlags: 0 - passFoldout: 0 - m_Version: 0 - filterFoldout: 1 - rendererFoldout: 1 - renderQueueType: 2 - passNames: - - Forward - layerMask: - serializedVersion: 2 - m_Bits: 1 - sortingCriteria: 59 - overrideMaterial: {fileID: 0} - overrideMaterialPassIndex: 0 - overrideMaterialPassName: Forward - overrideDepthState: 0 - depthCompareFunction: 4 - depthWrite: 1 - shaderPass: 0 ---- !u!4 &1609657392 +--- !u!4 &2041699444 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1609657390} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1.29, y: 0, z: 0} + m_GameObject: {fileID: 2041699443} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.29, y: 0, z: 200} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 0} + m_Father: {fileID: 1938177837} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1675087327 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1675087329} - - component: {fileID: 1675087328} - m_Layer: 0 - m_Name: CustomPass_AfterOpaqueDepthAndNormal - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1675087328 +--- !u!114 &2041699445 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1675087327} + m_GameObject: {fileID: 2041699443} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} @@ -2303,6 +4988,7 @@ MonoBehaviour: m_EditorClassIdentifier: isGlobal: 1 fadeRadius: 0 + priority: 0 customPasses: - id: 0 injectionPoint: 5 @@ -2322,8 +5008,6 @@ MonoBehaviour: filterFoldout: 1 rendererFoldout: 1 renderQueueType: 2 - passNames: - - Forward layerMask: serializedVersion: 2 m_Bits: 16384 @@ -2333,22 +5017,8 @@ MonoBehaviour: overrideMaterialPassName: Forward overrideDepthState: 1 depthCompareFunction: 4 - depthWrite: 0 + depthWrite: 1 shaderPass: 0 ---- !u!4 &1675087329 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1675087327} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1.29, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2130596026 GameObject: m_ObjectHideFlags: 0 @@ -2444,3 +5114,191 @@ Transform: m_Father: {fileID: 110938678} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2194996321326470682 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2298508573812409172} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 7 + 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.147, g: 0.08628003, b: 0.056594998, a: 0} + clearDepth: 1 + volumeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + volumeAnchorOverride: {fileID: 0} + antialiasing: 0 + SMAAQuality: 2 + dithering: 0 + stopNaNs: 0 + taaSharpenStrength: 0.5 + physicalParameters: + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + flipYMode: 0 + fullscreenPassthrough: 0 + allowDynamicResolution: 0 + customRenderingSettings: 1 + invertFaceCulling: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + hasPersistentHistory: 0 + m_RenderingPathCustomFrameSettings: + bitDatas: + data1: 70005818916701 + data2: 4539628424389459968 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 1 + data2: 0 + defaultFrameSettings: 0 +--- !u!20 &2280657050409914832 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2298508573812409172} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.2509804, g: 0.2509804, b: 0.2509804, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 763.8809 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.5 + height: 1 + near clip plane: 180 + far clip plane: 220 + field of view: 3.3 + orthographic: 0 + orthographic size: 1.2 + m_Depth: 1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 32 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 8400000, guid: b6b9dcb98c600534fa4922b259aac581, type: 2} + 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!1 &2298508573812409172 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2301058368061906180} + - component: {fileID: 2280657050409914832} + - component: {fileID: 2194996321326470682} + m_Layer: 0 + m_Name: Deferred + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2301058368061906180 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2298508573812409172} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 617007121} + - {fileID: 1609657392} + - {fileID: 1675087329} + - {fileID: 202184537} + - {fileID: 546121086} + - {fileID: 1497430087} + - {fileID: 474315046} + - {fileID: 110938678} + - {fileID: 206488784} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.meta new file mode 100644 index 00000000000..3994eeba5fa --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0c7485bfce378041b1a208d86d55875 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity new file mode 100644 index 00000000000..ab781c2fc7d --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity @@ -0,0 +1,1502 @@ +%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: 9 + 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_IndirectSpecularColor: {r: 0.031361558, g: 0.040105402, b: 0.051489316, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + 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_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + 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: 4890085278179872738, guid: dcc90465ec47fe341a09e00fd8b93edf, + type: 2} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + 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 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &64242708 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 64242709} + m_Layer: 0 + m_Name: BlurPass + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &64242709 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 64242708} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -70.5, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1795749611} + - {fileID: 1652072216} + - {fileID: 181213261} + - {fileID: 995342285} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &65093927 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1132393308280272, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_Name + value: HDRP_Test_Camera + objectReference: {fileID: 0} + - target: {fileID: 1132393308280272, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_IsActive + value: 1 + 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 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalPosition.z + value: -200 + 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_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_projectionMatrixMode + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: field of view + value: 26.991467 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: doBeforeTest.m_PersistentCalls.m_Calls.Array.size + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: doBeforeTest.m_PersistentCalls.m_Calls.Array.data[0].m_Mode + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: doBeforeTest.m_PersistentCalls.m_Calls.Array.data[0].m_CallState + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: checkMemoryAllocation + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} +--- !u!4 &65093928 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + m_PrefabInstance: {fileID: 65093927} + m_PrefabAsset: {fileID: 0} +--- !u!1 &179283798 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 179283799} + m_Layer: 0 + m_Name: BlurPass (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &179283799 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 179283798} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -70.5, y: 84.75, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1612872288} + - {fileID: 315305978} + - {fileID: 1007958953} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &181213260 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 181213261} + - component: {fileID: 181213263} + - component: {fileID: 181213262} + m_Layer: 0 + m_Name: New Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &181213261 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 181213260} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -4.45, z: 9.68} + m_LocalScale: {x: 0.09001844, y: 0.09001844, z: 0.09001844} + m_Children: [] + m_Father: {fileID: 64242709} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &181213262 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 181213260} + m_Text: Blur + m_OffsetZ: 0 + m_CharacterSize: 1 + m_LineSpacing: 1 + m_Anchor: 0 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 111 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &181213263 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 181213260} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &247597907 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 247597908} + - component: {fileID: 247597911} + - component: {fileID: 247597910} + - component: {fileID: 247597909} + m_Layer: 0 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &247597908 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 247597907} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 503088924} + m_Father: {fileID: 65093928} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &247597909 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 247597907} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &247597910 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 247597907} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &247597911 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 247597907} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!1 &315305977 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 315305978} + - component: {fileID: 315305981} + - component: {fileID: 315305980} + - component: {fileID: 315305979} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &315305978 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 315305977} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.84832263, y: 0.24588984, z: 8.01} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 179283799} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &315305979 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 315305977} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &315305980 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 315305977} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + 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: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &315305981 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 315305977} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &338225181 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 338225182} + - component: {fileID: 338225184} + - component: {fileID: 338225183} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &338225182 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338225181} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 200} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 65093928} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &338225183 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338225181} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &338225184 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338225181} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!1 &503088923 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 503088924} + - component: {fileID: 503088926} + - component: {fileID: 503088925} + m_Layer: 0 + m_Name: RawImage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &503088924 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 503088923} + 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_Children: [] + m_Father: {fileID: 247597908} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &503088925 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 503088923} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 8400000, guid: 94f05850b7f1d654b8127a229aec2c3a, type: 2} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!222 &503088926 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 503088923} + m_CullTransparentMesh: 0 +--- !u!114 &975076761 +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: 3df29e7cc05fbec4aa43e06ea875565d, type: 3} + m_Name: + m_EditorClassIdentifier: + active: 1 + m_AdvancedMode: 0 + rotation: + m_OverrideState: 0 + m_Value: 0 + min: 0 + max: 360 + skyIntensityMode: + m_OverrideState: 0 + m_Value: 0 + exposure: + m_OverrideState: 0 + m_Value: 0 + multiplier: + m_OverrideState: 0 + m_Value: 1 + min: 0 + upperHemisphereLuxValue: + m_OverrideState: 0 + m_Value: 1 + min: 0 + upperHemisphereLuxColor: + m_OverrideState: 0 + m_Value: {x: 0, y: 0, z: 0} + desiredLuxValue: + m_OverrideState: 0 + m_Value: 20000 + updateMode: + m_OverrideState: 0 + m_Value: 0 + updatePeriod: + m_OverrideState: 0 + m_Value: 0 + min: 0 + includeSunInBaking: + m_OverrideState: 0 + m_Value: 0 + sunSize: + m_OverrideState: 0 + m_Value: 0.04 + min: 0 + max: 1 + sunSizeConvergence: + m_OverrideState: 0 + m_Value: 5 + min: 1 + max: 10 + atmosphereThickness: + m_OverrideState: 0 + m_Value: 1 + min: 0 + max: 5 + skyTint: + m_OverrideState: 0 + m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} + hdr: 0 + showAlpha: 1 + showEyeDropper: 1 + groundColor: + m_OverrideState: 0 + m_Value: {r: 0.369, g: 0.349, b: 0.341, a: 1} + hdr: 0 + showAlpha: 1 + showEyeDropper: 1 + enableSunDisk: + m_OverrideState: 0 + m_Value: 1 +--- !u!1 &995342284 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 995342285} + - component: {fileID: 995342287} + - component: {fileID: 995342286} + m_Layer: 0 + m_Name: Custom Pass + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &995342285 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 995342284} + 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_Children: [] + m_Father: {fileID: 64242709} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &995342286 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 995342284} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &995342287 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 995342284} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 0 + fadeRadius: 0 + priority: 0 + customPasses: + - id: 0 + injectionPoint: 1 + references: + version: 1 + 00000000: + type: {class: Blur, ns: , asm: Assembly-CSharp} + data: + m_Name: Custom Pass + enabled: 1 + targetColorBuffer: 0 + targetDepthBuffer: 0 + clearFlags: 0 + passFoldout: 0 + m_Version: 0 +--- !u!1 &1007958952 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1007958953} + - component: {fileID: 1007958955} + - component: {fileID: 1007958954} + m_Layer: 0 + m_Name: New Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1007958953 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1007958952} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 10.2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 179283799} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1007958954 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1007958952} + m_Text: Hello World + m_OffsetZ: 0 + m_CharacterSize: 1 + m_LineSpacing: 1 + m_Anchor: 0 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 0 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1007958955 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1007958952} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1551760950 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1551760953} + - component: {fileID: 1551760952} + - component: {fileID: 1551760951} + 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 &1551760951 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1551760950} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 441482e8936e35048a1dffac814e3ef8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Profile: {fileID: 11400000, guid: 864689173ea47a14399cb0eb9a1d6e0e, type: 2} + m_StaticLightingSkyUniqueID: 2 + m_SkySettings: {fileID: 975076761} + m_SkySettingsFromProfile: {fileID: 7974066123450201752, guid: 864689173ea47a14399cb0eb9a1d6e0e, + type: 2} +--- !u!114 &1551760952 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1551760950} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: 9ad9379fd70197f448fb2f184be74226, type: 2} +--- !u!4 &1551760953 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1551760950} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.87, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1612872287 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1612872288} + - component: {fileID: 1612872291} + - component: {fileID: 1612872290} + - component: {fileID: 1612872289} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1612872288 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1612872287} + 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_Children: [] + m_Father: {fileID: 179283799} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1612872289 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1612872287} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 7 + 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: 1 + volumeAnchorOverride: {fileID: 0} + antialiasing: 0 + SMAAQuality: 2 + dithering: 0 + stopNaNs: 0 + taaSharpenStrength: 0.6 + physicalParameters: + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + flipYMode: 0 + fullscreenPassthrough: 0 + allowDynamicResolution: 0 + customRenderingSettings: 0 + invertFaceCulling: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + hasPersistentHistory: 0 + m_RenderingPathCustomFrameSettings: + bitDatas: + data1: 70297877217101 + data2: 4539628425463136256 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 0 + data2: 0 + defaultFrameSettings: 0 +--- !u!81 &1612872290 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1612872287} + m_Enabled: 1 +--- !u!20 &1612872291 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1612872287} + 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_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.5 + height: 0.5 + near clip plane: 0.3 + far clip plane: 50 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 8400000, guid: 94f05850b7f1d654b8127a229aec2c3a, type: 2} + 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!1 &1652072215 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1652072216} + - component: {fileID: 1652072219} + - component: {fileID: 1652072218} + - component: {fileID: 1652072217} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1652072216 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1652072215} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.83, y: 0.53, z: 8.01} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 64242709} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1652072217 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1652072215} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1652072218 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1652072215} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + 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: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1652072219 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1652072215} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1795749610 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1795749611} + - component: {fileID: 1795749614} + - component: {fileID: 1795749613} + - component: {fileID: 1795749612} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1795749611 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1795749610} + 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_Children: [] + m_Father: {fileID: 64242709} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1795749612 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1795749610} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 7 + 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: 1 + volumeAnchorOverride: {fileID: 0} + antialiasing: 0 + SMAAQuality: 2 + dithering: 0 + stopNaNs: 0 + taaSharpenStrength: 0.6 + physicalParameters: + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + flipYMode: 0 + fullscreenPassthrough: 0 + allowDynamicResolution: 0 + customRenderingSettings: 0 + invertFaceCulling: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + hasPersistentHistory: 0 + m_RenderingPathCustomFrameSettings: + bitDatas: + data1: 70297877217101 + data2: 4539628425463136256 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 0 + data2: 0 + defaultFrameSettings: 0 +--- !u!81 &1795749613 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1795749610} + m_Enabled: 1 +--- !u!20 &1795749614 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1795749610} + 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_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.5 + height: 0.5 + near clip plane: 0.3 + far clip plane: 50 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 8400000, guid: 94f05850b7f1d654b8127a229aec2c3a, type: 2} + 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 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity.meta new file mode 100644 index 00000000000..5298e5c598b --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3d584f34970fc5c44871961e3178f4ce +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702.renderTexture b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702.renderTexture new file mode 100644 index 00000000000..bc475ed7a22 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702.renderTexture @@ -0,0 +1,37 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!84 &8400000 +RenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 9702 + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + serializedVersion: 3 + m_Width: 640 + m_Height: 360 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthFormat: 2 + m_ColorFormat: 8 + m_MipMap: 0 + m_GenerateMips: 1 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + 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 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702.renderTexture.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702.renderTexture.meta new file mode 100644 index 00000000000..32af2db0295 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702.renderTexture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 94f05850b7f1d654b8127a229aec2c3a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs new file mode 100644 index 00000000000..d395cfe882f --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs @@ -0,0 +1,31 @@ +using UnityEngine; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering; +using UnityEngine.Experimental.Rendering; + +class Blur : CustomPass +{ + protected override void Execute(CustomPassContext ctx) + { + CustomPassUtils.GaussianBlur( + ctx, ctx.cameraColorBuffer, ctx.cameraColorBuffer, ctx.customColorBuffer.Value, + new Vector4(0.5f, 0.5f, 0, 0), new Vector4(0.5f, 0.5f, 0, 0), + 4, 1, 0, 0 + ); + CustomPassUtils.GaussianBlur( + ctx, ctx.cameraColorBuffer, ctx.cameraColorBuffer, ctx.customColorBuffer.Value, + new Vector4(0.5f, 0.5f, 0.5f, 0), new Vector4(0.5f, 0.5f, 0.5f, 0), + 16, 4, 0, 0 + ); + CustomPassUtils.GaussianBlur( + ctx, ctx.cameraColorBuffer, ctx.cameraColorBuffer, ctx.customColorBuffer.Value, + new Vector4(0.5f, 0.5f, 0.5f, 0.5f), new Vector4(0.5f, 0.5f, 0.5f, 0.5f), + 32, 8, 0, 0 + ); + CustomPassUtils.GaussianBlur( + ctx, ctx.cameraColorBuffer, ctx.cameraColorBuffer, ctx.customColorBuffer.Value, + new Vector4(0.5f, 0.5f, 0, 0.5f), new Vector4(0.5f, 0.5f, 0, 0.5f), + 64, 32, 0, 0 + ); + } +} \ No newline at end of file diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs.meta new file mode 100644 index 00000000000..8fca9f11c27 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3dd0edfb46737cd4dbfac39597215093 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Scene Settings Profile.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Scene Settings Profile.asset new file mode 100644 index 00000000000..5ecdae9653e --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Scene Settings Profile.asset @@ -0,0 +1,15 @@ +%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: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: Scene Settings Profile + m_EditorClassIdentifier: + components: [] diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Scene Settings Profile.asset.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Scene Settings Profile.asset.meta new file mode 100644 index 00000000000..8ad04c21fc9 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Scene Settings Profile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9ad9379fd70197f448fb2f184be74226 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassCSharpScript.template b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassCSharpScript.template index 3acb8547e31..bb5d0deb692 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassCSharpScript.template +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassCSharpScript.template @@ -14,9 +14,10 @@ class #SCRIPTNAME# : CustomPass // Setup code here } - protected override void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera hdCamera, CullingResults cullingResult) + protected override void Execute(CustomPassContext ctx) { - // Executed every frame for all the camera inside the pass volume + // Executed every frame for all the camera inside the pass volume. + // The context contains the command buffer to use to enqueue graphics commands. } protected override void Cleanup() diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/DrawRenderersCustomPassDrawer.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/DrawRenderersCustomPassDrawer.cs index 63d835a7615..9f3a54b7702 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/DrawRenderersCustomPassDrawer.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/DrawRenderersCustomPassDrawer.cs @@ -160,7 +160,7 @@ protected override void DoPassGUI(SerializedProperty customPass, Rect rect) bool ShowOpaqueObjectWarning() { // Only opaque objects are concerned - RenderQueueRange currentRange = CustomPass.GetRenderQueueRangeFromRenderQueueType((CustomPass.RenderQueueType)m_RenderQueue.intValue); + RenderQueueRange currentRange = CustomPassUtils.GetRenderQueueRangeFromRenderQueueType((CustomPass.RenderQueueType)m_RenderQueue.intValue); var allOpaque = HDRenderQueue.k_RenderQueue_AllOpaque; bool customPassQueueContainsOpaqueObjects = currentRange.upperBound >= allOpaque.lowerBound && currentRange.lowerBound <= allOpaque.upperBound; if (!customPassQueueContainsOpaqueObjects) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs index 71f1ed110e8..23dd1d454cb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -921,6 +921,9 @@ static class HDShaderIDs public static readonly int _InputTex = Shader.PropertyToID("_InputTex"); public static readonly int _LoD = Shader.PropertyToID("_LoD"); public static readonly int _FaceIndex = Shader.PropertyToID("_FaceIndex"); + + // Custom Pass Utils API + public static readonly int _SourceScaleBias = Shader.PropertyToID("_SourceScaleBias"); } // Shared material property names diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs index 763ca05c202..a9ee09519fb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs @@ -66,6 +66,8 @@ internal ProfilingSampler profilingSampler SharedRTManager currentRTManager; HDCamera currentHDCamera; + MaterialPropertyBlock userMaterialPropertyBlock; + /// /// Mirror of the value in the CustomPassVolume where this custom pass is listed /// @@ -170,23 +172,21 @@ internal void ExecuteInternal(ScriptableRenderContext renderContext, CommandBuff { Setup(renderContext, cmd); isSetup = true; + userMaterialPropertyBlock = new MaterialPropertyBlock(); } SetCustomPassTarget(cmd); // Create the custom pass context: - CustomPassContext ctx = new CustomPassContext - { - renderContext = renderContext, - cmd = cmd, - hdCamera = hdCamera, - cullingResult = cullingResult, - cameraColorBuffer = targets.cameraColorBuffer, - cameraDepthBuffer = rtManager.GetDepthStencilBuffer(IsMSAAEnabled(hdCamera)), - cameraNormalBuffer = rtManager.GetNormalBuffer(IsMSAAEnabled(hdCamera)), - customColorBuffer = targets.customColorBuffer, - customDepthBuffer = targets.customDepthBuffer, - }; + CustomPassContext ctx = new CustomPassContext( + renderContext, cmd, hdCamera, + cullingResult, targets.cameraColorBuffer, + rtManager.GetDepthStencilBuffer(IsMSAAEnabled(hdCamera)), + rtManager.GetNormalBuffer(IsMSAAEnabled(hdCamera)), + targets.customColorBuffer, + targets.customDepthBuffer, + userMaterialPropertyBlock + ); isExecuting = true; #pragma warning disable CS0618 // Member is obsolete @@ -270,16 +270,16 @@ protected virtual void Execute(ScriptableRenderContext renderContext, CommandBuf /// /// Called when your pass needs to be executed by a camera /// - /// Custom Pass Context. - // TODO: move this function to abstract when we deprecate the method above + /// The context of the custom pass. Contains command buffer, render context, buffer, etc. + // TODO: move this function to abstract when we remove the method above protected virtual void Execute(CustomPassContext ctx) {} /// /// Called before the first execution of the pass occurs. /// Allow you to allocate custom buffers. /// - /// - /// + /// The render context + /// Current command buffer of the frame protected virtual void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) {} /// @@ -288,6 +288,8 @@ protected virtual void Setup(ScriptableRenderContext renderContext, CommandBuffe /// protected virtual void Cleanup() {} + // TODO: mark obsolete all the Set* functions and add a variant that takes a CustomPassContext. + /// /// Bind the camera color buffer as the current render target /// @@ -401,27 +403,7 @@ protected RTHandle GetNormalBuffer() /// The custom pass render queue type. /// Returns a render queue range compatible with a ScriptableRenderContext.DrawRenderers. protected RenderQueueRange GetRenderQueueRange(CustomPass.RenderQueueType type) - => GetRenderQueueRangeFromRenderQueueType(type); - - internal static RenderQueueRange GetRenderQueueRangeFromRenderQueueType(RenderQueueType type) - { - switch (type) - { - case CustomPass.RenderQueueType.OpaqueNoAlphaTest: return HDRenderQueue.k_RenderQueue_OpaqueNoAlphaTest; - case CustomPass.RenderQueueType.OpaqueAlphaTest: return HDRenderQueue.k_RenderQueue_OpaqueAlphaTest; - case CustomPass.RenderQueueType.AllOpaque: return HDRenderQueue.k_RenderQueue_AllOpaque; - case CustomPass.RenderQueueType.AfterPostProcessOpaque: return HDRenderQueue.k_RenderQueue_AfterPostProcessOpaque; - case CustomPass.RenderQueueType.PreRefraction: return HDRenderQueue.k_RenderQueue_PreRefraction; - case CustomPass.RenderQueueType.Transparent: return HDRenderQueue.k_RenderQueue_Transparent; - case CustomPass.RenderQueueType.LowTransparent: return HDRenderQueue.k_RenderQueue_LowTransparent; - case CustomPass.RenderQueueType.AllTransparent: return HDRenderQueue.k_RenderQueue_AllTransparent; - case CustomPass.RenderQueueType.AllTransparentWithLowRes: return HDRenderQueue.k_RenderQueue_AllTransparentWithLowRes; - case CustomPass.RenderQueueType.AfterPostProcessTransparent: return HDRenderQueue.k_RenderQueue_AfterPostProcessTransparent; - case CustomPass.RenderQueueType.All: - default: - return HDRenderQueue.k_RenderQueue_All; - } - } + => CustomPassUtils.GetRenderQueueRangeFromRenderQueueType(type); /// /// Create a custom pass to execute a fullscreen pass diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs index 8b8f57c249c..34e97601f4c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs @@ -10,51 +10,70 @@ public struct CustomPassContext /// /// Scriptable Render Context, used for any SRP related operations. /// - public ScriptableRenderContext renderContext; + public readonly ScriptableRenderContext renderContext; /// /// Command Buffer, used to enqueue graphic commands to the GPU. /// - public CommandBuffer cmd; + public readonly CommandBuffer cmd; /// - /// HDCamera, HDRP data related to the rendering camera. Use the camera property to access the Camera class. + /// HdCamera, HDRP data related to the rendering camera. Use the camera property to access the Camera class. /// - public HDCamera hdCamera; + public readonly HDCamera hdCamera; /// /// Result of the culling either of the camera or the custom pass if AggregateCullingParameters is used. /// - public CullingResults cullingResult; + public readonly CullingResults cullingResults; /// /// Camera color buffer. /// - public RTHandle cameraColorBuffer; + public readonly RTHandle cameraColorBuffer; /// /// Camera depth buffer. /// - public RTHandle cameraDepthBuffer; + public readonly RTHandle cameraDepthBuffer; /// /// Camera normal buffer. /// - public RTHandle cameraNormalBuffer; + public readonly RTHandle cameraNormalBuffer; /// /// Lazy handle to the custom color buffer, not allocated if not used. /// - public Lazy customColorBuffer; + public readonly Lazy customColorBuffer; /// /// Lazy handle to the custom depth buffer, not allocated if not used. /// - public Lazy customDepthBuffer; + public readonly Lazy customDepthBuffer; /// /// Material Property Block, unique for each custom pass instance. /// - public MaterialPropertyBlock propertyBlock; + public readonly MaterialPropertyBlock propertyBlock; + + internal CustomPassContext( + ScriptableRenderContext renderContext, CommandBuffer cmd, + HDCamera hdCamera, CullingResults cullingResults, + RTHandle cameraColorBuffer, RTHandle cameraDepthBuffer, + RTHandle cameraNormalBuffer, Lazy customColorBuffer, + Lazy customDepthBuffer, MaterialPropertyBlock propertyBlock) + { + this.renderContext = renderContext; + this.cmd = cmd; + this.hdCamera = hdCamera; + this.cullingResults = cullingResults; + this.cameraColorBuffer = cameraColorBuffer; + this.cameraDepthBuffer = cameraDepthBuffer; + this.customColorBuffer = customColorBuffer; + this.cameraNormalBuffer = cameraNormalBuffer; + this.customDepthBuffer = customDepthBuffer; + this.propertyBlock = propertyBlock; + } } } \ No newline at end of file diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs index 7a7d68b9c88..bd639fc215d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs @@ -10,13 +10,17 @@ namespace UnityEngine.Rendering.HighDefinition /// public class CustomPassUtils { + /// + /// Fullscreen scale and bias values, it is the default for functions that have scale and bias overloads. + /// + /// x: scaleX, y: scaleY, z: biasX, w: biasY public static Vector4 fullScreenScaleBias = new Vector4(1, 1, 0, 0); static ShaderTagId[] litForwardTags = { HDShaderPassNames.s_ForwardOnlyName, HDShaderPassNames.s_ForwardName, HDShaderPassNames.s_SRPDefaultUnlitName }; static ShaderTagId[] depthTags = { HDShaderPassNames.s_DepthForwardOnlyName, HDShaderPassNames.s_DepthOnlyName }; - + static ProfilingSampler downSampleSampler = new ProfilingSampler("DownSample"); static ProfilingSampler verticalBlurSampler = new ProfilingSampler("Vertical Blur"); static ProfilingSampler horizontalBlurSampler = new ProfilingSampler("Horizontal Blur"); @@ -27,18 +31,36 @@ public class CustomPassUtils static Dictionary gaussianWeightsCache = new Dictionary(); + static int downSamplePassIndex = customPassUtilsMaterial.FindPass("Downsample"); + /// /// Convert the source buffer to an half resolution buffer and output it to the destination buffer. /// /// Custom Pass Context /// /// - /// /// /// - public static void DownSample(CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 1, int sourceMip = 0, int destMip = 0) + public static void DownSample(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sourceMip = 0, int destMip = 0) + => DownSample(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sourceMip, destMip); + + public static void DownSample(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sourceMip = 0, int destMip = 0) { - Debug.Log("TODO"); + // Check if the texture provided is at least half of the size of source. + if (destination.rt.width < source.rt.width / 2 || destination.rt.height < source.rt.height) + Debug.LogError("Destination for DownSample is too small, it needs to be at least half as big as source."); + + using (new ProfilingScope(ctx.cmd, downSampleSampler)) + { + CoreUtils.SetRenderTarget(ctx.cmd, destination, ClearFlag.None, miplevel: destMip); + + Vector2Int scaledViewportSize = destination.GetScaledSize(destination.rtHandleProperties.currentViewportSize); + ctx.cmd.SetViewport(new Rect(0.0f, 0.0f, scaledViewportSize.x, scaledViewportSize.y)); + + blurPropertyBlock.SetTexture(HDShaderIDs._Source, source); + blurPropertyBlock.SetVector(HDShaderIDs._SourceScaleBias, sourceScaleBias); + ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, downSamplePassIndex, MeshTopology.Quads, 4, 1, blurPropertyBlock); + } } // Do we provide an upsample function ? @@ -47,19 +69,19 @@ public static void DownSample(CustomPassContext ctx, RTHandle source, RTHandle d // Debug.Log("TODO"); // } - public static void Copy(CustomPassContext ctx, RTHandle source, RTHandle destination, int sourceMip = 0, int destMip = 0, bool bilinear = true) + public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sourceMip = 0, int destMip = 0, bool bilinear = false) => Copy(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sourceMip, destMip, bilinear); - public static void Copy(CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sourceMip = 0, int destMip = 0, bool bilinear = true) + public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sourceMip = 0, int destMip = 0, bool bilinear = false) { CoreUtils.SetRenderTarget(ctx.cmd, destination, ClearFlag.None, Color.black, destMip); HDUtils.BlitQuad(ctx.cmd, source, sourceScaleBias, fullScreenScaleBias, sourceMip, bilinear); } - public static void GaussianBlurVertical(CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, int sourceMip = 0, int destMip = 0) + public static void GaussianBlurVertical(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, int sourceMip = 0, int destMip = 0) => GaussianBlurVertical(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sampleCount, sourceMip, destMip); - public static void GaussianBlurVertical(CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, int sourceMip = 0, int destMip = 0) + public static void GaussianBlurVertical(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, int sourceMip = 0, int destMip = 0) { using (new ProfilingScope(ctx.cmd, verticalBlurSampler)) { @@ -67,10 +89,10 @@ public static void GaussianBlurVertical(CustomPassContext ctx, RTHandle source, } } - public static void GaussianBlurHorizontal(CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, int sourceMip = 0, int destMip = 0) + public static void GaussianBlurHorizontal(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, int sourceMip = 0, int destMip = 0) => GaussianBlurHorizontal(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sampleCount, sourceMip, destMip); - public static void GaussianBlurHorizontal(CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, int sourceMip = 0, int destMip = 0) + public static void GaussianBlurHorizontal(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, int sourceMip = 0, int destMip = 0) { using (new ProfilingScope(ctx.cmd, horizontalBlurSampler)) { @@ -78,28 +100,41 @@ public static void GaussianBlurHorizontal(CustomPassContext ctx, RTHandle source } } - public static void GaussianBlur(CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, int sampleCount = 8, float radius = 1, int sourceMip = 0, int destMip = 0) + public static void GaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, int sampleCount = 8, float radius = 1, int sourceMip = 0, int destMip = 0) => GaussianBlur(ctx, source, destination, tempTarget, fullScreenScaleBias, fullScreenScaleBias, sampleCount, radius, sourceMip, destMip); - public static void GaussianBlur(CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, float radius = 1, int sourceMip = 0, int destMip = 0) + public static void GaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, float radius = 1, int sourceMip = 0, int destMip = 0, bool downSample = true) { using (new ProfilingScope(ctx.cmd, gaussianblurSampler)) { - // Downsample to half res - DownSample(ctx, source, destination, 1, sourceMip, destMip); - // Vertical blur - GaussianBlurVertical(ctx, destination, tempTarget); - // Horizontal blur - GaussianBlurHorizontal(ctx, tempTarget, destination); + if (downSample) + { + // Downsample to half res + DownSample(ctx, source, tempTarget, sourceScaleBias, destScaleBias, sourceMip, destMip); + // Vertical blur + GaussianBlurVertical(ctx, tempTarget, destination); + // Instead of allocating a new buffer on the fly, we copy the data. + // We will be able to allocate it when rendergraph lands + Copy(ctx, destination, tempTarget, fullScreenScaleBias, destScaleBias); + // Horizontal blur and upsample + GaussianBlurHorizontal(ctx, tempTarget, destination); + } + else + { + // Vertical blur + GaussianBlurVertical(ctx, source, tempTarget); + // Horizontal blur and upsample + GaussianBlurHorizontal(ctx, tempTarget, destination); + } } } - public static void DrawRenderers(CustomPassContext ctx, LayerMask layerMask, Material overrideMaterial = null, int overideMaterialIndex = 0) + public static void DrawRenderers(in CustomPassContext ctx, LayerMask layerMask, CustomPass.RenderQueueType renderQueueFilter = CustomPass.RenderQueueType.All, Material overrideMaterial = null, int overideMaterialIndex = 0) { - var result = new RendererListDesc(litForwardTags, ctx.cullingResult, ctx.hdCamera.camera) + var result = new RendererListDesc(litForwardTags, ctx.cullingResults, ctx.hdCamera.camera) { rendererConfiguration = PerObjectData.None, - renderQueueRange = RenderQueueRange.all, + renderQueueRange = GetRenderQueueRangeFromRenderQueueType(renderQueueFilter), sortingCriteria = SortingCriteria.BackToFront, excludeObjectMotionVectors = false, layerMask = layerMask, @@ -109,9 +144,9 @@ public static void DrawRenderers(CustomPassContext ctx, LayerMask layerMask, Mat HDUtils.DrawRendererList(ctx.renderContext, ctx.cmd, RendererList.Create(result)); } - public static void DrawShadowMap(CustomPassContext ctx, RTHandle destination, Camera view, LayerMask layerMask) + public static void DrawShadowMap(in CustomPassContext ctx, RTHandle destination, Camera view, LayerMask layerMask) { - var result = new RendererListDesc(litForwardTags, ctx.cullingResult, ctx.hdCamera.camera) + var result = new RendererListDesc(litForwardTags, ctx.cullingResults, ctx.hdCamera.camera) { rendererConfiguration = PerObjectData.None, renderQueueRange = RenderQueueRange.all, @@ -129,7 +164,7 @@ public static void DrawShadowMap(CustomPassContext ctx, RTHandle destination, Ca } // Render objects from the view in parameter - public static void RenderFrom(CustomPassContext ctx, RTHandle destination, Camera view, LayerMask layerMask) + public static void RenderFrom(in CustomPassContext ctx, RTHandle destination, Camera view, LayerMask layerMask) { } @@ -167,5 +202,25 @@ float Gaussian(float x, float sigma = 1) return weights; } + + public static RenderQueueRange GetRenderQueueRangeFromRenderQueueType(CustomPass.RenderQueueType type) + { + switch (type) + { + case CustomPass.RenderQueueType.OpaqueNoAlphaTest: return HDRenderQueue.k_RenderQueue_OpaqueNoAlphaTest; + case CustomPass.RenderQueueType.OpaqueAlphaTest: return HDRenderQueue.k_RenderQueue_OpaqueAlphaTest; + case CustomPass.RenderQueueType.AllOpaque: return HDRenderQueue.k_RenderQueue_AllOpaque; + case CustomPass.RenderQueueType.AfterPostProcessOpaque: return HDRenderQueue.k_RenderQueue_AfterPostProcessOpaque; + case CustomPass.RenderQueueType.PreRefraction: return HDRenderQueue.k_RenderQueue_PreRefraction; + case CustomPass.RenderQueueType.Transparent: return HDRenderQueue.k_RenderQueue_Transparent; + case CustomPass.RenderQueueType.LowTransparent: return HDRenderQueue.k_RenderQueue_LowTransparent; + case CustomPass.RenderQueueType.AllTransparent: return HDRenderQueue.k_RenderQueue_AllTransparent; + case CustomPass.RenderQueueType.AllTransparentWithLowRes: return HDRenderQueue.k_RenderQueue_AllTransparentWithLowRes; + case CustomPass.RenderQueueType.AfterPostProcessTransparent: return HDRenderQueue.k_RenderQueue_AfterPostProcessTransparent; + case CustomPass.RenderQueueType.All: + default: + return HDRenderQueue.k_RenderQueue_All; + } + } } } \ No newline at end of file diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader index ab9bac495d0..64a9ee42555 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader @@ -1,4 +1,4 @@ -Shader "Hidden/FullScreen/Blur" +Shader "Hidden/HDRP/CustomPassUtils" { HLSLINCLUDE @@ -15,9 +15,19 @@ Shader "Hidden/FullScreen/Blur" float _Radius; float _SampleCount; float4 _ViewPortSize; // We need the viewport size because we have a non fullscreen render target (blur buffers are downsampled in half res) + float4 _SourceScaleBias; + + float2 GetScaledUVs(Varyings varyings) + { + float2 uv = varyings.positionCS.xy; + + // Apply scale and bias + return uv * _SourceScaleBias.xy + _SourceScaleBias.zw; + } float4 Copy(Varyings varyings) : SV_Target { + // TODO: handle scale and bias return LOAD_TEXTURE2D_X_LOD(_Source, varyings.positionCS.xy, _SourceMip); } @@ -41,7 +51,7 @@ Shader "Hidden/FullScreen/Blur" { float depth = LoadCameraDepth(varyings.positionCS.xy); PositionInputs posInput = GetPositionInput(varyings.positionCS.xy, _ViewPortSize.zw, depth, UNITY_MATRIX_I_VP, UNITY_MATRIX_V); - return posInput.positionNDC.xy * _RTHandleScale; + return posInput.positionNDC.xy * _RTHandleScale.zw; } float4 HorizontalBlur(Varyings varyings) : SV_Target @@ -76,24 +86,31 @@ Shader "Hidden/FullScreen/Blur" return float4(BlurPixels(taps), 1); } - float4 CompositeMaskedBlur(Varyings varyings) : SV_Target + float4 DownSample(Varyings varyings) : SV_Target { - float depth = LoadCameraDepth(varyings.positionCS.xy); - float2 uv = ClampUVs(GetSampleUVs(varyings)); + float2 uv = GetScaledUVs(varyings); + // TODO: add half pixel offset ? + return SAMPLE_TEXTURE2D_X_LOD(_Source, s_linear_clamp_sampler, uv, 0); + } - float4 colorBuffer = SAMPLE_TEXTURE2D_X_LOD(_ColorBufferCopy, s_linear_clamp_sampler, uv, 0).rgba; - float4 blurredBuffer = SAMPLE_TEXTURE2D_X_LOD(_Source, s_linear_clamp_sampler, uv, 0).rgba; - float4 mask = SAMPLE_TEXTURE2D_X_LOD(_Mask, s_linear_clamp_sampler, uv, 0); - float maskDepth = SAMPLE_TEXTURE2D_X_LOD(_MaskDepth, s_linear_clamp_sampler, uv, 0).r; - float maskValue = 0; + // float4 CompositeMaskedBlur(Varyings varyings) : SV_Target + // { + // float depth = LoadCameraDepth(varyings.positionCS.xy); + // float2 uv = ClampUVs(GetSampleUVs(varyings)); - maskValue = any(mask.rgb > 0.1) || (maskDepth > depth - 0.0001); + // float4 colorBuffer = SAMPLE_TEXTURE2D_X_LOD(_ColorBufferCopy, s_linear_clamp_sampler, uv, 0).rgba; + // float4 blurredBuffer = SAMPLE_TEXTURE2D_X_LOD(_Source, s_linear_clamp_sampler, uv, 0).rgba; + // float4 mask = SAMPLE_TEXTURE2D_X_LOD(_Mask, s_linear_clamp_sampler, uv, 0); + // float maskDepth = SAMPLE_TEXTURE2D_X_LOD(_MaskDepth, s_linear_clamp_sampler, uv, 0).r; + // float maskValue = 0; - if (_InvertMask > 0.5) - maskValue = !maskValue; + // maskValue = any(mask.rgb > 0.1) || (maskDepth > depth - 0.0001); - return float4(lerp(blurredBuffer.rgb, colorBuffer.rgb, maskValue), colorBuffer.a); - } + // if (_InvertMask > 0.5) + // maskValue = !maskValue; + + // return float4(lerp(blurredBuffer.rgb, colorBuffer.rgb, maskValue), colorBuffer.a); + // } ENDHLSL diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs index 12972bf9be6..c60dbeb69c8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs @@ -9,7 +9,7 @@ namespace UnityEngine.Rendering.HighDefinition /// DrawRenderers Custom Pass /// [System.Serializable] - class DrawRenderersCustomPass : CustomPass + public class DrawRenderersCustomPass : CustomPass { /// /// HDRP Shader passes @@ -17,30 +17,58 @@ class DrawRenderersCustomPass : CustomPass public enum ShaderPass { // Ordered by frame time in HDRP + ///Object Depth pre-pass, only the depth of the object will be rendered. DepthPrepass = 1, + ///Forward pass, render the object color. Forward = 0, } // Used only for the UI to keep track of the toggle state - public bool filterFoldout; - public bool rendererFoldout; + [SerializeField] internal bool filterFoldout; + [SerializeField] internal bool rendererFoldout; //Filter settings - public CustomPass.RenderQueueType renderQueueType = CustomPass.RenderQueueType.AllOpaque; - public string[] passNames = new string[1] { "Forward" }; + /// + /// Render Queue filter to select which kind of object to render. + /// + public RenderQueueType renderQueueType = RenderQueueType.AllOpaque; + /// + /// Layer Mask filter, select which layer to render. + /// public LayerMask layerMask = 1; // Layer mask Default enabled + /// + /// Sorting flags of the objects to render. + /// public SortingCriteria sortingCriteria = SortingCriteria.CommonOpaque; // Override material + /// + /// Replaces the material of selected renders by this one, be sure to also set overrideMaterialPassName to a good value when using this property. + /// public Material overrideMaterial = null; [SerializeField] int overrideMaterialPassIndex = 0; + /// + /// Select which pass will be used to render objects when using an override material. + /// public string overrideMaterialPassName = "Forward"; + /// + /// When true, overrides the depth state of the objects. + /// public bool overrideDepthState = false; + /// + /// Overrides the Depth comparison function, only used when overrideDepthState is true. + /// public CompareFunction depthCompareFunction = CompareFunction.LessEqual; + /// + /// Overrides the Depth write, only used when overrideDepthState is true. + /// public bool depthWrite = true; + /// + /// Set the shader pass to use when the override material is null + /// public ShaderPass shaderPass = ShaderPass.Forward; int fadeValueId; @@ -51,7 +79,12 @@ public enum ShaderPass // Cache the shaderTagIds so we don't allocate a new array each frame ShaderTagId[] cachedShaderTagIDs; - /// + /// + /// Called before the first execution of the pass occurs. + /// Allow you to allocate custom buffers. + /// + /// The render context + /// Current command buffer of the frame protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) { fadeValueId = Shader.PropertyToID("_FadeValue"); @@ -74,7 +107,12 @@ protected override void Setup(ScriptableRenderContext renderContext, CommandBuff }; } - /// + /// + /// Use this method if you want to draw objects that are not visible in the camera. + /// For example if you disable a layer in the camera and add it in the culling parameters, then the culling result will contains your layer. + /// + /// Aggregate the parameters in this property (use |= for masks fields, etc.) + /// The camera where the culling is being done protected override void AggregateCullingParameters(ref ScriptableCullingParameters cullingParameters, HDCamera hdCamera) { cullingParameters.cullingMask |= (uint)(int)layerMask; @@ -91,10 +129,7 @@ protected ShaderTagId[] GetShaderTagIds() /// /// Execute the DrawRenderers with parameters setup from the editor /// - /// - /// - /// - /// + /// The context of the custom pass. Contains command buffer, render context, buffer, etc. protected override void Execute(CustomPassContext ctx) { var shaderPasses = GetShaderTagIds(); @@ -121,7 +156,7 @@ protected override void Execute(CustomPassContext ctx) PerObjectData renderConfig = ctx.hdCamera.frameSettings.IsEnabled(FrameSettingsField.Shadowmask) ? HDUtils.k_RendererConfigurationBakedLightingWithShadowMask : HDUtils.k_RendererConfigurationBakedLighting; - var result = new RendererListDesc(shaderPasses, ctx.cullingResult, ctx.hdCamera.camera) + var result = new RendererListDesc(shaderPasses, ctx.cullingResults, ctx.hdCamera.camera) { rendererConfiguration = renderConfig, renderQueueRange = GetRenderQueueRange(renderQueueType), @@ -136,7 +171,11 @@ protected override void Execute(CustomPassContext ctx) HDUtils.DrawRendererList(ctx.renderContext, ctx.cmd, RendererList.Create(result)); } - /// + /// + /// List all the materials that need to be displayed at the bottom of the component. + /// All the materials gathered by this method will be used to create a Material Editor and then can be edited directly on the custom pass. + /// + /// An enumerable of materials to show in the inspector. These materials can be null, the list is cleaned afterwards public override IEnumerable RegisterMaterialForInspector() { yield return overrideMaterial; } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/FullScreenCustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/FullScreenCustomPass.cs index d3da11c15f7..92a278997cf 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/FullScreenCustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/FullScreenCustomPass.cs @@ -9,18 +9,31 @@ namespace UnityEngine.Rendering.HighDefinition /// FullScreen Custom Pass /// [System.Serializable] - class FullScreenCustomPass : CustomPass + public class FullScreenCustomPass : CustomPass { - // Fullscreen pass settings + /// + /// Material used for the fullscreen pass, it's shader must have been created with. + /// public Material fullscreenPassMaterial; [SerializeField] int materialPassIndex = 0; + /// + /// Name of the pass to use in the fullscreen material. + /// public string materialPassName = "Custom Pass 0"; + /// + /// Set to true if your shader will sample in the camera color buffer. + /// public bool fetchColorBuffer; int fadeValueId; - /// + /// + /// Called before the first execution of the pass occurs. + /// Allow you to allocate custom buffers. + /// + /// The render context + /// Current command buffer of the frame protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) { fadeValueId = Shader.PropertyToID("_FadeValue"); @@ -33,7 +46,7 @@ protected override void Setup(ScriptableRenderContext renderContext, CommandBuff /// /// Execute the pass with the fullscreen setup /// - /// + /// The context of the custom pass. Contains command buffer, render context, buffer, etc. protected override void Execute(CustomPassContext ctx) { if (fullscreenPassMaterial != null) @@ -50,7 +63,11 @@ protected override void Execute(CustomPassContext ctx) } } - /// + /// + /// List all the materials that need to be displayed at the bottom of the component. + /// All the materials gathered by this method will be used to create a Material Editor and then can be edited directly on the custom pass. + /// + /// An enumerable of materials to show in the inspector. These materials can be null, the list is cleaned afterwards public override IEnumerable RegisterMaterialForInspector() { yield return fullscreenPassMaterial; } } } From 71dee6cc88395d01118e4128e6dcdec51b437313 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Wed, 8 Apr 2020 19:21:52 +0200 Subject: [PATCH 04/37] Fixes for the Gaussian blur of the custom pass API --- .../Scenes/9x_Other/9702_CustomPass_API.unity | 520 ++++++++++++++---- .../9702_UnlitUVChecker.mat | 275 +++++++++ .../9702_UnlitUVChecker.mat.meta | 8 + .../9x_Other/9702_CustomPass_API/Blur.cs | 27 +- .../Scene Settings Profile.asset | 75 ++- .../RenderPipeline/HDRenderPipeline.cs | 2 + .../RenderPipeline/HDStringConstants.cs | 5 + .../RenderPass/CustomPass/CustomPassUtils.cs | 181 ++++-- .../CustomPass/CustomPassUtils.shader | 91 ++- 9 files changed, 973 insertions(+), 211 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702_UnlitUVChecker.mat create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702_UnlitUVChecker.mat.meta diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity index ab781c2fc7d..8e0f00b3294 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.031361558, g: 0.040105402, b: 0.051489316, a: 1} + m_IndirectSpecularColor: {r: 0.04969687, g: 0.06986856, b: 0.109084845, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -124,6 +124,210 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &21651893 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 21651896} + - component: {fileID: 21651895} + - component: {fileID: 21651894} + 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 &21651894 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 21651893} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 10 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 + m_PointlightHDType: 0 + m_SpotLightShape: 0 + m_AreaLightShape: 0 + m_Intensity: 3.1415927 + m_EnableSpotReflector: 0 + m_LuxAtDistance: 1 + m_InnerSpotPercent: 0 + m_LightDimmer: 1 + m_VolumetricDimmer: 1 + m_LightUnit: 2 + m_FadeDistance: 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 + m_MaxSmoothness: 0.99 + m_ApplyRangeAttenuation: 1 + m_DisplayAreaLightEmissiveMesh: 0 + m_AreaLightCookie: {fileID: 0} + m_AreaLightShadowCone: 120 + m_UseScreenSpaceShadows: 0 + m_InteractsWithSky: 1 + m_AngularDiameter: 0.5 + m_FlareSize: 2 + m_FlareTint: {r: 1, g: 1, b: 1, a: 1} + m_FlareFalloff: 4 + m_SurfaceTexture: {fileID: 0} + m_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 + 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: 16 + m_MinFilterSize: 0.1 + m_KernelSize: 5 + m_LightAngle: 1 + m_MaxDepthBias: 0.001 + m_ShadowResolution: + m_Override: 512 + m_UseOverride: 1 + m_Level: 0 + m_ShadowDimmer: 1 + m_VolumetricShadowDimmer: 1 + m_ShadowFadeDistance: 10000 + m_UseContactShadow: + m_Override: 0 + 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_BarnDoorAngle: 90 + m_BarnDoorLength: 0.05 + m_ShadowCascadeRatios: + - 0.05 + - 0.2 + - 0.3 + m_ShadowCascadeBorders: + - 0.2 + - 0.2 + - 0.2 + - 0.2 + m_ShadowAlgorithm: 0 + m_ShadowVariant: 0 + m_ShadowPrecision: 0 + useOldInspector: 0 + useVolumetric: 1 + featuresFoldout: 1 + showAdditionalSettings: 0 + m_AreaLightEmissiveMeshShadowCastingMode: 0 + m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 +--- !u!108 &21651895 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 21651893} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 3.1415927 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + 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_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &21651896 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 21651893} + m_LocalRotation: {x: 0.20132819, y: -0.19256037, z: 0.21085635, w: 0.93697757} + m_LocalPosition: {x: -66.727, y: 0.028490186, z: 0.49772072} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 27.289, y: -18.09, z: 20.939} --- !u!1 &64242708 GameObject: m_ObjectHideFlags: 0 @@ -152,11 +356,11 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1795749611} - - {fileID: 1652072216} - {fileID: 181213261} - {fileID: 995342285} + - {fileID: 1289910855} m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &65093927 PrefabInstance: @@ -227,6 +431,16 @@ PrefabInstance: propertyPath: field of view value: 26.991467 objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_Version + value: 7 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_RenderingPathCustomFrameSettings.bitDatas.data1 + value: 70005818916701 + objectReference: {fileID: 0} - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} propertyPath: doBeforeTest.m_PersistentCalls.m_Calls.Array.size @@ -286,7 +500,7 @@ Transform: - {fileID: 315305978} - {fileID: 1007958953} m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &181213260 GameObject: @@ -318,7 +532,7 @@ Transform: m_LocalScale: {x: 0.09001844, y: 0.09001844, z: 0.09001844} m_Children: [] m_Father: {fileID: 64242709} - m_RootOrder: 2 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!102 &181213262 TextMesh: @@ -714,7 +928,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 503088923} m_CullTransparentMesh: 0 ---- !u!114 &975076761 +--- !u!114 &994537274 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -823,7 +1037,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 64242709} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!65 &995342286 BoxCollider: @@ -861,7 +1075,7 @@ MonoBehaviour: 00000000: type: {class: Blur, ns: , asm: Assembly-CSharp} data: - m_Name: Custom Pass + m_Name: Blur enabled: 1 targetColorBuffer: 0 targetDepthBuffer: 0 @@ -963,6 +1177,102 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1289910854 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1289910855} + - component: {fileID: 1289910858} + - component: {fileID: 1289910857} + - component: {fileID: 1289910856} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1289910855 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1289910854} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 1.1} + m_LocalScale: {x: 2.2141, y: 1.2662, z: 1} + m_Children: [] + m_Father: {fileID: 64242709} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &1289910856 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1289910854} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1289910857 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1289910854} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 935f43c84f10daf409aa21b21e2b8b34, 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1289910858 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1289910854} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1551760950 GameObject: m_ObjectHideFlags: 0 @@ -995,7 +1305,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Profile: {fileID: 11400000, guid: 864689173ea47a14399cb0eb9a1d6e0e, type: 2} m_StaticLightingSkyUniqueID: 2 - m_SkySettings: {fileID: 975076761} + m_SkySettings: {fileID: 994537274} m_SkySettingsFromProfile: {fileID: 7974066123450201752, guid: 864689173ea47a14399cb0eb9a1d6e0e, type: 2} --- !u!114 &1551760952 @@ -1027,7 +1337,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1612872287 GameObject: @@ -1217,101 +1527,6 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 ---- !u!1 &1652072215 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1652072216} - - component: {fileID: 1652072219} - - component: {fileID: 1652072218} - - component: {fileID: 1652072217} - m_Layer: 0 - m_Name: Cube - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1652072216 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1652072215} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.83, y: 0.53, z: 8.01} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 64242709} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &1652072217 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1652072215} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1652072218 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1652072215} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - 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: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1652072219 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1652072215} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1795749610 GameObject: m_ObjectHideFlags: 0 @@ -1500,3 +1715,98 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 +--- !u!1 &1829389919 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1829389923} + - component: {fileID: 1829389922} + - component: {fileID: 1829389921} + - component: {fileID: 1829389920} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1829389920 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1829389919} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1829389921 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1829389919} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 55bee4340e0c9d349b90f5bc9b9c16a4, 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1829389922 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1829389919} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1829389923 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1829389919} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -72.327, y: -0.08426334, z: 0.087} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702_UnlitUVChecker.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702_UnlitUVChecker.mat new file mode 100644 index 00000000000..76b416ffc29 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702_UnlitUVChecker.mat @@ -0,0 +1,275 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6146136251724717348 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 3 +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 9702_UnlitUVChecker + m_Shader: {fileID: 4800000, guid: c4edd00ff2db5b24391a4fcb1762e459, type: 3} + m_ShaderKeywords: _DISABLE_SSR_TRANSPARENT _NORMALMAP_TANGENT_SPACE + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + MotionVector: User + disabledShaderPasses: + - DistortionVectors + - MOTIONVECTORS + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - Texture2D_539F31FE: + m_Texture: {fileID: 2800000, guid: b23bea53bdbdb5a4aaacf12522910599, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _CoatMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortionVectorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissiveColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HeightMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceThicknessMap: + 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} + - _MaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecularColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SubsurfaceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TransmittanceColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _UnlitColorMap: + m_Texture: {fileID: 2800000, guid: b23bea53bdbdb5a4aaacf12522910599, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - Vector1_90AA7A8: 0.5 + - _AORemapMax: 1 + - _AORemapMin: 0 + - _ATDistance: 1 + - _AddPrecomputedVelocity: 0 + - _AlbedoAffectEmissive: 0 + - _AlphaCutoff: 0.5 + - _AlphaCutoffEnable: 0 + - _AlphaCutoffPostpass: 0.5 + - _AlphaCutoffPrepass: 0.5 + - _AlphaCutoffShadow: 0.5 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _Anisotropy: 0 + - _BlendMode: 0 + - _CoatMask: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoScale: 1 + - _DetailNormalScale: 1 + - _DetailSmoothnessScale: 1 + - _DiffusionProfile: 0 + - _DiffusionProfileHash: 0 + - _DisplacementLockObjectScale: 1 + - _DisplacementLockTilingScale: 1 + - _DisplacementMode: 0 + - _DistortionBlendMode: 0 + - _DistortionBlurBlendMode: 0 + - _DistortionBlurDstBlend: 1 + - _DistortionBlurRemapMax: 1 + - _DistortionBlurRemapMin: 0 + - _DistortionBlurScale: 1 + - _DistortionBlurSrcBlend: 1 + - _DistortionDepthTest: 1 + - _DistortionDstBlend: 1 + - _DistortionEnable: 0 + - _DistortionOnly: 0 + - _DistortionScale: 1 + - _DistortionSrcBlend: 1 + - _DistortionVectorBias: -1 + - _DistortionVectorScale: 2 + - _DoubleSidedEnable: 0 + - _DoubleSidedNormalMode: 1 + - _DstBlend: 0 + - _EmissiveColorMode: 1 + - _EmissiveExposureWeight: 1 + - _EmissiveIntensity: 1 + - _EmissiveIntensityUnit: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _EnableGeometricSpecularAA: 0 + - _EnergyConservingSpecularColor: 1 + - _HeightAmplitude: 0.02 + - _HeightCenter: 0.5 + - _HeightMapParametrization: 0 + - _HeightMax: 1 + - _HeightMin: -1 + - _HeightOffset: 0 + - _HeightPoMAmplitude: 2 + - _HeightTessAmplitude: 2 + - _HeightTessCenter: 0.5 + - _IncludeIndirectLighting: 1 + - _InvTilingScale: 1 + - _Ior: 1.5 + - _IridescenceMask: 1 + - _IridescenceThickness: 1 + - _LinkDetailsWithBase: 1 + - _MaterialID: 1 + - _Metallic: 0 + - _NormalMapSpace: 0 + - _NormalScale: 1 + - _PPDLodThreshold: 5 + - _PPDMaxSamples: 15 + - _PPDMinSamples: 5 + - _PPDPrimitiveLength: 1 + - _PPDPrimitiveWidth: 1 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _SSRefractionProjectionModel: 0 + - _Smoothness: 0.5 + - _SmoothnessRemapMax: 1 + - _SmoothnessRemapMin: 0 + - _SpecularAAScreenSpaceVariance: 0.1 + - _SpecularAAThreshold: 0.2 + - _SpecularOcclusionMode: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 0 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 32 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SubsurfaceMask: 1 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TexWorldScale: 1 + - _TexWorldScaleEmissive: 1 + - _Thickness: 1 + - _TransmissionEnable: 1 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVBase: 0 + - _UVDetail: 0 + - _UVEmissive: 0 + - _UseEmissiveIntensity: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestModeDistortion: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - Color_6DBB962E: {r: 1, g: 0.7607843, b: 0, a: 1} + - Vector2_C19C925C: {r: 0, g: 0, b: 0, a: 0} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} + - _Color: {r: 0, g: 0, b: 0, a: 1} + - _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1} + - _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} + - _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} + - _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1} + - _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0} + - _UnlitColor: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702_UnlitUVChecker.mat.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702_UnlitUVChecker.mat.meta new file mode 100644 index 00000000000..8c6cd2e24ec --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/9702_UnlitUVChecker.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 935f43c84f10daf409aa21b21e2b8b34 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs index d395cfe882f..e1b95ba8bdb 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs @@ -5,27 +5,42 @@ class Blur : CustomPass { + RTHandle halfResTarget; + + protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) + { + halfResTarget = RTHandles.Alloc( + Vector2.one * 0.5f, TextureXR.slices, dimension: TextureXR.dimension, + colorFormat: GraphicsFormat.B10G11R11_UFloatPack32, // We don't need alpha for this effect + useDynamicScale: true, name: "Half Res Custom Pass" + ); + } + protected override void Execute(CustomPassContext ctx) { + float radius = 8.0f; + + // make radius screen size dependent to have blur size consistent accross dimensions. + radius *= ctx.cameraColorBuffer.rtHandleProperties.rtHandleScale.x; CustomPassUtils.GaussianBlur( - ctx, ctx.cameraColorBuffer, ctx.cameraColorBuffer, ctx.customColorBuffer.Value, + ctx, ctx.cameraColorBuffer, ctx.cameraColorBuffer, halfResTarget, new Vector4(0.5f, 0.5f, 0, 0), new Vector4(0.5f, 0.5f, 0, 0), - 4, 1, 0, 0 + 4, radius / 2, 0, 0, true ); CustomPassUtils.GaussianBlur( - ctx, ctx.cameraColorBuffer, ctx.cameraColorBuffer, ctx.customColorBuffer.Value, + ctx, ctx.cameraColorBuffer, ctx.cameraColorBuffer, halfResTarget, new Vector4(0.5f, 0.5f, 0.5f, 0), new Vector4(0.5f, 0.5f, 0.5f, 0), - 16, 4, 0, 0 + 16, radius, 0, 0, false ); CustomPassUtils.GaussianBlur( ctx, ctx.cameraColorBuffer, ctx.cameraColorBuffer, ctx.customColorBuffer.Value, new Vector4(0.5f, 0.5f, 0.5f, 0.5f), new Vector4(0.5f, 0.5f, 0.5f, 0.5f), - 32, 8, 0, 0 + 16, radius * 2, 0, 0, false ); CustomPassUtils.GaussianBlur( ctx, ctx.cameraColorBuffer, ctx.cameraColorBuffer, ctx.customColorBuffer.Value, new Vector4(0.5f, 0.5f, 0, 0.5f), new Vector4(0.5f, 0.5f, 0, 0.5f), - 64, 32, 0, 0 + 64, radius * 4, 0, 0, true ); } } \ No newline at end of file diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Scene Settings Profile.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Scene Settings Profile.asset index 5ecdae9653e..f19f670668c 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Scene Settings Profile.asset +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Scene Settings Profile.asset @@ -1,5 +1,77 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6322084644017855310 +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: 2d08ce26990eb1a4a9177b860541e702, type: 3} + m_Name: Exposure + m_EditorClassIdentifier: + active: 1 + m_AdvancedMode: 0 + mode: + m_OverrideState: 1 + m_Value: 0 + meteringMode: + m_OverrideState: 1 + m_Value: 2 + luminanceSource: + m_OverrideState: 1 + m_Value: 1 + fixedExposure: + m_OverrideState: 1 + m_Value: 0 + compensation: + m_OverrideState: 1 + m_Value: 0 + limitMin: + m_OverrideState: 1 + m_Value: -10 + limitMax: + m_OverrideState: 1 + m_Value: 20 + curveMap: + m_OverrideState: 1 + m_Value: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: -10 + value: -10 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 20 + value: 20 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + adaptationMode: + m_OverrideState: 1 + m_Value: 1 + adaptationSpeedDarkToLight: + m_OverrideState: 1 + m_Value: 3 + min: 0.001 + adaptationSpeedLightToDark: + m_OverrideState: 1 + m_Value: 1 + min: 0.001 --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 @@ -12,4 +84,5 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} m_Name: Scene Settings Profile m_EditorClassIdentifier: - components: [] + components: + - {fileID: -6322084644017855310} diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index a4a1765e85e..3da528ac5be 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -909,6 +909,8 @@ protected override void Dispose(bool disposing) CleanupPrepass(); CoreUtils.Destroy(m_ColorResolveMaterial); + CustomPassUtils.Cleanup(); + #if UNITY_EDITOR SceneViewDrawMode.ResetDrawMode(); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs index 23dd1d454cb..97aa53a6d00 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -924,6 +924,11 @@ static class HDShaderIDs // Custom Pass Utils API public static readonly int _SourceScaleBias = Shader.PropertyToID("_SourceScaleBias"); + public static readonly int _GaussianWeights = Shader.PropertyToID("_GaussianWeights"); + public static readonly int _SampleCount = Shader.PropertyToID("_SampleCount"); + public static readonly int _Radius = Shader.PropertyToID("_Radius"); + public static readonly int _ViewPortSize = Shader.PropertyToID("_ViewPortSize"); + public static readonly int _ViewportScaleBias = Shader.PropertyToID("_ViewportScaleBias"); } // Shared material property names diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs index bd639fc215d..0f4b68f3b42 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs @@ -8,7 +8,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// A set of custom pass utility function to help you build your effects /// - public class CustomPassUtils + public static class CustomPassUtils { /// /// Fullscreen scale and bias values, it is the default for functions that have scale and bias overloads. @@ -16,22 +16,24 @@ public class CustomPassUtils /// x: scaleX, y: scaleY, z: biasX, w: biasY public static Vector4 fullScreenScaleBias = new Vector4(1, 1, 0, 0); - static ShaderTagId[] litForwardTags = { - HDShaderPassNames.s_ForwardOnlyName, HDShaderPassNames.s_ForwardName, HDShaderPassNames.s_SRPDefaultUnlitName - }; + static ShaderTagId[] litForwardTags = { HDShaderPassNames.s_ForwardOnlyName, HDShaderPassNames.s_ForwardName, HDShaderPassNames.s_SRPDefaultUnlitName }; static ShaderTagId[] depthTags = { HDShaderPassNames.s_DepthForwardOnlyName, HDShaderPassNames.s_DepthOnlyName }; static ProfilingSampler downSampleSampler = new ProfilingSampler("DownSample"); static ProfilingSampler verticalBlurSampler = new ProfilingSampler("Vertical Blur"); static ProfilingSampler horizontalBlurSampler = new ProfilingSampler("Horizontal Blur"); static ProfilingSampler gaussianblurSampler = new ProfilingSampler("Gaussian Blur"); + static ProfilingSampler copySampler = new ProfilingSampler("Copy"); - static MaterialPropertyBlock blurPropertyBlock = new MaterialPropertyBlock(); + static MaterialPropertyBlock propertyBlock = new MaterialPropertyBlock(); static Material customPassUtilsMaterial = new Material(HDRenderPipeline.defaultAsset.renderPipelineResources.shaders.customPassUtils); - static Dictionary gaussianWeightsCache = new Dictionary(); + static Dictionary gaussianWeightsCache = new Dictionary(); static int downSamplePassIndex = customPassUtilsMaterial.FindPass("Downsample"); + static int verticalBlurPassIndex = customPassUtilsMaterial.FindPass("VerticalBlur"); + static int horizontalBlurPassIndex = customPassUtilsMaterial.FindPass("HorizontalBlur"); + static int copyPassIndex = customPassUtilsMaterial.FindPass("Copy"); /// /// Convert the source buffer to an half resolution buffer and output it to the destination buffer. @@ -44,22 +46,29 @@ public class CustomPassUtils public static void DownSample(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sourceMip = 0, int destMip = 0) => DownSample(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sourceMip, destMip); + /// + /// + /// + /// + /// + /// + /// Scale and bias to apply when sampling the source buffer + /// Scale and bias to apply when writing into the destination buffer. It's scale is relative to the destination buffer, so if you want an half res downsampling into a fullres buffer you need to specify a scale of 0.5;0,5. If your buffer is already half res Then 1;1 scale works. + /// + /// public static void DownSample(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sourceMip = 0, int destMip = 0) { // Check if the texture provided is at least half of the size of source. - if (destination.rt.width < source.rt.width / 2 || destination.rt.height < source.rt.height) + if (destination.rt.width < source.rt.width / 2 || destination.rt.height < source.rt.height / 2) Debug.LogError("Destination for DownSample is too small, it needs to be at least half as big as source."); using (new ProfilingScope(ctx.cmd, downSampleSampler)) { - CoreUtils.SetRenderTarget(ctx.cmd, destination, ClearFlag.None, miplevel: destMip); + SetRenderTargetWithScaleBias(ctx, propertyBlock, destination, destScaleBias, ClearFlag.None, destMip); - Vector2Int scaledViewportSize = destination.GetScaledSize(destination.rtHandleProperties.currentViewportSize); - ctx.cmd.SetViewport(new Rect(0.0f, 0.0f, scaledViewportSize.x, scaledViewportSize.y)); - - blurPropertyBlock.SetTexture(HDShaderIDs._Source, source); - blurPropertyBlock.SetVector(HDShaderIDs._SourceScaleBias, sourceScaleBias); - ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, downSamplePassIndex, MeshTopology.Quads, 4, 1, blurPropertyBlock); + propertyBlock.SetTexture(HDShaderIDs._Source, source); + propertyBlock.SetVector(HDShaderIDs._SourceScaleBias, sourceScaleBias); + ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, downSamplePassIndex, MeshTopology.Quads, 4, 1, propertyBlock); } } @@ -69,62 +78,107 @@ public static void DownSample(in CustomPassContext ctx, RTHandle source, RTHandl // Debug.Log("TODO"); // } - public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sourceMip = 0, int destMip = 0, bool bilinear = false) - => Copy(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sourceMip, destMip, bilinear); + public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sourceMip = 0, int destMip = 0) + => Copy(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sourceMip, destMip); - public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sourceMip = 0, int destMip = 0, bool bilinear = false) + public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sourceMip = 0, int destMip = 0) { - CoreUtils.SetRenderTarget(ctx.cmd, destination, ClearFlag.None, Color.black, destMip); - HDUtils.BlitQuad(ctx.cmd, source, sourceScaleBias, fullScreenScaleBias, sourceMip, bilinear); + if (source == destination) + Debug.LogError("Can't copy the buffer. Source has to be different from the destination."); + + using (new ProfilingScope(ctx.cmd, copySampler)) + { + SetRenderTargetWithScaleBias(ctx, propertyBlock, destination, destScaleBias, ClearFlag.None, destMip); + + propertyBlock.SetTexture(HDShaderIDs._Source, source); + propertyBlock.SetVector(HDShaderIDs._SourceScaleBias, sourceScaleBias); + ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, copyPassIndex, MeshTopology.Quads, 4, 1, propertyBlock); + } } - public static void GaussianBlurVertical(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, int sourceMip = 0, int destMip = 0) - => GaussianBlurVertical(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sampleCount, sourceMip, destMip); + public static void VerticalGaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, float radius = 5, int sourceMip = 0, int destMip = 0) + => VerticalGaussianBlur(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sampleCount, radius, sourceMip, destMip); - public static void GaussianBlurVertical(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, int sourceMip = 0, int destMip = 0) + public static void VerticalGaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, float radius = 5, int sourceMip = 0, int destMip = 0) { + if (source == destination) + Debug.LogError("Can't blur the buffer. Source has to be different from the destination."); + using (new ProfilingScope(ctx.cmd, verticalBlurSampler)) { - + SetRenderTargetWithScaleBias(ctx, propertyBlock, destination, destScaleBias, ClearFlag.None, destMip); + + propertyBlock.SetTexture(HDShaderIDs._Source, source); + propertyBlock.SetVector(HDShaderIDs._SourceScaleBias, sourceScaleBias); + propertyBlock.SetBuffer(HDShaderIDs._GaussianWeights, GetGaussianWeights(sampleCount)); + propertyBlock.SetFloat(HDShaderIDs._SampleCount, sampleCount); + propertyBlock.SetFloat(HDShaderIDs._Radius, radius); + ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, verticalBlurPassIndex, MeshTopology.Quads, 4, 1, propertyBlock); } } - public static void GaussianBlurHorizontal(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, int sourceMip = 0, int destMip = 0) - => GaussianBlurHorizontal(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sampleCount, sourceMip, destMip); + public static void HorizontalGaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, float radius = 5, int sourceMip = 0, int destMip = 0) + => HorizontalGaussianBlur(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sampleCount, radius, sourceMip, destMip); - public static void GaussianBlurHorizontal(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, int sourceMip = 0, int destMip = 0) + public static void HorizontalGaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, float radius = 5, int sourceMip = 0, int destMip = 0) { + if (source == destination) + Debug.LogError("Can't blur the buffer. Source has to be different from the destination."); + using (new ProfilingScope(ctx.cmd, horizontalBlurSampler)) { - + SetRenderTargetWithScaleBias(ctx, propertyBlock, destination, destScaleBias, ClearFlag.None, destMip); + + propertyBlock.SetTexture(HDShaderIDs._Source, source); + propertyBlock.SetVector(HDShaderIDs._SourceScaleBias, sourceScaleBias); + propertyBlock.SetBuffer(HDShaderIDs._GaussianWeights, GetGaussianWeights(sampleCount)); + propertyBlock.SetFloat(HDShaderIDs._SampleCount, sampleCount); + propertyBlock.SetFloat(HDShaderIDs._Radius, radius); + ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, horizontalBlurPassIndex, MeshTopology.Quads, 4, 1, propertyBlock); } } - public static void GaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, int sampleCount = 8, float radius = 1, int sourceMip = 0, int destMip = 0) - => GaussianBlur(ctx, source, destination, tempTarget, fullScreenScaleBias, fullScreenScaleBias, sampleCount, radius, sourceMip, destMip); + public static void GaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, int sampleCount = 9, float radius = 5, int sourceMip = 0, int destMip = 0, bool downSample = true) + => GaussianBlur(ctx, source, destination, tempTarget, fullScreenScaleBias, fullScreenScaleBias, sampleCount, radius, sourceMip, destMip, downSample); - public static void GaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, float radius = 1, int sourceMip = 0, int destMip = 0, bool downSample = true) + public static void GaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 9, float radius = 5, int sourceMip = 0, int destMip = 0, bool downSample = true) { + if (source == tempTarget || destination == tempTarget) + Debug.LogError("Can't blur the buffer. tempTarget has to be different from both source or destination."); + if (tempTarget.scaleFactor.x != tempTarget.scaleFactor.y || (tempTarget.scaleFactor.x != 0.5f && tempTarget.scaleFactor.x != 1.0f)) + Debug.LogError($"Can't blur the buffer. Only a scaleFactor of 0.5 or 1.0 is supported on tempTarget. Current scaleFactor: {tempTarget.scaleFactor}"); + + // Gaussian blur doesn't like even numbers + if (sampleCount % 2 == 0) + sampleCount++; + using (new ProfilingScope(ctx.cmd, gaussianblurSampler)) { if (downSample) { - // Downsample to half res - DownSample(ctx, source, tempTarget, sourceScaleBias, destScaleBias, sourceMip, destMip); + // When the temp target is not already downsampled, we need to do it by hand: + bool manualDownsampling = tempTarget.scaleFactor.x != 0.5f; + // Downsample to half res in mip 0 of temp target (in case temp target doesn't have any mipmap we use 0) + // Vector4 + DownSample(ctx, source, tempTarget, sourceScaleBias, destScaleBias, sourceMip, 0); // Vertical blur - GaussianBlurVertical(ctx, tempTarget, destination); + if (!manualDownsampling) + destScaleBias.Scale(new Vector4(0.5f, 0.5f, 1, 1)); + VerticalGaussianBlur(ctx, tempTarget, destination, sourceScaleBias, destScaleBias, sampleCount, radius, 0, destMip); // Instead of allocating a new buffer on the fly, we copy the data. // We will be able to allocate it when rendergraph lands - Copy(ctx, destination, tempTarget, fullScreenScaleBias, destScaleBias); + if (!manualDownsampling) + destScaleBias.Scale(new Vector4(2, 2, 1, 1)); + Copy(ctx, destination, tempTarget, fullScreenScaleBias, destScaleBias, 0, destMip); // Horizontal blur and upsample - GaussianBlurHorizontal(ctx, tempTarget, destination); + HorizontalGaussianBlur(ctx, tempTarget, destination, sourceScaleBias, destScaleBias, sampleCount, radius, sourceMip, destMip); } else { // Vertical blur - GaussianBlurVertical(ctx, source, tempTarget); + VerticalGaussianBlur(ctx, source, tempTarget, sourceScaleBias, destScaleBias, sampleCount, radius, sourceMip, destMip); // Horizontal blur and upsample - GaussianBlurHorizontal(ctx, tempTarget, destination); + HorizontalGaussianBlur(ctx, tempTarget, destination, sourceScaleBias, destScaleBias, sampleCount, radius, sourceMip, destMip); } } } @@ -173,24 +227,27 @@ public static void RenderFrom(in CustomPassContext ctx, RTHandle destination, Ca /// Generate gaussian weights for a given number of samples /// /// - /// - internal static float[] GetGaussianWeights(int weightCount) + /// a GPU compute buffer containing the weights + internal static ComputeBuffer GetGaussianWeights(int weightCount) { float[] weights; + ComputeBuffer gpuWeights; + + if (gaussianWeightsCache.TryGetValue(weightCount, out gpuWeights)) + return gpuWeights; - if (gaussianWeightsCache.TryGetValue(weightCount, out weights)) - return weights; - weights = new float[weightCount]; - float p = 0; float integrationBound = 3; + float p = -integrationBound; + float c = 0; + float step = (1.0f / (float)weightCount) * integrationBound * 2; for (int i = 0; i < weightCount; i++) { - float w = (Gaussian(p) / (float)weightCount) * integrationBound; - p += 1.0f / (float)weightCount * integrationBound; + float w = (Gaussian(p) / (float)weightCount) * integrationBound * 2; weights[i] = w; + p += step; + c += w; } - gaussianWeightsCache[weightCount] = weights; // Gaussian function float Gaussian(float x, float sigma = 1) @@ -200,7 +257,11 @@ float Gaussian(float x, float sigma = 1) return a * b; } - return weights; + gpuWeights = new ComputeBuffer(weights.Length, sizeof(float)); + gpuWeights.SetData(weights); + gaussianWeightsCache[weightCount] = gpuWeights; + + return gpuWeights; } public static RenderQueueRange GetRenderQueueRangeFromRenderQueueType(CustomPass.RenderQueueType type) @@ -222,5 +283,31 @@ public static RenderQueueRange GetRenderQueueRangeFromRenderQueueType(CustomPass return HDRenderQueue.k_RenderQueue_All; } } + + // TODO when rendergraph is available: a PostProcess pass which does the copy with a temp target + + internal static void Cleanup() + { + foreach (var gaussianWeights in gaussianWeightsCache) + gaussianWeights.Value.Release(); + gaussianWeightsCache.Clear(); + } + + internal static Vector4 SetRenderTargetWithScaleBias(in CustomPassContext ctx, MaterialPropertyBlock block, RTHandle destination, Vector4 destScaleBias, ClearFlag clearFlag, int miplevel) + { + // viewport with RT handle scale and scale factor: + Rect viewport = new Rect(); + Vector2 destSize = viewport.size = destination.GetScaledSize(destination.rtHandleProperties.currentViewportSize); + viewport.position = new Vector2(viewport.size.x * destScaleBias.z, viewport.size.y * destScaleBias.w); + viewport.size *= new Vector2(destScaleBias.x, destScaleBias.y); + + CoreUtils.SetRenderTarget(ctx.cmd, destination, clearFlag, Color.black, miplevel); + ctx.cmd.SetViewport(viewport); + + block.SetVector(HDShaderIDs._ViewPortSize, new Vector4(destSize.x, destSize.y, 1.0f / destSize.x, 1.0f / destSize.y)); + block.SetVector(HDShaderIDs._ViewportScaleBias, new Vector4(1.0f / (destScaleBias.x), 1.0f / (destScaleBias.y), destScaleBias.z, destScaleBias.w)); + + return new Vector4(viewport.size.x, viewport.size.y, viewport.position.x, viewport.position.y); + } } } \ No newline at end of file diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader index 64a9ee42555..7010c3e8673 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader @@ -6,21 +6,26 @@ Shader "Hidden/HDRP/CustomPassUtils" #pragma target 4.5 #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch - // #pragma enable_d3d11_debug_symbols + #pragma enable_d3d11_debug_symbols #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassCommon.hlsl" TEXTURE2D_X(_Source); - float _SourceMip; - float _Radius; - float _SampleCount; - float4 _ViewPortSize; // We need the viewport size because we have a non fullscreen render target (blur buffers are downsampled in half res) - float4 _SourceScaleBias; + float _SourceMip; + float4 _ViewPortSize; // We need the viewport size because we have a non fullscreen render target (blur buffers are downsampled in half res) + float4 _SourceScaleBias; + float4 _ViewportScaleBias; + + float _Radius; + float _SampleCount; + Buffer _GaussianWeights; float2 GetScaledUVs(Varyings varyings) { - float2 uv = varyings.positionCS.xy; - + // Remap UV from part of the screen (due to viewport scale / offset) to 0 - 1 + float2 uv01 = (varyings.positionCS.xy * _RTHandleScale.xy * _ViewPortSize.zw - _ViewportScaleBias.zw) * _ViewportScaleBias.xy; + float2 uv = uv01; + // Apply scale and bias return uv * _SourceScaleBias.xy + _SourceScaleBias.zw; } @@ -28,62 +33,46 @@ Shader "Hidden/HDRP/CustomPassUtils" float4 Copy(Varyings varyings) : SV_Target { // TODO: handle scale and bias - return LOAD_TEXTURE2D_X_LOD(_Source, varyings.positionCS.xy, _SourceMip); - } - - float3 BlurPixels(float3 taps[9]) - { - return 0.27343750 * (taps[4] ) - + 0.21875000 * (taps[3] + taps[5]) - + 0.10937500 * (taps[2] + taps[6]) - + 0.03125000 * (taps[1] + taps[7]) - + 0.00390625 * (taps[0] + taps[8]); + return LOAD_TEXTURE2D_X_LOD(_Source, varyings.positionCS.xy * _SourceScaleBias.xy + _SourceScaleBias.zw, _SourceMip); } // We need to clamp the UVs to avoid bleeding from bigger render tragets (when we have multiple cameras) float2 ClampUVs(float2 uv) { - uv = clamp(uv, 0, _RTHandleScale.xy - _ViewPortSize.zw); // clamp UV to 1 pixel to avoid bleeding - return uv; + // Clamp UV to the current viewport: + float2 offset = _ViewportScaleBias.zw * _RTHandleScale.xy; + float2 halfPixelSize = _ViewPortSize.zw / 2; + uv = clamp(uv, offset + halfPixelSize, rcp(_ViewportScaleBias.xy) * _RTHandleScale.xy + offset - halfPixelSize); + return saturate(uv); } - float2 GetSampleUVs(Varyings varyings) + float4 Blur(float2 uv, float2 direction) { - float depth = LoadCameraDepth(varyings.positionCS.xy); - PositionInputs posInput = GetPositionInput(varyings.positionCS.xy, _ViewPortSize.zw, depth, UNITY_MATRIX_I_VP, UNITY_MATRIX_V); - return posInput.positionNDC.xy * _RTHandleScale.zw; - } - - float4 HorizontalBlur(Varyings varyings) : SV_Target - { - float2 texcoord = GetSampleUVs(varyings); - // Horizontal blur from the camera color buffer - float2 offset = _ScreenSize.zw * _Radius; // We don't use _ViewPortSize here because we want the offset to be the same between all the blur passes. - float3 taps[9]; - for (int i = -4; i <= 4; i++) + float4 result = 0; + for (int i = 0; i < _SampleCount; i++) { - float2 uv = ClampUVs(texcoord + float2(i, 0) * offset); - taps[i + 4] = SAMPLE_TEXTURE2D_X_LOD(_Source, s_linear_clamp_sampler, uv, 0).rgb; + float offset = lerp(-_Radius, _Radius, (float(i) / _SampleCount)); + float2 offsetUV = ClampUVs(uv + direction * offset * _ScreenSize.zw); + float4 sourceValue = SAMPLE_TEXTURE2D_X_LOD(_Source, s_linear_clamp_sampler, offsetUV, 0); + + result += sourceValue * _GaussianWeights[i]; } - return float4(BlurPixels(taps), 1); + return result; + } - float4 VerticalBlur(Varyings varyings) : SV_Target + float4 HorizontalBlur(Varyings varyings) : SV_Target { - float2 texcoord = GetSampleUVs(varyings); - - // Vertical blur from the blur color buffer - float2 offset = _ScreenSize.zw * _Radius; - float3 taps[9]; - for (int i = -4; i <= 4; i++) - { - float2 uv = ClampUVs(texcoord + float2(0, i) * offset); - taps[i + 4] = SAMPLE_TEXTURE2D_X_LOD(_Source, s_linear_clamp_sampler, uv, 0).rgb; - } + float2 uv = GetScaledUVs(varyings); + return Blur(uv, float2(1, 0)); + } - return float4(BlurPixels(taps), 1); + float4 VerticalBlur(Varyings varyings) : SV_Target + { + float2 uv = GetScaledUVs(varyings); + return Blur(uv, float2(0, 1)); } float4 DownSample(Varyings varyings) : SV_Target @@ -146,8 +135,7 @@ Shader "Hidden/HDRP/CustomPassUtils" Pass { - // Horizontal Blur - Name "Horizontal Blur" + Name "HorizontalBlur" ZWrite Off ZTest Always @@ -161,8 +149,7 @@ Shader "Hidden/HDRP/CustomPassUtils" Pass { - // Vertical Blur - Name "Vertical Blur" + Name "VerticalBlur" ZWrite Off ZTest Always From 328fe7e4633bdc52146d245c3536fb88253db5fc Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Thu, 9 Apr 2020 14:11:29 +0200 Subject: [PATCH 05/37] Fix blur release --- .../8205_SceneDepthColorNodes/SceneColorMaterialUnlit.mat | 7 ++++--- .../Scenes/9x_Other/9702_CustomPass_API/Blur.cs | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8205_SceneDepthColorNodes/SceneColorMaterialUnlit.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8205_SceneDepthColorNodes/SceneColorMaterialUnlit.mat index 37e916999a2..71aaa8b1b1e 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8205_SceneDepthColorNodes/SceneColorMaterialUnlit.mat +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8205_SceneDepthColorNodes/SceneColorMaterialUnlit.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} m_Name: m_EditorClassIdentifier: - version: 2 + version: 3 --- !u!21 &2100000 Material: serializedVersion: 6 @@ -199,8 +199,9 @@ Material: - _PPDPrimitiveLength: 1 - _PPDPrimitiveWidth: 1 - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 - _RefractionModel: 0 - - _RenderQueueType: 5 + - _RenderQueueType: 4 - _RequireSplitLighting: 0 - _SSRefractionProjectionModel: 0 - _ShiverDirectionality: 0.5 @@ -219,7 +220,7 @@ Material: - _StencilWriteMask: 6 - _StencilWriteMaskDepth: 8 - _StencilWriteMaskDistortionVec: 4 - - _StencilWriteMaskGBuffer: 3 + - _StencilWriteMaskGBuffer: 14 - _StencilWriteMaskMV: 40 - _Stiffness: 1 - _SubsurfaceMask: 1 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs index e1b95ba8bdb..7bfcf2fa152 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Blur.cs @@ -43,4 +43,9 @@ protected override void Execute(CustomPassContext ctx) 64, radius * 4, 0, 0, true ); } + + protected override void Cleanup() + { + halfResTarget.Release(); + } } \ No newline at end of file From 909a75c83d16733a1bbf904f8dbf50e5483fa00b Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 10 Apr 2020 14:19:35 +0200 Subject: [PATCH 06/37] Added custom pass copy test and fixed blur --- .../Outline/Outline.cs | 10 +- .../Scenes/9x_Other/9702_CustomPass_API.unity | 280 ++++++++---------- .../9x_Other/9702_CustomPass_API/Copy.cs | 73 +++++ .../9x_Other/9702_CustomPass_API/Copy.cs.meta | 11 + .../9702_CustomPass_API/DrawFromCamera.cs | 27 ++ .../DrawFromCamera.cs.meta | 11 + .../RenderPipeline/HDRenderPipeline.cs | 2 + .../RenderPipeline/HDStringConstants.cs | 1 + .../RenderPass/CustomPass/CustomPassUtils.cs | 36 +-- .../CustomPass/CustomPassUtils.shader | 28 +- .../RenderPass/CustomPass/CustomPassVolume.cs | 18 +- 11 files changed, 299 insertions(+), 198 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Copy.cs create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Copy.cs.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs.meta diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Outline/Outline.cs b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Outline/Outline.cs index bd181a5be64..c35eeb62945 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Outline/Outline.cs +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Outline/Outline.cs @@ -15,14 +15,12 @@ class Outline : CustomPass Shader outlineShader; Material fullscreenOutline; - MaterialPropertyBlock outlineProperties; RTHandle outlineBuffer; protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) { outlineShader = Shader.Find("Hidden/Outline"); fullscreenOutline = CoreUtils.CreateEngineMaterial(outlineShader); - outlineProperties = new MaterialPropertyBlock(); outlineBuffer = RTHandles.Alloc( Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, @@ -38,13 +36,13 @@ protected override void Execute(CustomPassContext ctx) CustomPassUtils.DrawRenderers(ctx, outlineLayer); // Setup outline effect properties - outlineProperties.SetColor("_OutlineColor", outlineColor); - outlineProperties.SetTexture("_OutlineBuffer", outlineBuffer); - outlineProperties.SetFloat("_Threshold", threshold); + ctx.propertyBlock.SetColor("_OutlineColor", outlineColor); + ctx.propertyBlock.SetTexture("_OutlineBuffer", outlineBuffer); + ctx.propertyBlock.SetFloat("_Threshold", threshold); // Render the outline as a fullscreen alpha-blended pass on top of the camera color CoreUtils.SetRenderTarget(ctx.cmd, ctx.cameraColorBuffer, ClearFlag.None); - CoreUtils.DrawFullScreen(ctx.cmd, fullscreenOutline, outlineProperties, shaderPassId: 0); + CoreUtils.DrawFullScreen(ctx.cmd, fullscreenOutline, ctx.propertyBlock, shaderPassId: 0); } protected override void Cleanup() diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity index 8e0f00b3294..bde5a919cda 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity @@ -479,7 +479,7 @@ GameObject: m_Component: - component: {fileID: 179283799} m_Layer: 0 - m_Name: BlurPass (1) + m_Name: OtherFullscreen m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -497,8 +497,9 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1612872288} - - {fileID: 315305978} - - {fileID: 1007958953} + - {fileID: 2044874742} + - {fileID: 1006754252} + - {fileID: 1262988724} m_Father: {fileID: 0} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -696,101 +697,6 @@ Canvas: m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 ---- !u!1 &315305977 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 315305978} - - component: {fileID: 315305981} - - component: {fileID: 315305980} - - component: {fileID: 315305979} - m_Layer: 0 - m_Name: Cube - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &315305978 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 315305977} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.84832263, y: 0.24588984, z: 8.01} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 179283799} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &315305979 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 315305977} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &315305980 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 315305977} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - 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: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &315305981 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 315305977} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &338225181 GameObject: m_ObjectHideFlags: 0 @@ -928,7 +834,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 503088923} m_CullTransparentMesh: 0 ---- !u!114 &994537274 +--- !u!114 &906681166 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1082,7 +988,7 @@ MonoBehaviour: clearFlags: 0 passFoldout: 0 m_Version: 0 ---- !u!1 &1007958952 +--- !u!1 &1006754251 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1090,59 +996,59 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1007958953} - - component: {fileID: 1007958955} - - component: {fileID: 1007958954} + - component: {fileID: 1006754252} + - component: {fileID: 1006754254} + - component: {fileID: 1006754253} m_Layer: 0 - m_Name: New Text + m_Name: New Text (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1007958953 +--- !u!4 &1006754252 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1007958952} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 10.2} - m_LocalScale: {x: 1, y: 1, z: 1} + m_GameObject: {fileID: 1006754251} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.42, z: 9.68} + m_LocalScale: {x: 0.09001844, y: 0.09001844, z: 0.09001844} m_Children: [] m_Father: {fileID: 179283799} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!102 &1007958954 +--- !u!102 &1006754253 TextMesh: serializedVersion: 3 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1007958952} - m_Text: Hello World + m_GameObject: {fileID: 1006754251} + m_Text: Copy m_OffsetZ: 0 m_CharacterSize: 1 m_LineSpacing: 1 m_Anchor: 0 m_Alignment: 0 m_TabSize: 4 - m_FontSize: 0 + m_FontSize: 111 m_FontStyle: 0 m_RichText: 1 m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_Color: serializedVersion: 2 rgba: 4294967295 ---- !u!23 &1007958955 +--- !u!23 &1006754254 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1007958952} + m_GameObject: {fileID: 1006754251} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -1177,6 +1083,81 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1262988723 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1262988724} + - component: {fileID: 1262988726} + - component: {fileID: 1262988725} + m_Layer: 0 + m_Name: Custom Pass + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1262988724 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1262988723} + 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_Children: [] + m_Father: {fileID: 179283799} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1262988725 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1262988723} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &1262988726 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1262988723} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 0 + fadeRadius: 0 + priority: 0 + customPasses: + - id: 0 + injectionPoint: 1 + references: + version: 1 + 00000000: + type: {class: Copy, ns: , asm: Assembly-CSharp} + data: + m_Name: Custom Pass + enabled: 1 + targetColorBuffer: 0 + targetDepthBuffer: 0 + clearFlags: 0 + passFoldout: 0 + m_Version: 0 --- !u!1 &1289910854 GameObject: m_ObjectHideFlags: 0 @@ -1305,7 +1286,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Profile: {fileID: 11400000, guid: 864689173ea47a14399cb0eb9a1d6e0e, type: 2} m_StaticLightingSkyUniqueID: 2 - m_SkySettings: {fileID: 994537274} + m_SkySettings: {fileID: 906681166} m_SkySettingsFromProfile: {fileID: 7974066123450201752, guid: 864689173ea47a14399cb0eb9a1d6e0e, type: 2} --- !u!114 &1551760952 @@ -1503,7 +1484,7 @@ Camera: m_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 - x: 0 + x: 0.5 y: 0 width: 0.5 height: 0.5 @@ -1715,7 +1696,7 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 ---- !u!1 &1829389919 +--- !u!1 &2044874741 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1723,37 +1704,52 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1829389923} - - component: {fileID: 1829389922} - - component: {fileID: 1829389921} - - component: {fileID: 1829389920} + - component: {fileID: 2044874742} + - component: {fileID: 2044874745} + - component: {fileID: 2044874744} + - component: {fileID: 2044874743} m_Layer: 0 - m_Name: Cube + m_Name: Quad (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!65 &1829389920 -BoxCollider: +--- !u!4 &2044874742 +Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1829389919} + m_GameObject: {fileID: 2044874741} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 1.1} + m_LocalScale: {x: 2.2141, y: 1.2662, z: 1} + m_Children: [] + m_Father: {fileID: 179283799} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &2044874743 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2044874741} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1829389921 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2044874744 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1829389919} + m_GameObject: {fileID: 2044874741} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -1766,7 +1762,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 55bee4340e0c9d349b90f5bc9b9c16a4, type: 2} + - {fileID: 2100000, guid: 935f43c84f10daf409aa21b21e2b8b34, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1788,25 +1784,11 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1829389922 +--- !u!33 &2044874745 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1829389919} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &1829389923 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1829389919} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -72.327, y: -0.08426334, z: 0.087} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_GameObject: {fileID: 2044874741} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Copy.cs b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Copy.cs new file mode 100644 index 00000000000..7d23b3b5f6c --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Copy.cs @@ -0,0 +1,73 @@ +using UnityEngine; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering; +using UnityEngine.Experimental.Rendering; + +class Copy : CustomPass +{ + RTHandle halfResTarget; + + protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) + { + halfResTarget = RTHandles.Alloc( + Vector2.one * 0.5f, TextureXR.slices, dimension: TextureXR.dimension, + colorFormat: GraphicsFormat.B10G11R11_UFloatPack32, // We don't need alpha for this effect + useDynamicScale: true, name: "Half Res Custom Pass", + useMipMap: true, autoGenerateMips: false + ); + } + + protected override void Execute(CustomPassContext ctx) + { + // Top right + CustomPassUtils.Copy( + ctx, ctx.cameraColorBuffer, ctx.customColorBuffer.Value, + new Vector4(0.5f, 0.5f, 0.5f, 0.5f), new Vector4(0.5f, 0.5f, 0, 0), + 0, 0 + ); + CustomPassUtils.Copy( + ctx, ctx.customColorBuffer.Value, ctx.cameraColorBuffer, + new Vector4(0.5f, 0.5f, 0, 0), new Vector4(0.25f, 0.25f, 0.75f, 0.75f), + 0, 0 + ); + + // Bottom left + CustomPassUtils.Copy( + ctx, ctx.cameraColorBuffer, halfResTarget, + new Vector4(0.5f, 0.5f, 0.0f, 0.5f), new Vector4(0.5f, 0.5f, 0, 0), + 0, 0 + ); + CustomPassUtils.Copy( + ctx, halfResTarget, ctx.cameraColorBuffer, + new Vector4(0.5f, 0.5f, 0, 0), new Vector4(0.25f, 0.25f, 0.5f, 0.5f), + 0, 0 + ); + + // Bottom right + CustomPassUtils.Copy( + ctx, ctx.cameraColorBuffer, ctx.customColorBuffer.Value, + new Vector4(0.5f, 0.5f, 0.0f, 0.0f), new Vector4(0.5f, 0.5f, 0, 0), + 0, 0 + ); + CustomPassUtils.Copy( + ctx, ctx.customColorBuffer.Value, ctx.cameraColorBuffer, + new Vector4(0.5f, 0.5f, 0, 0), new Vector4(0.25f, 0.25f, 0.75f, 0.5f), + 0, 0 + ); + + // top left + CustomPassUtils.Copy( + ctx, ctx.cameraColorBuffer, halfResTarget, + new Vector4(0.5f, 0.5f, 0.5f, 0.0f), new Vector4(0.5f, 0.5f, 0, 0), + 0, 1 + ); + CustomPassUtils.Copy( + ctx, halfResTarget, ctx.cameraColorBuffer, + new Vector4(0.5f, 0.5f, 0, 0), new Vector4(0.25f, 0.25f, 0.5f, 0.75f), + 1, 0 + ); + + } + + protected override void Cleanup() => halfResTarget.Release(); +} \ No newline at end of file diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Copy.cs.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Copy.cs.meta new file mode 100644 index 00000000000..6f5c54a7df9 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/Copy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 34f6dc251f990f741b21d74077e96dd0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs new file mode 100644 index 00000000000..8e73ef5229b --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs @@ -0,0 +1,27 @@ +using UnityEngine; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering; +using UnityEngine.Experimental.Rendering; + +class DrawFromCamera : CustomPass +{ + // It can be used to configure render targets and their clear state. Also to create temporary render target textures. + // When empty this render pass will render to the active camera render target. + // You should never call CommandBuffer.SetRenderTarget. Instead call ConfigureTarget and ConfigureClear. + // The render pipeline will ensure target setup and clearing happens in an performance manner. + protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) + { + // Setup code here + } + + protected override void Execute(CustomPassContext ctx) + { + // Executed every frame for all the camera inside the pass volume. + // The context contains the command buffer to use to enqueue graphics commands. + } + + protected override void Cleanup() + { + // Cleanup code + } +} \ No newline at end of file diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs.meta new file mode 100644 index 00000000000..4b31f2001b1 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cb755fe59b64e8f48b813dcfdcf107af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 3da528ac5be..041b4ff2932 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -496,6 +496,8 @@ public HDRenderPipeline(HDRenderPipelineAsset asset, HDRenderPipelineAsset defau InitializePrepass(m_Asset); m_ColorResolveMaterial = CoreUtils.CreateEngineMaterial(asset.renderPipelineResources.shaders.colorResolvePS); + + CustomPassUtils.Initialize(); } #if UNITY_EDITOR diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs index 97aa53a6d00..310abc421a4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -929,6 +929,7 @@ static class HDShaderIDs public static readonly int _Radius = Shader.PropertyToID("_Radius"); public static readonly int _ViewPortSize = Shader.PropertyToID("_ViewPortSize"); public static readonly int _ViewportScaleBias = Shader.PropertyToID("_ViewportScaleBias"); + public static readonly int _SourceSize = Shader.PropertyToID("_SourceSize"); } // Shared material property names diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs index 0f4b68f3b42..93884a53254 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs @@ -26,14 +26,23 @@ public static class CustomPassUtils static ProfilingSampler copySampler = new ProfilingSampler("Copy"); static MaterialPropertyBlock propertyBlock = new MaterialPropertyBlock(); - static Material customPassUtilsMaterial = new Material(HDRenderPipeline.defaultAsset.renderPipelineResources.shaders.customPassUtils); + static Material customPassUtilsMaterial; static Dictionary gaussianWeightsCache = new Dictionary(); - static int downSamplePassIndex = customPassUtilsMaterial.FindPass("Downsample"); - static int verticalBlurPassIndex = customPassUtilsMaterial.FindPass("VerticalBlur"); - static int horizontalBlurPassIndex = customPassUtilsMaterial.FindPass("HorizontalBlur"); - static int copyPassIndex = customPassUtilsMaterial.FindPass("Copy"); + static int downSamplePassIndex; + static int verticalBlurPassIndex; + static int horizontalBlurPassIndex; + static int copyPassIndex; + + internal static void Initialize() + { + customPassUtilsMaterial = new Material(HDRenderPipeline.defaultAsset.renderPipelineResources.shaders.customPassUtils); + downSamplePassIndex = customPassUtilsMaterial.FindPass("Downsample"); + verticalBlurPassIndex = customPassUtilsMaterial.FindPass("VerticalBlur"); + horizontalBlurPassIndex = customPassUtilsMaterial.FindPass("HorizontalBlur"); + copyPassIndex = customPassUtilsMaterial.FindPass("Copy"); + } /// /// Convert the source buffer to an half resolution buffer and output it to the destination buffer. @@ -90,8 +99,10 @@ public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle dest { SetRenderTargetWithScaleBias(ctx, propertyBlock, destination, destScaleBias, ClearFlag.None, destMip); + Vector2 sourceSize = source.GetScaledSize(source.rtHandleProperties.currentViewportSize); propertyBlock.SetTexture(HDShaderIDs._Source, source); propertyBlock.SetVector(HDShaderIDs._SourceScaleBias, sourceScaleBias); + propertyBlock.SetVector(HDShaderIDs._SourceSize, new Vector4(sourceSize.x, sourceSize.y, 1.0f / sourceSize.x, 1.0f / sourceSize.y)); ctx.cmd.DrawProcedural(Matrix4x4.identity, customPassUtilsMaterial, copyPassIndex, MeshTopology.Quads, 4, 1, propertyBlock); } } @@ -156,20 +167,13 @@ public static void GaussianBlur(in CustomPassContext ctx, RTHandle source, RTHan { if (downSample) { - // When the temp target is not already downsampled, we need to do it by hand: - bool manualDownsampling = tempTarget.scaleFactor.x != 0.5f; // Downsample to half res in mip 0 of temp target (in case temp target doesn't have any mipmap we use 0) - // Vector4 DownSample(ctx, source, tempTarget, sourceScaleBias, destScaleBias, sourceMip, 0); // Vertical blur - if (!manualDownsampling) - destScaleBias.Scale(new Vector4(0.5f, 0.5f, 1, 1)); VerticalGaussianBlur(ctx, tempTarget, destination, sourceScaleBias, destScaleBias, sampleCount, radius, 0, destMip); // Instead of allocating a new buffer on the fly, we copy the data. // We will be able to allocate it when rendergraph lands - if (!manualDownsampling) - destScaleBias.Scale(new Vector4(2, 2, 1, 1)); - Copy(ctx, destination, tempTarget, fullScreenScaleBias, destScaleBias, 0, destMip); + Copy(ctx, destination, tempTarget, sourceScaleBias, destScaleBias, 0, destMip); // Horizontal blur and upsample HorizontalGaussianBlur(ctx, tempTarget, destination, sourceScaleBias, destScaleBias, sampleCount, radius, sourceMip, destMip); } @@ -293,7 +297,7 @@ internal static void Cleanup() gaussianWeightsCache.Clear(); } - internal static Vector4 SetRenderTargetWithScaleBias(in CustomPassContext ctx, MaterialPropertyBlock block, RTHandle destination, Vector4 destScaleBias, ClearFlag clearFlag, int miplevel) + internal static void SetRenderTargetWithScaleBias(in CustomPassContext ctx, MaterialPropertyBlock block, RTHandle destination, Vector4 destScaleBias, ClearFlag clearFlag, int miplevel) { // viewport with RT handle scale and scale factor: Rect viewport = new Rect(); @@ -305,9 +309,7 @@ internal static Vector4 SetRenderTargetWithScaleBias(in CustomPassContext ctx, M ctx.cmd.SetViewport(viewport); block.SetVector(HDShaderIDs._ViewPortSize, new Vector4(destSize.x, destSize.y, 1.0f / destSize.x, 1.0f / destSize.y)); - block.SetVector(HDShaderIDs._ViewportScaleBias, new Vector4(1.0f / (destScaleBias.x), 1.0f / (destScaleBias.y), destScaleBias.z, destScaleBias.w)); - - return new Vector4(viewport.size.x, viewport.size.y, viewport.position.x, viewport.position.y); + block.SetVector(HDShaderIDs._ViewportScaleBias, new Vector4(1.0f / destScaleBias.x, 1.0f / destScaleBias.y, destScaleBias.z, destScaleBias.w)); } } } \ No newline at end of file diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader index 7010c3e8673..7004f720bd8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader @@ -15,6 +15,7 @@ Shader "Hidden/HDRP/CustomPassUtils" float4 _ViewPortSize; // We need the viewport size because we have a non fullscreen render target (blur buffers are downsampled in half res) float4 _SourceScaleBias; float4 _ViewportScaleBias; + float4 _SourceSize; float _Radius; float _SampleCount; @@ -32,8 +33,11 @@ Shader "Hidden/HDRP/CustomPassUtils" float4 Copy(Varyings varyings) : SV_Target { - // TODO: handle scale and bias - return LOAD_TEXTURE2D_X_LOD(_Source, varyings.positionCS.xy * _SourceScaleBias.xy + _SourceScaleBias.zw, _SourceMip); + float2 uv01 = (varyings.positionCS.xy * _ViewPortSize.zw - _ViewportScaleBias.zw) * _ViewportScaleBias.xy; + // Apply scale and bias + float2 uv = uv01 * _SourceScaleBias.xy + _SourceScaleBias.zw; + + return LOAD_TEXTURE2D_X_LOD(_Source, uv * _SourceSize.xy, _SourceMip); } // We need to clamp the UVs to avoid bleeding from bigger render tragets (when we have multiple cameras) @@ -78,29 +82,9 @@ Shader "Hidden/HDRP/CustomPassUtils" float4 DownSample(Varyings varyings) : SV_Target { float2 uv = GetScaledUVs(varyings); - // TODO: add half pixel offset ? return SAMPLE_TEXTURE2D_X_LOD(_Source, s_linear_clamp_sampler, uv, 0); } - // float4 CompositeMaskedBlur(Varyings varyings) : SV_Target - // { - // float depth = LoadCameraDepth(varyings.positionCS.xy); - // float2 uv = ClampUVs(GetSampleUVs(varyings)); - - // float4 colorBuffer = SAMPLE_TEXTURE2D_X_LOD(_ColorBufferCopy, s_linear_clamp_sampler, uv, 0).rgba; - // float4 blurredBuffer = SAMPLE_TEXTURE2D_X_LOD(_Source, s_linear_clamp_sampler, uv, 0).rgba; - // float4 mask = SAMPLE_TEXTURE2D_X_LOD(_Mask, s_linear_clamp_sampler, uv, 0); - // float maskDepth = SAMPLE_TEXTURE2D_X_LOD(_MaskDepth, s_linear_clamp_sampler, uv, 0).r; - // float maskValue = 0; - - // maskValue = any(mask.rgb > 0.1) || (maskDepth > depth - 0.0001); - - // if (_InvertMask > 0.5) - // maskValue = !maskValue; - - // return float4(lerp(blurredBuffer.rgb, colorBuffer.rgb, maskValue), colorBuffer.a); - // } - ENDHLSL SubShader diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs index 6cb40883a61..d1f2e2d08ee 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs @@ -282,16 +282,26 @@ public static void GetActivePassVolumes(CustomPassInjectionPoint injectionPoint, /// /// Add a pass of type passType in the active pass list /// - /// - public void AddPassOfType(Type passType) + /// The type of the CustomPass to create + /// The new custom + public CustomPass AddPassOfType() where T : CustomPass => AddPassOfType(typeof(T)); + + /// + /// Add a pass of type passType in the active pass list + /// + /// The type of the CustomPass to create + /// The new custom + public CustomPass AddPassOfType(Type passType) { if (!typeof(CustomPass).IsAssignableFrom(passType)) { Debug.LogError($"Can't add pass type {passType} to the list because it does not inherit from CustomPass."); - return ; + return null; } - customPasses.Add(Activator.CreateInstance(passType) as CustomPass); + var customPass = Activator.CreateInstance(passType) as CustomPass; + customPasses.Add(customPass); + return customPass; } #if UNITY_EDITOR From a8e9d958c2c8b27bc12e27d614a104ee9b8496d8 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Thu, 16 Apr 2020 16:13:26 +0200 Subject: [PATCH 07/37] Added more custom pass documentation --- .../M_HDRP_LitTessellation.mat | 2 +- .../9x_Other/9402_AlphaToMask/M_SG_Eye.mat | 2 +- .../9x_Other/9402_AlphaToMask/M_SG_Hair.mat | 2 +- .../9x_Other/9402_AlphaToMask/M_SG_Lit.mat | 4 +- .../9402_AlphaToMask/M_SG_StackLit.mat | 2 +- .../9x_Other/9402_AlphaToMask/M_SG_Unlit.mat | 2 +- .../Scenes/9x_Other/9702_CustomPass_API.unity | 592 +++++++++++++++--- .../Custom-Pass-API-User-Manual.md | 67 ++ .../Documentation~/Custom-Pass.md | 125 ++-- .../Images/CustomPass_FrameDebugger.png | 3 + .../RenderPipeline/HDRenderPipeline.cs | 2 +- .../RenderPass/CustomPass/CustomPass.cs | 7 +- .../RenderPass/CustomPass/CustomPassUtils.cs | 136 +++- 13 files changed, 764 insertions(+), 182 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-API-User-Manual.md create mode 100644 com.unity.render-pipelines.high-definition/Documentation~/Images/CustomPass_FrameDebugger.png diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_HDRP_LitTessellation.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_HDRP_LitTessellation.mat index d6cd50ca4ab..4ff12fd0316 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_HDRP_LitTessellation.mat +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_HDRP_LitTessellation.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} m_Name: m_EditorClassIdentifier: - version: 2 + version: 3 --- !u!21 &2100000 Material: serializedVersion: 6 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Eye.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Eye.mat index 887feedc313..2be4e4fcc49 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Eye.mat +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Eye.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} m_Name: m_EditorClassIdentifier: - version: 2 + version: 3 --- !u!21 &2100000 Material: serializedVersion: 6 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Hair.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Hair.mat index 86a58eea864..c7b885d6193 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Hair.mat +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Hair.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} m_Name: m_EditorClassIdentifier: - version: 2 + version: 3 --- !u!21 &2100000 Material: serializedVersion: 6 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Lit.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Lit.mat index 6a12b6a09e9..7bfd1a3672d 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Lit.mat +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Lit.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} m_Name: m_EditorClassIdentifier: - version: 2 + version: 3 --- !u!21 &2100000 Material: serializedVersion: 6 @@ -37,6 +37,7 @@ Material: - TransparentDepthPrepass - TransparentDepthPostpass - TransparentBackface + - RayTracingPrepass m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -213,6 +214,7 @@ Material: - _PPDPrimitiveLength: 1 - _PPDPrimitiveWidth: 1 - _PreRefractionPass: 0 + - _RayTracing: 0 - _ReceivesSSR: 0 - _ReceivesSSRTransparent: 1 - _RefractionModel: 0 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_StackLit.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_StackLit.mat index 4258b1e5f7f..6ce0bde4190 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_StackLit.mat +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_StackLit.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} m_Name: m_EditorClassIdentifier: - version: 2 + version: 3 --- !u!21 &2100000 Material: serializedVersion: 6 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Unlit.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Unlit.mat index c24dc69dcae..4ba88889ebd 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Unlit.mat +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9402_AlphaToMask/M_SG_Unlit.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} m_Name: m_EditorClassIdentifier: - version: 2 + version: 3 --- !u!21 &2100000 Material: serializedVersion: 6 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity index bde5a919cda..c1b56097d79 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity @@ -529,7 +529,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 181213260} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -4.45, z: 9.68} + m_LocalPosition: {x: -7.77, y: -4.45, z: 9.68} m_LocalScale: {x: 0.09001844, y: 0.09001844, z: 0.09001844} m_Children: [] m_Father: {fileID: 64242709} @@ -543,7 +543,7 @@ TextMesh: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 181213260} - m_Text: Blur + m_Text: Blur (Downsample + VBlur + HBlur) m_OffsetZ: 0 m_CharacterSize: 1 m_LineSpacing: 1 @@ -598,6 +598,40 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &211598673 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 211598674} + m_Layer: 0 + m_Name: DrawFromCamera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &211598674 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 211598673} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -110.25, y: 84.75, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1796147642} + - {fileID: 2026715368} + - {fileID: 1007981418} + - {fileID: 1264929867} + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &247597907 GameObject: m_ObjectHideFlags: 0 @@ -834,85 +868,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 503088923} m_CullTransparentMesh: 0 ---- !u!114 &906681166 -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: 3df29e7cc05fbec4aa43e06ea875565d, type: 3} - m_Name: - m_EditorClassIdentifier: - active: 1 - m_AdvancedMode: 0 - rotation: - m_OverrideState: 0 - m_Value: 0 - min: 0 - max: 360 - skyIntensityMode: - m_OverrideState: 0 - m_Value: 0 - exposure: - m_OverrideState: 0 - m_Value: 0 - multiplier: - m_OverrideState: 0 - m_Value: 1 - min: 0 - upperHemisphereLuxValue: - m_OverrideState: 0 - m_Value: 1 - min: 0 - upperHemisphereLuxColor: - m_OverrideState: 0 - m_Value: {x: 0, y: 0, z: 0} - desiredLuxValue: - m_OverrideState: 0 - m_Value: 20000 - updateMode: - m_OverrideState: 0 - m_Value: 0 - updatePeriod: - m_OverrideState: 0 - m_Value: 0 - min: 0 - includeSunInBaking: - m_OverrideState: 0 - m_Value: 0 - sunSize: - m_OverrideState: 0 - m_Value: 0.04 - min: 0 - max: 1 - sunSizeConvergence: - m_OverrideState: 0 - m_Value: 5 - min: 1 - max: 10 - atmosphereThickness: - m_OverrideState: 0 - m_Value: 1 - min: 0 - max: 5 - skyTint: - m_OverrideState: 0 - m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} - hdr: 0 - showAlpha: 1 - showEyeDropper: 1 - groundColor: - m_OverrideState: 0 - m_Value: {r: 0.369, g: 0.349, b: 0.341, a: 1} - hdr: 0 - showAlpha: 1 - showEyeDropper: 1 - enableSunDisk: - m_OverrideState: 0 - m_Value: 1 --- !u!1 &995342284 GameObject: m_ObjectHideFlags: 0 @@ -1083,6 +1038,101 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1007981417 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1007981418} + - component: {fileID: 1007981420} + - component: {fileID: 1007981419} + 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 &1007981418 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1007981417} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.42, z: 9.68} + m_LocalScale: {x: 0.09001844, y: 0.09001844, z: 0.09001844} + m_Children: [] + m_Father: {fileID: 211598674} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1007981419 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1007981417} + m_Text: Copy + m_OffsetZ: 0 + m_CharacterSize: 1 + m_LineSpacing: 1 + m_Anchor: 0 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 111 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1007981420 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1007981417} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!1 &1262988723 GameObject: m_ObjectHideFlags: 0 @@ -1151,13 +1201,77 @@ MonoBehaviour: 00000000: type: {class: Copy, ns: , asm: Assembly-CSharp} data: - m_Name: Custom Pass + m_Name: CustomCopy enabled: 1 targetColorBuffer: 0 targetDepthBuffer: 0 clearFlags: 0 passFoldout: 0 m_Version: 0 +--- !u!1 &1264929866 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1264929867} + - component: {fileID: 1264929869} + - component: {fileID: 1264929868} + m_Layer: 0 + m_Name: Custom Pass + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1264929867 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1264929866} + 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_Children: [] + m_Father: {fileID: 211598674} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1264929868 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1264929866} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &1264929869 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1264929866} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 0 + fadeRadius: 0 + priority: 0 + customPasses: [] + injectionPoint: 1 + references: + version: 1 --- !u!1 &1289910854 GameObject: m_ObjectHideFlags: 0 @@ -1286,9 +1400,6 @@ MonoBehaviour: m_EditorClassIdentifier: m_Profile: {fileID: 11400000, guid: 864689173ea47a14399cb0eb9a1d6e0e, type: 2} m_StaticLightingSkyUniqueID: 2 - m_SkySettings: {fileID: 906681166} - m_SkySettingsFromProfile: {fileID: 7974066123450201752, guid: 864689173ea47a14399cb0eb9a1d6e0e, - type: 2} --- !u!114 &1551760952 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1424,6 +1535,11 @@ MonoBehaviour: dithering: 0 stopNaNs: 0 taaSharpenStrength: 0.6 + TAAQuality: 1 + taaHistorySharpening: 0.35 + taaAntiFlicker: 0.5 + taaMotionVectorRejection: 0 + taaAntiHistoryRinging: 0 physicalParameters: m_Iso: 200 m_ShutterSpeed: 0.005 @@ -1433,6 +1549,7 @@ MonoBehaviour: m_BarrelClipping: 0.25 m_Anamorphism: 0 flipYMode: 0 + xrRendering: 1 fullscreenPassthrough: 0 allowDynamicResolution: 0 customRenderingSettings: 0 @@ -1451,6 +1568,9 @@ MonoBehaviour: maximumLODLevel: 0 maximumLODLevelMode: 0 maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 20 materialQuality: 0 renderingPathCustomFrameSettingsOverrideMask: mask: @@ -1612,6 +1732,11 @@ MonoBehaviour: dithering: 0 stopNaNs: 0 taaSharpenStrength: 0.6 + TAAQuality: 1 + taaHistorySharpening: 0.35 + taaAntiFlicker: 0.5 + taaMotionVectorRejection: 0 + taaAntiHistoryRinging: 0 physicalParameters: m_Iso: 200 m_ShutterSpeed: 0.005 @@ -1621,6 +1746,7 @@ MonoBehaviour: m_BarrelClipping: 0.25 m_Anamorphism: 0 flipYMode: 0 + xrRendering: 1 fullscreenPassthrough: 0 allowDynamicResolution: 0 customRenderingSettings: 0 @@ -1639,6 +1765,9 @@ MonoBehaviour: maximumLODLevel: 0 maximumLODLevelMode: 0 maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 20 materialQuality: 0 renderingPathCustomFrameSettingsOverrideMask: mask: @@ -1696,6 +1825,299 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 +--- !u!1 &1796147641 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1796147642} + - component: {fileID: 1796147645} + - component: {fileID: 1796147644} + - component: {fileID: 1796147643} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1796147642 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1796147641} + 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_Children: [] + m_Father: {fileID: 211598674} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1796147643 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1796147641} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 7 + 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: 1 + volumeAnchorOverride: {fileID: 0} + antialiasing: 0 + SMAAQuality: 2 + dithering: 0 + stopNaNs: 0 + taaSharpenStrength: 0.6 + TAAQuality: 1 + taaHistorySharpening: 0.35 + taaAntiFlicker: 0.5 + taaMotionVectorRejection: 0 + taaAntiHistoryRinging: 0 + physicalParameters: + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + flipYMode: 0 + xrRendering: 1 + fullscreenPassthrough: 0 + allowDynamicResolution: 0 + customRenderingSettings: 0 + invertFaceCulling: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + hasPersistentHistory: 0 + m_RenderingPathCustomFrameSettings: + bitDatas: + data1: 70297877217101 + data2: 4539628425463136256 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 20 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 0 + data2: 0 + defaultFrameSettings: 0 +--- !u!81 &1796147644 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1796147641} + m_Enabled: 1 +--- !u!20 &1796147645 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1796147641} + 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_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.5 + height: 0.5 + near clip plane: 0.3 + far clip plane: 50 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 8400000, guid: 94f05850b7f1d654b8127a229aec2c3a, type: 2} + 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!1 &2026715367 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2026715368} + - component: {fileID: 2026715371} + - component: {fileID: 2026715370} + - component: {fileID: 2026715369} + m_Layer: 0 + m_Name: Quad (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2026715368 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2026715367} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 1.1} + m_LocalScale: {x: 2.2141, y: 1.2662, z: 1} + m_Children: [] + m_Father: {fileID: 211598674} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &2026715369 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2026715367} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2026715370 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2026715367} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 935f43c84f10daf409aa21b21e2b8b34, 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &2026715371 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2026715367} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &2044874741 GameObject: m_ObjectHideFlags: 0 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-API-User-Manual.md b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-API-User-Manual.md new file mode 100644 index 00000000000..899f9ac5be9 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-API-User-Manual.md @@ -0,0 +1,67 @@ +# Custom Pass Utils API User Manual + +## Blur + +### Gaussian Blur + +The gaussian blur function will allow you to blur an image with an arbitrary radius and quality (number of samples). For performance reasons, you also have the possibility to run the blur kernel after a downsample pass. + +Here's an example of Custom Pass that blurs the camera color buffer: + +```CSharp +using UnityEngine; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering; +using UnityEngine.Experimental.Rendering; + +class GaussianBlur : CustomPass +{ + RTHandle halfResTarget; + + protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) + { + halfResTarget = RTHandles.Alloc( + // Note the * 0.5 here, it will allocate a half res target, which saves a lot of memory + Vector2.one * 0.5f, TextureXR.slices, dimension: TextureXR.dimension, + // We don't need alpha for this effect so we use an HDR no alpha texture format + colorFormat: GraphicsFormat.B10G11R11_UFloatPack32, + // Never forget to name your textures, it'll be very useful for debugging + useDynamicScale: true, name: "Half Res Custom Pass" + ); + } + + protected override void Execute(CustomPassContext ctx) + { + // We choose an arbitrary 8 pixel radius for our blur + float radius = 8.0f; + // Precision of the blur, also affect the cost of the shader, 9 is a good value for real time apps + int sampleCount = 9; + + // In case you have multiple camera at different resolution, make the blur coherent across these cameras. + radius *= ctx.cameraColorBuffer.rtHandleProperties.rtHandleScale.x; + + // Our gaussian blur call, with the camera color buffer in source and destination + // The half res target is used as temporary render target between the passes of our blur + // Note that it's content will be cleared by the Gaussian Blur function. + CustomPassUtils.GaussianBlur( + ctx, ctx.cameraColorBuffer, ctx.cameraColorBuffer, halfResTarget, + sampleCount, radius, downSample: true + ); + } + + // Release the GPU memory, otherwise it'll leak + protected override void Cleanup() => halfResTarget.Release(); +} +``` + +Note that we use a half res target `halfResTarget` because we first do a downsample pass. Alternatively you can also use the custom pass buffer we provide in HDRP, even if it's not a half res buffer, the algorithm will use only half of the texture. + + \ No newline at end of file diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass.md b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass.md index 2e8d98ed523..8ed7d3db022 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass.md @@ -16,7 +16,7 @@ Custom Passes have been implemented through a volume system, but note that it's Like in volumes, there is two modes for the custom pass volume: `Local` and `Global`. The `Local` mode uses colliders attached to the GameObject where the custom pass is to define a zone where the effect will be executed. `Global` volumes are executed everywhere in your scene. The priority is used to determine the execution order when you have multiple custom pass volumes in your scene that share the same injection point. -A `fade` system is also available to allow you to smooth the transition between your normal rendering and the custom custom pass. The control over the distance of the fade is done by the **Fade Radius** field in the UI of the Custom Pass Volume Component, the radius is exposed in meter and is not scaled with the object transform. +A `fade` system is also available to allow you to smooth the transition between your normal rendering and the custom pass. The control over the distance of the fade is done by the **Fade Radius** field in the UI of the Custom Pass Volume Component, the radius is exposed in meter and is not scaled with the object transform. Because we give the full control over what can be done in the custom passes, the fading must be manually included in your effects. To help you, there is a builtin variable `_FadeValue` in the shader and `CustomPass.fadeValue` in the C# that contains a value between 0 and 1 representing how far the camera is from the collider bounding volume. If you want more details about the fading in script, you can [jump to the scripting API tag](#ScriptingAPI). Here you can see an example of a custom pass with a box collider (solid transparent box) and the fade radius is represented by the wireframe cube. @@ -101,7 +101,7 @@ In this snippet, we fetch a lot of useful input data that you might need in your ### DrawRenderers Custom Pass -This pass will allow you to draw a subset of objects that are in the camera view (result of the camera culling). +This pass will allow you to draw a subset of objects that are in the camera view (the result of the camera culling). Here is how the inspector for the DrawRenderers pass looks like: ![CustomPassDrawRenderers_Inspector](Images/CustomPassDrawRenderers_Inspector.png) @@ -121,11 +121,11 @@ Before Transparent | Unlit + Lit forward only with refraction Before Post Process | Unlit + Lit forward only with refraction After Post Process | Unlit + Lit forward only with refraction -If you try to render a material in a unsupported configuration, it will result in an undefined behavior. For example rendering lit objects during `After Opaque Depth And Normal` will produce unexpected results. +If you try to render material in an unsupported configuration, it will result in an undefined behavior. For example rendering lit objects during `After Opaque Depth And Normal` will produce unexpected results. The pass name is also used to select which pass of the shader we will render, on a ShaderGraph or an HDRP unlit material it is useful because the default pass is the `SceneSelectionPass` and the pass used to render the object is `ForwardOnly`. You might also want to use the `DepthForwardOnly` pass if you want to only render the depth of the object. -To create advanced effects, you can use the **Custom Renderers Pass** shader that will create an unlit one pass HDRP shader and inside the `GetSurfaceAndBuiltinData` function you will be able ot put your fragment shader code: +To create advanced effects, you can use the **Custom Renderers Pass** shader that will create an unlit one pass HDRP shader and inside the `GetSurfaceAndBuiltinData` function you will be able to put your fragment shader code: ```HLSL // Put the code to render the objects in your custom pass in this function @@ -219,7 +219,7 @@ class #SCRIPTNAME# : CustomPass { protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) {} - protected override void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera camera, CullingResults cullingResult) {} + protected override void Execute(CustomPassContext ctx) {} protected override void Cleanup() {} } @@ -233,7 +233,7 @@ To code your custom pass, you have three entry point: In the `Setup` and `Execute` functions, we gives you access to the [ScriptableRenderContext](https://docs.unity3d.com/2019.3/Documentation/ScriptReference/Rendering.ScriptableRenderContext.html) and a [CommandBuffer](https://docs.unity3d.com/2019.3/Documentation/ScriptReference/Rendering.CommandBuffer.html), these two classes contains everything you need to render pretty much everything but here we will focus on these two functions [ScriptableRenderContext.DrawRenderers](https://docs.unity3d.com/2019.3/Documentation/ScriptReference/Rendering.ScriptableRenderContext.DrawRenderers.html) and [CommandBuffer.DrawProcedural](https://docs.unity3d.com/2019.3/Documentation/ScriptReference/Rendering.CommandBuffer.DrawProcedural.html). -> **Important:** if the a shader is never referenced in any of your scenes it won't get built and the effect will not work when running the game outside of the editor. Either add it to a [Resources folder](https://docs.unity3d.com/Manual/LoadingResourcesatRuntime.html) or put it in the **Always Included Shaders** list in `Edit -> Project Settings -> Graphics`. Be careful with this especially if you load shaders using `Shader.Find()` otherwise, you'll end up with a black screen. +> **Important:** if the shader is never referenced in any of your scenes it won't get built and the effect will not work when running the game outside of the editor. Either add it to a [Resources folder](https://docs.unity3d.com/Manual/LoadingResourcesatRuntime.html) or put it in the **Always Included Shaders** list in `Edit -> Project Settings -> Graphics`. Be careful with this especially if you load shaders using `Shader.Find()` otherwise, you'll end up with a black screen. > **Pro Tips:** @@ -249,9 +249,13 @@ In the `Setup` and `Execute` functions, we gives you access to the [ScriptableRe Now that you have allocated your resources you're ready to start doing stuff in the `Execute` function. +### CustomPassUtils API functions + +The CustomPassUtils class contains powerful utility functions to help you build your effects, to learn more, check out the [Custom Pass API User Manual](Custom-Pass-API-User-Manual.md). + ### Calling a FullScreen Pass in C\# -To do a FullScreen pass using a material, we uses `CoreUtils.DrawFullScreen` which under the hood call `DrawProcedural` on the Command Buffer in parameter. So when we do a FullScreen Pass the code looks like this: +To do a FullScreen pass using a material, we uses `CoreUtils.DrawFullScreen` which under the hood call `DrawProcedural` on the Command Buffer. So when we do a FullScreen Pass the code looks like this: ```CSharp SetCameraRenderTarget(cmd); // Bind the camera color buffer along with depth without clearing the buffers. @@ -261,9 +265,20 @@ CoreUtils.DrawFullScreen(cmd, material, shaderPassId: 0); Where `cmd` is the command buffer and shaderPassId is the equivalent of `Pass Name` in the UI but with indices instead. Note that in this example the `SetCameraRenderTarget` is optional because the render target bound when the `Execute` function is called is the one set in the UI with the `Target Color Buffer` and `Target Depth Buffer` fields. -### Calling DrawRenderers inC\# +Alternatively, you can also use HDUtils.DrawFullScreen function which takes in parameter the buffer you want to write to, like this: +```CSharp +HDUtils.DrawFullScreen(cmd, material, targetBuffer, shaderPassId: shaderPassId); +``` + +### Calling DrawRenderers in C\# + +Calling the DrawRenderers function on the ScriptableRenderContext require a lot of boilerplate code and to simplify this, the CustomPassUtils class provides a function that takes less arguments: + +```CSharp +CustomPassUtils.DrawRenderers(in CustomPassContext ctx, LayerMask layerMask, CustomPass.RenderQueueType renderQueueFilter = CustomPass.RenderQueueType.All, Material overrideMaterial = null, int overideMaterialIndex = 0) +``` -Calling the DrawRenderers function on the ScriptableRenderContext require a lot of boilerplate code and to simplify this, HDRP provides a simpler interface: +But because it is simpler, it is also less flexible so you'll probably need more controls and in this case you can use this more complex syntax: ```CSharp var result = new RendererListDesc(shaderTags, cullingResult, hdCamera.camera) @@ -284,9 +299,11 @@ For the `renderQueueRange`, you can use the `GetRenderQueueRange` function in th > **⚠️ WARNING: Be careful with the override material pass index:** when you call the DrawRenderers with an [override material](https://docs.unity3d.com/ScriptReference/Rendering.DrawingSettings-overrideMaterial.html), then you need to select which pass you're going to render using the override material pass index. But in build, this index can be changed after that the shader stripper removed passes from shader (like every HDRP shaders) and that will shift the pass indices in the shader and so your index will become invalid. To prevent this issue, we recommend to store the name of the pass and then use `Material.FindPass` when issuing the draw. +> **⚠️ WARNING: Opaque objects may not be visible** if they are rendered only during the custom pass, because we assume that they already are in the depth pre-pass, we set the `Depth Test` to `Depth Equal`. Because of this you may need to override the `Depth Test` to `Less Equal` using the `depthState` property of the [RenderStateBlock](https://docs.unity3d.com/ScriptReference/Rendering.RenderStateBlock.html). + ### Scripting the volume component -You can retrieve the `CustomPassVolume` in script using [GetComponent](https://docs.unity3d.com/2019.3/Documentation/ScriptReference/GameObject.GetComponent.html) and access most of the things available from the UI like `isGlobal`, `fadeRadius` and `injectionPoint`. +You can retrieve the `CustomPassVolume` in a script using [GetComponent](https://docs.unity3d.com/2019.3/Documentation/ScriptReference/GameObject.GetComponent.html) and access most of the things available from the UI like `isGlobal`, `fadeRadius` and `injectionPoint`. You can also dynamically change the list of Custom Passes executed by modifying the `customPasses` list. @@ -323,7 +340,24 @@ When you create a custom pass drawer, even if your DoPassGUI is empty, you'll ha protected override PassUIFlag commonPassUIFlags => PassUIFlag.Name | PassUIFlag.TargetColorBuffer; ``` -### Other API functions +### Troubleshooting + +#### Scaling issues + +They can appear when you have two cameras that are not using the same resolution (most common case in-game and scene views) and can be caused by: + +- Calls to [CommandBuffer.SetRenderTarget()](https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.SetRenderTarget.html) instead of [CoreUtils.SetRenderTarget()](https://docs.unity3d.com/Packages/com.unity.render-pipelines.core@latest/index.html?subfolder=/api/UnityEngine.Rendering.CoreUtils.html#UnityEngine_Rendering_CoreUtils_SetRenderTarget_CommandBuffer_UnityEngine_Rendering_RTHandle_UnityEngine_Rendering_RTHandle_UnityEngine_Rendering_ClearFlag_System_Int32_CubemapFace_System_Int32_). Note that the CoreUtils one also sets the viewport. +- In the shader, a missing multiplication by `_RTHandleScale.xy` for the UVs when sampling an RTHandle buffer. + +#### Shuriken Particle System + +When you render a particle system that is only visible in the custom pass and your particles are facing the wrong direction it's probably because you didn't override the `AggregateCullingParameters`. The orientation of the particles in Shuriken is computed during the culling so if you don't have the correct setup it will not be rendered properly. + +#### Decals + +Decals applied on objects rendered with custom passes will only be applied to transparent objects rendered after the `After Depth and Normal` injection point. Decals will be ignored with Opaque objects. + +#### Culling issues Sometimes you want to render objects only in a custom pass and not in the camera. To achieve this, you disable the layer of your objects in the camera culling mask, but it also means that the cullingResult you receive in the `Execute` function won't contain this object (because by default this cullingResult is the camera cullingResult). To overcome this issue, you can override this function in the CustomPass class: @@ -331,18 +365,20 @@ Sometimes you want to render objects only in a custom pass and not in the camera protected virtual void AggregateCullingParameters(ref ScriptableCullingParameters cullingParameters, HDCamera camera) {} ``` -it will allow you to add more layers / custom culling option to the cullingResult you receive in the `Execute` function. +it will allow you to add more layers / custom culling options to the cullingResult you receive in the `Execute` function. -> **⚠️ WARNING: Opaque objects may not be visible** if they are rendered only during the custom pass, because we assume that they already are in the depth pre-pass, we set the `Depth Test` to `Depth Equal`. Because of this you may need to override the `Depth Test` to `Less Equal` using the `depthState` property of the [RenderStateBlock](https://docs.unity3d.com/ScriptReference/Rendering.RenderStateBlock.html). +## How to debug ? -### Troubleshooting - -**Scaling issues**, they can appear when you have two cameras that are not using the same resolution (most common case in game and scene views) and can be caused by: +When writing your effect, you'll probably arrive at a point where you want to debug and analyze what's going on. -- Calls to [CommandBuffer.SetRenderTarget()](https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.SetRenderTarget.html) instead of [CoreUtils.SetRenderTarget()](https://docs.unity3d.com/Packages/com.unity.render-pipelines.core@latest/index.html?subfolder=/api/UnityEngine.Rendering.CoreUtils.html#UnityEngine_Rendering_CoreUtils_SetRenderTarget_CommandBuffer_UnityEngine_Rendering_RTHandle_UnityEngine_Rendering_RTHandle_UnityEngine_Rendering_ClearFlag_System_Int32_CubemapFace_System_Int32_). Note that the CoreUtils one also sets the viewport. -- In the shader, a missing multiplication by `_RTHandleScale.xy` for the UVs when sampling an RTHandle buffer. +The frame debugger is here to help you, enabling it in the game view allow you to examine every draw calls you issued in the custom pass. To find your pass, you just need to search for the name of custom pass you set in the UI. +For example, in this image I'm debugging the outline pass which I called "My Outline Pass" in the inspector: +![](Images/CustomPass_FrameDebugger.png) -**Shuriken Particle System**, when you render a particle system that is only visible in the custom pass and your particles are facing the wrong direction it's probably because you didn't override the `AggregateCullingParameters`. The orientation of the particles in Shuriken is computed during the culling so if you don't have the correct setup it will not be rendered properly. +You can now clearly see the steps executed by the custom pass: +- `Clear` on the 'Outline Buffer' +- `RenderLoopNewBatcher.Draw` is a call to DrawRenderers, it will draw meshes we selected using the SRP Batcher. +- `Draw Procedural` is our fullscreen pass which takes the outline buffer in parameter and blits the outline to our camera color buffer. ## Example: Glitch Effect (without code) @@ -389,57 +425,34 @@ class Outline : CustomPass Shader outlineShader; Material fullscreenOutline; - MaterialPropertyBlock outlineProperties; - ShaderTagId[] shaderTags; RTHandle outlineBuffer; protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) { outlineShader = Shader.Find("Hidden/Outline"); fullscreenOutline = CoreUtils.CreateEngineMaterial(outlineShader); - outlineProperties = new MaterialPropertyBlock(); - - // List all the materials that will be replaced in the frame - shaderTags = new ShaderTagId[3] - { - new ShaderTagId("Forward"), - new ShaderTagId("ForwardOnly"), - new ShaderTagId("SRPDefaultUnlit"), - }; outlineBuffer = RTHandles.Alloc( Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, - colorFormat: GraphicsFormat.B10G11R11_UFloatPack32, + colorFormat: GraphicsFormat.B10G11R11_UFloatPack32, // We don't need alpha for this effect useDynamicScale: true, name: "Outline Buffer" ); } - void DrawOutlineMeshes(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera hdCamera, CullingResults cullingResult) - { - var result = new RendererListDesc(shaderTags, cullingResult, hdCamera.camera) - { - // We need the lighting render configuration to support rendering lit objects - rendererConfiguration = PerObjectData.LightProbe | PerObjectData.LightProbeProxyVolume | PerObjectData.Lightmaps, - renderQueueRange = RenderQueueRange.all, - sortingCriteria = SortingCriteria.BackToFront, - excludeObjectMotionVectors = false, - layerMask = outlineLayer, - }; - - CoreUtils.SetRenderTarget(cmd, outlineBuffer, ClearFlag.Color); - HDUtils.DrawRendererList(renderContext, cmd, RendererList.Create(result)); - } - - protected override void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera camera, CullingResults cullingResult) + protected override void Execute(CustomPassContext ctx) { - DrawOutlineMeshes(renderContext, cmd, camera, cullingResult); - - SetCameraRenderTarget(cmd); - - outlineProperties.SetColor("_OutlineColor", outlineColor); - outlineProperties.SetTexture("_OutlineBuffer", outlineBuffer); - outlineProperties.SetFloat("_Threshold", threshold); - CoreUtils.DrawFullScreen(cmd, fullscreenOutline, outlineProperties, shaderPassId: 0); + // Render meshes we want to outline in the outline buffer + CoreUtils.SetRenderTarget(ctx.cmd, outlineBuffer, ClearFlag.Color); + CustomPassUtils.DrawRenderers(ctx, outlineLayer); + + // Setup outline effect properties + ctx.propertyBlock.SetColor("_OutlineColor", outlineColor); + ctx.propertyBlock.SetTexture("_OutlineBuffer", outlineBuffer); + ctx.propertyBlock.SetFloat("_Threshold", threshold); + + // Render the outline as a fullscreen alpha-blended pass on top of the camera color + CoreUtils.SetRenderTarget(ctx.cmd, ctx.cameraColorBuffer, ClearFlag.None); + CoreUtils.DrawFullScreen(ctx.cmd, fullscreenOutline, ctx.propertyBlock, shaderPassId: 0); } protected override void Cleanup() diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Images/CustomPass_FrameDebugger.png b/com.unity.render-pipelines.high-definition/Documentation~/Images/CustomPass_FrameDebugger.png new file mode 100644 index 00000000000..73f1ee8968a --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Documentation~/Images/CustomPass_FrameDebugger.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:250bc517d35f454a35bb326ff9ed9779016a1f58d16be42fd3ac2c4af6600033 +size 748344 diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index fe048fa637f..4525826178a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -585,7 +585,7 @@ void InitializeRenderTextures() m_CameraSssDiffuseLightingBuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GraphicsFormat.B10G11R11_UFloatPack32, enableRandomWrite: true, useDynamicScale: true, name: "CameraSSSDiffuseLighting"); m_CustomPassColorBuffer = new Lazy(() => RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GetCustomBufferFormat(), enableRandomWrite: true, useDynamicScale: true, name: "CustomPassColorBuffer")); - m_CustomPassDepthBuffer = new Lazy(() => RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GraphicsFormat.R32_UInt, enableRandomWrite: true, useDynamicScale: true, isShadowMap: true, name: "CustomPassDepthBuffer", depthBufferBits: DepthBits.Depth32)); + m_CustomPassDepthBuffer = new Lazy(() => RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GraphicsFormat.R32_UInt, enableRandomWrite: true, useDynamicScale: true, name: "CustomPassDepthBuffer", depthBufferBits: DepthBits.Depth32)); m_DistortionBuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: Builtin.GetDistortionBufferFormat(), useDynamicScale: true, name: "Distortion"); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs index a9ee09519fb..b33f12e2dc7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs @@ -178,11 +178,12 @@ internal void ExecuteInternal(ScriptableRenderContext renderContext, CommandBuff SetCustomPassTarget(cmd); // Create the custom pass context: + bool msaa = IsMSAAEnabled(hdCamera); CustomPassContext ctx = new CustomPassContext( renderContext, cmd, hdCamera, - cullingResult, targets.cameraColorBuffer, - rtManager.GetDepthStencilBuffer(IsMSAAEnabled(hdCamera)), - rtManager.GetNormalBuffer(IsMSAAEnabled(hdCamera)), + cullingResult, msaa ? targets.cameraColorMSAABuffer : targets.cameraColorBuffer, + rtManager.GetDepthStencilBuffer(msaa), + rtManager.GetNormalBuffer(msaa), targets.customColorBuffer, targets.customDepthBuffer, userMaterialPropertyBlock diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs index 93884a53254..5bdb1bcc4ef 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs @@ -82,14 +82,28 @@ public static void DownSample(in CustomPassContext ctx, RTHandle source, RTHandl } // Do we provide an upsample function ? - // public static void UpSample(CustomPassContext ctx, RTHandle source, RTHandle destination) - // { - // Debug.Log("TODO"); - // } + /// + /// + /// + /// + /// + /// + /// + /// public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sourceMip = 0, int destMip = 0) => Copy(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sourceMip, destMip); + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sourceMip = 0, int destMip = 0) { if (source == destination) @@ -107,9 +121,31 @@ public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle dest } } + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// public static void VerticalGaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, float radius = 5, int sourceMip = 0, int destMip = 0) => VerticalGaussianBlur(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sampleCount, radius, sourceMip, destMip); + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// public static void VerticalGaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, float radius = 5, int sourceMip = 0, int destMip = 0) { if (source == destination) @@ -128,9 +164,31 @@ public static void VerticalGaussianBlur(in CustomPassContext ctx, RTHandle sourc } } + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// public static void HorizontalGaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, float radius = 5, int sourceMip = 0, int destMip = 0) => HorizontalGaussianBlur(ctx, source, destination, fullScreenScaleBias, fullScreenScaleBias, sampleCount, radius, sourceMip, destMip); + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// public static void HorizontalGaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, float radius = 5, int sourceMip = 0, int destMip = 0) { if (source == destination) @@ -149,9 +207,35 @@ public static void HorizontalGaussianBlur(in CustomPassContext ctx, RTHandle sou } } + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// public static void GaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, int sampleCount = 9, float radius = 5, int sourceMip = 0, int destMip = 0, bool downSample = true) => GaussianBlur(ctx, source, destination, tempTarget, fullScreenScaleBias, fullScreenScaleBias, sampleCount, radius, sourceMip, destMip, downSample); + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// public static void GaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 9, float radius = 5, int sourceMip = 0, int destMip = 0, bool downSample = true) { if (source == tempTarget || destination == tempTarget) @@ -187,11 +271,21 @@ public static void GaussianBlur(in CustomPassContext ctx, RTHandle source, RTHan } } + /// + /// Simpler version of ScriptableRenderContext.DrawRenderers to draw HDRP materials. + /// + /// + /// + /// + /// + /// public static void DrawRenderers(in CustomPassContext ctx, LayerMask layerMask, CustomPass.RenderQueueType renderQueueFilter = CustomPass.RenderQueueType.All, Material overrideMaterial = null, int overideMaterialIndex = 0) { + PerObjectData renderConfig = ctx.hdCamera.frameSettings.IsEnabled(FrameSettingsField.Shadowmask) ? HDUtils.k_RendererConfigurationBakedLightingWithShadowMask : HDUtils.k_RendererConfigurationBakedLighting; + var result = new RendererListDesc(litForwardTags, ctx.cullingResults, ctx.hdCamera.camera) { - rendererConfiguration = PerObjectData.None, + rendererConfiguration = renderConfig, renderQueueRange = GetRenderQueueRangeFromRenderQueueType(renderQueueFilter), sortingCriteria = SortingCriteria.BackToFront, excludeObjectMotionVectors = false, @@ -202,35 +296,10 @@ public static void DrawRenderers(in CustomPassContext ctx, LayerMask layerMask, HDUtils.DrawRendererList(ctx.renderContext, ctx.cmd, RendererList.Create(result)); } - public static void DrawShadowMap(in CustomPassContext ctx, RTHandle destination, Camera view, LayerMask layerMask) - { - var result = new RendererListDesc(litForwardTags, ctx.cullingResults, ctx.hdCamera.camera) - { - rendererConfiguration = PerObjectData.None, - renderQueueRange = RenderQueueRange.all, - sortingCriteria = SortingCriteria.BackToFront, - excludeObjectMotionVectors = false, - layerMask = layerMask, - // stateBlock = new RenderStateBlock(RenderStateMask.Depth){ depthState = new DepthState(true, CompareFunction.LessEqual)}, - }; - - var hdrp = HDRenderPipeline.currentPipeline; - // ctx.hdCamera.SetupGlobalParams(ctx.cmd, hdrp.m_) - - CoreUtils.SetRenderTarget(ctx.cmd, destination, ClearFlag.Depth); - HDUtils.DrawRendererList(ctx.renderContext, ctx.cmd, RendererList.Create(result)); - } - - // Render objects from the view in parameter - public static void RenderFrom(in CustomPassContext ctx, RTHandle destination, Camera view, LayerMask layerMask) - { - - } - /// /// Generate gaussian weights for a given number of samples /// - /// + /// number of weights you want to generate /// a GPU compute buffer containing the weights internal static ComputeBuffer GetGaussianWeights(int weightCount) { @@ -268,6 +337,11 @@ float Gaussian(float x, float sigma = 1) return gpuWeights; } + /// + /// Convert a Custom Pass render queue type to a RenderQueueRange that can be used in DrawRenderers + /// + /// The type of render queue + /// The converted render queue range public static RenderQueueRange GetRenderQueueRangeFromRenderQueueType(CustomPass.RenderQueueType type) { switch (type) From 90dfddad53d583248f2a316c3b9ee64a7341ab02 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Thu, 16 Apr 2020 17:08:26 +0200 Subject: [PATCH 08/37] Added custom pass API graphic test reference image --- .../Scenes/9x_Other/9702_CustomPass_API.unity | 47 ++++------ .../9702_CustomPass_API/DrawFromCamera.cs | 27 ------ .../DrawFromCamera.cs.meta | 11 --- .../Metal/None/9702_CustomPass_API.png | 3 + .../Metal/None/9702_CustomPass_API.png.meta | 94 +++++++++++++++++++ .../Direct3D11/None/9702_CustomPass_API.png | 3 + .../None/9702_CustomPass_API.png.meta | 94 +++++++++++++++++++ .../Vulkan/None/9702_CustomPass_API.png | 3 + .../Vulkan/None/9702_CustomPass_API.png.meta | 94 +++++++++++++++++++ .../Direct3D11/None/9702_CustomPass_API.png | 3 + .../None/9702_CustomPass_API.png.meta | 94 +++++++++++++++++++ .../Vulkan/None/9702_CustomPass_API.png | 3 + .../Vulkan/None/9702_CustomPass_API.png.meta | 94 +++++++++++++++++++ .../RenderPass/CustomPass/CustomPassUtils.cs | 2 +- 14 files changed, 504 insertions(+), 68 deletions(-) delete mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs delete mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9702_CustomPass_API.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9702_CustomPass_API.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/9702_CustomPass_API.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/9702_CustomPass_API.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/9702_CustomPass_API.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/9702_CustomPass_API.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/9702_CustomPass_API.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/9702_CustomPass_API.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/9702_CustomPass_API.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/9702_CustomPass_API.png.meta diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity index c1b56097d79..c35cfcf33b8 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity @@ -469,6 +469,12 @@ Transform: type: 3} m_PrefabInstance: {fileID: 65093927} m_PrefabAsset: {fileID: 0} +--- !u!20 &65093929 stripped +Camera: + m_CorrespondingSourceObject: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + m_PrefabInstance: {fileID: 65093927} + m_PrefabAsset: {fileID: 0} --- !u!1 &179283798 GameObject: m_ObjectHideFlags: 0 @@ -613,7 +619,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &211598674 Transform: m_ObjectHideFlags: 0 @@ -658,9 +664,9 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 247597907} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 8.9} + m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 503088924} m_Father: {fileID: 65093928} @@ -669,8 +675,8 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} + m_SizeDelta: {x: 2, y: 2} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &247597909 MonoBehaviour: m_ObjectHideFlags: 0 @@ -719,8 +725,8 @@ Canvas: m_GameObject: {fileID: 247597907} m_Enabled: 1 serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 0} + m_RenderMode: 2 + m_Camera: {fileID: 65093929} m_PlaneDistance: 100 m_PixelPerfect: 0 m_ReceivesEvents: 1 @@ -829,10 +835,10 @@ RectTransform: m_Father: {fileID: 247597908} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 6.4, y: 3.6} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &503088925 MonoBehaviour: @@ -850,6 +856,7 @@ MonoBehaviour: m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -1441,7 +1448,6 @@ GameObject: m_Component: - component: {fileID: 1612872288} - component: {fileID: 1612872291} - - component: {fileID: 1612872290} - component: {fileID: 1612872289} m_Layer: 0 m_Name: Camera @@ -1577,14 +1583,6 @@ MonoBehaviour: data1: 0 data2: 0 defaultFrameSettings: 0 ---- !u!81 &1612872290 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1612872287} - m_Enabled: 1 --- !u!20 &1612872291 Camera: m_ObjectHideFlags: 0 @@ -1638,7 +1636,6 @@ GameObject: m_Component: - component: {fileID: 1795749611} - component: {fileID: 1795749614} - - component: {fileID: 1795749613} - component: {fileID: 1795749612} m_Layer: 0 m_Name: Camera @@ -1774,14 +1771,6 @@ MonoBehaviour: data1: 0 data2: 0 defaultFrameSettings: 0 ---- !u!81 &1795749613 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1795749610} - m_Enabled: 1 --- !u!20 &1795749614 Camera: m_ObjectHideFlags: 0 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs deleted file mode 100644 index 8e73ef5229b..00000000000 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs +++ /dev/null @@ -1,27 +0,0 @@ -using UnityEngine; -using UnityEngine.Rendering.HighDefinition; -using UnityEngine.Rendering; -using UnityEngine.Experimental.Rendering; - -class DrawFromCamera : CustomPass -{ - // It can be used to configure render targets and their clear state. Also to create temporary render target textures. - // When empty this render pass will render to the active camera render target. - // You should never call CommandBuffer.SetRenderTarget. Instead call ConfigureTarget and ConfigureClear. - // The render pipeline will ensure target setup and clearing happens in an performance manner. - protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) - { - // Setup code here - } - - protected override void Execute(CustomPassContext ctx) - { - // Executed every frame for all the camera inside the pass volume. - // The context contains the command buffer to use to enqueue graphics commands. - } - - protected override void Cleanup() - { - // Cleanup code - } -} \ No newline at end of file diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs.meta deleted file mode 100644 index 4b31f2001b1..00000000000 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/DrawFromCamera.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: cb755fe59b64e8f48b813dcfdcf107af -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9702_CustomPass_API.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9702_CustomPass_API.png new file mode 100644 index 00000000000..f0bb3664b51 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9702_CustomPass_API.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:928bce3e7253c593f7b9f8a602993ec008769ba0fcf50f2f8a7103c3080f8dba +size 176368 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9702_CustomPass_API.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9702_CustomPass_API.png.meta new file mode 100644 index 00000000000..e668953146a --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9702_CustomPass_API.png.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: b15d06ee5c6404945a617004fcf683cf +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/9702_CustomPass_API.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/9702_CustomPass_API.png new file mode 100644 index 00000000000..f0bb3664b51 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/9702_CustomPass_API.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:928bce3e7253c593f7b9f8a602993ec008769ba0fcf50f2f8a7103c3080f8dba +size 176368 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/9702_CustomPass_API.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/9702_CustomPass_API.png.meta new file mode 100644 index 00000000000..2c9e98f4e2d --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/9702_CustomPass_API.png.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: 313b85750c3aa9043b38fc23fceb7a1c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + 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 + isReadable: 1 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/9702_CustomPass_API.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/9702_CustomPass_API.png new file mode 100644 index 00000000000..f0bb3664b51 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/9702_CustomPass_API.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:928bce3e7253c593f7b9f8a602993ec008769ba0fcf50f2f8a7103c3080f8dba +size 176368 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/9702_CustomPass_API.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/9702_CustomPass_API.png.meta new file mode 100644 index 00000000000..8ff057796a6 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/9702_CustomPass_API.png.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: 0fa13cc5abc54994f9861630e78f01a9 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/9702_CustomPass_API.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/9702_CustomPass_API.png new file mode 100644 index 00000000000..f0bb3664b51 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/9702_CustomPass_API.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:928bce3e7253c593f7b9f8a602993ec008769ba0fcf50f2f8a7103c3080f8dba +size 176368 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/9702_CustomPass_API.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/9702_CustomPass_API.png.meta new file mode 100644 index 00000000000..9c607a3db57 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/9702_CustomPass_API.png.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: cf89d957cd0ce3e498298a5535343c35 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/9702_CustomPass_API.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/9702_CustomPass_API.png new file mode 100644 index 00000000000..f0bb3664b51 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/9702_CustomPass_API.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:928bce3e7253c593f7b9f8a602993ec008769ba0fcf50f2f8a7103c3080f8dba +size 176368 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/9702_CustomPass_API.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/9702_CustomPass_API.png.meta new file mode 100644 index 00000000000..5824393cb69 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/9702_CustomPass_API.png.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: da1012ffc038da14d8a3de422c322175 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs index 5bdb1bcc4ef..cf708fde074 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs @@ -37,7 +37,7 @@ public static class CustomPassUtils internal static void Initialize() { - customPassUtilsMaterial = new Material(HDRenderPipeline.defaultAsset.renderPipelineResources.shaders.customPassUtils); + customPassUtilsMaterial = CoreUtils.CreateEngineMaterial(HDRenderPipeline.defaultAsset.renderPipelineResources.shaders.customPassUtils); downSamplePassIndex = customPassUtilsMaterial.FindPass("Downsample"); verticalBlurPassIndex = customPassUtilsMaterial.FindPass("VerticalBlur"); horizontalBlurPassIndex = customPassUtilsMaterial.FindPass("HorizontalBlur"); From 6dce3890e6efaf28605d1860d4820cfcc9cc6ec9 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Thu, 16 Apr 2020 17:24:25 +0200 Subject: [PATCH 09/37] Added more obsolete things --- .../RenderPipeline/RenderPass/CustomPass/CustomPass.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs index b33f12e2dc7..f5b885c4536 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs @@ -289,14 +289,13 @@ protected virtual void Setup(ScriptableRenderContext renderContext, CommandBuffe /// protected virtual void Cleanup() {} - // TODO: mark obsolete all the Set* functions and add a variant that takes a CustomPassContext. - /// /// Bind the camera color buffer as the current render target /// /// /// if true we bind the camera depth buffer in addition to the color /// + [Obsolete("Use directly CoreUtils.SetRenderTarget with the render target of your choice.")] protected void SetCameraRenderTarget(CommandBuffer cmd, bool bindDepth = true, ClearFlag clearFlags = ClearFlag.None) { if (!isExecuting) @@ -314,6 +313,7 @@ protected void SetCameraRenderTarget(CommandBuffer cmd, bool bindDepth = true, C /// /// if true we bind the custom depth buffer in addition to the color /// + [Obsolete("Use directly CoreUtils.SetRenderTarget with the render target of your choice.")] protected void SetCustomRenderTarget(CommandBuffer cmd, bool bindDepth = true, ClearFlag clearFlags = ClearFlag.None) { if (!isExecuting) From e32b4acca2f6ba38e6d066a9e2c8e5eea9231af8 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Thu, 16 Apr 2020 17:34:19 +0200 Subject: [PATCH 10/37] fix function visibility --- .../RenderPipeline/RenderPass/DrawRenderersCustomPass.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs index c60dbeb69c8..d040f90a0a9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs @@ -118,7 +118,7 @@ protected override void AggregateCullingParameters(ref ScriptableCullingParamete cullingParameters.cullingMask |= (uint)(int)layerMask; } - protected ShaderTagId[] GetShaderTagIds() + ShaderTagId[] GetShaderTagIds() { if (shaderPass == ShaderPass.DepthPrepass) return depthShaderTags; From 852626885c41b350b000312e666b89c8f1283beb Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 17 Apr 2020 11:50:21 +0200 Subject: [PATCH 11/37] Added the API to override camera rendering --- .../RenderPipeline/HDRenderPipeline.cs | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index ebdfa2fb13e..da29f0d794b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -279,6 +279,7 @@ internal int GetMaxScreenSpaceShadows() bool m_ValidAPI; // False by default mean we render normally, true mean we don't render anything bool m_IsDepthBufferCopyValid; RenderTexture m_TemporaryTargetForCubemaps; + HDCamera m_CurrentHDCamera; private CameraCache<(Transform viewer, HDProbe probe, int face)> m_ProbeCameraCache = new CameraCache<(Transform viewer, HDProbe probe, int face)>(); @@ -1899,6 +1900,7 @@ AOVRequestData aovRequest // Updates RTHandle hdCamera.BeginRender(cmd); + m_CurrentHDCamera = hdCamera; if (m_RayTracingSupported) { @@ -2560,6 +2562,8 @@ void Callback(CommandBuffer c, HDCamera cam) // Otherwise command would not be rendered in order. renderContext.ExecuteCommandBuffer(cmd); cmd.Clear(); + + m_CurrentHDCamera = null; } struct BlitFinalCameraTextureParameters @@ -4753,5 +4757,57 @@ void SendColorGraphicsBuffer(CommandBuffer cmd, HDCamera hdCamera) VFXManager.SetCameraBuffer(hdCamera.camera, VFXCameraBufferTypes.Color, colorBuffer, 0, 0, hdCamera.actualWidth, hdCamera.actualHeight); } } + + /// + /// Overrides the current camera, changing all the matrices and view parameters for the new one. + /// It allows you to render objects from another camera, which can be useful in custom passes for example. + /// + public struct OverrideCameraRendering : IDisposable + { + CommandBuffer cmd; + + /// + /// Overrides the current camera, changing all the matrices and view parameters for the new one. + /// + /// The current command buffer in use + /// The camera that will replace the current one + /// + /// + /// using (new HDRenderPipeline.OverrideCameraRendering(cmd, overrideCamera)) + /// { + /// ... + /// } + /// + /// + public OverrideCameraRendering(CommandBuffer cmd, Camera overrideCamera) + { + this.cmd = cmd; + var hdrp = HDRenderPipeline.currentPipeline; + var hdCamera = HDCamera.GetOrCreate(overrideCamera); + + // Update HDCamera datas + hdCamera.Update(hdCamera.frameSettings, hdrp, hdrp.m_MSAASamples, hdrp.m_XRSystem.emptyPass); + hdCamera.UpdateAllViewConstants(false); + hdCamera.UpdateShaderVariablesGlobalCB(ref hdrp.m_ShaderVariablesGlobalCB, hdrp.m_FrameCount); + + ConstantBuffer.PushGlobal(cmd, hdrp.m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal); + } + + /// + /// Reset the camera settings to the original camera + /// + void IDisposable.Dispose() + { + if (m_CurrentHDCamera == null) + { + Debug.LogError("OverrideCameraRendering can only be called inside the render loop !"); + return; + } + + var hdrp = HDRenderPipeline.currentPipeline; + hdrp.m_CurrentHDCamera.UpdateShaderVariablesGlobalCB(ref hdrp.m_ShaderVariablesGlobalCB, hdrp.m_FrameCount); + ConstantBuffer.PushGlobal(cmd, hdrp.m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal); + } + } } } From 4cb6126bec6cb6208eecac159d405121e166add0 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 17 Apr 2020 11:50:27 +0200 Subject: [PATCH 12/37] Updated changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ee5b4177476..c09cb091cb6 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -105,6 +105,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added Light decomposition lighting debugging modes and support in AOV - Added exposure compensation to Fixed exposure mode - Added support for rasterized area light shadows in StackLit +- Added an API in HDRP to override the camera within the rendering of a frame (mainly for custom pass). ### Fixed - Fix when rescale probe all direction below zero (1219246) From 9d8dd992464ef87ce4fb3655c94b05984f41a059 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 17 Apr 2020 12:07:38 +0200 Subject: [PATCH 13/37] Updated changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ee5b4177476..052ccf94c2b 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -105,6 +105,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added Light decomposition lighting debugging modes and support in AOV - Added exposure compensation to Fixed exposure mode - Added support for rasterized area light shadows in StackLit +- Added CustomPassUtils API to simplify Blur, Copy and DrawRenderers custom passes. ### Fixed - Fix when rescale probe all direction below zero (1219246) From 27f9e29baa48bd0e2f7968d1de374bd9510e50bc Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 17 Apr 2020 12:10:01 +0200 Subject: [PATCH 14/37] Fixed compilation issue --- .../Runtime/RenderPipeline/HDRenderPipeline.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index da29f0d794b..43421a6bc07 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -4798,13 +4798,14 @@ public OverrideCameraRendering(CommandBuffer cmd, Camera overrideCamera) /// void IDisposable.Dispose() { - if (m_CurrentHDCamera == null) + var hdrp = HDRenderPipeline.currentPipeline; + + if (hdrp.m_CurrentHDCamera == null) { Debug.LogError("OverrideCameraRendering can only be called inside the render loop !"); return; } - var hdrp = HDRenderPipeline.currentPipeline; hdrp.m_CurrentHDCamera.UpdateShaderVariablesGlobalCB(ref hdrp.m_ShaderVariablesGlobalCB, hdrp.m_FrameCount); ConstantBuffer.PushGlobal(cmd, hdrp.m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal); } From 3cc615c36b9eb82c5fa742ca9eef549ce88bac6d Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 17 Apr 2020 12:24:30 +0200 Subject: [PATCH 15/37] Added custom pass API test scene --- .../HDRP_Tests/ProjectSettings/EditorBuildSettings.asset | 3 +++ 1 file changed, 3 insertions(+) diff --git a/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset b/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset index 5b410ffabfd..ec182da547c 100644 --- a/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset +++ b/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset @@ -560,6 +560,9 @@ EditorBuildSettings: - enabled: 1 path: Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen.unity guid: 86f8f2a99d6720b48abc19c684103d74 + - enabled: 1 + path: Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity + guid: 3d584f34970fc5c44871961e3178f4ce - enabled: 1 path: Assets/GraphicTests/Scenes/9x_Other/9801_ShurikenLightModule.unity guid: d50ee167e49a2d74988347d7888c3613 From 4f11b76713b038ed217d131e4fd07a678fae41d6 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 17 Apr 2020 16:17:27 +0200 Subject: [PATCH 16/37] Begin to add custom pass override test --- .../Scenes/9x_Other/9702_CustomPass_API.unity | 971 +++++++++++++++++- .../9702_CustomPass_API/OverrideCamera.cs | 39 + .../OverrideCamera.cs.meta | 11 + .../CustomPassRenderersUtils.shader | 67 ++ .../CustomPassRenderersUtils.shader.meta | 10 + .../RenderPass/CustomPass/CustomPassUtils.cs | 27 + .../RenderPipeline/RenderPipelineResources.cs | 2 + .../HDRenderPipelineResources.asset | 2 + 8 files changed, 1095 insertions(+), 34 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/OverrideCamera.cs create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/OverrideCamera.cs.meta create mode 100644 com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassRenderersUtils.shader create mode 100644 com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassRenderersUtils.shader.meta diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity index c35cfcf33b8..74bfc7a0040 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity @@ -475,6 +475,204 @@ Camera: type: 3} m_PrefabInstance: {fileID: 65093927} m_PrefabAsset: {fileID: 0} +--- !u!1 &169452103 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 169452104} + - component: {fileID: 169452107} + - component: {fileID: 169452106} + - component: {fileID: 169452105} + m_Layer: 0 + m_Name: OverrideCamera0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &169452104 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 169452103} + m_LocalRotation: {x: 0.49999842, y: 0.49999985, z: -0.5000001, w: 0.5000016} + m_LocalPosition: {x: -0.96499634, y: 1.4570007, z: 4.4789977} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1344937665} + m_Father: {fileID: 211598674} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: -90} +--- !u!114 &169452105 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 169452103} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 7 + 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: 1 + volumeAnchorOverride: {fileID: 0} + antialiasing: 0 + SMAAQuality: 2 + dithering: 0 + stopNaNs: 0 + taaSharpenStrength: 0.5 + TAAQuality: 1 + taaHistorySharpening: 0.35 + taaAntiFlicker: 0.5 + taaMotionVectorRejection: 0 + taaAntiHistoryRinging: 0 + physicalParameters: + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + flipYMode: 0 + xrRendering: 1 + fullscreenPassthrough: 0 + allowDynamicResolution: 0 + customRenderingSettings: 0 + invertFaceCulling: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + hasPersistentHistory: 0 + m_RenderingPathCustomFrameSettings: + bitDatas: + data1: 72198260625768269 + data2: 13763000462317912064 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 20 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 0 + data2: 0 + defaultFrameSettings: 0 +--- !u!81 &169452106 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 169452103} + m_Enabled: 1 +--- !u!20 &169452107 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 169452103} + m_Enabled: 0 + 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_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 10 + field of view: 60 + orthographic: 0 + 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: 0 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 --- !u!1 &179283798 GameObject: m_ObjectHideFlags: 0 @@ -619,7 +817,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!4 &211598674 Transform: m_ObjectHideFlags: 0 @@ -635,6 +833,10 @@ Transform: - {fileID: 2026715368} - {fileID: 1007981418} - {fileID: 1264929867} + - {fileID: 169452104} + - {fileID: 261956907} + - {fileID: 2129115081} + - {fileID: 487669536} m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -700,43 +902,240 @@ MonoBehaviour: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 247597907} + m_GameObject: {fileID: 247597907} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &247597911 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 247597907} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 65093929} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!1 &261956906 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 261956907} + - component: {fileID: 261956910} + - component: {fileID: 261956909} + - component: {fileID: 261956908} + m_Layer: 0 + m_Name: OverrideCamera1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &261956907 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 261956906} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.43, y: 0, z: 3.19} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 211598674} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &261956908 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 261956906} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 7 + 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: 1 + volumeAnchorOverride: {fileID: 0} + antialiasing: 0 + SMAAQuality: 2 + dithering: 0 + stopNaNs: 0 + taaSharpenStrength: 0.5 + TAAQuality: 1 + taaHistorySharpening: 0.35 + taaAntiFlicker: 0.5 + taaMotionVectorRejection: 0 + taaAntiHistoryRinging: 0 + physicalParameters: + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + flipYMode: 0 + xrRendering: 1 + fullscreenPassthrough: 0 + allowDynamicResolution: 0 + customRenderingSettings: 0 + invertFaceCulling: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + hasPersistentHistory: 0 + m_RenderingPathCustomFrameSettings: + bitDatas: + data1: 72198260625768269 + data2: 13763000462317912064 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 20 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 0 + data2: 0 + defaultFrameSettings: 0 +--- !u!81 &261956909 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 261956906} m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 ---- !u!223 &247597911 -Canvas: +--- !u!20 &261956910 +Camera: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 247597907} + m_GameObject: {fileID: 261956906} m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 65093929} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 + 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_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + 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: 0 + 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: 0 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 --- !u!1 &338225181 GameObject: m_ObjectHideFlags: 0 @@ -803,6 +1202,203 @@ MonoBehaviour: m_FirstSelected: {fileID: 0} m_sendNavigationEvents: 1 m_DragThreshold: 10 +--- !u!1 &487669535 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 487669536} + - component: {fileID: 487669539} + - component: {fileID: 487669538} + - component: {fileID: 487669537} + m_Layer: 0 + m_Name: OverrideCamera3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &487669536 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 487669535} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.4300003, y: 0, z: 3.19} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 211598674} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &487669537 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 487669535} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 7 + 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: 1 + volumeAnchorOverride: {fileID: 0} + antialiasing: 0 + SMAAQuality: 2 + dithering: 0 + stopNaNs: 0 + taaSharpenStrength: 0.5 + TAAQuality: 1 + taaHistorySharpening: 0.35 + taaAntiFlicker: 0.5 + taaMotionVectorRejection: 0 + taaAntiHistoryRinging: 0 + physicalParameters: + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + flipYMode: 0 + xrRendering: 1 + fullscreenPassthrough: 0 + allowDynamicResolution: 0 + customRenderingSettings: 0 + invertFaceCulling: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + hasPersistentHistory: 0 + m_RenderingPathCustomFrameSettings: + bitDatas: + data1: 72198260625768269 + data2: 13763000462317912064 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 20 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 0 + data2: 0 + defaultFrameSettings: 0 +--- !u!81 &487669538 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 487669535} + m_Enabled: 1 +--- !u!20 &487669539 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 487669535} + 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_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + 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: 0 + 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: 0 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 --- !u!1 &503088923 GameObject: m_ObjectHideFlags: 0 @@ -1071,7 +1667,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1007981417} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: -4.42, z: 9.68} + m_LocalPosition: {x: -3.71, y: -4.42, z: 9.68} m_LocalScale: {x: 0.09001844, y: 0.09001844, z: 0.09001844} m_Children: [] m_Father: {fileID: 211598674} @@ -1085,7 +1681,7 @@ TextMesh: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1007981417} - m_Text: Copy + m_Text: Camera Override m_OffsetZ: 0 m_CharacterSize: 1 m_LineSpacing: 1 @@ -1275,10 +1871,25 @@ MonoBehaviour: isGlobal: 0 fadeRadius: 0 priority: 0 - customPasses: [] + customPasses: + - id: 0 injectionPoint: 1 references: version: 1 + 00000000: + type: {class: OverrideCamera, ns: , asm: Assembly-CSharp} + data: + m_Name: Custom Pass + enabled: 1 + targetColorBuffer: 0 + targetDepthBuffer: 0 + clearFlags: 0 + passFoldout: 0 + m_Version: 0 + customCamera0: {fileID: 169452107} + customCamera1: {fileID: 261956910} + customCamera2: {fileID: 2129115084} + customCamera3: {fileID: 487669539} --- !u!1 &1289910854 GameObject: m_ObjectHideFlags: 0 @@ -1375,6 +1986,101 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1289910854} m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1344937664 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1344937665} + - component: {fileID: 1344937668} + - component: {fileID: 1344937667} + - component: {fileID: 1344937666} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1344937665 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1344937664} + m_LocalRotation: {x: -0.3535529, y: 0.35355288, z: -0.1464461, w: 0.85355395} + m_LocalPosition: {x: 0, y: -0, z: 1.685} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 169452104} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: -30, y: 54.735, z: -35.264} +--- !u!65 &1344937666 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1344937664} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1344937667 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1344937664} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + 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: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1344937668 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1344937664} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1551760950 GameObject: m_ObjectHideFlags: 0 @@ -2203,3 +2909,200 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2044874741} m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &2129115080 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2129115081} + - component: {fileID: 2129115084} + - component: {fileID: 2129115083} + - component: {fileID: 2129115082} + m_Layer: 0 + m_Name: OverrideCamera2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &2129115081 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2129115080} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.4300003, y: 0, z: 3.19} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 211598674} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2129115082 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2129115080} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 7 + 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: 1 + volumeAnchorOverride: {fileID: 0} + antialiasing: 0 + SMAAQuality: 2 + dithering: 0 + stopNaNs: 0 + taaSharpenStrength: 0.5 + TAAQuality: 1 + taaHistorySharpening: 0.35 + taaAntiFlicker: 0.5 + taaMotionVectorRejection: 0 + taaAntiHistoryRinging: 0 + physicalParameters: + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + flipYMode: 0 + xrRendering: 1 + fullscreenPassthrough: 0 + allowDynamicResolution: 0 + customRenderingSettings: 0 + invertFaceCulling: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + hasPersistentHistory: 0 + m_RenderingPathCustomFrameSettings: + bitDatas: + data1: 72198260625768269 + data2: 13763000462317912064 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 20 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 0 + data2: 0 + defaultFrameSettings: 0 +--- !u!81 &2129115083 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2129115080} + m_Enabled: 1 +--- !u!20 &2129115084 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2129115080} + 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_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + 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: 0 + 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: 0 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/OverrideCamera.cs b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/OverrideCamera.cs new file mode 100644 index 00000000000..dbfa4285743 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/OverrideCamera.cs @@ -0,0 +1,39 @@ +using UnityEngine; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering; +using UnityEngine.Experimental.Rendering; + +class OverrideCamera : CustomPass +{ + public Camera customCamera0 = null; + public Camera customCamera1 = null; + public Camera customCamera2 = null; + public Camera customCamera3 = null; + + RTHandle temp; + + protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) + { + temp = RTHandles.Alloc( + Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, + colorFormat: GraphicsFormat.B10G11R11_UFloatPack32, // We don't need alpha for this effect + useDynamicScale: true, name: "Override Camera Temp" + ); + } + + // In a real application we should override the culling params and aggregate all the cameras + + protected override void Execute(CustomPassContext ctx) + { + if (customCamera0 == null || customCamera1 == null || customCamera2 == null || customCamera3 == null) + return; + + using (new HDRenderPipeline.OverrideCameraRendering(ctx.cmd, customCamera0)) + { + // CoreUtils.SetRenderTarget(ctx.cmd, temp); + // CustomPassUtils.DrawRenderers(ctx, -1); + } + } + + protected override void Cleanup() => temp.Release(); +} \ No newline at end of file diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/OverrideCamera.cs.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/OverrideCamera.cs.meta new file mode 100644 index 00000000000..58da30341f6 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API/OverrideCamera.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 96d2743a173a8fc44b3cb2cb012e6b41 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassRenderersUtils.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassRenderersUtils.shader new file mode 100644 index 00000000000..f48e1a5c6d1 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassRenderersUtils.shader @@ -0,0 +1,67 @@ +Shader "Renderers/CustomPassRenderersUtils" +{ + Properties + { + } + + HLSLINCLUDE + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch + + // #pragma enable_d3d11_debug_symbols + + //enable GPU instancing support + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + + // List all the attributes needed in your shader (will be passed to the vertex shader) + // you can see the complete list of these attributes in VaryingMesh.hlsl + #define ATTRIBUTES_NEED_TEXCOORD0 + #define ATTRIBUTES_NEED_NORMAL + #define ATTRIBUTES_NEED_TANGENT + + // List all the varyings needed in your fragment shader + #define VARYINGS_NEED_TEXCOORD0 + #define VARYINGS_NEED_TANGENT_TO_WORLD + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassRenderers.hlsl" + + #pragma vertex Vert + #pragma fragment Frag + + ENDHLSL + + SubShader + { + Pass + { + Name "DepthPass" + Tags { "LightMode" = "DepthPass" } + + Blend Off + ZWrite Off + ZTest LEqual + + Cull Back + + HLSLPROGRAM + + // Put the code to render the objects in your custom pass in this function + void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 viewDirection, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData) + { + float depth = fragInputs.positionRWS.z; + + // Write back the data to the output structures + ZERO_INITIALIZE(BuiltinData, builtinData); // No call to InitBuiltinData as we don't have any lighting + builtinData.opacity = opacity; + builtinData.emissiveColor = float3(0, 0, 0); + surfaceData.color = depth; + } + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassForwardUnlit.hlsl" + + ENDHLSL + } + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassRenderersUtils.shader.meta b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassRenderersUtils.shader.meta new file mode 100644 index 00000000000..3994660c0c2 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassRenderersUtils.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: cef5ba33ee5063d4c8b495d2292e394d +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs index cf708fde074..9711e0f9ac1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs @@ -27,6 +27,7 @@ public static class CustomPassUtils static MaterialPropertyBlock propertyBlock = new MaterialPropertyBlock(); static Material customPassUtilsMaterial; + static Material customPassRenderersUtilsMaterial; static Dictionary gaussianWeightsCache = new Dictionary(); @@ -34,6 +35,7 @@ public static class CustomPassUtils static int verticalBlurPassIndex; static int horizontalBlurPassIndex; static int copyPassIndex; + static int depthPassIndex; internal static void Initialize() { @@ -42,6 +44,9 @@ internal static void Initialize() verticalBlurPassIndex = customPassUtilsMaterial.FindPass("VerticalBlur"); horizontalBlurPassIndex = customPassUtilsMaterial.FindPass("HorizontalBlur"); copyPassIndex = customPassUtilsMaterial.FindPass("Copy"); + + customPassRenderersUtilsMaterial = CoreUtils.CreateEngineMaterial(HDRenderPipeline.defaultAsset.renderPipelineResources.shaders.customPassRenderersUtils); + depthPassIndex = customPassRenderersUtilsMaterial.FindPass("DepthPass"); } /// @@ -362,6 +367,28 @@ public static RenderQueueRange GetRenderQueueRangeFromRenderQueueType(CustomPass } } + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void RenderFromCamera(in CustomPassContext ctx, Camera view, LayerMask layerMask = default(LayerMask), CustomPass.RenderQueueType renderQueueFilter = CustomPass.RenderQueueType.All, Material overrideMaterial = null, int overrideMaterialIndex = 0) + { + using (new HDRenderPipeline.OverrideCameraRendering(ctx.cmd, view)) + { + DrawRenderers(ctx, layerMask, renderQueueFilter, overrideMaterial, overrideMaterialIndex); + } + } + + public static void RenderDepthFromCamera(in CustomPassContext ctx, Camera view, RTHandle target, LayerMask layerMask = default(LayerMask), CustomPass.RenderQueueType renderQueueFilter = CustomPass.RenderQueueType.All) + { + RenderFromCamera(ctx, view, layerMask, renderQueueFilter, customPassRenderersUtilsMaterial, depthPassIndex); + } + // TODO when rendergraph is available: a PostProcess pass which does the copy with a temp target internal static void Cleanup() diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPipelineResources.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPipelineResources.cs index 3542ed6f263..cd011563f35 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPipelineResources.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPipelineResources.cs @@ -167,6 +167,8 @@ public sealed class ShaderResources public ComputeShader clearUIntTextureCS; [Reload("Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.shader")] public Shader customPassUtils; + [Reload("Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassRenderersUtils.shader")] + public Shader customPassRenderersUtils; // XR [Reload("Runtime/ShaderLibrary/XRMirrorView.shader")] diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineResources.asset b/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineResources.asset index 97e9db22961..7a5a857eed0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineResources.asset +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineResources.asset @@ -124,6 +124,8 @@ MonoBehaviour: clearUIntTextureCS: {fileID: 7200000, guid: d067ad4b88af51c498875426894aef76, type: 3} customPassUtils: {fileID: 4800000, guid: 7e3722d0388000848acb25fd3cc8c088, type: 3} + customPassRenderersUtils: {fileID: 4800000, guid: cef5ba33ee5063d4c8b495d2292e394d, + type: 3} xrMirrorViewPS: {fileID: 4800000, guid: e6255f98cf405eb45ab6f9006cf11e1f, type: 3} xrOcclusionMeshPS: {fileID: 4800000, guid: 46a45b32bb110604fb36216b63bcdb81, type: 3} shadowClearPS: {fileID: 4800000, guid: e3cab24f27741f44d8af1e94d006267c, type: 3} From a71e6de35adb067df1a012e870ac5896aad94a0d Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 17 Apr 2020 16:19:06 +0200 Subject: [PATCH 17/37] Factorized protection function --- .../RenderPipeline/HDRenderPipeline.cs | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 43421a6bc07..99c398009d5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -4764,7 +4764,8 @@ void SendColorGraphicsBuffer(CommandBuffer cmd, HDCamera hdCamera) /// public struct OverrideCameraRendering : IDisposable { - CommandBuffer cmd; + CommandBuffer cmd; + Camera overrideCamera; /// /// Overrides the current camera, changing all the matrices and view parameters for the new one. @@ -4782,6 +4783,11 @@ public struct OverrideCameraRendering : IDisposable public OverrideCameraRendering(CommandBuffer cmd, Camera overrideCamera) { this.cmd = cmd; + this.overrideCamera = overrideCamera; + + if (!IsContextValid(overrideCamera)) + return; + var hdrp = HDRenderPipeline.currentPipeline; var hdCamera = HDCamera.GetOrCreate(overrideCamera); @@ -4793,19 +4799,31 @@ public OverrideCameraRendering(CommandBuffer cmd, Camera overrideCamera) ConstantBuffer.PushGlobal(cmd, hdrp.m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal); } - /// - /// Reset the camera settings to the original camera - /// - void IDisposable.Dispose() + bool IsContextValid(Camera overrideCamera) { var hdrp = HDRenderPipeline.currentPipeline; if (hdrp.m_CurrentHDCamera == null) { Debug.LogError("OverrideCameraRendering can only be called inside the render loop !"); - return; + return false; } + if (overrideCamera == hdrp.m_CurrentHDCamera.camera) + return false; + + return true; + } + + /// + /// Reset the camera settings to the original camera + /// + void IDisposable.Dispose() + { + if (!IsContextValid(overrideCamera)) + return; + + var hdrp = HDRenderPipeline.currentPipeline; hdrp.m_CurrentHDCamera.UpdateShaderVariablesGlobalCB(ref hdrp.m_ShaderVariablesGlobalCB, hdrp.m_FrameCount); ConstantBuffer.PushGlobal(cmd, hdrp.m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal); } From 30c9659f7e0f06b4bff18200bba2b1568be87d2c Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 17 Apr 2020 17:21:13 +0200 Subject: [PATCH 18/37] Update custom pass test scene --- .../Scenes/9x_Other/9702_CustomPass_API.unity | 99 ++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity index 74bfc7a0040..a10eb3db713 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9702_CustomPass_API.unity @@ -1736,6 +1736,101 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1032924497 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1032924501} + - component: {fileID: 1032924500} + - component: {fileID: 1032924499} + - component: {fileID: 1032924498} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &1032924498 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1032924497} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1032924499 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1032924497} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: d59fa2eee3f81294b84e624b5fc8c13f, 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1032924500 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1032924497} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1032924501 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1032924497} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -109.946, y: 84.73686, z: 0.765} + m_LocalScale: {x: 0.37269, y: 0.37269, z: 0.37269} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1262988723 GameObject: m_ObjectHideFlags: 0 @@ -1873,13 +1968,13 @@ MonoBehaviour: priority: 0 customPasses: - id: 0 - injectionPoint: 1 + injectionPoint: 4 references: version: 1 00000000: type: {class: OverrideCamera, ns: , asm: Assembly-CSharp} data: - m_Name: Custom Pass + m_Name: Override Camera enabled: 1 targetColorBuffer: 0 targetDepthBuffer: 0 From 8c600716bf90677397d9211b097862bfe5669991 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 17 Apr 2020 17:51:33 +0200 Subject: [PATCH 19/37] Fixed custom pass API doc --- .../Custom-Pass-API-User-Manual.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-API-User-Manual.md b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-API-User-Manual.md index 899f9ac5be9..871f329f077 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-API-User-Manual.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-API-User-Manual.md @@ -4,7 +4,7 @@ ### Gaussian Blur -The gaussian blur function will allow you to blur an image with an arbitrary radius and quality (number of samples). For performance reasons, you also have the possibility to run the blur kernel after a downsample pass. +The Gaussian blur function allows you to blur an image with an arbitrary radius and quality (number of samples). For performance reasons, you can run the blur kernel after a downsample pass. This decreases the resource intensity of the blur effect but also decreases the quality. Here's an example of Custom Pass that blurs the camera color buffer: @@ -21,40 +21,40 @@ class GaussianBlur : CustomPass protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) { halfResTarget = RTHandles.Alloc( - // Note the * 0.5 here, it will allocate a half res target, which saves a lot of memory + // Note the * 0.5f here. This allocates a half-resolution target, which saves a lot of memory. Vector2.one * 0.5f, TextureXR.slices, dimension: TextureXR.dimension, - // We don't need alpha for this effect so we use an HDR no alpha texture format + // Since alpha is unnecessary for Gaussian blur, this effect uses an HDR texture format with no alpha channel. colorFormat: GraphicsFormat.B10G11R11_UFloatPack32, - // Never forget to name your textures, it'll be very useful for debugging + // When creating textures, be sure to name them as it is useful for debugging. useDynamicScale: true, name: "Half Res Custom Pass" ); } protected override void Execute(CustomPassContext ctx) { - // We choose an arbitrary 8 pixel radius for our blur + // Specifies the radius for the blur in pixels. This example uses an 8 pixel radius. float radius = 8.0f; - // Precision of the blur, also affect the cost of the shader, 9 is a good value for real time apps + // Specifies the precision of the blur. This also affects the resource intensity of the blue. A value of 9 is good for real-time applications. int sampleCount = 9; - // In case you have multiple camera at different resolution, make the blur coherent across these cameras. + // In cases where you have multiple cameras with different resolutions, this makes the blur coherent across these cameras. radius *= ctx.cameraColorBuffer.rtHandleProperties.rtHandleScale.x; - // Our gaussian blur call, with the camera color buffer in source and destination - // The half res target is used as temporary render target between the passes of our blur - // Note that it's content will be cleared by the Gaussian Blur function. + // The actual Gaussian blur call. It specifies the current camera's color buffer as the source and destination. + // This uses the half-resolution target as a temporary render target between the blur passes. + // Note that the Gaussian blur function clears the content of the half-resolution buffer when it finishes. CustomPassUtils.GaussianBlur( ctx, ctx.cameraColorBuffer, ctx.cameraColorBuffer, halfResTarget, sampleCount, radius, downSample: true ); } - // Release the GPU memory, otherwise it'll leak + // Releases the GPU memory allocated for the half-resolution target. This is important otherwise the memory will leak. protected override void Cleanup() => halfResTarget.Release(); } ``` -Note that we use a half res target `halfResTarget` because we first do a downsample pass. Alternatively you can also use the custom pass buffer we provide in HDRP, even if it's not a half res buffer, the algorithm will use only half of the texture. +Note that this example uses a half-resolution target, halfResTarget, because the example first processes a downsample pass. Alternatively, you can also use the custom pass buffer that HDRP provides. Even if this is not a half-resolution buffer, the algorithm only uses half of the texture.