From 8ef21eb58cc931b6338e9f3a393fff4d2f35f9e6 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 29 Jun 2021 17:19:59 +0200 Subject: [PATCH 01/41] Random prep --- .../Common/GlobalDynamicResolutionSettings.cs | 7 ++++- .../Shaders/TemporalAntiAliasing.shader | 15 +++++++++- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 15 ++++++---- .../HDRenderPipeline.PostProcess.cs | 30 +++++++++++++++++-- .../RenderPipeline/HDRenderPipeline.cs | 3 +- .../RenderPipeline/HDStringConstants.cs | 1 + 6 files changed, 60 insertions(+), 11 deletions(-) diff --git a/com.unity.render-pipelines.core/Runtime/Common/GlobalDynamicResolutionSettings.cs b/com.unity.render-pipelines.core/Runtime/Common/GlobalDynamicResolutionSettings.cs index a097d32da3e..552ff009db1 100644 --- a/com.unity.render-pipelines.core/Runtime/Common/GlobalDynamicResolutionSettings.cs +++ b/com.unity.render-pipelines.core/Runtime/Common/GlobalDynamicResolutionSettings.cs @@ -42,7 +42,12 @@ public enum DynamicResUpscaleFilter : byte /// Edge Adaptive Scaling Upres. /// [InspectorName("Edge Adaptive Scaling Upres")] - EdgeAdaptiveScalingUpres + EdgeAdaptiveScalingUpres, + /// + /// Edge Adaptive Scaling Upres. + /// + [InspectorName("TAA Upsample")] + TAAU } /// User-facing settings for dynamic resolution. diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index 4c9bb084707..f157d0e62ce 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -14,7 +14,7 @@ Shader "Hidden/HDRP/TemporalAA" #pragma multi_compile_local_fragment _ FORCE_BILINEAR_HISTORY #pragma multi_compile_local_fragment _ ENABLE_MV_REJECTION #pragma multi_compile_local_fragment _ ANTI_RINGING - #pragma multi_compile_local_fragment LOW_QUALITY MEDIUM_QUALITY HIGH_QUALITY POST_DOF + #pragma multi_compile_local_fragment LOW_QUALITY MEDIUM_QUALITY HIGH_QUALITY UPSCALE POST_DOF #pragma editor_sync_compilation @@ -71,6 +71,19 @@ Shader "Hidden/HDRP/TemporalAA" #define PERCEPTUAL_SPACE 1 #define PERCEPTUAL_SPACE_ONLY_END 0 && (PERCEPTUAL_SPACE == 0) +#elif defined(UPSCALE) + #define YCOCG 1 + #define HISTORY_SAMPLING_METHOD BICUBIC_5TAP + #define WIDE_NEIGHBOURHOOD 1 + #define NEIGHBOUROOD_CORNER_METHOD VARIANCE + #define CENTRAL_FILTERING /*UPSCALE*/ BLACKMAN_HARRIS + #define HISTORY_CLIP DIRECT_CLIP + #define ANTI_FLICKER 1 + #define ANTI_FLICKER_MV_DEPENDENT 1 + #define VELOCITY_REJECTION defined(ENABLE_MV_REJECTION) + #define PERCEPTUAL_SPACE 1 + #define PERCEPTUAL_SPACE_ONLY_END 0 && (PERCEPTUAL_SPACE == 0) + #elif defined(POST_DOF) #define YCOCG 1 #define HISTORY_SAMPLING_METHOD BILINEAR diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 2c0eceb5712..965adfb5c6d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -674,6 +674,11 @@ internal bool IsDLSSEnabled() return m_AdditionalCameraData == null ? false : m_AdditionalCameraData.cameraCanRenderDLSS; } + internal bool UpsampleHappensBeforePost() + { + return IsDLSSEnabled() || DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; + } + internal bool allowDeepLearningSuperSampling => m_AdditionalCameraData == null ? false : m_AdditionalCameraData.allowDeepLearningSuperSampling; internal bool deepLearningSuperSamplingUseCustomQualitySettings => m_AdditionalCameraData == null ? false : m_AdditionalCameraData.deepLearningSuperSamplingUseCustomQualitySettings; internal uint deepLearningSuperSamplingQuality => m_AdditionalCameraData == null ? 0 : m_AdditionalCameraData.deepLearningSuperSamplingQuality; @@ -683,7 +688,7 @@ internal bool IsDLSSEnabled() internal bool RequiresCameraJitter() { - return antialiasing == AntialiasingMode.TemporalAntialiasing || IsDLSSEnabled(); + return antialiasing == AntialiasingMode.TemporalAntialiasing || IsDLSSEnabled() || (DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU); } internal bool IsSSREnabled(bool transparent = false) @@ -773,8 +778,8 @@ internal void Update(FrameSettings currentFrameSettings, HDRenderPipeline hdrp, UpdateAntialiasing(); - // ORDER is importand: we read the upsamplerSchedule when we decide if we need to refresh the history buffers, so be careful when moving this - DynamicResolutionHandler.instance.upsamplerSchedule = IsDLSSEnabled() ? DynamicResolutionHandler.UpsamplerScheduleType.BeforePost : DynamicResolutionHandler.UpsamplerScheduleType.AfterPost; + // ORDER is important: we read the upsamplerSchedule when we decide if we need to refresh the history buffers, so be careful when moving this + DynamicResolutionHandler.instance.upsamplerSchedule = UpsampleHappensBeforePost() ? DynamicResolutionHandler.UpsamplerScheduleType.BeforePost : DynamicResolutionHandler.UpsamplerScheduleType.AfterPost; // Handle memory allocation. if (allocateHistoryBuffers) @@ -893,7 +898,7 @@ internal void Update(FrameSettings currentFrameSettings, HDRenderPipeline hdrp, Vector2Int scaledSize = DynamicResolutionHandler.instance.GetScaledSize(new Vector2Int(actualWidth, actualHeight)); actualWidth = scaledSize.x; actualHeight = scaledSize.y; - globalMipBias += DynamicResolutionHandler.instance.CalculateMipBias(scaledSize, nonScaledViewport, IsDLSSEnabled()); + globalMipBias += DynamicResolutionHandler.instance.CalculateMipBias(scaledSize, nonScaledViewport, UpsampleHappensBeforePost()); lowResScale = DynamicResolutionHandler.instance.GetLowResMultiplier(lowResScale); } @@ -1028,7 +1033,7 @@ internal static void ResetAllHistoryRTHandleSystems(int width, int height) var hdCamera = kvp.Value; var currentHistorySize = hdCamera.m_HistoryRTSystem.rtHandleProperties.currentRenderTargetSize; // We only reset if the new size if smaller than current reference (otherwise we might increase the size of off screen camera with lower resolution than the new reference. - if (width < currentHistorySize.x || height < currentHistorySize.y) + if (width > currentHistorySize.x || height > currentHistorySize.y) { hdCamera.m_HistoryRTSystem.ResetReferenceSize(width, height); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 9d1e4cda0b5..8520fa2a73e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -482,6 +482,8 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, if (hdCamera.antialiasing == HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing) { source = DoTemporalAntialiasing(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, postDoF: false, "TAA Destination"); + if (DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU) + SetCurrentResolutionGroup(renderGraph, hdCamera, ResolutionGroup.AfterDynamicResUpscale); } else if (hdCamera.antialiasing == HDAdditionalCameraData.AntialiasingMode.SubpixelMorphologicalAntiAliasing) { @@ -1404,6 +1406,8 @@ class TemporalAntiAliasingData public Vector4 taaParameters; public Vector4 taaFilterWeights; public bool motionVectorRejection; + public Vector4 taauParams; + public Rect finalViewport; public TextureHandle source; public TextureHandle destination; @@ -1468,7 +1472,12 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.temporalAAMaterial.EnableKeyword("ENABLE_MV_REJECTION"); } - if (postDoF) + bool TAAU = DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; + if (TAAU) + { + passData.temporalAAMaterial.EnableKeyword("UPSCALE"); + } + else if (postDoF) { passData.temporalAAMaterial.EnableKeyword("POST_DOF"); } @@ -1516,6 +1525,10 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem TextureHandle dest = GetPostprocessOutputHandle(renderGraph, "Post-DoF TAA Destination"); passData.destination = builder.WriteTexture(dest); + + passData.finalViewport = camera.finalViewport; + var resScale = DynamicResolutionHandler.instance.GetCurrentScale(); + passData.taauParams = new Vector4(0.4f, resScale, 0, 0); } TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle sourceTexture, bool postDoF, string outputName) @@ -1560,6 +1573,7 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, mpb.SetVector(HDShaderIDs._TaaPostParameters, data.taaParameters); mpb.SetVector(HDShaderIDs._TaaHistorySize, taaHistorySize); mpb.SetVector(HDShaderIDs._TaaFilterWeights, data.taaFilterWeights); + mpb.SetVector(HDShaderIDs._TaauParameters, data.taauParams); CoreUtils.SetRenderTarget(ctx.cmd, data.destination, data.depthBuffer); ctx.cmd.SetRandomWriteTarget(1, data.nextHistory); @@ -1568,8 +1582,18 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, ctx.cmd.SetRandomWriteTarget(2, nextMVLenTexture); } - ctx.cmd.DrawProcedural(Matrix4x4.identity, data.temporalAAMaterial, 0, MeshTopology.Triangles, 3, 1, mpb); - ctx.cmd.DrawProcedural(Matrix4x4.identity, data.temporalAAMaterial, 1, MeshTopology.Triangles, 3, 1, mpb); + Rect rect; + if (DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU) + { + rect = data.finalViewport; + HDUtils.DrawFullScreen(ctx.cmd, rect, data.temporalAAMaterial, data.destination, data.depthBuffer, mpb, 0); + HDUtils.DrawFullScreen(ctx.cmd, rect, data.temporalAAMaterial, data.destination, data.depthBuffer, mpb, 1); + } + else + { + ctx.cmd.DrawProcedural(Matrix4x4.identity, data.temporalAAMaterial, 0, MeshTopology.Triangles, 3, 1, mpb); + ctx.cmd.DrawProcedural(Matrix4x4.identity, data.temporalAAMaterial, 1, MeshTopology.Triangles, 3, 1, mpb); + } ctx.cmd.ClearRandomWriteTargets(); }); 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 db2b781170c..a0c34473382 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -1731,7 +1731,8 @@ ref _cullingResults // Here we use the non scaled resolution for the RTHandleSystem ref size because we assume that at some point we will need full resolution anyway. // This is necessary because we assume that after post processes, we have the full size render target for debug rendering // The only point of calling this here is to grow the render targets. The call in BeginRender will setup the current RTHandle viewport size. - RTHandles.SetReferenceSize(maxSize.x, maxSize.y); + // RTHandles.SetReferenceSize(maxSize.x, maxSize.y); + ResetRTHandleReferenceSize(maxSize.x, maxSize.y); } 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 68d9766cf53..f32d7aa7383 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -278,6 +278,7 @@ static class HDShaderIDs public static readonly int _TaaPostParameters = Shader.PropertyToID("_TaaPostParameters"); public static readonly int _TaaHistorySize = Shader.PropertyToID("_TaaHistorySize"); public static readonly int _TaaFilterWeights = Shader.PropertyToID("_TaaFilterWeights"); + public static readonly int _TaauParameters = Shader.PropertyToID("_TaauParameters"); public static readonly int _WorldSpaceCameraPos1 = Shader.PropertyToID("_WorldSpaceCameraPos1"); public static readonly int _ViewMatrix1 = Shader.PropertyToID("_ViewMatrix1"); From bbac55c161cc0acd0f3eddbcf7c6040d5f3c3278 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 29 Jun 2021 17:55:22 +0200 Subject: [PATCH 02/41] DIfferent messing about... not happy tho, need to handle rthandle later --- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 2 +- .../HDRenderPipeline.PostProcess.cs | 31 +++++++++++++++++-- .../RenderPipeline/HDRenderPipeline.cs | 3 +- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 965adfb5c6d..e09bf008f31 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -1033,7 +1033,7 @@ internal static void ResetAllHistoryRTHandleSystems(int width, int height) var hdCamera = kvp.Value; var currentHistorySize = hdCamera.m_HistoryRTSystem.rtHandleProperties.currentRenderTargetSize; // We only reset if the new size if smaller than current reference (otherwise we might increase the size of off screen camera with lower resolution than the new reference. - if (width > currentHistorySize.x || height > currentHistorySize.y) + if (width < currentHistorySize.x || height < currentHistorySize.y) { hdCamera.m_HistoryRTSystem.ResetReferenceSize(width, height); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 8520fa2a73e..e3545a9ff84 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1354,12 +1354,31 @@ TextureHandle CustomPostProcessPass(RenderGraph renderGraph, HDCamera hdCamera, #region Temporal Anti-aliasing - void GrabTemporalAntialiasingHistoryTextures(HDCamera camera, out RTHandle previous, out RTHandle next, bool postDoF = false) + void GrabTemporalAntialiasingHistoryTextures(HDCamera camera, out RTHandle previous, out RTHandle next, float customScale, bool postDoF = false) { RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) { return rtHandleSystem.Alloc( - Vector2.one, TextureXR.slices, DepthBits.None, dimension: TextureXR.dimension, + Vector2.one * customScale, TextureXR.slices, DepthBits.None, dimension: TextureXR.dimension, + filterMode: FilterMode.Bilinear, colorFormat: GetPostprocessTextureFormat(), + enableRandomWrite: true, useDynamicScale: true, name: $"{id} TAA History" + ); + } + + int historyType = (int)(postDoF ? + HDCameraFrameHistoryType.TemporalAntialiasingPostDoF : HDCameraFrameHistoryType.TemporalAntialiasing); + + next = camera.GetCurrentFrameRT(historyType) + ?? camera.AllocHistoryFrameRT(historyType, Allocator, 2); + previous = camera.GetPreviousFrameRT(historyType); + } + + void GrabTemporalAntialiasingHistoryTextures(HDCamera camera, out RTHandle previous, out RTHandle next, int width, int height, bool postDoF = false) + { + RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) + { + return rtHandleSystem.Alloc( + width, height, TextureXR.slices, DepthBits.None, dimension: TextureXR.dimension, filterMode: FilterMode.Bilinear, colorFormat: GetPostprocessTextureFormat(), enableRandomWrite: true, useDynamicScale: true, name: $"{id} TAA History" ); @@ -1500,7 +1519,13 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem } } - GrabTemporalAntialiasingHistoryTextures(camera, out var prevHistory, out var nextHistory, postDoF); + RTHandle prevHistory, nextHistory; + if (TAAU) + { + GrabTemporalAntialiasingHistoryTextures(camera, out prevHistory, out nextHistory, (int)camera.finalViewport.width, (int)camera.finalViewport.height, postDoF); + } + else + GrabTemporalAntialiasingHistoryTextures(camera, out prevHistory, out nextHistory, 1, postDoF); Vector2Int prevViewPort = camera.historyRTHandleProperties.previousViewportSize; passData.previousScreenSize = new Vector4(prevViewPort.x, prevViewPort.y, 1.0f / prevViewPort.x, 1.0f / prevViewPort.y); 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 a0c34473382..db2b781170c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -1731,8 +1731,7 @@ ref _cullingResults // Here we use the non scaled resolution for the RTHandleSystem ref size because we assume that at some point we will need full resolution anyway. // This is necessary because we assume that after post processes, we have the full size render target for debug rendering // The only point of calling this here is to grow the render targets. The call in BeginRender will setup the current RTHandle viewport size. - // RTHandles.SetReferenceSize(maxSize.x, maxSize.y); - ResetRTHandleReferenceSize(maxSize.x, maxSize.y); + RTHandles.SetReferenceSize(maxSize.x, maxSize.y); } From 6e086e5a4c24a5375944c3e1e86bc77488885816 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Wed, 30 Jun 2021 11:06:07 +0200 Subject: [PATCH 03/41] Functionally good taau --- .../Shaders/TemporalAntiAliasing.shader | 36 ++++++++--- .../Shaders/TemporalAntialiasing.hlsl | 63 +++++++++++++++++-- .../HDRenderPipeline.PostProcess.cs | 15 +++-- 3 files changed, 96 insertions(+), 18 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index f157d0e62ce..1612de2a970 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -14,12 +14,12 @@ Shader "Hidden/HDRP/TemporalAA" #pragma multi_compile_local_fragment _ FORCE_BILINEAR_HISTORY #pragma multi_compile_local_fragment _ ENABLE_MV_REJECTION #pragma multi_compile_local_fragment _ ANTI_RINGING - #pragma multi_compile_local_fragment LOW_QUALITY MEDIUM_QUALITY HIGH_QUALITY UPSCALE POST_DOF + #pragma multi_compile_local_fragment LOW_QUALITY MEDIUM_QUALITY HIGH_QUALITY TAA_UPSCALE POST_DOF #pragma editor_sync_compilation + //#pragma enable_d3d11_debug_symbols #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.hlsl" @@ -71,12 +71,12 @@ Shader "Hidden/HDRP/TemporalAA" #define PERCEPTUAL_SPACE 1 #define PERCEPTUAL_SPACE_ONLY_END 0 && (PERCEPTUAL_SPACE == 0) -#elif defined(UPSCALE) +#elif defined(TAA_UPSCALE) #define YCOCG 1 #define HISTORY_SAMPLING_METHOD BICUBIC_5TAP #define WIDE_NEIGHBOURHOOD 1 #define NEIGHBOUROOD_CORNER_METHOD VARIANCE - #define CENTRAL_FILTERING /*UPSCALE*/ BLACKMAN_HARRIS + #define CENTRAL_FILTERING UPSCALE #define HISTORY_CLIP DIRECT_CLIP #define ANTI_FLICKER 1 #define ANTI_FLICKER_MV_DEPENDENT 1 @@ -89,7 +89,7 @@ Shader "Hidden/HDRP/TemporalAA" #define HISTORY_SAMPLING_METHOD BILINEAR #define WIDE_NEIGHBOURHOOD 0 #define NEIGHBOUROOD_CORNER_METHOD VARIANCE - #define CENTRAL_FILTERING NO_FILTERINGs + #define CENTRAL_FILTERING NO_FILTERING #define HISTORY_CLIP DIRECT_CLIP #define ANTI_FLICKER 1 #define ANTI_FLICKER_MV_DEPENDENT 1 @@ -116,6 +116,14 @@ Shader "Hidden/HDRP/TemporalAA" #define _SpeedRejectionIntensity _TaaPostParameters.z #define _ContrastForMaxAntiFlicker _TaaPostParameters.w + // TAAU specific + float4 _TaauParameters; + #define _TAAUFilterRcpSigma2 _TaauParameters.x + #define _TAAUScale _TaauParameters.y + #define _InputSize _ScreenSize + + + #if VELOCITY_REJECTION TEXTURE2D_X(_InputVelocityMagnitudeHistory); #ifdef SHADER_API_PSSL @@ -161,12 +169,18 @@ Shader "Hidden/HDRP/TemporalAA" float sharpenStrength = _TaaFrameInfo.x; float2 jitter = _TaaJitterStrength.zw; - float2 uv = input.texcoord - jitter; + float2 uv = input.texcoord; + + #ifdef TAA_UPSCALE + float2 outputPixInInput = input.texcoord * _InputSize.xy - _TaaJitterStrength.xy; + + uv = _InputSize.zw * (0.5f + floor(outputPixInInput)); + #endif // --------------- Get closest motion vector --------------- float2 motionVector; -#if ORTHOGRAPHIC +#if ORTHOGRAPHIC || /* TODO: This should not be the case, but we are a bit in an awkward state w.r.t depth and motion vector sizes. */ defined(TAA_UPSCALE) float2 closest = input.positionCS.xy; #else float2 closest = GetClosestFragment(_DepthTexture, int2(input.positionCS.xy)); @@ -192,7 +206,13 @@ Shader "Hidden/HDRP/TemporalAA" // -------------------------------------------------------- // --------------- Filter central sample --------------- - CTYPE filteredColor = FilterCentralColor(samples, _TaaFilterWeights); + float4 filterParams = _TaaFilterWeights; + #ifdef TAA_UPSCALE + filterParams.x = _TAAUFilterRcpSigma2; + filterParams.y = _TAAUScale; + filterParams.zw = outputPixInInput - (floor(outputPixInInput) + 0.5f); + #endif + CTYPE filteredColor = FilterCentralColor(samples, filterParams); // ------------------------------------------------------ if (offScreen) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index a17d7891173..94fbc0ebde1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -67,12 +67,16 @@ float4 Fetch4Array(Texture2DArray tex, uint slot, float2 coords, float2 offset, #define NO_FILTERING 0 #define BOX_FILTER 1 #define BLACKMAN_HARRIS 2 +#define UPSCALE 3 // Clip option #define DIRECT_CLIP 0 #define BLEND_WITH_CLIP 1 #define SIMPLE_CLAMP 2 +#if CENTRAL_FILTERING == UPSCALE +#define UPSAMPLE +#endif // Set defines in case not set outside the include #ifndef YCOCG @@ -434,6 +438,11 @@ struct NeighbourhoodSamples CTYPE minNeighbour; CTYPE maxNeighbour; CTYPE avgNeighbour; + +#ifdef UPSAMPLE + // TODO: The way we handle offsets now will force this in VGPR. It is not good, will need to revisit. Now that we can sample stencil in compute, we should move to compute and all this nonsense is not needed anymore. + float2 offsets[8]; +#endif }; @@ -479,6 +488,17 @@ void GatherNeighbourhood(TEXTURE2D_X(InputTexture), float2 UV, float2 positionSS samples.neighbours[6] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset3, _RTHandleScale.xy).CTYPE_SWIZZLE); samples.neighbours[7] = QuadReadColorAcrossDiagonal(centralColor, positionSS); +#ifdef UPSAMPLE + samples.offsets[0] = float2(0.0f, quadOffset.y); + samples.offsets[1] = float2(quadOffset.x, 0.0f); + samples.offsets[2] = float2(-quadOffset.x, 0.0f); + samples.offsets[3] = float2(0.0f, -quadOffset.y); + samples.offsets[4] = offset1; + samples.offsets[5] = offset2; + samples.offsets[6] = offset3; + samples.offsets[7] = int2(-quadOffset.x, -quadOffset.y); +#endif + #else // !WIDE_NEIGHBOURHOOD #if SMALL_NEIGHBOURHOOD_SHAPE == PLUS @@ -591,7 +611,25 @@ void GetNeighbourhoodCorners(inout NeighbourhoodSamples samples, float historyLu // Filter main color // --------------------------------------------------- -CTYPE FilterCentralColor(NeighbourhoodSamples samples, float4 filterWeights) +float GetSampleWeight(NeighbourhoodSamples samples, int neighbourIdx, float4 filterParameters, bool centralPixel = false) +{ +#ifdef UPSAMPLE + // Very spiky gaussian (See for honor presentation) + const float rcpStdDev2 = filterParameters.x; // (1/(sigma*sigma)) + const float resolutionScale2 = filterParameters.y * filterParameters.y; + const float2 inputToOutputVec = filterParameters.zw; + + float2 d = (centralPixel ? 0 : samples.offsets[neighbourIdx]) - inputToOutputVec; + return exp2(-0.5f * dot(d, d) * resolutionScale2 * rcpStdDev2); + +#elif CENTRAL_FILTERING == BLACKMAN_HARRIS + return 1; // TODO. +#else + return 1; +#endif +} + +CTYPE FilterCentralColor(NeighbourhoodSamples samples, float4 filterParams) { #if CENTRAL_FILTERING == NO_FILTERING @@ -608,13 +646,30 @@ CTYPE FilterCentralColor(NeighbourhoodSamples samples, float4 filterWeights) #elif CENTRAL_FILTERING == BLACKMAN_HARRIS - CTYPE filtered = samples.central * filterWeights.x; - filtered += (samples.neighbours[0] + samples.neighbours[1] + samples.neighbours[2] + samples.neighbours[3]) * filterWeights.y; + // TODO : GetSampleWeight + + CTYPE filtered = samples.central * filterParams.x; + filtered += (samples.neighbours[0] + samples.neighbours[1] + samples.neighbours[2] + samples.neighbours[3]) * filterParams.y; #if WIDE_NEIGHBOURHOOD - filtered += (samples.neighbours[4] + samples.neighbours[5] + samples.neighbours[6] + samples.neighbours[7]) * filterWeights.z; + filtered += (samples.neighbours[4] + samples.neighbours[5] + samples.neighbours[6] + samples.neighbours[7]) * filterParams.z; #endif return filtered; +#elif CENTRAL_FILTERING == UPSCALE + + float totalWeight = GetSampleWeight(samples, 0, filterParams, true); + CTYPE filtered = 0; + filtered += samples.central * totalWeight; + + for (int i = 0; i < 8; ++i) + { + float w = GetSampleWeight(samples, i, filterParams); + filtered += samples.neighbours[i] * w; + totalWeight += w; + } + + filtered *= rcp(totalWeight); + return filtered; #endif } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index e3545a9ff84..5967fd079ce 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -465,13 +465,13 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, source = DynamicExposurePass(renderGraph, hdCamera, source); - if (m_DLSSPassEnabled && DynamicResolutionHandler.instance.upsamplerSchedule == DynamicResolutionHandler.UpsamplerScheduleType.BeforePost) + if ((m_DLSSPassEnabled || DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU) && DynamicResolutionHandler.instance.upsamplerSchedule == DynamicResolutionHandler.UpsamplerScheduleType.BeforePost) { var upsamplignSceneResults = SceneUpsamplePass(renderGraph, hdCamera, source, depthBuffer, motionVectors); - source = upsamplignSceneResults.color; - depthBuffer = upsamplignSceneResults.depthBuffer; + //source = upsamplignSceneResults.color; + // depthBuffer = upsamplignSceneResults.depthBuffer; motionVectors = upsamplignSceneResults.motionVectors; - SetCurrentResolutionGroup(renderGraph, hdCamera, ResolutionGroup.AfterDynamicResUpscale); + // SetCurrentResolutionGroup(renderGraph, hdCamera, ResolutionGroup.AfterDynamicResUpscale); } source = CustomPostProcessPass(renderGraph, hdCamera, source, depthBuffer, normalBuffer, motionVectors, m_GlobalSettings.beforeTAACustomPostProcesses, HDProfileId.CustomPostProcessBeforeTAA); @@ -1494,7 +1494,7 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem bool TAAU = DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; if (TAAU) { - passData.temporalAAMaterial.EnableKeyword("UPSCALE"); + passData.temporalAAMaterial.EnableKeyword("TAA_UPSCALE"); } else if (postDoF) { @@ -1529,6 +1529,8 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem Vector2Int prevViewPort = camera.historyRTHandleProperties.previousViewportSize; passData.previousScreenSize = new Vector4(prevViewPort.x, prevViewPort.y, 1.0f / prevViewPort.x, 1.0f / prevViewPort.y); + if (TAAU) + passData.previousScreenSize = new Vector4(camera.finalViewport.width, camera.finalViewport.height, 1.0f / camera.finalViewport.width, 1.0f / camera.finalViewport.height); passData.source = builder.ReadTexture(sourceTexture); passData.depthBuffer = builder.ReadTexture(depthBuffer); @@ -1553,7 +1555,8 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.finalViewport = camera.finalViewport; var resScale = DynamicResolutionHandler.instance.GetCurrentScale(); - passData.taauParams = new Vector4(0.4f, resScale, 0, 0); + float stdDev = 0.4f; + passData.taauParams = new Vector4(1.0f / (stdDev * stdDev), 1.0f / resScale, 0, 0); } TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle sourceTexture, bool postDoF, string outputName) From d5e43bb8141cdc29e122ab42fd9150df2f0c21d6 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Wed, 30 Jun 2021 13:26:10 +0200 Subject: [PATCH 04/41] Tweakable base blend factor --- .../Common/GlobalDynamicResolutionSettings.cs | 2 +- .../Camera/HDCameraUI.Rendering.Drawers.cs | 46 +++++++++++++++++-- .../Camera/HDCameraUI.Rendering.Skin.cs | 3 ++ .../Camera/SerializedHDCamera.cs | 2 + .../Shaders/TemporalAntiAliasing.shader | 12 +++-- .../Shaders/TemporalAntialiasing.hlsl | 8 ++-- .../Camera/HDAdditionalCameraData.cs | 4 ++ .../Runtime/RenderPipeline/Camera/HDCamera.cs | 2 + .../HDRenderPipeline.PostProcess.cs | 3 ++ .../RenderPipeline/HDStringConstants.cs | 1 + 10 files changed, 69 insertions(+), 14 deletions(-) diff --git a/com.unity.render-pipelines.core/Runtime/Common/GlobalDynamicResolutionSettings.cs b/com.unity.render-pipelines.core/Runtime/Common/GlobalDynamicResolutionSettings.cs index 552ff009db1..6390c755c0e 100644 --- a/com.unity.render-pipelines.core/Runtime/Common/GlobalDynamicResolutionSettings.cs +++ b/com.unity.render-pipelines.core/Runtime/Common/GlobalDynamicResolutionSettings.cs @@ -46,7 +46,7 @@ public enum DynamicResUpscaleFilter : byte /// /// Edge Adaptive Scaling Upres. /// - [InspectorName("TAA Upsample")] + [InspectorName("TAA Upsample (Experimental)")] TAAU } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Drawers.cs index 9082344a60b..1b6bbb43712 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Drawers.cs @@ -10,11 +10,13 @@ static partial class HDCameraUI { partial class Rendering { - public static readonly CED.IDrawer Drawer = CED.FoldoutGroup( - CameraUI.Rendering.Styles.header, - Expandable.Rendering, - k_ExpandedState, - FoldoutOption.Indent, + enum AdditionalProperties + { + Rendering = 1 << 5, + } + readonly static AdditionalPropertiesState k_AdditionalPropertiesState = new AdditionalPropertiesState(0, "HDRP"); + + public static readonly CED.IDrawer RenderingDrawer = CED.Group( CED.Group( Drawer_Rendering_AllowDynamicResolution, Drawer_Rendering_Antialiasing @@ -40,6 +42,30 @@ partial class Rendering ) ); + public static readonly CED.IDrawer Drawer = CED.AdditionalPropertiesFoldoutGroup(CameraUI.Rendering.Styles.header, Expandable.Rendering, k_ExpandedState, AdditionalProperties.Rendering, k_AdditionalPropertiesState, RenderingDrawer, Draw_Rendering_Advanced); + + internal static void RegisterEditor(HDCameraEditor editor) + { + k_AdditionalPropertiesState.RegisterEditor(editor); + } + + internal static void UnregisterEditor(HDCameraEditor editor) + { + k_AdditionalPropertiesState.UnregisterEditor(editor); + } + + [SetAdditionalPropertiesVisibility] + internal static void SetAdditionalPropertiesVisibility(bool value) + { + if (value) + k_AdditionalPropertiesState.ShowAll(); + else + k_AdditionalPropertiesState.HideAll(); + } + + static void Draw_Rendering_Advanced(SerializedHDCamera p, Editor owner) + {} + static void Drawer_Rendering_AllowDynamicResolution(SerializedHDCamera p, Editor owner) { CameraUI.Output.Drawer_Output_AllowDynamicResolution(p, owner); @@ -145,6 +171,11 @@ static void Drawer_Rendering_Antialiasing_SMAA(SerializedHDCamera p, Editor owne EditorGUILayout.PropertyField(p.SMAAQuality, Styles.SMAAQualityPresetContent); } + static void Draw_Rendering_Antialiasing_TAA_Advanced(SerializedHDCamera p, Editor owner) + { + EditorGUILayout.PropertyField(p.taaBaseBlendFactor, Styles.TAABaseBlendFactor); + } + static void Drawer_Rendering_Antialiasing_TAA(SerializedHDCamera p, Editor owner) { EditorGUILayout.PropertyField(p.taaQualityLevel, Styles.TAAQualityLevel); @@ -161,6 +192,11 @@ static void Drawer_Rendering_Antialiasing_TAA(SerializedHDCamera p, Editor owner EditorGUILayout.PropertyField(p.taaMotionVectorRejection, Styles.TAAMotionVectorRejection); EditorGUILayout.PropertyField(p.taaAntiRinging, Styles.TAAAntiRinging); } + + if (k_AdditionalPropertiesState[AdditionalProperties.Rendering]) + { + Draw_Rendering_Antialiasing_TAA_Advanced(p, owner); + } } static void Drawer_Rendering_RenderingPath(SerializedHDCamera p, Editor owner) diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Skin.cs index 7215be5ccf9..ec2e1e02026 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Skin.cs @@ -19,6 +19,9 @@ class Styles public static readonly GUIContent TAAMotionVectorRejection = EditorGUIUtility.TrTextContent("Speed Rejection", "Higher this value, more likely history will be rejected when current and reprojected history motion vector differ by a substantial amount. High values can decrease ghosting but will also reintroduce aliasing on the aforementioned cases."); public static readonly GUIContent TAAQualityLevel = EditorGUIUtility.TrTextContent("Quality Preset", "Low quality is fast, but can lead to more ghosting and blurrier output when moving, Medium quality has better ghosting handling and sharper results upon movement, High allows for velocity rejection policy, has better antialiasing and has mechanism to combat ringing for over sharpening the history."); public static readonly GUIContent TAAAntiRinging = EditorGUIUtility.TrTextContent("Anti-ringing", "When enabled, ringing artifacts (dark or strangely saturated edges) caused by history sharpening will be improved. This comes at a potential loss of sharpness upon motion."); + // Advanced TAA + public static readonly GUIContent TAABaseBlendFactor = EditorGUIUtility.TrTextContent("Base blend factor", "Determines how much the history buffer is blended together with current frame result. Higher values means more history contribution, which leads to better anti aliasing, but also more prone to ghosting."); + public static readonly GUIContent renderingPath = EditorGUIUtility.TrTextContent("Custom Frame Settings", "Define custom values for Frame Settings for this Camera to use."); public static readonly GUIContent fullScreenPassthrough = EditorGUIUtility.TrTextContent("Fullscreen Passthrough", "This will skip rendering settings to directly rendering in fullscreen(for instance: Useful for video)"); diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/SerializedHDCamera.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/SerializedHDCamera.cs index 1aaaa7d7660..d99096b5d98 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/SerializedHDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/SerializedHDCamera.cs @@ -44,6 +44,7 @@ class SerializedHDCamera : ISerializedCamera public SerializedProperty taaAntiFlicker; public SerializedProperty taaMotionVectorRejection; public SerializedProperty taaAntiRinging; + public SerializedProperty taaBaseBlendFactor; public SerializedProperty taaQualityLevel; public SerializedProperty clearColorMode; @@ -105,6 +106,7 @@ public SerializedHDCamera(SerializedObject serializedObject) taaMotionVectorRejection = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.taaMotionVectorRejection); taaAntiRinging = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.taaAntiHistoryRinging); taaQualityLevel = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.TAAQuality); + taaBaseBlendFactor = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.taaBaseBlendFactor); clearColorMode = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.clearColorMode); backgroundColorHDR = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.backgroundColorHDR); diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index 1612de2a970..70a1fbf4fc2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -111,11 +111,18 @@ Shader "Hidden/HDRP/TemporalAA" RW_TEXTURE2D_X(CTYPE, _OutputHistoryTexture) : register(u1); #endif + float4 _TaaPostParameters; + float4 _TaaPostParameters1; + float4 _TaaHistorySize; + float4 _TaaFilterWeights; + #define _HistorySharpening _TaaPostParameters.x #define _AntiFlickerIntensity _TaaPostParameters.y #define _SpeedRejectionIntensity _TaaPostParameters.z #define _ContrastForMaxAntiFlicker _TaaPostParameters.w + #define _BaseBlendFactor _TaaPostParameters1.x + // TAAU specific float4 _TaauParameters; #define _TAAUFilterRcpSigma2 _TaauParameters.x @@ -133,9 +140,6 @@ Shader "Hidden/HDRP/TemporalAA" #endif #endif - float4 _TaaPostParameters; - float4 _TaaHistorySize; - float4 _TaaFilterWeights; struct Attributes { @@ -234,7 +238,7 @@ Shader "Hidden/HDRP/TemporalAA" // ------------------------------------------------------------------------------ // --------------- Compute blend factor for history --------------- - float blendFactor = GetBlendFactor(colorLuma, historyLuma, GetLuma(samples.minNeighbour), GetLuma(samples.maxNeighbour)); + float blendFactor = GetBlendFactor(colorLuma, historyLuma, GetLuma(samples.minNeighbour), GetLuma(samples.maxNeighbour), _BaseBlendFactor); // -------------------------------------------------------- // ------------------- Alpha handling --------------------------- diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index 94fbc0ebde1..d4df9f10af6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -678,10 +678,10 @@ CTYPE FilterCentralColor(NeighbourhoodSamples samples, float4 filterParams) // Blend factor calculation // --------------------------------------------------- -float HistoryContrast(float historyLuma, float minNeighbourLuma, float maxNeighbourLuma) +float HistoryContrast(float historyLuma, float minNeighbourLuma, float maxNeighbourLuma, float baseBlendFactor) { float lumaContrast = max(maxNeighbourLuma - minNeighbourLuma, 0) / historyLuma; - float blendFactor = 0.125; + float blendFactor = baseBlendFactor; return saturate(blendFactor * rcp(1.0 + lumaContrast)); } @@ -691,11 +691,11 @@ float DistanceToClamp(float historyLuma, float minNeighbourLuma, float maxNeighb return saturate((0.125 * distToClamp) / (distToClamp + maxNeighbourLuma - minNeighbourLuma)); } -float GetBlendFactor(float colorLuma, float historyLuma, float minNeighbourLuma, float maxNeighbourLuma) +float GetBlendFactor(float colorLuma, float historyLuma, float minNeighbourLuma, float maxNeighbourLuma, float baseBlendFactor) { // TODO: Investigate factoring in the speed in this computation. - return HistoryContrast(historyLuma, minNeighbourLuma, maxNeighbourLuma); + return HistoryContrast(historyLuma, minNeighbourLuma, maxNeighbourLuma, baseBlendFactor); } // --------------------------------------------------- diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs index a2d43729aec..556da28dddd 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs @@ -325,6 +325,10 @@ public enum TAAQualityLevel /// When enabled, ringing artifacts (dark or strangely saturated edges) caused by history sharpening will be improved. This comes at a potential loss of sharpness upon motion. public bool taaAntiHistoryRinging = false; + /// Determines how much the history buffer is blended together with current frame result. Higher values means more history contribution. + [Range(0.6f, 0.95f)] + public float taaBaseBlendFactor = 0.875f; + /// Physical camera parameters. [ValueCopy] // reference should not be same. only content. public HDPhysicalCamera physicalParameters = HDPhysicalCamera.GetDefaults(); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index e09bf008f31..49f211a2489 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -237,6 +237,7 @@ internal struct VolumetricCloudsAnimationData internal float taaHistorySharpening; internal float taaAntiFlicker; internal float taaMotionVectorRejection; + internal float taaBaseBlendFactor; internal bool taaAntiRinging; internal Vector4 zBufferParams; @@ -1387,6 +1388,7 @@ void UpdateAntialiasing() taaAntiFlicker = m_AdditionalCameraData.taaAntiFlicker; taaAntiRinging = m_AdditionalCameraData.taaAntiHistoryRinging; taaMotionVectorRejection = m_AdditionalCameraData.taaMotionVectorRejection; + taaBaseBlendFactor = m_AdditionalCameraData.taaBaseBlendFactor; } else antialiasing = AntialiasingMode.None; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 5967fd079ce..e2aac5563fb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1423,6 +1423,7 @@ class TemporalAntiAliasingData public bool resetPostProcessingHistory; public Vector4 previousScreenSize; public Vector4 taaParameters; + public Vector4 taaParameters1; public Vector4 taaFilterWeights; public bool motionVectorRejection; public Vector4 taauParams; @@ -1452,6 +1453,7 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem float temporalContrastForMaxAntiFlicker = 0.7f - Mathf.Lerp(0.0f, 0.3f, Mathf.SmoothStep(0.5f, 1.0f, camera.taaAntiFlicker)); passData.taaParameters = new Vector4(camera.taaHistorySharpening, postDoF ? maxAntiflicker : Mathf.Lerp(minAntiflicker, maxAntiflicker, camera.taaAntiFlicker), motionRejectionMultiplier, temporalContrastForMaxAntiFlicker); + passData.taaParameters1 = new Vector4(1.0f - camera.taaBaseBlendFactor, 0, 0, 0); // Precompute weights used for the Blackman-Harris filter. TODO: Note that these are slightly wrong as they don't take into account the jitter size. This needs to be fixed at some point. float crossWeights = Mathf.Exp(-2.29f * 2); @@ -1599,6 +1601,7 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, var taaHistorySize = data.previousScreenSize; mpb.SetVector(HDShaderIDs._TaaPostParameters, data.taaParameters); + mpb.SetVector(HDShaderIDs._TaaPostParameters1, data.taaParameters1); mpb.SetVector(HDShaderIDs._TaaHistorySize, taaHistorySize); mpb.SetVector(HDShaderIDs._TaaFilterWeights, data.taaFilterWeights); mpb.SetVector(HDShaderIDs._TaauParameters, data.taauParams); 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 f32d7aa7383..0a701ed0244 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -276,6 +276,7 @@ static class HDShaderIDs public static readonly int _TaaJitterStrength = Shader.PropertyToID("_TaaJitterStrength"); public static readonly int _TaaPostParameters = Shader.PropertyToID("_TaaPostParameters"); + public static readonly int _TaaPostParameters1 = Shader.PropertyToID("_TaaPostParameters1"); public static readonly int _TaaHistorySize = Shader.PropertyToID("_TaaHistorySize"); public static readonly int _TaaFilterWeights = Shader.PropertyToID("_TaaFilterWeights"); public static readonly int _TaauParameters = Shader.PropertyToID("_TaauParameters"); From 52d9bf007e45c2868489bab31defc7c9623b9cf3 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Wed, 30 Jun 2021 22:17:25 +0200 Subject: [PATCH 05/41] Fixed scene filtering. --- .../Shaders/TemporalAntiAliasing.shader | 9 +++- .../Shaders/TemporalAntialiasing.hlsl | 23 +++++----- .../HDRenderPipeline.PostProcess.cs | 44 ++++++++++++++----- .../RenderPipeline/HDStringConstants.cs | 1 + 4 files changed, 55 insertions(+), 22 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index 70a1fbf4fc2..0a192c9daa4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -184,7 +184,7 @@ Shader "Hidden/HDRP/TemporalAA" // --------------- Get closest motion vector --------------- float2 motionVector; -#if ORTHOGRAPHIC || /* TODO: This should not be the case, but we are a bit in an awkward state w.r.t depth and motion vector sizes. */ defined(TAA_UPSCALE) +#if ORTHOGRAPHIC || /* TODO: This should not be the case, but we are a bit in an awkward state w.r.t depth and motion vector sizes. Needs fixing. */ defined(TAA_UPSCALE) float2 closest = input.positionCS.xy; #else float2 closest = GetClosestFragment(_DepthTexture, int2(input.positionCS.xy)); @@ -211,12 +211,17 @@ Shader "Hidden/HDRP/TemporalAA" // --------------- Filter central sample --------------- float4 filterParams = _TaaFilterWeights; + float4 filterParams1 = _TaaFilterWeights1; + float centralWeight = _CentralWeight; #ifdef TAA_UPSCALE filterParams.x = _TAAUFilterRcpSigma2; filterParams.y = _TAAUScale; filterParams.zw = outputPixInInput - (floor(outputPixInInput) + 0.5f); + #elif CENTRAL_FILTERING == BLACKMAN_HARRIS + // We need to swizzle weights as we use quad communication to access neighbours, so the order of neighbours is not always the same (this needs to go away when moving back to compute) + SwizzleFilterWeights(input.positionCS.xy, filterParams, filterParams1); #endif - CTYPE filteredColor = FilterCentralColor(samples, filterParams); + CTYPE filteredColor = FilterCentralColor(samples, filterParams, filterParams1, centralWeight); // ------------------------------------------------------ if (offScreen) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index d4df9f10af6..aef7626e276 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -560,6 +560,7 @@ void VarianceNeighbourhood(inout NeighbourhoodSamples samples, float historyLuma CTYPE moment1 = 0; CTYPE moment2 = 0; + // UPDATE WITH TEMPORAL UP SHRINKAGE for (int i = 0; i < NEIGHBOUR_COUNT; ++i) { moment1 += samples.neighbours[i]; @@ -611,7 +612,7 @@ void GetNeighbourhoodCorners(inout NeighbourhoodSamples samples, float historyLu // Filter main color // --------------------------------------------------- -float GetSampleWeight(NeighbourhoodSamples samples, int neighbourIdx, float4 filterParameters, bool centralPixel = false) +float GetSampleWeight(NeighbourhoodSamples samples, int neighbourIdx, float4 filterParameters, float4 filterParameters2, float centralWeight, bool centralPixel = false) { #ifdef UPSAMPLE // Very spiky gaussian (See for honor presentation) @@ -621,15 +622,12 @@ float GetSampleWeight(NeighbourhoodSamples samples, int neighbourIdx, float4 fil float2 d = (centralPixel ? 0 : samples.offsets[neighbourIdx]) - inputToOutputVec; return exp2(-0.5f * dot(d, d) * resolutionScale2 * rcpStdDev2); - -#elif CENTRAL_FILTERING == BLACKMAN_HARRIS - return 1; // TODO. #else return 1; #endif } -CTYPE FilterCentralColor(NeighbourhoodSamples samples, float4 filterParams) +CTYPE FilterCentralColor(NeighbourhoodSamples samples, float4 filterParameters, float4 filterParameters2, float centralWeight) { #if CENTRAL_FILTERING == NO_FILTERING @@ -648,22 +646,22 @@ CTYPE FilterCentralColor(NeighbourhoodSamples samples, float4 filterParams) // TODO : GetSampleWeight - CTYPE filtered = samples.central * filterParams.x; - filtered += (samples.neighbours[0] + samples.neighbours[1] + samples.neighbours[2] + samples.neighbours[3]) * filterParams.y; + CTYPE filtered = samples.central * centralWeight; + filtered += (samples.neighbours[0] * filterParameters.x + samples.neighbours[1] * filterParameters.y + samples.neighbours[2] * filterParameters.z + samples.neighbours[3] * filterParameters.w); #if WIDE_NEIGHBOURHOOD - filtered += (samples.neighbours[4] + samples.neighbours[5] + samples.neighbours[6] + samples.neighbours[7]) * filterParams.z; + filtered += (samples.neighbours[4] * filterParameters2.x + samples.neighbours[5] * filterParameters2.y + samples.neighbours[6] * filterParameters2.z + samples.neighbours[7] * filterParameters2.w); #endif return filtered; #elif CENTRAL_FILTERING == UPSCALE - float totalWeight = GetSampleWeight(samples, 0, filterParams, true); + float totalWeight = GetSampleWeight(samples, 0, filterParameters, 0, 0, true); CTYPE filtered = 0; filtered += samples.central * totalWeight; for (int i = 0; i < 8; ++i) { - float w = GetSampleWeight(samples, i, filterParams); + float w = GetSampleWeight(samples, i, filterParameters, 0, 0); filtered += samples.neighbours[i] * w; totalWeight += w; } @@ -678,6 +676,11 @@ CTYPE FilterCentralColor(NeighbourhoodSamples samples, float4 filterParams) // Blend factor calculation // --------------------------------------------------- +float UpsampleConfidenceValue() +{ + +} + float HistoryContrast(float historyLuma, float minNeighbourLuma, float maxNeighbourLuma, float baseBlendFactor) { float lumaContrast = max(maxNeighbourLuma - minNeighbourLuma, 0) / historyLuma; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index e2aac5563fb..12ac46ab1b3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1425,6 +1425,7 @@ class TemporalAntiAliasingData public Vector4 taaParameters; public Vector4 taaParameters1; public Vector4 taaFilterWeights; + public Vector4 taaFilterWeights1; public bool motionVectorRejection; public Vector4 taauParams; public Rect finalViewport; @@ -1453,21 +1454,43 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem float temporalContrastForMaxAntiFlicker = 0.7f - Mathf.Lerp(0.0f, 0.3f, Mathf.SmoothStep(0.5f, 1.0f, camera.taaAntiFlicker)); passData.taaParameters = new Vector4(camera.taaHistorySharpening, postDoF ? maxAntiflicker : Mathf.Lerp(minAntiflicker, maxAntiflicker, camera.taaAntiFlicker), motionRejectionMultiplier, temporalContrastForMaxAntiFlicker); - passData.taaParameters1 = new Vector4(1.0f - camera.taaBaseBlendFactor, 0, 0, 0); - // Precompute weights used for the Blackman-Harris filter. TODO: Note that these are slightly wrong as they don't take into account the jitter size. This needs to be fixed at some point. - float crossWeights = Mathf.Exp(-2.29f * 2); - float plusWeights = Mathf.Exp(-2.29f); - float centerWeight = 1; + // Precompute weights used for the Blackman-Harris filter. - float totalWeight = centerWeight + (4 * plusWeights); - if (camera.TAAQuality == HDAdditionalCameraData.TAAQualityLevel.High) + Vector2Int[] offsets = new Vector2Int[] { - totalWeight += crossWeights * 4; + new Vector2Int(0, 0), + new Vector2Int(0, 1), + new Vector2Int(1, 0), + new Vector2Int(-1, 0), + new Vector2Int(0, -1), + new Vector2Int(-1, 1), + new Vector2Int(1, -1), + new Vector2Int(1, 1), + new Vector2Int(-1, -1) + }; + + + float[] weights = new float[9]; + float totalWeight = 0; + for (int i = 0; i < 9; ++i) + { + float x = offsets[i].x - camera.taaJitter.x; + float y = offsets[i].y - camera.taaJitter.y; + float d = (x * x + y * y); + + weights[i] = Mathf.Exp((-0.5f / (0.22f)) * d); + totalWeight += weights[i]; + } + + for (int i = 0; i < 9; ++i) + { + weights[i] /= totalWeight; } - // Weights will be x: central, y: plus neighbours, z: cross neighbours, w: total - passData.taaFilterWeights = new Vector4(centerWeight / totalWeight, plusWeights / totalWeight, crossWeights / totalWeight, totalWeight); + passData.taaParameters1 = new Vector4(1.0f - camera.taaBaseBlendFactor, weights[0], 0, 0); + passData.taaFilterWeights = new Vector4(weights[1], weights[2], weights[3], weights[4]); + passData.taaFilterWeights1 = new Vector4(weights[5], weights[6], weights[7], weights[8]); passData.temporalAAMaterial = m_TemporalAAMaterial; passData.temporalAAMaterial.shaderKeywords = null; @@ -1604,6 +1627,7 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, mpb.SetVector(HDShaderIDs._TaaPostParameters1, data.taaParameters1); mpb.SetVector(HDShaderIDs._TaaHistorySize, taaHistorySize); mpb.SetVector(HDShaderIDs._TaaFilterWeights, data.taaFilterWeights); + mpb.SetVector(HDShaderIDs._TaaFilterWeights1, data.taaFilterWeights1); mpb.SetVector(HDShaderIDs._TaauParameters, data.taauParams); CoreUtils.SetRenderTarget(ctx.cmd, data.destination, data.depthBuffer); 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 0a701ed0244..0274b0e1942 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -279,6 +279,7 @@ static class HDShaderIDs public static readonly int _TaaPostParameters1 = Shader.PropertyToID("_TaaPostParameters1"); public static readonly int _TaaHistorySize = Shader.PropertyToID("_TaaHistorySize"); public static readonly int _TaaFilterWeights = Shader.PropertyToID("_TaaFilterWeights"); + public static readonly int _TaaFilterWeights1 = Shader.PropertyToID("_TaaFilterWeights1"); public static readonly int _TaauParameters = Shader.PropertyToID("_TaauParameters"); public static readonly int _WorldSpaceCameraPos1 = Shader.PropertyToID("_WorldSpaceCameraPos1"); From cdd0640d599cc0bc6b7edb7a33220a558af72c4e Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 1 Jul 2021 17:17:29 +0200 Subject: [PATCH 06/41] Finalize a bit shader side. --- .../Shaders/TemporalAntiAliasing.shader | 39 +++++++++-- .../Shaders/TemporalAntialiasing.hlsl | 68 ++++++++++++++----- .../HDRenderPipeline.PostProcess.cs | 31 ++++++++- 3 files changed, 113 insertions(+), 25 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index 0a192c9daa4..7de481bbfd0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -17,7 +17,7 @@ Shader "Hidden/HDRP/TemporalAA" #pragma multi_compile_local_fragment LOW_QUALITY MEDIUM_QUALITY HIGH_QUALITY TAA_UPSCALE POST_DOF #pragma editor_sync_compilation - //#pragma enable_d3d11_debug_symbols + // #pragma enable_d3d11_debug_symbols #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" @@ -115,6 +115,7 @@ Shader "Hidden/HDRP/TemporalAA" float4 _TaaPostParameters1; float4 _TaaHistorySize; float4 _TaaFilterWeights; + float4 _TaaFilterWeights1; #define _HistorySharpening _TaaPostParameters.x #define _AntiFlickerIntensity _TaaPostParameters.y @@ -122,11 +123,14 @@ Shader "Hidden/HDRP/TemporalAA" #define _ContrastForMaxAntiFlicker _TaaPostParameters.w #define _BaseBlendFactor _TaaPostParameters1.x + #define _CentralWeight _TaaPostParameters1.y // TAAU specific float4 _TaauParameters; #define _TAAUFilterRcpSigma2 _TaauParameters.x #define _TAAUScale _TaauParameters.y + #define _TAAUBoxConfidenceThresh _TaauParameters.z + #define _TAAURenderScale _TaauParameters.w #define _InputSize _ScreenSize @@ -166,6 +170,21 @@ Shader "Hidden/HDRP/TemporalAA" // ------------------------------------------------------------------ + // This complexity will not be needed when moving to CS. + void SwizzleFilterWeights(int2 posSS, inout float4 filterParams1, inout float4 filterParams2) + { + // Data arrives as if filterParams weights for { (0, 1), (1, 0), (-1, 0), (0,-1) }, filterParams2 for { (-1, 1), (1, -1), (1, 1), (-1, -1) } + bool2 needSwizzle = (posSS & 1) == 0; + + filterParams1.yz = needSwizzle.x ? filterParams1.zy : filterParams1.yz; + filterParams1.xw = needSwizzle.y ? filterParams1.wx : filterParams1.xw; +#if WIDE_NEIGHBOURHOOD + filterParams2 = all(needSwizzle) ? filterParams2.yxwz : + (needSwizzle.x && !needSwizzle.y) ? filterParams2.zwxy : + (!needSwizzle.x && needSwizzle.y) ? filterParams2.wzyx : filterParams2; +#endif + } + void FragTAA(Varyings input, out CTYPE outColor : SV_Target0) { UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); @@ -176,7 +195,8 @@ Shader "Hidden/HDRP/TemporalAA" float2 uv = input.texcoord; #ifdef TAA_UPSCALE - float2 outputPixInInput = input.texcoord * _InputSize.xy - _TaaJitterStrength.xy; + float2 outputPixInInput = input.texcoord * _InputSize.xy + float2(_TaaJitterStrength.x, -_TaaJitterStrength.y); + outputPixInInput = input.texcoord * _InputSize.xy - _TaaJitterStrength.xy; uv = _InputSize.zw * (0.5f + floor(outputPixInInput)); #endif @@ -217,6 +237,7 @@ Shader "Hidden/HDRP/TemporalAA" filterParams.x = _TAAUFilterRcpSigma2; filterParams.y = _TAAUScale; filterParams.zw = outputPixInInput - (floor(outputPixInInput) + 0.5f); + #elif CENTRAL_FILTERING == BLACKMAN_HARRIS // We need to swizzle weights as we use quad communication to access neighbours, so the order of neighbours is not always the same (this needs to go away when moving back to compute) SwizzleFilterWeights(input.positionCS.xy, filterParams, filterParams1); @@ -231,12 +252,15 @@ Shader "Hidden/HDRP/TemporalAA" float colorLuma = GetLuma(filteredColor); float historyLuma = GetLuma(history); -#if ANTI_FLICKER_MV_DEPENDENT || VELOCITY_REJECTION - float motionVectorLength = length(motionVector); -#else float motionVectorLength = 0.0f; + float motionVectorLenInPixels = 0.0f; + +#if ANTI_FLICKER_MV_DEPENDENT || VELOCITY_REJECTION + motionVectorLength = length(motionVector); + motionVectorLenInPixels = motionVectorLength * length(_InputSize.xy); #endif - GetNeighbourhoodCorners(samples, historyLuma, colorLuma, float2(_AntiFlickerIntensity, _ContrastForMaxAntiFlicker), motionVectorLength); + + GetNeighbourhoodCorners(samples, historyLuma, colorLuma, float2(_AntiFlickerIntensity, _ContrastForMaxAntiFlicker), motionVectorLenInPixels, _TAAURenderScale); history = GetClippedHistory(filteredColor, history, samples.minNeighbour, samples.maxNeighbour); filteredColor = SharpenColor(samples, filteredColor, sharpenStrength); @@ -266,6 +290,9 @@ Shader "Hidden/HDRP/TemporalAA" blendFactor = ModifyBlendWithMotionVectorRejection(_InputVelocityMagnitudeHistory, lengthMV, prevUV, blendFactor, _SpeedRejectionIntensity); #endif +#ifdef TAA_UPSCALE + blendFactor *= GetUpsampleConfidence(filterParams.zw, _TAAUBoxConfidenceThresh, _TAAUFilterRcpSigma2, _TAAUScale); +#endif blendFactor = max(blendFactor, 0.03); CTYPE finalColor; diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index aef7626e276..ff2bab0a7e9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -74,6 +74,12 @@ float4 Fetch4Array(Texture2DArray tex, uint slot, float2 coords, float2 offset, #define BLEND_WITH_CLIP 1 #define SIMPLE_CLAMP 2 +// Upsample pixel confidence factor (used for tuning the blend factor when upsampling) +// See A Survey of Temporal Antialiasing Techniques [Yang et al 2020], section 5.1 +#define GAUSSIAN_WEIGHT 0 +#define BOX_REJECT 1 +#define CONFIDENCE_FACTOR BOX_REJECT + #if CENTRAL_FILTERING == UPSCALE #define UPSAMPLE #endif @@ -325,7 +331,7 @@ float ModifyBlendWithMotionVectorRejection(TEXTURE2D_X(VelocityMagnitudeTexture) // We don't start rejecting until we have the equivalent of around 40 texels in 1080p diff -= 0.015935382; float val = saturate(diff * speedRejectionFactor); - return lerp(blendFactor, 1.0, val*val); + return lerp(blendFactor, 0.97f, val*val); #else return blendFactor; @@ -555,7 +561,7 @@ void MinMaxNeighbourhood(inout NeighbourhoodSamples samples) samples.avgNeighbour *= rcp(NEIGHBOUR_COUNT); } -void VarianceNeighbourhood(inout NeighbourhoodSamples samples, float historyLuma, float colorLuma, float2 antiFlickerParams, float motionVectorLen) +void VarianceNeighbourhood(inout NeighbourhoodSamples samples, float historyLuma, float colorLuma, float2 antiFlickerParams, float motionVecLenInPixels, float downsampleFactor) { CTYPE moment1 = 0; CTYPE moment2 = 0; @@ -585,26 +591,32 @@ void VarianceNeighbourhood(inout NeighbourhoodSamples samples, float historyLuma stDevMultiplier = 1.5; float temporalContrast = saturate(abs(colorLuma - historyLuma) / Max3(0.2, colorLuma, historyLuma)); #if ANTI_FLICKER_MV_DEPENDENT - const float screenDiag = length(_ScreenSize.xy); const float maxFactorScale = 2.25f; // when stationary const float minFactorScale = 0.8f; // when moving more than slightly - float localizedAntiFlicker = lerp(antiFlickerParams.x * minFactorScale, antiFlickerParams.x * maxFactorScale, saturate(1.0f - 2.0f * (motionVectorLen * screenDiag))); + float localizedAntiFlicker = lerp(antiFlickerParams.x * minFactorScale, antiFlickerParams.x * maxFactorScale, saturate(1.0f - 2.0f * (motionVecLenInPixels))); #else float localizedAntiFlicker = antiFlickerParams.x; #endif stDevMultiplier += lerp(0.0, localizedAntiFlicker, smoothstep(0.05, antiFlickerParams.y, temporalContrast)); +#endif +#if CENTRAL_FILTERING == UPSCALE + // We shrink the bounding box when upscaling as ghosting is more likely. + // Ideally the shrinking should happen also (or just) when sampling the neighbours + // This shrinking should also be investigated a bit further with more content. (TODO). + stDevMultiplier = lerp(stDevMultiplier, 0.9f, saturate(downsampleFactor)); #endif + samples.minNeighbour = moment1 - stdDev * stDevMultiplier; samples.maxNeighbour = moment1 + stdDev * stDevMultiplier; } -void GetNeighbourhoodCorners(inout NeighbourhoodSamples samples, float historyLuma, float colorLuma, float2 antiFlickerParams, float motionVecLen) +void GetNeighbourhoodCorners(inout NeighbourhoodSamples samples, float historyLuma, float colorLuma, float2 antiFlickerParams, float motionVecLenInPixels, float downsampleFactor) { #if NEIGHBOUROOD_CORNER_METHOD == MINMAX MinMaxNeighbourhood(samples); #else - VarianceNeighbourhood(samples, historyLuma, colorLuma, antiFlickerParams, motionVecLen); + VarianceNeighbourhood(samples, historyLuma, colorLuma, antiFlickerParams, motionVecLenInPixels, downsampleFactor); #endif } @@ -612,7 +624,7 @@ void GetNeighbourhoodCorners(inout NeighbourhoodSamples samples, float historyLu // Filter main color // --------------------------------------------------- -float GetSampleWeight(NeighbourhoodSamples samples, int neighbourIdx, float4 filterParameters, float4 filterParameters2, float centralWeight, bool centralPixel = false) +float GetSampleWeight(NeighbourhoodSamples samples, int neighbourIdx, float4 filterParameters, bool centralPixel = false) { #ifdef UPSAMPLE // Very spiky gaussian (See for honor presentation) @@ -643,9 +655,6 @@ CTYPE FilterCentralColor(NeighbourhoodSamples samples, float4 filterParameters, return avg / (1 + NEIGHBOUR_COUNT); #elif CENTRAL_FILTERING == BLACKMAN_HARRIS - - // TODO : GetSampleWeight - CTYPE filtered = samples.central * centralWeight; filtered += (samples.neighbours[0] * filterParameters.x + samples.neighbours[1] * filterParameters.y + samples.neighbours[2] * filterParameters.z + samples.neighbours[3] * filterParameters.w); #if WIDE_NEIGHBOURHOOD @@ -655,13 +664,13 @@ CTYPE FilterCentralColor(NeighbourhoodSamples samples, float4 filterParameters, #elif CENTRAL_FILTERING == UPSCALE - float totalWeight = GetSampleWeight(samples, 0, filterParameters, 0, 0, true); + float totalWeight = GetSampleWeight(samples, 0, filterParameters, true); CTYPE filtered = 0; filtered += samples.central * totalWeight; for (int i = 0; i < 8; ++i) { - float w = GetSampleWeight(samples, i, filterParameters, 0, 0); + float w = GetSampleWeight(samples, i, filterParameters); filtered += samples.neighbours[i] * w; totalWeight += w; } @@ -676,11 +685,6 @@ CTYPE FilterCentralColor(NeighbourhoodSamples samples, float4 filterParameters, // Blend factor calculation // --------------------------------------------------- -float UpsampleConfidenceValue() -{ - -} - float HistoryContrast(float historyLuma, float minNeighbourLuma, float maxNeighbourLuma, float baseBlendFactor) { float lumaContrast = max(maxNeighbourLuma - minNeighbourLuma, 0) / historyLuma; @@ -784,3 +788,33 @@ CTYPE SharpenColor(NeighbourhoodSamples samples, CTYPE color, float sharpenStren return outputSharpened; } + +// --------------------------------------------------- +// Upscale confidence factor +// --------------------------------------------------- + +// Binary accept or not +float BoxKernelConfidence(float2 inputToOutputVec, float confidenceThreshold) +{ + // Binary (TODO: Smooth it?) + float confidenceScore = dot(inputToOutputVec, inputToOutputVec) < (confidenceThreshold); + return confidenceScore; +} + +float GaussianConfidence(float2 inputToOutputVec, float rcpStdDev2, float resScale) +{ + const float resolutionScale2 = resScale * resScale; + + return resolutionScale2 * exp2(-0.5f * dot(inputToOutputVec, inputToOutputVec) * resolutionScale2 * rcpStdDev2); +} + +float GetUpsampleConfidence(float2 inputToOutputVec, float confidenceThreshold, float rcpStdDev2, float resScale) +{ +#if CONFIDENCE_FACTOR == GAUSSIAN_WEIGHT + return saturate(GaussianConfidence(inputToOutputVec, rcpStdDev2, resScale)); +#elif CONFIDENCE_FACTOR == BOX_REJECT + return BoxKernelConfidence(inputToOutputVec, confidenceThreshold); +#endif + + return 1; +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 12ac46ab1b3..fca662c8247 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1408,6 +1408,22 @@ RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) previous = camera.GetPreviousFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude); } + void GrabVelocityMagnitudeHistoryTextures(HDCamera camera, out RTHandle previous, out RTHandle next, int width, int height) + { + RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) + { + return rtHandleSystem.Alloc( + width, height, TextureXR.slices, DepthBits.None, dimension: TextureXR.dimension, + filterMode: FilterMode.Bilinear, colorFormat: GraphicsFormat.R16_SFloat, + enableRandomWrite: true, useDynamicScale: true, name: $"{id} Velocity magnitude" + ); + } + + next = camera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude) + ?? camera.AllocHistoryFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude, Allocator, 2); + previous = camera.GetPreviousFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude); + } + void ReleasePostDoFTAAHistoryTextures(HDCamera camera) { var rt = camera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.TemporalAntialiasingPostDoF); @@ -1550,7 +1566,9 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem GrabTemporalAntialiasingHistoryTextures(camera, out prevHistory, out nextHistory, (int)camera.finalViewport.width, (int)camera.finalViewport.height, postDoF); } else + { GrabTemporalAntialiasingHistoryTextures(camera, out prevHistory, out nextHistory, 1, postDoF); + } Vector2Int prevViewPort = camera.historyRTHandleProperties.previousViewportSize; passData.previousScreenSize = new Vector4(prevViewPort.x, prevViewPort.y, 1.0f / prevViewPort.x, 1.0f / prevViewPort.y); @@ -1569,7 +1587,16 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.nextHistory = builder.WriteTexture(renderGraph.ImportTexture(nextHistory)); // Note: In case we run TAA for a second time (post-dof), we can use the same velocity history (and not write the output) - GrabVelocityMagnitudeHistoryTextures(camera, out var prevMVLen, out var nextMVLen); + RTHandle prevMVLen, nextMVLen; + if (TAAU) + { + GrabVelocityMagnitudeHistoryTextures(camera, out prevMVLen, out nextMVLen, (int)camera.finalViewport.width, (int)camera.finalViewport.height); + } + else + { + GrabVelocityMagnitudeHistoryTextures(camera, out prevMVLen, out nextMVLen); + } + passData.prevMVLen = builder.ReadTexture(renderGraph.ImportTexture(prevMVLen)); passData.nextMVLen = (!postDoF) ? builder.WriteTexture(renderGraph.ImportTexture(nextMVLen)) : TextureHandle.nullHandle; @@ -1581,7 +1608,7 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.finalViewport = camera.finalViewport; var resScale = DynamicResolutionHandler.instance.GetCurrentScale(); float stdDev = 0.4f; - passData.taauParams = new Vector4(1.0f / (stdDev * stdDev), 1.0f / resScale, 0, 0); + passData.taauParams = new Vector4(1.0f / (stdDev * stdDev), 1.0f / resScale, 0.5f * resScale * resScale, resScale); } TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle sourceTexture, bool postDoF, string outputName) From b115580d4f6e82c8ca5f8699699bd33d33425244 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Fri, 2 Jul 2021 10:59:31 +0200 Subject: [PATCH 07/41] Make the upsampling of depth and movec irrelevant anymore --- .../Shaders/DepthOfFieldCoC.compute | 4 +- .../Shaders/DepthOfFieldCoCReproject.compute | 6 +- .../Shaders/DoFCircleOfConfusion.compute | 4 +- .../Shaders/MotionBlurMotionVecPrep.compute | 8 +- .../Shaders/TemporalAntiAliasing.shader | 17 +- .../Shaders/TemporalAntialiasing.hlsl | 4 +- .../HDRenderPipeline.PostProcess.cs | 148 +----------------- .../ShaderLibrary/ShaderVariables.hlsl | 17 +- 8 files changed, 44 insertions(+), 164 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoC.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoC.compute index aa9a8fc7a2a..52975b99df3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoC.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoC.compute @@ -45,7 +45,7 @@ void KMainPhysical(uint3 dispatchThreadId : SV_DispatchThreadID) { UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z); - float depth = LoadCameraDepth(dispatchThreadId.xy); + float depth = LoadCameraDepth(FromOutputPosSSToPreupsamplePosSS(dispatchThreadId.xy)); float linearEyeDepth = LinearEyeDepth(depth, _ZBufferParams); float coc = (1.0 - FocusDist / max(linearEyeDepth, 1e-6f)) * MaxCoC; @@ -63,7 +63,7 @@ void KMainPhysical(uint3 dispatchThreadId : SV_DispatchThreadID) void KMainManual(uint3 dispatchThreadId : SV_DispatchThreadID) { UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z); - float depth = LoadCameraDepth(dispatchThreadId.xy); + float depth = LoadCameraDepth(FromOutputPosSSToPreupsamplePosSS(dispatchThreadId.xy)); float linearEyeDepth = LinearEyeDepth(depth, _ZBufferParams); float nearBlend = GetFixedNearBlend(linearEyeDepth); diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoCReproject.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoCReproject.compute index 8ede212db7c..aff57a44bb2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoCReproject.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoCReproject.compute @@ -72,7 +72,11 @@ void KMain(uint3 dispatchThreadId : SV_DispatchThreadID) // Sample the history buffer with the motion vector at the closest point float2 motionVector; - DecodeMotionVector(LOAD_TEXTURE2D_X(_CameraMotionVectorsTexture, max(int2(posInputs.positionSS) + int2(closest.xy), 0)), motionVector); + float2 motionVecUV = FromOutputPosSSToPreupsampleUV(max(int2(posInputs.positionSS) + int2(closest.xy), 0)); + motionVecUV = ClampAndScaleUVForPoint(motionVecUV); + + float4 encodedMV = SAMPLE_TEXTURE2D_X_LOD(_CameraMotionVectorsTexture, s_point_clamp_sampler, motionVecUV, 0); + DecodeMotionVector(encodedMV, motionVector); float cocHis = SAMPLE_TEXTURE2D_X_LOD(_InputHistoryCoCTexture, SAMPLER_STATE, (uv - motionVector) * ScreenToTargetScaleHistory.xy, 0.0).x; // Neighborhood clamping diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DoFCircleOfConfusion.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DoFCircleOfConfusion.compute index 5df95393c63..0c562225c2c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DoFCircleOfConfusion.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DoFCircleOfConfusion.compute @@ -32,7 +32,7 @@ void KMainCoCPhysical(uint3 dispatchThreadId : SV_DispatchThreadID) UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z); PositionInputs posInputs = GetPositionInput(float2(dispatchThreadId.xy), _ScreenSize.zw, uint2(GROUP_RES, GROUP_RES)); - float depth = LoadCameraDepth(posInputs.positionSS); + float depth = LoadCameraDepth(FromOutputPosSSToPreupsamplePosSS(dispatchThreadId.xy)); // Note: the linearization of the depth is encoded directly in the MAD parameters float CoC = _Params.w - _Params.z * depth; @@ -60,7 +60,7 @@ void KMainCoCManual(uint3 dispatchThreadId : SV_DispatchThreadID) { UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z); - float depth = LoadCameraDepth(dispatchThreadId.xy); + float depth = LoadCameraDepth(FromOutputPosSSToPreupsamplePosSS(dispatchThreadId.xy)); // Note: we can avoid explicit linearization by merging it with the other computations float linearEyeDepth = LinearEyeDepth(depth, _ZBufferParams); diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/MotionBlurMotionVecPrep.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/MotionBlurMotionVecPrep.compute index 0d1f9e12bf5..5323ccad0b1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/MotionBlurMotionVecPrep.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/MotionBlurMotionVecPrep.compute @@ -145,14 +145,18 @@ void MotionVecPreppingCS(uint3 dispatchThreadId : SV_DispatchThreadID) UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z); float3 motionVecAndDepth = 0.0f; - float4 motionVecBufferSample = LOAD_TEXTURE2D_X(_CameraMotionVectorsTexture, dispatchThreadId.xy); + + float2 motionVecUV = FromOutputPosSSToPreupsampleUV(dispatchThreadId.xy); + motionVecUV = ClampAndScaleUVForPoint(motionVecUV); + + float4 motionVecBufferSample = SAMPLE_TEXTURE2D_X_LOD(_CameraMotionVectorsTexture, s_point_clamp_sampler, motionVecUV, 0); // if we have a value > 1.0f, it means we have selected the "no motion option", hence we force motionVec 0. bool forceNoMotion = PixelSetAsNoMotionVectors(motionVecBufferSample); float2 motionVec; DecodeMotionVector(motionVecBufferSample, motionVec); - float depth = LoadCameraDepth(dispatchThreadId.xy); + float depth = LoadCameraDepth(FromOutputPosSSToPreupsamplePosSS(dispatchThreadId.xy)); if ( !forceNoMotion diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index 7de481bbfd0..41135dbcc52 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -195,8 +195,7 @@ Shader "Hidden/HDRP/TemporalAA" float2 uv = input.texcoord; #ifdef TAA_UPSCALE - float2 outputPixInInput = input.texcoord * _InputSize.xy + float2(_TaaJitterStrength.x, -_TaaJitterStrength.y); - outputPixInInput = input.texcoord * _InputSize.xy - _TaaJitterStrength.xy; + float2 outputPixInInput = input.texcoord * _InputSize.xy - _TaaJitterStrength.xy; uv = _InputSize.zw * (0.5f + floor(outputPixInInput)); #endif @@ -204,12 +203,13 @@ Shader "Hidden/HDRP/TemporalAA" // --------------- Get closest motion vector --------------- float2 motionVector; -#if ORTHOGRAPHIC || /* TODO: This should not be the case, but we are a bit in an awkward state w.r.t depth and motion vector sizes. Needs fixing. */ defined(TAA_UPSCALE) - float2 closest = input.positionCS.xy; +#if ORTHOGRAPHIC + float2 closestOffset = 0; #else - float2 closest = GetClosestFragment(_DepthTexture, int2(input.positionCS.xy)); + float2 closestOffset = GetClosestFragmentOffset(_DepthTexture, int2(input.positionCS.xy)); #endif - DecodeMotionVector(LOAD_TEXTURE2D_X(_CameraMotionVectorsTexture, closest), motionVector); + + DecodeMotionVector(SAMPLE_TEXTURE2D_X_LOD(_CameraMotionVectorsTexture, s_point_clamp_sampler, ClampAndScaleUVForPoint(uv + closestOffset * _InputSize.zw), 0), motionVector); // -------------------------------------------------------- // --------------- Get resampled history --------------- @@ -226,7 +226,7 @@ Shader "Hidden/HDRP/TemporalAA" color = ConvertToWorkingSpace(color); NeighbourhoodSamples samples; - GatherNeighbourhood(_InputTexture, uv, input.positionCS.xy, color, samples); + GatherNeighbourhood(_InputTexture, uv, floor(input.positionCS.xy), color, samples); // -------------------------------------------------------- // --------------- Filter central sample --------------- @@ -240,7 +240,7 @@ Shader "Hidden/HDRP/TemporalAA" #elif CENTRAL_FILTERING == BLACKMAN_HARRIS // We need to swizzle weights as we use quad communication to access neighbours, so the order of neighbours is not always the same (this needs to go away when moving back to compute) - SwizzleFilterWeights(input.positionCS.xy, filterParams, filterParams1); + SwizzleFilterWeights(floor(input.positionCS.xy), filterParams, filterParams1); #endif CTYPE filteredColor = FilterCentralColor(samples, filterParams, filterParams1, centralWeight); // ------------------------------------------------------ @@ -313,7 +313,6 @@ Shader "Hidden/HDRP/TemporalAA" _OutputHistoryTexture[COORD_TEXTURE2D_X(input.positionCS.xy)] = color.CTYPE_SWIZZLE; outColor = color.CTYPE_SWIZZLE; - #if VELOCITY_REJECTION && !defined(POST_DOF) _OutputVelocityMagnitudeHistory[COORD_TEXTURE2D_X(input.positionCS.xy)] = lengthMV; #endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index ff2bab0a7e9..f59dad83179 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -274,7 +274,7 @@ float3 ConvertToOutputSpace(float3 color) // --------------------------------------------------- // Front most neighbourhood velocity ([Karis 2014]) -float2 GetClosestFragment(TEXTURE2D_X(DepthTexture), int2 positionSS) +float2 GetClosestFragmentOffset(TEXTURE2D_X(DepthTexture), int2 positionSS) { float center = LOAD_TEXTURE2D_X_LOD(DepthTexture, positionSS, 0).r; @@ -296,7 +296,7 @@ float2 GetClosestFragment(TEXTURE2D_X(DepthTexture), int2 positionSS) closest = COMPARE_DEPTH(s2, closest.z) ? float3(offset2, s2) : closest; closest = COMPARE_DEPTH(s1, closest.z) ? float3(offset1, s1) : closest; - return positionSS + closest.xy; + return closest.xy; } // Used since some compute might want to call this and we cannot use Quad reads in that case. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index fca662c8247..b3fe44c76bb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -465,13 +465,10 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, source = DynamicExposurePass(renderGraph, hdCamera, source); - if ((m_DLSSPassEnabled || DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU) && DynamicResolutionHandler.instance.upsamplerSchedule == DynamicResolutionHandler.UpsamplerScheduleType.BeforePost) + if (m_DLSSPassEnabled && DynamicResolutionHandler.instance.upsamplerSchedule == DynamicResolutionHandler.UpsamplerScheduleType.BeforePost) { - var upsamplignSceneResults = SceneUpsamplePass(renderGraph, hdCamera, source, depthBuffer, motionVectors); - //source = upsamplignSceneResults.color; - // depthBuffer = upsamplignSceneResults.depthBuffer; - motionVectors = upsamplignSceneResults.motionVectors; - // SetCurrentResolutionGroup(renderGraph, hdCamera, ResolutionGroup.AfterDynamicResUpscale); + source = DoDLSSPass(renderGraph, hdCamera, inputColor, depthBuffer, motionVectors); + SetCurrentResolutionGroup(renderGraph, hdCamera, ResolutionGroup.AfterDynamicResUpscale); } source = CustomPostProcessPass(renderGraph, hdCamera, source, depthBuffer, normalBuffer, motionVectors, m_GlobalSettings.beforeTAACustomPostProcesses, HDProfileId.CustomPostProcessBeforeTAA); @@ -3357,145 +3354,6 @@ TextureHandle MotionBlurPass(RenderGraph renderGraph, HDCamera hdCamera, Texture #region Upsample Scene - class SceneUpsamplingData - { - public struct Textures - { - public TextureHandle color; - public TextureHandle depthBuffer; - public TextureHandle motionVectors; - } - public UpsampleSceneParameters parameters; - public bool upsampleColor; - public Textures inputTextures = new Textures(); - public Textures outputTextures = new Textures(); - } - - struct UpsampleSceneParameters - { - public ComputeShader upsampleSceneCS; - public int mainUpsampleKernel; - public int viewCount; - public float width; - public float height; - } - - UpsampleSceneParameters PrepareUpsampleSceneParameters(HDCamera camera) - { - var parameters = new UpsampleSceneParameters(); - - parameters.upsampleSceneCS = defaultResources.shaders.upsampleSceneCS; - parameters.mainUpsampleKernel = parameters.upsampleSceneCS.FindKernel("MainUpsample"); - parameters.viewCount = camera.viewCount; - parameters.width = camera.finalViewport.width; - parameters.height = camera.finalViewport.height; - return parameters; - } - - static void DoUpsampleScene( - UpsampleSceneParameters parameters, CommandBuffer cmd, - RTHandle sourceColor, RTHandle sourceDepth, RTHandle sourceMotionVectors, - RTHandle outputColor, RTHandle outputDepth, RTHandle outputMotionVectors) - { - var mainKernel = parameters.mainUpsampleKernel; - if (mainKernel < 0) - throw new Exception(String.Format( - "Invalid kernel specified for UpsampleSceneCS")); - - var cs = parameters.upsampleSceneCS; - if (sourceColor != null) - cmd.SetComputeTextureParam(cs, mainKernel, HDShaderIDs._InputTexture, sourceColor); - cmd.SetComputeTextureParam(cs, mainKernel, HDShaderIDs._InputDepth, sourceDepth); - cmd.SetComputeTextureParam(cs, mainKernel, HDShaderIDs._CameraMotionVectorsTexture, sourceMotionVectors); - - cmd.SetComputeTextureParam(cs, mainKernel, HDShaderIDs._OutputTexture, outputColor); - cmd.SetComputeTextureParam(cs, mainKernel, HDShaderIDs._OutputDepthTexture, outputDepth); - cmd.SetComputeTextureParam(cs, mainKernel, HDShaderIDs._OutputMotionVectorTexture, outputMotionVectors); - - cmd.SetComputeVectorParam(cs, HDShaderIDs._ViewPortSize, new Vector4(parameters.width, parameters.height, 1.0f / parameters.width, 1.0f / parameters.height)); - - const int xThreads = 8; - const int yThreads = 4; - int dispatchX = HDUtils.DivRoundUp(Mathf.RoundToInt(parameters.width), xThreads); - int dispatchY = HDUtils.DivRoundUp(Mathf.RoundToInt(parameters.height), yThreads); - cmd.DispatchCompute(cs, mainKernel, dispatchX, dispatchY, parameters.viewCount); - } - - SceneUpsamplingData.Textures SceneUpsamplePass(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle inputColor, TextureHandle inputDepth, TextureHandle inputMotionVectors) - { - SceneUpsamplingData.Textures outTextures; - - TextureHandle upsampledColor = TextureHandle.nullHandle; - bool upsampleColorInScenePass = true; - if (m_DLSSPassEnabled) - { - upsampledColor = DoDLSSPass(renderGraph, hdCamera, inputColor, inputDepth, inputMotionVectors); - upsampleColorInScenePass = false; - } - - using (var builder = renderGraph.AddRenderPass("Scene Upsampling", out var passData, ProfilingSampler.Get(HDProfileId.SceneUpsampling))) - { - passData.parameters = PrepareUpsampleSceneParameters(hdCamera); - passData.upsampleColor = upsampleColorInScenePass; - - if (passData.upsampleColor) - passData.inputTextures.color = builder.ReadTexture(inputColor); - - passData.inputTextures.depthBuffer = builder.ReadTexture(inputDepth); - passData.inputTextures.motionVectors = builder.ReadTexture(inputMotionVectors); - - if (passData.upsampleColor) - { - passData.outputTextures.color = renderGraph.CreateTexture(new TextureDesc(Vector2.one, false, true) - { - name = "Resolved Color Buffer", - colorFormat = renderGraph.GetTextureDesc(inputColor).colorFormat, - useMipMap = false, - enableRandomWrite = true - }); - - passData.outputTextures.color = builder.WriteTexture(passData.outputTextures.color); - } - else - { - passData.outputTextures.color = upsampledColor; - } - - passData.outputTextures.depthBuffer = renderGraph.CreateTexture(new TextureDesc(Vector2.one, false, true) - { - name = "Resolved Depth Buffer", - colorFormat = GraphicsFormat.R32_SFloat, - useMipMap = false, - enableRandomWrite = true - }); - passData.outputTextures.depthBuffer = builder.WriteTexture(passData.outputTextures.depthBuffer); - - passData.outputTextures.motionVectors = renderGraph.CreateTexture(new TextureDesc(Vector2.one, false, true) - { - name = "Resolved Motion Vectors", - colorFormat = renderGraph.GetTextureDesc(inputMotionVectors).colorFormat, - useMipMap = false, - enableRandomWrite = true - }); - passData.outputTextures.motionVectors = builder.WriteTexture(passData.outputTextures.motionVectors); - - builder.SetRenderFunc( - (SceneUpsamplingData data, RenderGraphContext ctx) => - { - DoUpsampleScene( - data.parameters, ctx.cmd, - data.upsampleColor ? (RTHandle)data.inputTextures.color : null, - data.inputTextures.depthBuffer, - data.inputTextures.motionVectors, - data.outputTextures.color, - data.outputTextures.depthBuffer, - data.outputTextures.motionVectors); - }); - outTextures = passData.outputTextures; - } - return outTextures; - } - private void SetCurrentResolutionGroup(RenderGraph renderGraph, HDCamera camera, ResolutionGroup newResGroup) { if (resGroup == newResGroup) diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl index f1894582a9c..4d1e61d4ab4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl @@ -399,7 +399,7 @@ float2 ClampAndScaleUVForBilinearPostProcessTexture(float2 UV, float2 texelSize) return ClampAndScaleUV(UV, texelSize, 0.5f, _RTHandlePostProcessScale.xy); } -// This is assuming an upsampled texture used in post processing, with original screen size and a half a texel offset for the clamping. +// This is assuming an upsampled texture used in post processing, with original screen size and numberOfTexels offset for the clamping. float2 ClampAndScaleUVPostProcessTexture(float2 UV, float2 texelSize, float numberOfTexels) { return ClampAndScaleUV(UV, texelSize, numberOfTexels, _RTHandlePostProcessScale.xy); @@ -415,6 +415,21 @@ float2 ClampAndScaleUVPostProcessTextureForPoint(float2 UV) return min(UV, 1.0f) * _RTHandlePostProcessScale.xy; } +// IMPORTANT: This is expecting the corner not the center. +float2 FromOutputPosSSToPreupsampleUV(int2 posSS) +{ + return (posSS + 0.5f) * _PostProcessScreenSize.zw; +} + +// IMPORTANT: This is expecting the corner not the center. +float2 FromOutputPosSSToPreupsamplePosSS(float2 posSS) +{ + float2 uv = FromOutputPosSSToPreupsampleUV(posSS); + return floor(uv * _ScreenSize.xy); +} + + + uint Get1DAddressFromPixelCoord(uint2 pixCoord, uint2 screenSize, uint eye) { // We need to shift the index to look up the right eye info. From 0f8bb063391423a3334f75884217a2dae93e9758 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Fri, 2 Jul 2021 17:29:42 +0200 Subject: [PATCH 08/41] Better sharpening --- .../Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index f59dad83179..6cecb4a297d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -772,12 +772,12 @@ CTYPE SharpenColor(NeighbourhoodSamples samples, CTYPE color, float sharpenStren linearC.xyz = ConvertToOutputSpace(linearC.xyz); linearAvg.xyz = ConvertToOutputSpace(linearAvg.xyz); - linearC.xyz = linearC.xyz + (linearC.xyz - linearAvg.xyz) * sharpenStrength * 3; + linearC.xyz = linearC.xyz + max(0, (linearC.xyz - linearAvg.xyz)) * sharpenStrength * 3; linearC.xyz = clamp(linearC.xyz, 0, CLAMP_MAX); linearC = ConvertToWorkingSpace(linearC); #else - linearC = linearC + (linearC - linearAvg) * sharpenStrength * 3; + linearC = linearC + (linearC - linearAvg) * sharpenStrength * 4; linearC = clamp(linearC, 0, CLAMP_MAX); #endif CTYPE outputSharpened = linearC * PerceptualWeight(linearC); From 6ba147863b43a1fbcb70c7ed4b308a23e4d248d9 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Fri, 2 Jul 2021 18:11:05 +0200 Subject: [PATCH 09/41] Fix wrong constant --- .../Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index 6cecb4a297d..eb7b5a1b527 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -777,7 +777,7 @@ CTYPE SharpenColor(NeighbourhoodSamples samples, CTYPE color, float sharpenStren linearC = ConvertToWorkingSpace(linearC); #else - linearC = linearC + (linearC - linearAvg) * sharpenStrength * 4; + linearC = linearC + (linearC - linearAvg) * sharpenStrength * 3; linearC = clamp(linearC, 0, CLAMP_MAX); #endif CTYPE outputSharpened = linearC * PerceptualWeight(linearC); From 22c88a01f549119e33b52e0bee25cb4c518e5dfb Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Fri, 2 Jul 2021 18:11:59 +0200 Subject: [PATCH 10/41] Start of fix for HW (need to check another branch) --- .../Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index b3fe44c76bb..ee2318bdfbf 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1377,7 +1377,7 @@ RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) return rtHandleSystem.Alloc( width, height, TextureXR.slices, DepthBits.None, dimension: TextureXR.dimension, filterMode: FilterMode.Bilinear, colorFormat: GetPostprocessTextureFormat(), - enableRandomWrite: true, useDynamicScale: true, name: $"{id} TAA History" + enableRandomWrite: true, useDynamicScale: false, name: $"{id} TAA History" ); } @@ -1597,9 +1597,10 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.prevMVLen = builder.ReadTexture(renderGraph.ImportTexture(prevMVLen)); passData.nextMVLen = (!postDoF) ? builder.WriteTexture(renderGraph.ImportTexture(nextMVLen)) : TextureHandle.nullHandle; - passData.destination = builder.WriteTexture(GetPostprocessOutputHandle(renderGraph, outputName));; + // TODO! ONLY DO WHEN HW! + passData.destination = builder.WriteTexture(GetPostprocessUpsampledOutputHandle(renderGraph, outputName));; - TextureHandle dest = GetPostprocessOutputHandle(renderGraph, "Post-DoF TAA Destination"); + TextureHandle dest = GetPostprocessUpsampledOutputHandle(renderGraph, "Post-DoF TAA Destination"); passData.destination = builder.WriteTexture(dest); passData.finalViewport = camera.finalViewport; From 1c14eef6255a4c6a8367082999325cf06b858d40 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Fri, 2 Jul 2021 18:53:06 +0200 Subject: [PATCH 11/41] Fix HW dynamic res and fix ambiguity with stencil test. --- .../Shaders/TemporalAntiAliasing.shader | 13 +++++++++++++ .../HDRenderPipeline.PostProcess.cs | 16 ++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index 41135dbcc52..f415959af39 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -372,6 +372,19 @@ Shader "Hidden/HDRP/TemporalAA" #pragma fragment FragExcludedTAA ENDHLSL } + + Pass // TAAU + { + // We cannot stencil with TAAU, we will need to manually sample the texture. + + ZWrite Off ZTest Always Blend Off Cull Off + + HLSLPROGRAM + #pragma vertex Vert + #pragma fragment FragTAA + ENDHLSL + } + } Fallback Off } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index ee2318bdfbf..6572fe34b66 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1597,10 +1597,15 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.prevMVLen = builder.ReadTexture(renderGraph.ImportTexture(prevMVLen)); passData.nextMVLen = (!postDoF) ? builder.WriteTexture(renderGraph.ImportTexture(nextMVLen)) : TextureHandle.nullHandle; - // TODO! ONLY DO WHEN HW! - passData.destination = builder.WriteTexture(GetPostprocessUpsampledOutputHandle(renderGraph, outputName));; - - TextureHandle dest = GetPostprocessUpsampledOutputHandle(renderGraph, "Post-DoF TAA Destination"); + TextureHandle dest; + if (DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU && DynamicResolutionHandler.instance.HardwareDynamicResIsEnabled()) + { + dest = GetPostprocessUpsampledOutputHandle(renderGraph, outputName); + } + else + { + dest = GetPostprocessOutputHandle(renderGraph, outputName); + } passData.destination = builder.WriteTexture(dest); passData.finalViewport = camera.finalViewport; @@ -1666,8 +1671,7 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, if (DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU) { rect = data.finalViewport; - HDUtils.DrawFullScreen(ctx.cmd, rect, data.temporalAAMaterial, data.destination, data.depthBuffer, mpb, 0); - HDUtils.DrawFullScreen(ctx.cmd, rect, data.temporalAAMaterial, data.destination, data.depthBuffer, mpb, 1); + HDUtils.DrawFullScreen(ctx.cmd, rect, data.temporalAAMaterial, data.destination, mpb, 2); } else { From 778b89e4b46eed52c1546cee7476099082033411 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Mon, 5 Jul 2021 14:47:28 +0200 Subject: [PATCH 12/41] Fix history sampling, black flashes and DoF. Still probems with post dof TAA --- .../Shaders/TemporalAntiAliasing.shader | 7 +- .../Shaders/TemporalAntialiasing.hlsl | 31 ++-- .../HDRenderPipeline.PostProcess.cs | 135 ++++++++++-------- .../RenderPipeline/HDStringConstants.cs | 1 + 4 files changed, 100 insertions(+), 74 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index f415959af39..d1a6d858c44 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -134,6 +134,9 @@ Shader "Hidden/HDRP/TemporalAA" #define _InputSize _ScreenSize + float4 _TaaScales; + #define _RTHandleScaleForTAAHistory _TaaScales.xy + #if VELOCITY_REJECTION TEXTURE2D_X(_InputVelocityMagnitudeHistory); @@ -215,7 +218,7 @@ Shader "Hidden/HDRP/TemporalAA" // --------------- Get resampled history --------------- float2 prevUV = input.texcoord - motionVector; - CTYPE history = GetFilteredHistory(_InputHistoryTexture, prevUV, _HistorySharpening, _TaaHistorySize); + CTYPE history = GetFilteredHistory(_InputHistoryTexture, prevUV, _HistorySharpening, _TaaHistorySize, _RTHandleScaleForTAAHistory); bool offScreen = any(abs(prevUV * 2 - 1) >= (1.0f - (1.0 * _TaaHistorySize.zw))); history.xyz *= PerceptualWeight(history); // ----------------------------------------------------- @@ -287,7 +290,7 @@ Shader "Hidden/HDRP/TemporalAA" #if VELOCITY_REJECTION float lengthMV = motionVectorLength * 10; - blendFactor = ModifyBlendWithMotionVectorRejection(_InputVelocityMagnitudeHistory, lengthMV, prevUV, blendFactor, _SpeedRejectionIntensity); + blendFactor = ModifyBlendWithMotionVectorRejection(_InputVelocityMagnitudeHistory, lengthMV, prevUV, blendFactor, _SpeedRejectionIntensity, _RTHandleScaleForTAAHistory); #endif #ifdef TAA_UPSCALE diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index eb7b5a1b527..880fa101e5e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -121,6 +121,7 @@ float4 Fetch4Array(Texture2DArray tex, uint slot, float2 coords, float2 offset, #define PERCEPTUAL_SPACE 1 #endif + // --------------------------------------------------- // Utilities functions // --------------------------------------------------- @@ -320,12 +321,12 @@ float2 GetClosestFragmentCompute(float2 positionSS) } -float ModifyBlendWithMotionVectorRejection(TEXTURE2D_X(VelocityMagnitudeTexture), float mvLen, float2 prevUV, float blendFactor, float speedRejectionFactor) +float ModifyBlendWithMotionVectorRejection(TEXTURE2D_X(VelocityMagnitudeTexture), float mvLen, float2 prevUV, float blendFactor, float speedRejectionFactor, float2 rtHandleScale) { // TODO: This needs some refinement, it can lead to some annoying flickering coming back on strong camera movement. #if VELOCITY_REJECTION - float prevMVLen = Fetch(VelocityMagnitudeTexture, prevUV, 0, _RTHandleScaleHistory.zw).x; + float prevMVLen = Fetch(VelocityMagnitudeTexture, prevUV, 0, rtHandleScale).x; float diff = abs(mvLen - prevMVLen); // We don't start rejecting until we have the equivalent of around 40 texels in 1080p @@ -342,15 +343,15 @@ float ModifyBlendWithMotionVectorRejection(TEXTURE2D_X(VelocityMagnitudeTexture) // History sampling // --------------------------------------------------- -CTYPE HistoryBilinear(TEXTURE2D_X(HistoryTexture), float2 UV) +CTYPE HistoryBilinear(TEXTURE2D_X(HistoryTexture), float2 UV, float2 rtHandleScale) { - CTYPE color = Fetch4(HistoryTexture, UV, 0.0, _RTHandleScaleHistory.zw).CTYPE_SWIZZLE; + CTYPE color = Fetch4(HistoryTexture, UV, 0.0, rtHandleScale).CTYPE_SWIZZLE; return color; } // From Filmic SMAA presentation[Jimenez 2016] // A bit more verbose that it needs to be, but makes it a bit better at latency hiding -CTYPE HistoryBicubic5Tap(TEXTURE2D_X(HistoryTexture), float2 UV, float sharpening, float4 historyBufferInfo) +CTYPE HistoryBicubic5Tap(TEXTURE2D_X(HistoryTexture), float2 UV, float sharpening, float4 historyBufferInfo, float2 rtHandleScale) { float2 samplePos = UV * historyBufferInfo.xy; float2 tc1 = floor(samplePos - 0.5) + 0.5; @@ -370,11 +371,11 @@ CTYPE HistoryBicubic5Tap(TEXTURE2D_X(HistoryTexture), float2 UV, float sharpenin float2 tc3 = historyBufferInfo.zw * (tc1 + 2.0); float2 tc12 = historyBufferInfo.zw * (tc1 + w2 / w12); - CTYPE s0 = Fetch4(HistoryTexture, float2(tc12.x, tc0.y), 0.0, _RTHandleScaleHistory.zw).CTYPE_SWIZZLE; - CTYPE s1 = Fetch4(HistoryTexture, float2(tc0.x, tc12.y), 0.0, _RTHandleScaleHistory.zw).CTYPE_SWIZZLE; - CTYPE s2 = Fetch4(HistoryTexture, float2(tc12.x, tc12.y), 0.0, _RTHandleScaleHistory.zw).CTYPE_SWIZZLE; - CTYPE s3 = Fetch4(HistoryTexture, float2(tc3.x, tc0.y), 0.0, _RTHandleScaleHistory.zw).CTYPE_SWIZZLE; - CTYPE s4 = Fetch4(HistoryTexture, float2(tc12.x, tc3.y), 0.0, _RTHandleScaleHistory.zw).CTYPE_SWIZZLE; + CTYPE s0 = Fetch4(HistoryTexture, float2(tc12.x, tc0.y), 0.0, rtHandleScale).CTYPE_SWIZZLE; + CTYPE s1 = Fetch4(HistoryTexture, float2(tc0.x, tc12.y), 0.0, rtHandleScale).CTYPE_SWIZZLE; + CTYPE s2 = Fetch4(HistoryTexture, float2(tc12.x, tc12.y), 0.0, rtHandleScale).CTYPE_SWIZZLE; + CTYPE s3 = Fetch4(HistoryTexture, float2(tc3.x, tc0.y), 0.0, rtHandleScale).CTYPE_SWIZZLE; + CTYPE s4 = Fetch4(HistoryTexture, float2(tc12.x, tc3.y), 0.0, rtHandleScale).CTYPE_SWIZZLE; float cw0 = (w12.x * w0.y); float cw1 = (w0.x * w12.y); @@ -411,14 +412,14 @@ CTYPE HistoryBicubic5Tap(TEXTURE2D_X(HistoryTexture), float2 UV, float sharpenin } -CTYPE GetFilteredHistory(TEXTURE2D_X(HistoryTexture), float2 UV, float sharpening, float4 historyBufferInfo) +CTYPE GetFilteredHistory(TEXTURE2D_X(HistoryTexture), float2 UV, float sharpening, float4 historyBufferInfo, float2 rtHandleScale) { CTYPE history = 0; #if (HISTORY_SAMPLING_METHOD == BILINEAR || defined(FORCE_BILINEAR_HISTORY)) - history = HistoryBilinear(HistoryTexture, UV); + history = HistoryBilinear(HistoryTexture, UV, rtHandleScale); #elif HISTORY_SAMPLING_METHOD == BICUBIC_5TAP - history = HistoryBicubic5Tap(HistoryTexture, UV, sharpening, historyBufferInfo); + history = HistoryBicubic5Tap(HistoryTexture, UV, sharpening, historyBufferInfo, rtHandleScale); #endif history = clamp(history, 0, CLAMP_MAX); @@ -492,7 +493,7 @@ void GatherNeighbourhood(TEXTURE2D_X(InputTexture), float2 UV, float2 positionSS samples.neighbours[4] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset1, _RTHandleScale.xy).CTYPE_SWIZZLE); samples.neighbours[5] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset2, _RTHandleScale.xy).CTYPE_SWIZZLE); samples.neighbours[6] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset3, _RTHandleScale.xy).CTYPE_SWIZZLE); - samples.neighbours[7] = QuadReadColorAcrossDiagonal(centralColor, positionSS); + samples.neighbours[7] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, fastOffset, _RTHandleScale.xy).CTYPE_SWIZZLE); /* TODO: Why is this not good? QuadReadColorAcrossDiagonal(centralColor, positionSS); */ #ifdef UPSAMPLE samples.offsets[0] = float2(0.0f, quadOffset.y); @@ -502,7 +503,7 @@ void GatherNeighbourhood(TEXTURE2D_X(InputTexture), float2 UV, float2 positionSS samples.offsets[4] = offset1; samples.offsets[5] = offset2; samples.offsets[6] = offset3; - samples.offsets[7] = int2(-quadOffset.x, -quadOffset.y); + samples.offsets[7] = fastOffset; #endif #else // !WIDE_NEIGHBOURHOOD diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 6572fe34b66..cb5523febf7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -66,10 +66,13 @@ private enum SMAAStage HableCurve m_HableCurve; //Viewport information - + Rect m_PrevFinalViewport = new Rect(Vector2.zero, Vector2.one * -1); Vector2Int m_AfterDynamicResUpscaleRes = new Vector2Int(1, 1); Vector2Int m_BeforeDynamicResUpscaleRes = new Vector2Int(1, 1); + Dictionary m_WasRunningTAAU = new Dictionary(); + Dictionary m_WillNeedToClearHistoryBuffers = new Dictionary(); + private enum ResolutionGroup { BeforeDynamicResUpscale, @@ -266,6 +269,14 @@ bool PostProcessEnableAlpha() return m_EnableAlpha; } + void ReleasePostProcessHistoryBuffers(HDCamera camera) + { + camera.ReleaseHistoryFrameRT((int)HDCameraFrameHistoryType.TemporalAntialiasing); + camera.ReleaseHistoryFrameRT((int)HDCameraFrameHistoryType.TemporalAntialiasingPostDoF); + camera.ReleaseHistoryFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude); + camera.ReleaseHistoryFrameRT((int)HDCameraFrameHistoryType.DepthOfFieldCoC); + } + void CleanupPostProcess() { RTHandles.Release(m_EmptyExposureTexture); @@ -442,6 +453,11 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, renderGraph.BeginProfilingSampler(ProfilingSampler.Get(HDProfileId.PostProcessing)); + if (m_WillNeedToClearHistoryBuffers.ContainsKey(hdCamera) && m_WillNeedToClearHistoryBuffers[hdCamera]) + { + ReleasePostProcessHistoryBuffers(hdCamera); + } + var source = inputColor; var depthBuffer = prepassOutput.resolvedDepthBuffer; var depthBufferMipChain = prepassOutput.depthPyramidTexture; @@ -480,7 +496,10 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, { source = DoTemporalAntialiasing(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, postDoF: false, "TAA Destination"); if (DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU) + { SetCurrentResolutionGroup(renderGraph, hdCamera, ResolutionGroup.AfterDynamicResUpscale); + m_PrevFinalViewport = hdCamera.finalViewport; + } } else if (hdCamera.antialiasing == HDAdditionalCameraData.AntialiasingMode.SubpixelMorphologicalAntiAliasing) { @@ -525,6 +544,27 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, FinalPass(renderGraph, hdCamera, afterPostProcessBuffer, alphaTexture, dest, source, m_BlueNoise, flipYInPostProcess); + bool currFrameIsTAAUpsampled = DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; + bool cameraWasRunningTAA = false; + if (m_WasRunningTAAU.ContainsKey(hdCamera)) + { + cameraWasRunningTAA = m_WasRunningTAAU[hdCamera]; + m_WasRunningTAAU[hdCamera] = currFrameIsTAAUpsampled; + } + else + { + m_WasRunningTAAU.Add(hdCamera, currFrameIsTAAUpsampled); + } + + if (m_WillNeedToClearHistoryBuffers.ContainsKey(hdCamera)) + { + m_WillNeedToClearHistoryBuffers[hdCamera] = (cameraWasRunningTAA != currFrameIsTAAUpsampled); + } + else + { + m_WillNeedToClearHistoryBuffers.Add(hdCamera, (cameraWasRunningTAA != currFrameIsTAAUpsampled)); + } + renderGraph.EndProfilingSampler(ProfilingSampler.Get(HDProfileId.PostProcessing)); // Reset the post process size if needed, so any passes that read this data during Render Graph execute will have the expected data @@ -1351,7 +1391,7 @@ TextureHandle CustomPostProcessPass(RenderGraph renderGraph, HDCamera hdCamera, #region Temporal Anti-aliasing - void GrabTemporalAntialiasingHistoryTextures(HDCamera camera, out RTHandle previous, out RTHandle next, float customScale, bool postDoF = false) + void GrabTemporalAntialiasingHistoryTextures(HDCamera camera, out RTHandle previous, out RTHandle next, Vector2 customScale, bool postDoF = false) { RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) { @@ -1370,47 +1410,12 @@ RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) previous = camera.GetPreviousFrameRT(historyType); } - void GrabTemporalAntialiasingHistoryTextures(HDCamera camera, out RTHandle previous, out RTHandle next, int width, int height, bool postDoF = false) - { - RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) - { - return rtHandleSystem.Alloc( - width, height, TextureXR.slices, DepthBits.None, dimension: TextureXR.dimension, - filterMode: FilterMode.Bilinear, colorFormat: GetPostprocessTextureFormat(), - enableRandomWrite: true, useDynamicScale: false, name: $"{id} TAA History" - ); - } - - int historyType = (int)(postDoF ? - HDCameraFrameHistoryType.TemporalAntialiasingPostDoF : HDCameraFrameHistoryType.TemporalAntialiasing); - - next = camera.GetCurrentFrameRT(historyType) - ?? camera.AllocHistoryFrameRT(historyType, Allocator, 2); - previous = camera.GetPreviousFrameRT(historyType); - } - - void GrabVelocityMagnitudeHistoryTextures(HDCamera camera, out RTHandle previous, out RTHandle next) - { - RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) - { - return rtHandleSystem.Alloc( - Vector2.one, TextureXR.slices, DepthBits.None, dimension: TextureXR.dimension, - filterMode: FilterMode.Bilinear, colorFormat: GraphicsFormat.R16_SFloat, - enableRandomWrite: true, useDynamicScale: true, name: $"{id} Velocity magnitude" - ); - } - - next = camera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude) - ?? camera.AllocHistoryFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude, Allocator, 2); - previous = camera.GetPreviousFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude); - } - - void GrabVelocityMagnitudeHistoryTextures(HDCamera camera, out RTHandle previous, out RTHandle next, int width, int height) + void GrabVelocityMagnitudeHistoryTextures(HDCamera camera, Vector2 customScale, out RTHandle previous, out RTHandle next) { RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) { return rtHandleSystem.Alloc( - width, height, TextureXR.slices, DepthBits.None, dimension: TextureXR.dimension, + Vector2.one * customScale, TextureXR.slices, DepthBits.None, dimension: TextureXR.dimension, filterMode: FilterMode.Bilinear, colorFormat: GraphicsFormat.R16_SFloat, enableRandomWrite: true, useDynamicScale: true, name: $"{id} Velocity magnitude" ); @@ -1442,6 +1447,8 @@ class TemporalAntiAliasingData public bool motionVectorRejection; public Vector4 taauParams; public Rect finalViewport; + public Rect prevFinalViewport; + public bool runsTAAU; public TextureHandle source; public TextureHandle destination; @@ -1457,7 +1464,7 @@ class TemporalAntiAliasingData void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, TemporalAntiAliasingData passData, HDCamera camera, TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle sourceTexture, bool postDoF, string outputName) { - passData.resetPostProcessingHistory = camera.resetPostProcessingHistory; + passData.resetPostProcessingHistory = (camera.resetPostProcessingHistory || (m_WillNeedToClearHistoryBuffers.ContainsKey(camera) && m_WillNeedToClearHistoryBuffers[camera])); float minAntiflicker = 0.0f; float maxAntiflicker = 3.5f; @@ -1529,7 +1536,8 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.temporalAAMaterial.EnableKeyword("ENABLE_MV_REJECTION"); } - bool TAAU = DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; + bool TAAU = DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU && !postDoF; + passData.runsTAAU = TAAU; if (TAAU) { passData.temporalAAMaterial.EnableKeyword("TAA_UPSCALE"); @@ -1558,13 +1566,17 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem } RTHandle prevHistory, nextHistory; + Vector2 historyScale = Vector2.one; + if (TAAU) { - GrabTemporalAntialiasingHistoryTextures(camera, out prevHistory, out nextHistory, (int)camera.finalViewport.width, (int)camera.finalViewport.height, postDoF); + historyScale = new Vector2((float)camera.finalViewport.width / camera.actualWidth, (float)camera.finalViewport.height / camera.actualHeight); } - else + + GrabTemporalAntialiasingHistoryTextures(camera, out prevHistory, out nextHistory, historyScale, postDoF); + if (prevHistory == null) { - GrabTemporalAntialiasingHistoryTextures(camera, out prevHistory, out nextHistory, 1, postDoF); + Debug.Log("WUT"); } Vector2Int prevViewPort = camera.historyRTHandleProperties.previousViewportSize; @@ -1585,20 +1597,14 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem // Note: In case we run TAA for a second time (post-dof), we can use the same velocity history (and not write the output) RTHandle prevMVLen, nextMVLen; - if (TAAU) - { - GrabVelocityMagnitudeHistoryTextures(camera, out prevMVLen, out nextMVLen, (int)camera.finalViewport.width, (int)camera.finalViewport.height); - } - else - { - GrabVelocityMagnitudeHistoryTextures(camera, out prevMVLen, out nextMVLen); - } + GrabVelocityMagnitudeHistoryTextures(camera, historyScale, out prevMVLen, out nextMVLen); + passData.prevMVLen = builder.ReadTexture(renderGraph.ImportTexture(prevMVLen)); passData.nextMVLen = (!postDoF) ? builder.WriteTexture(renderGraph.ImportTexture(nextMVLen)) : TextureHandle.nullHandle; TextureHandle dest; - if (DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU && DynamicResolutionHandler.instance.HardwareDynamicResIsEnabled()) + if (TAAU && DynamicResolutionHandler.instance.HardwareDynamicResIsEnabled()) { dest = GetPostprocessUpsampledOutputHandle(renderGraph, outputName); } @@ -1608,6 +1614,7 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem } passData.destination = builder.WriteTexture(dest); + passData.prevFinalViewport = m_PrevFinalViewport.width < 0 ? camera.finalViewport : m_PrevFinalViewport; passData.finalViewport = camera.finalViewport; var resScale = DynamicResolutionHandler.instance.GetCurrentScale(); float stdDev = 0.4f; @@ -1626,6 +1633,8 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, RTHandle source = data.source; RTHandle nextMVLenTexture = data.nextMVLen; RTHandle prevMVLenTexture = data.prevMVLen; + RTHandle prevHistory = (RTHandle)data.prevHistory; + RTHandle nextHistory = (RTHandle)data.nextHistory; if (data.resetPostProcessingHistory) { @@ -1634,8 +1643,8 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, var rtScaleSource = source.rtHandleProperties.rtHandleScale; historyMpb.SetVector(HDShaderIDs._BlitScaleBias, new Vector4(rtScaleSource.x, rtScaleSource.y, 0.0f, 0.0f)); historyMpb.SetFloat(HDShaderIDs._BlitMipLevel, 0); - HDUtils.DrawFullScreen(ctx.cmd, HDUtils.GetBlitMaterial(source.rt.dimension), data.prevHistory, historyMpb, 0); - HDUtils.DrawFullScreen(ctx.cmd, HDUtils.GetBlitMaterial(source.rt.dimension), data.nextHistory, historyMpb, 0); + HDUtils.DrawFullScreen(ctx.cmd, HDUtils.GetBlitMaterial(prevHistory.rt.dimension), data.prevHistory, historyMpb, 0); + HDUtils.DrawFullScreen(ctx.cmd, HDUtils.GetBlitMaterial(nextHistory.rt.dimension), data.nextHistory, historyMpb, 0); } var mpb = ctx.renderGraphPool.GetTempMaterialPropertyBlock(); @@ -1660,7 +1669,19 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, mpb.SetVector(HDShaderIDs._TaaFilterWeights1, data.taaFilterWeights1); mpb.SetVector(HDShaderIDs._TaauParameters, data.taauParams); - CoreUtils.SetRenderTarget(ctx.cmd, data.destination, data.depthBuffer); + Vector4 scales = new Vector4(data.prevFinalViewport.width / ((RTHandle)data.prevHistory).rt.width, data.prevFinalViewport.height / ((RTHandle)data.prevHistory).rt.height, 0, 0); + + mpb.SetVector(HDShaderIDs._TaaScales, scales); + + if (data.runsTAAU) + { + CoreUtils.SetRenderTarget(ctx.cmd, data.destination); + } + else + { + CoreUtils.SetRenderTarget(ctx.cmd, data.destination, data.depthBuffer); + } + ctx.cmd.SetRandomWriteTarget(1, data.nextHistory); if (nextMVLenTexture != null && data.motionVectorRejection) { @@ -1668,7 +1689,7 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, } Rect rect; - if (DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU) + if (data.runsTAAU) { rect = data.finalViewport; HDUtils.DrawFullScreen(ctx.cmd, rect, data.temporalAAMaterial, data.destination, mpb, 2); 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 0274b0e1942..38b7a8f0e23 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -281,6 +281,7 @@ static class HDShaderIDs public static readonly int _TaaFilterWeights = Shader.PropertyToID("_TaaFilterWeights"); public static readonly int _TaaFilterWeights1 = Shader.PropertyToID("_TaaFilterWeights1"); public static readonly int _TaauParameters = Shader.PropertyToID("_TaauParameters"); + public static readonly int _TaaScales = Shader.PropertyToID("_TaaScales"); public static readonly int _WorldSpaceCameraPos1 = Shader.PropertyToID("_WorldSpaceCameraPos1"); public static readonly int _ViewMatrix1 = Shader.PropertyToID("_ViewMatrix1"); From befce33e5efc4d7534758c969728987770516b50 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Mon, 5 Jul 2021 16:59:54 +0200 Subject: [PATCH 13/41] Fixing issues with physical DoF (still an issue with half a texel) --- .../Shaders/TemporalAntiAliasing.shader | 15 ++++++++--- .../Shaders/TemporalAntialiasing.hlsl | 24 ++++++++--------- .../HDRenderPipeline.PostProcess.cs | 27 +++++++++++-------- .../RenderPipeline/HDRenderPipeline.cs | 2 +- 4 files changed, 41 insertions(+), 27 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index d1a6d858c44..5d400746021 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -135,8 +135,18 @@ Shader "Hidden/HDRP/TemporalAA" float4 _TaaScales; +#if defined(TAA_UPSCALE) #define _RTHandleScaleForTAAHistory _TaaScales.xy + #define _RTHandleScaleForTAA _TaaScales.zw +#else + #define _RTHandleScaleForTAAHistory _RTHandlePostProcessScaleHistory.xy + #define _RTHandleScaleForTAA _RTHandlePostProcessScale.xy + + //#define _RTHandleScaleForTAAHistory _RTHandleScaleHistory.zw + //#define _RTHandleScaleForTAA _RTHandleScale.xy + +#endif #if VELOCITY_REJECTION TEXTURE2D_X(_InputVelocityMagnitudeHistory); @@ -147,7 +157,6 @@ Shader "Hidden/HDRP/TemporalAA" #endif #endif - struct Attributes { uint vertexID : SV_VertexID; @@ -224,12 +233,12 @@ Shader "Hidden/HDRP/TemporalAA" // ----------------------------------------------------- // --------------- Gather neigbourhood data --------------- - CTYPE color = Fetch4(_InputTexture, uv, 0.0, _RTHandleScale.xy).CTYPE_SWIZZLE; + CTYPE color = Fetch4(_InputTexture, uv, 0.0, _RTHandleScaleForTAA).CTYPE_SWIZZLE; color = clamp(color, 0, CLAMP_MAX); color = ConvertToWorkingSpace(color); NeighbourhoodSamples samples; - GatherNeighbourhood(_InputTexture, uv, floor(input.positionCS.xy), color, samples); + GatherNeighbourhood(_InputTexture, uv, floor(input.positionCS.xy), color, _RTHandleScaleForTAA, samples); // -------------------------------------------------------- // --------------- Filter central sample --------------- diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index 880fa101e5e..8f13e5af886 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -468,7 +468,7 @@ void ConvertNeighboursToPerceptualSpace(inout NeighbourhoodSamples samples) samples.central.xyz *= PerceptualWeight(samples.central); } -void GatherNeighbourhood(TEXTURE2D_X(InputTexture), float2 UV, float2 positionSS, CTYPE centralColor, out NeighbourhoodSamples samples) +void GatherNeighbourhood(TEXTURE2D_X(InputTexture), float2 UV, float2 positionSS, CTYPE centralColor, float2 rtHandleScale, out NeighbourhoodSamples samples) { samples = (NeighbourhoodSamples)0; @@ -479,8 +479,8 @@ void GatherNeighbourhood(TEXTURE2D_X(InputTexture), float2 UV, float2 positionSS #if WIDE_NEIGHBOURHOOD // Plus shape - samples.neighbours[0] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, float2(0.0f, quadOffset.y), _RTHandleScale.xy).CTYPE_SWIZZLE); - samples.neighbours[1] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, float2(quadOffset.x, 0.0f), _RTHandleScale.xy).CTYPE_SWIZZLE); + samples.neighbours[0] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, float2(0.0f, quadOffset.y), rtHandleScale).CTYPE_SWIZZLE); + samples.neighbours[1] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, float2(quadOffset.x, 0.0f), rtHandleScale).CTYPE_SWIZZLE); samples.neighbours[2] = QuadReadColorAcrossX(centralColor, positionSS); samples.neighbours[3] = QuadReadColorAcrossY(centralColor, positionSS); @@ -490,10 +490,10 @@ void GatherNeighbourhood(TEXTURE2D_X(InputTexture), float2 UV, float2 positionSS int2 offset2 = int2(quadOffset.x, -quadOffset.y); int2 offset3 = quadOffset; - samples.neighbours[4] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset1, _RTHandleScale.xy).CTYPE_SWIZZLE); - samples.neighbours[5] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset2, _RTHandleScale.xy).CTYPE_SWIZZLE); - samples.neighbours[6] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset3, _RTHandleScale.xy).CTYPE_SWIZZLE); - samples.neighbours[7] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, fastOffset, _RTHandleScale.xy).CTYPE_SWIZZLE); /* TODO: Why is this not good? QuadReadColorAcrossDiagonal(centralColor, positionSS); */ + samples.neighbours[4] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset1, rtHandleScale).CTYPE_SWIZZLE); + samples.neighbours[5] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset2, rtHandleScale).CTYPE_SWIZZLE); + samples.neighbours[6] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset3, rtHandleScale).CTYPE_SWIZZLE); + samples.neighbours[7] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, fastOffset, rtHandleScale).CTYPE_SWIZZLE); /* TODO: Why is this not good? QuadReadColorAcrossDiagonal(centralColor, positionSS); */ #ifdef UPSAMPLE samples.offsets[0] = float2(0.0f, quadOffset.y); @@ -510,8 +510,8 @@ void GatherNeighbourhood(TEXTURE2D_X(InputTexture), float2 UV, float2 positionSS #if SMALL_NEIGHBOURHOOD_SHAPE == PLUS - samples.neighbours[0] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, float2(0.0f, quadOffset.y), _RTHandleScale.xy).CTYPE_SWIZZLE); - samples.neighbours[1] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, float2(quadOffset.x, 0.0f), _RTHandleScale.xy).CTYPE_SWIZZLE); + samples.neighbours[0] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, float2(0.0f, quadOffset.y), rtHandleScale).CTYPE_SWIZZLE); + samples.neighbours[1] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, float2(quadOffset.x, 0.0f), rtHandleScale).CTYPE_SWIZZLE); samples.neighbours[2] = QuadReadColorAcrossX(centralColor, positionSS); samples.neighbours[3] = QuadReadColorAcrossY(centralColor, positionSS); @@ -522,9 +522,9 @@ void GatherNeighbourhood(TEXTURE2D_X(InputTexture), float2 UV, float2 positionSS int2 offset2 = int2(quadOffset.x, -quadOffset.y); int2 offset3 = quadOffset; - samples.neighbours[0] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset1, _RTHandleScale.xy).CTYPE_SWIZZLE); - samples.neighbours[1] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset2, _RTHandleScale.xy).CTYPE_SWIZZLE); - samples.neighbours[2] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset3, _RTHandleScale.xy).CTYPE_SWIZZLE); + samples.neighbours[0] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset1, rtHandleScale).CTYPE_SWIZZLE); + samples.neighbours[1] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset2, rtHandleScale).CTYPE_SWIZZLE); + samples.neighbours[2] = ConvertToWorkingSpace(Fetch4(InputTexture, UV, offset3, rtHandleScale).CTYPE_SWIZZLE); samples.neighbours[3] = QuadReadColorAcrossDiagonal(centralColor, positionSS); #endif // SMALL_NEIGHBOURHOOD_SHAPE == 4 diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index cb5523febf7..d71cb450769 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1448,6 +1448,7 @@ class TemporalAntiAliasingData public Vector4 taauParams; public Rect finalViewport; public Rect prevFinalViewport; + public Vector4 taaScales; public bool runsTAAU; public TextureHandle source; @@ -1536,9 +1537,9 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.temporalAAMaterial.EnableKeyword("ENABLE_MV_REJECTION"); } - bool TAAU = DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU && !postDoF; + bool TAAU = DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; passData.runsTAAU = TAAU; - if (TAAU) + if (TAAU && !postDoF) { passData.temporalAAMaterial.EnableKeyword("TAA_UPSCALE"); } @@ -1574,10 +1575,6 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem } GrabTemporalAntialiasingHistoryTextures(camera, out prevHistory, out nextHistory, historyScale, postDoF); - if (prevHistory == null) - { - Debug.Log("WUT"); - } Vector2Int prevViewPort = camera.historyRTHandleProperties.previousViewportSize; passData.previousScreenSize = new Vector4(prevViewPort.x, prevViewPort.y, 1.0f / prevViewPort.x, 1.0f / prevViewPort.y); @@ -1599,7 +1596,6 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem RTHandle prevMVLen, nextMVLen; GrabVelocityMagnitudeHistoryTextures(camera, historyScale, out prevMVLen, out nextMVLen); - passData.prevMVLen = builder.ReadTexture(renderGraph.ImportTexture(prevMVLen)); passData.nextMVLen = (!postDoF) ? builder.WriteTexture(renderGraph.ImportTexture(nextMVLen)) : TextureHandle.nullHandle; @@ -1615,6 +1611,18 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.destination = builder.WriteTexture(dest); passData.prevFinalViewport = m_PrevFinalViewport.width < 0 ? camera.finalViewport : m_PrevFinalViewport; + var mainRTScales = RTHandles.CalculateRatioAgainstMaxSize(camera.actualWidth, camera.actualHeight); + + if (TAAU && postDoF) + { + // We are already upsampled here. + // mainRTScales = RTHandles.CalculateRatioAgainstMaxSize((int)camera.finalViewport.width, (int)camera.finalViewport.height); + //mainRTScales.x = camera.finalViewport.width / ((RTHandle)dest).rt.width; + //mainRTScales.y = camera.finalViewport.height / ((RTHandle)dest).rt.height; + } + Vector4 scales = new Vector4(passData.prevFinalViewport.width / prevHistory.rt.width, passData.prevFinalViewport.height / prevHistory.rt.height, mainRTScales.x, mainRTScales.y); + passData.taaScales = scales; + passData.finalViewport = camera.finalViewport; var resScale = DynamicResolutionHandler.instance.GetCurrentScale(); float stdDev = 0.4f; @@ -1668,10 +1676,7 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, mpb.SetVector(HDShaderIDs._TaaFilterWeights, data.taaFilterWeights); mpb.SetVector(HDShaderIDs._TaaFilterWeights1, data.taaFilterWeights1); mpb.SetVector(HDShaderIDs._TaauParameters, data.taauParams); - - Vector4 scales = new Vector4(data.prevFinalViewport.width / ((RTHandle)data.prevHistory).rt.width, data.prevFinalViewport.height / ((RTHandle)data.prevHistory).rt.height, 0, 0); - - mpb.SetVector(HDShaderIDs._TaaScales, scales); + mpb.SetVector(HDShaderIDs._TaaScales, data.taaScales); if (data.runsTAAU) { 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 db2b781170c..34641e10d49 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -1167,7 +1167,7 @@ protected override void Render(ScriptableRenderContext renderContext, Camera[] c } dynResHandler.SetCurrentCameraRequest(cameraRequestedDynamicRes); - dynResHandler.runUpscalerFilterOnFullResolution = hdCam != null && hdCam.cameraCanRenderDLSS; + dynResHandler.runUpscalerFilterOnFullResolution = (hdCam != null && hdCam.cameraCanRenderDLSS) || DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; RTHandles.SetHardwareDynamicResolutionState(dynResHandler.HardwareDynamicResIsEnabled()); From 003084f5d1124f228a4ddf4c85839964c4057582 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Mon, 5 Jul 2021 18:34:55 +0200 Subject: [PATCH 14/41] Fix some misc issues with physically based dof --- .../Shaders/TemporalAntiAliasing.shader | 10 ------ .../Runtime/RenderPipeline/Camera/HDCamera.cs | 4 +++ .../HDRenderPipeline.PostProcess.cs | 36 ++++++------------- 3 files changed, 15 insertions(+), 35 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index 5d400746021..dd888a10254 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -135,19 +135,9 @@ Shader "Hidden/HDRP/TemporalAA" float4 _TaaScales; -#if defined(TAA_UPSCALE) #define _RTHandleScaleForTAAHistory _TaaScales.xy #define _RTHandleScaleForTAA _TaaScales.zw -#else - #define _RTHandleScaleForTAAHistory _RTHandlePostProcessScaleHistory.xy - #define _RTHandleScaleForTAA _RTHandlePostProcessScale.xy - - //#define _RTHandleScaleForTAAHistory _RTHandleScaleHistory.zw - //#define _RTHandleScaleForTAA _RTHandleScale.xy - -#endif - #if VELOCITY_REJECTION TEXTURE2D_X(_InputVelocityMagnitudeHistory); #ifdef SHADER_API_PSSL diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 49f211a2489..144c70fc99a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -115,6 +115,10 @@ public struct ViewConstants internal bool dofHistoryIsValid = false; // used to invalidate DoF accumulation history when switching DoF modes + // State needed to handle TAAU. + internal bool previousFrameWasTAAUpsampled = false; + internal bool needToReleasePostProcessHistory = false; + // Pass all the systems that may want to initialize per-camera data here. // That way you will never create an HDCamera and forget to initialize the data. /// diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 0ada43f7316..ac50c25deb3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -453,7 +453,7 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, renderGraph.BeginProfilingSampler(ProfilingSampler.Get(HDProfileId.PostProcessing)); - if (m_WillNeedToClearHistoryBuffers.ContainsKey(hdCamera) && m_WillNeedToClearHistoryBuffers[hdCamera]) + if (hdCamera.needToReleasePostProcessHistory) { ReleasePostProcessHistoryBuffers(hdCamera); } @@ -498,7 +498,6 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, if (DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU) { SetCurrentResolutionGroup(renderGraph, hdCamera, ResolutionGroup.AfterDynamicResUpscale); - m_PrevFinalViewport = hdCamera.finalViewport; } } else if (hdCamera.antialiasing == HDAdditionalCameraData.AntialiasingMode.SubpixelMorphologicalAntiAliasing) @@ -545,25 +544,12 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, FinalPass(renderGraph, hdCamera, afterPostProcessBuffer, alphaTexture, dest, source, m_BlueNoise, flipYInPostProcess); bool currFrameIsTAAUpsampled = DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; - bool cameraWasRunningTAA = false; - if (m_WasRunningTAAU.ContainsKey(hdCamera)) - { - cameraWasRunningTAA = m_WasRunningTAAU[hdCamera]; - m_WasRunningTAAU[hdCamera] = currFrameIsTAAUpsampled; - } - else - { - m_WasRunningTAAU.Add(hdCamera, currFrameIsTAAUpsampled); - } + bool cameraWasRunningTAA = hdCamera.previousFrameWasTAAUpsampled; + hdCamera.previousFrameWasTAAUpsampled = currFrameIsTAAUpsampled; - if (m_WillNeedToClearHistoryBuffers.ContainsKey(hdCamera)) - { - m_WillNeedToClearHistoryBuffers[hdCamera] = (cameraWasRunningTAA != currFrameIsTAAUpsampled); - } - else - { - m_WillNeedToClearHistoryBuffers.Add(hdCamera, (cameraWasRunningTAA != currFrameIsTAAUpsampled)); - } + hdCamera.needToReleasePostProcessHistory = (cameraWasRunningTAA != currFrameIsTAAUpsampled); + + m_PrevFinalViewport = hdCamera.finalViewport; renderGraph.EndProfilingSampler(ProfilingSampler.Get(HDProfileId.PostProcessing)); @@ -1465,7 +1451,7 @@ class TemporalAntiAliasingData void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, TemporalAntiAliasingData passData, HDCamera camera, TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle sourceTexture, bool postDoF, string outputName) { - passData.resetPostProcessingHistory = (camera.resetPostProcessingHistory || (m_WillNeedToClearHistoryBuffers.ContainsKey(camera) && m_WillNeedToClearHistoryBuffers[camera])); + passData.resetPostProcessingHistory = (camera.resetPostProcessingHistory || camera.needToReleasePostProcessHistory); float minAntiflicker = 0.0f; float maxAntiflicker = 3.5f; @@ -1613,14 +1599,14 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.prevFinalViewport = m_PrevFinalViewport.width < 0 ? camera.finalViewport : m_PrevFinalViewport; var mainRTScales = RTHandles.CalculateRatioAgainstMaxSize(camera.actualWidth, camera.actualHeight); + var historyRenderingViewport = TAAU ? new Vector2(passData.prevFinalViewport.width, passData.prevFinalViewport.height) : camera.historyRTHandleProperties.previousViewportSize; if (TAAU && postDoF) { // We are already upsampled here. - // mainRTScales = RTHandles.CalculateRatioAgainstMaxSize((int)camera.finalViewport.width, (int)camera.finalViewport.height); - //mainRTScales.x = camera.finalViewport.width / ((RTHandle)dest).rt.width; - //mainRTScales.y = camera.finalViewport.height / ((RTHandle)dest).rt.height; + mainRTScales = RTHandles.CalculateRatioAgainstMaxSize((int)camera.finalViewport.width, (int)camera.finalViewport.height); } - Vector4 scales = new Vector4(passData.prevFinalViewport.width / prevHistory.rt.width, passData.prevFinalViewport.height / prevHistory.rt.height, mainRTScales.x, mainRTScales.y); + Vector4 scales = new Vector4(historyRenderingViewport.x / prevHistory.rt.width, historyRenderingViewport.y / prevHistory.rt.height, mainRTScales.x, mainRTScales.y); + passData.taaScales = scales; passData.finalViewport = camera.finalViewport; From 649ae73b8e012e15d0505e17faaeb4c7a5f738a4 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 6 Jul 2021 10:08:56 +0200 Subject: [PATCH 15/41] Fix for switches --- .../Shaders/TemporalAntiAliasing.shader | 28 +++++++++ .../Runtime/RenderPipeline/Camera/HDCamera.cs | 1 - .../HDRenderPipeline.PostProcess.cs | 62 ++++++++++--------- 3 files changed, 61 insertions(+), 30 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index dd888a10254..a10dbd107e1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -330,6 +330,24 @@ Shader "Hidden/HDRP/TemporalAA" outColor = Fetch4(_InputTexture, uv, 0.0, _RTHandleScale.xy).CTYPE_SWIZZLE; } + + void FragCopyHistory(Varyings input, out CTYPE outColor : SV_Target0) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + float2 jitter = _TaaJitterStrength.zw; + float2 uv = input.texcoord; + +#ifdef TAA_UPSCALE + float2 outputPixInInput = input.texcoord * _InputSize.xy - _TaaJitterStrength.xy; + + uv = _InputSize.zw * (0.5f + floor(outputPixInInput)); +#endif + CTYPE color = Fetch4(_InputTexture, uv, 0.0, _RTHandleScaleForTAA).CTYPE_SWIZZLE; + + outColor = color; + } + ENDHLSL SubShader @@ -387,6 +405,16 @@ Shader "Hidden/HDRP/TemporalAA" ENDHLSL } + Pass // Copy history + { + ZWrite Off ZTest Always Blend Off Cull Off + + HLSLPROGRAM + #pragma vertex Vert + #pragma fragment FragCopyHistory + ENDHLSL + } + } Fallback Off } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 144c70fc99a..8f9c3850621 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -117,7 +117,6 @@ public struct ViewConstants // State needed to handle TAAU. internal bool previousFrameWasTAAUpsampled = false; - internal bool needToReleasePostProcessHistory = false; // Pass all the systems that may want to initialize per-camera data here. // That way you will never create an HDCamera and forget to initialize the data. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index ac50c25deb3..30c1fc586f2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -269,14 +269,6 @@ bool PostProcessEnableAlpha() return m_EnableAlpha; } - void ReleasePostProcessHistoryBuffers(HDCamera camera) - { - camera.ReleaseHistoryFrameRT((int)HDCameraFrameHistoryType.TemporalAntialiasing); - camera.ReleaseHistoryFrameRT((int)HDCameraFrameHistoryType.TemporalAntialiasingPostDoF); - camera.ReleaseHistoryFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude); - camera.ReleaseHistoryFrameRT((int)HDCameraFrameHistoryType.DepthOfFieldCoC); - } - void CleanupPostProcess() { RTHandles.Release(m_EmptyExposureTexture); @@ -453,11 +445,6 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, renderGraph.BeginProfilingSampler(ProfilingSampler.Get(HDProfileId.PostProcessing)); - if (hdCamera.needToReleasePostProcessHistory) - { - ReleasePostProcessHistoryBuffers(hdCamera); - } - var source = inputColor; var depthBuffer = prepassOutput.resolvedDepthBuffer; var depthBufferMipChain = prepassOutput.depthPyramidTexture; @@ -547,7 +534,7 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, bool cameraWasRunningTAA = hdCamera.previousFrameWasTAAUpsampled; hdCamera.previousFrameWasTAAUpsampled = currFrameIsTAAUpsampled; - hdCamera.needToReleasePostProcessHistory = (cameraWasRunningTAA != currFrameIsTAAUpsampled); + hdCamera.resetPostProcessingHistory = (cameraWasRunningTAA != currFrameIsTAAUpsampled); m_PrevFinalViewport = hdCamera.finalViewport; @@ -1451,7 +1438,7 @@ class TemporalAntiAliasingData void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, TemporalAntiAliasingData passData, HDCamera camera, TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle sourceTexture, bool postDoF, string outputName) { - passData.resetPostProcessingHistory = (camera.resetPostProcessingHistory || camera.needToReleasePostProcessHistory); + passData.resetPostProcessingHistory = camera.resetPostProcessingHistory; float minAntiflicker = 0.0f; float maxAntiflicker = 3.5f; @@ -1460,7 +1447,9 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem // The anti flicker becomes much more aggressive on higher values float temporalContrastForMaxAntiFlicker = 0.7f - Mathf.Lerp(0.0f, 0.3f, Mathf.SmoothStep(0.5f, 1.0f, camera.taaAntiFlicker)); - passData.taaParameters = new Vector4(camera.taaHistorySharpening, postDoF ? maxAntiflicker : Mathf.Lerp(minAntiflicker, maxAntiflicker, camera.taaAntiFlicker), motionRejectionMultiplier, temporalContrastForMaxAntiFlicker); + bool TAAU = DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; + + passData.taaParameters = new Vector4(TAAU && postDoF ? 0.25f : camera.taaHistorySharpening, postDoF ? maxAntiflicker : Mathf.Lerp(minAntiflicker, maxAntiflicker, camera.taaAntiFlicker), motionRejectionMultiplier, temporalContrastForMaxAntiFlicker); // Precompute weights used for the Blackman-Harris filter. @@ -1523,7 +1512,6 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.temporalAAMaterial.EnableKeyword("ENABLE_MV_REJECTION"); } - bool TAAU = DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; passData.runsTAAU = TAAU; if (TAAU && !postDoF) { @@ -1562,6 +1550,7 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem GrabTemporalAntialiasingHistoryTextures(camera, out prevHistory, out nextHistory, historyScale, postDoF); + Vector2Int prevViewPort = camera.historyRTHandleProperties.previousViewportSize; passData.previousScreenSize = new Vector4(prevViewPort.x, prevViewPort.y, 1.0f / prevViewPort.x, 1.0f / prevViewPort.y); if (TAAU) @@ -1596,17 +1585,20 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem } passData.destination = builder.WriteTexture(dest); - passData.prevFinalViewport = m_PrevFinalViewport.width < 0 ? camera.finalViewport : m_PrevFinalViewport; + bool needToUseCurrFrameSizeForHistory = camera.resetPostProcessingHistory || TAAU != camera.previousFrameWasTAAUpsampled; + + passData.prevFinalViewport = (m_PrevFinalViewport.width < 0 || needToUseCurrFrameSizeForHistory) ? camera.finalViewport : m_PrevFinalViewport; var mainRTScales = RTHandles.CalculateRatioAgainstMaxSize(camera.actualWidth, camera.actualHeight); - var historyRenderingViewport = TAAU ? new Vector2(passData.prevFinalViewport.width, passData.prevFinalViewport.height) : camera.historyRTHandleProperties.previousViewportSize; + var historyRenderingViewport = TAAU ? new Vector2(passData.prevFinalViewport.width, passData.prevFinalViewport.height) : + (needToUseCurrFrameSizeForHistory ? RTHandles.rtHandleProperties.currentViewportSize : camera.historyRTHandleProperties.previousViewportSize); + if (TAAU && postDoF) { // We are already upsampled here. mainRTScales = RTHandles.CalculateRatioAgainstMaxSize((int)camera.finalViewport.width, (int)camera.finalViewport.height); } Vector4 scales = new Vector4(historyRenderingViewport.x / prevHistory.rt.width, historyRenderingViewport.y / prevHistory.rt.height, mainRTScales.x, mainRTScales.y); - passData.taaScales = scales; passData.finalViewport = camera.finalViewport; @@ -1630,15 +1622,27 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, RTHandle prevHistory = (RTHandle)data.prevHistory; RTHandle nextHistory = (RTHandle)data.nextHistory; + const int taaPass = 0; + const int excludeTaaPass = 1; + const int taauPass = 2; + const int copyHistoryPass = 3; + if (data.resetPostProcessingHistory) { var historyMpb = ctx.renderGraphPool.GetTempMaterialPropertyBlock(); - historyMpb.SetTexture(HDShaderIDs._BlitTexture, source); - var rtScaleSource = source.rtHandleProperties.rtHandleScale; - historyMpb.SetVector(HDShaderIDs._BlitScaleBias, new Vector4(rtScaleSource.x, rtScaleSource.y, 0.0f, 0.0f)); - historyMpb.SetFloat(HDShaderIDs._BlitMipLevel, 0); - HDUtils.DrawFullScreen(ctx.cmd, HDUtils.GetBlitMaterial(prevHistory.rt.dimension), data.prevHistory, historyMpb, 0); - HDUtils.DrawFullScreen(ctx.cmd, HDUtils.GetBlitMaterial(nextHistory.rt.dimension), data.nextHistory, historyMpb, 0); + historyMpb.SetTexture(HDShaderIDs._InputTexture, source); + historyMpb.SetVector(HDShaderIDs._TaaScales, data.taaScales); + if (data.runsTAAU) + { + Rect r = data.finalViewport; + HDUtils.DrawFullScreen(ctx.cmd, r, data.temporalAAMaterial, data.prevHistory, historyMpb, copyHistoryPass); + HDUtils.DrawFullScreen(ctx.cmd, r, data.temporalAAMaterial, data.nextHistory, historyMpb, copyHistoryPass); + } + else + { + HDUtils.DrawFullScreen(ctx.cmd, data.temporalAAMaterial, data.prevHistory, historyMpb, copyHistoryPass); + HDUtils.DrawFullScreen(ctx.cmd, data.temporalAAMaterial, data.nextHistory, historyMpb, copyHistoryPass); + } } var mpb = ctx.renderGraphPool.GetTempMaterialPropertyBlock(); @@ -1683,12 +1687,12 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, if (data.runsTAAU) { rect = data.finalViewport; - HDUtils.DrawFullScreen(ctx.cmd, rect, data.temporalAAMaterial, data.destination, mpb, 2); + HDUtils.DrawFullScreen(ctx.cmd, rect, data.temporalAAMaterial, data.destination, mpb, taauPass); } else { - ctx.cmd.DrawProcedural(Matrix4x4.identity, data.temporalAAMaterial, 0, MeshTopology.Triangles, 3, 1, mpb); - ctx.cmd.DrawProcedural(Matrix4x4.identity, data.temporalAAMaterial, 1, MeshTopology.Triangles, 3, 1, mpb); + ctx.cmd.DrawProcedural(Matrix4x4.identity, data.temporalAAMaterial, taaPass, MeshTopology.Triangles, 3, 1, mpb); + ctx.cmd.DrawProcedural(Matrix4x4.identity, data.temporalAAMaterial, excludeTaaPass, MeshTopology.Triangles, 3, 1, mpb); } ctx.cmd.ClearRandomWriteTargets(); }); From ea19fd8fa5bd27aeaa9eed037f84f1fcd8ddd9ae Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 6 Jul 2021 11:01:27 +0200 Subject: [PATCH 16/41] UX stuff --- .../Camera/HDCameraUI.Rendering.Drawers.cs | 13 ++++++++++++- .../Camera/HDCameraUI.Rendering.Skin.cs | 2 ++ .../Shaders/TemporalAntialiasing.hlsl | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Drawers.cs index 1b6bbb43712..f01d176fb20 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Drawers.cs @@ -15,6 +15,8 @@ enum AdditionalProperties Rendering = 1 << 5, } readonly static AdditionalPropertiesState k_AdditionalPropertiesState = new AdditionalPropertiesState(0, "HDRP"); + static bool s_IsRunningTAAU = false; + public static readonly CED.IDrawer RenderingDrawer = CED.Group( CED.Group( @@ -70,6 +72,12 @@ static void Drawer_Rendering_AllowDynamicResolution(SerializedHDCamera p, Editor { CameraUI.Output.Drawer_Output_AllowDynamicResolution(p, owner); + var dynamicResSettings = HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.dynamicResolutionSettings; + s_IsRunningTAAU = p.allowDynamicResolution.boolValue && dynamicResSettings.upsampleFilter == UnityEngine.Rendering.DynamicResUpscaleFilter.TAAU && dynamicResSettings.enabled; + + if (s_IsRunningTAAU) + EditorGUILayout.HelpBox(Styles.taauInfoBox, MessageType.Info); + #if ENABLE_NVIDIA && ENABLE_NVIDIA_MODULE EditorGUI.indentLevel++; Drawer_Draw_DLSS_Section(p, owner); @@ -158,7 +166,7 @@ static void Drawer_Rendering_Antialiasing(SerializedHDCamera p, Editor owner) static CED.IDrawer AntialiasingModeDrawer(HDAdditionalCameraData.AntialiasingMode antialiasingMode, CED.ActionDrawer antialiasingDrawer) { return CED.Conditional( - (serialized, owner) => serialized.antialiasing.intValue == (int)antialiasingMode, + (serialized, owner) => (serialized.antialiasing.intValue == (int)antialiasingMode) && (s_IsRunningTAAU ? serialized.antialiasing.intValue == (int)HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing : true), CED.Group( GroupOption.Indent, antialiasingDrawer @@ -179,6 +187,9 @@ static void Draw_Rendering_Antialiasing_TAA_Advanced(SerializedHDCamera p, Edito static void Drawer_Rendering_Antialiasing_TAA(SerializedHDCamera p, Editor owner) { EditorGUILayout.PropertyField(p.taaQualityLevel, Styles.TAAQualityLevel); + if (s_IsRunningTAAU) + p.taaQualityLevel.intValue = (int)HDAdditionalCameraData.TAAQualityLevel.High; + EditorGUILayout.PropertyField(p.taaSharpenStrength, Styles.TAASharpen); if (p.taaQualityLevel.intValue > (int)HDAdditionalCameraData.TAAQualityLevel.Low) diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Skin.cs index ec2e1e02026..d05094dac56 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Skin.cs @@ -28,6 +28,8 @@ class Styles public static readonly GUIContent exposureTarget = EditorGUIUtility.TrTextContent("Exposure Target", "The object used as a target for centering the Exposure's Procedural Mask metering mode when target object option is set (See Exposure Volume Component)."); public static readonly GUIContent allowDynamicResolution = EditorGUIUtility.TrTextContent("Allow Dynamic Resolution", "Whether to support dynamic resolution."); + public const string taauInfoBox = "When TAA Upsample is enabled, TAA is run as antialiasing algorithm and uses High Quality as base, to select other anti-aliasing methods please change upscale filter for dynamic resolution."; + public const string DLSSFeatureDetectedMsg = "Unity detected NVIDIA Deep Learning Super Sampling and will ignore the Fallback Anti Aliasing Method."; public const string DLSSFeatureNotDetectedMsg = "Unity cannot detect NVIDIA Deep Learning Super Sampling and will use the Fallback Anti Aliasing Method instead."; public const string DLSSNotEnabledInQualityAsset = "The quality asset in this project does not have NVIDIA Deep Learning Super Sampling (DLSS) enabled. DLSS will not be running on this camera."; diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index 8f13e5af886..31044a8d45f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -778,7 +778,7 @@ CTYPE SharpenColor(NeighbourhoodSamples samples, CTYPE color, float sharpenStren linearC = ConvertToWorkingSpace(linearC); #else - linearC = linearC + (linearC - linearAvg) * sharpenStrength * 3; + linearC = linearC + max(0,(linearC - linearAvg)) * sharpenStrength * 3; linearC = clamp(linearC, 0, CLAMP_MAX); #endif CTYPE outputSharpened = linearC * PerceptualWeight(linearC); From 9e2d9f59aed1dc7ddbf16f8bfdcdaffc547fafe0 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 6 Jul 2021 11:20:56 +0200 Subject: [PATCH 17/41] Super basic documentation. --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 4 ++++ .../Documentation~/HDRP-Camera.md | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index c5ee349f42b..92c4f5a453a 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -77,6 +77,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added support for reflection probes as a fallback for ray traced reflections (case 1338644). - Added a minimum motion vector length to the motion vector debug view. - Added a better support for LODs in the ray tracing acceleration structure. +- Added Blend factor control for TAA. +- Added Experimental Temporal Upscaling. ### Fixed - Fixed Intensity Multiplier not affecting realtime global illumination. @@ -369,6 +371,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Hair uses GGX LTC for area light specular. - Moved invariants outside of loop for a minor CPU speedup in the light loop code. - Various improvements to the volumetric clouds. +- Slightly improved TAA flickering. +- Reduced ringing of TAA sharpening. ## [11.0.0] - 2020-10-21 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Camera.md b/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Camera.md index 2a2d88e251e..c1ac3d195b3 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Camera.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Camera.md @@ -59,7 +59,7 @@ The Camera Inspector includes the following groups of properties: | |**Use Custom Attributes** | Enable this property to make this Camera override the DLSS attributes specified in the [HDRP Asset](HDRP-Asset.md). | | |**Use Optimal Settings** | Enable this property to allow DLSS to automatically control the sharpness and screen percentage for this Camera. This property only appears if you enable **Use Custom Attributes**. | | |**Sharpness** | The pixel sharpness that the DLSS upscaler uses for this Camera.
This property only appears if you enable **Use Custom Attributes**. | -| **Post Anti-aliasing** || This Camera can use [multisample anti-aliasing (MSAA)](Anti-Aliasing.md#MSAA), at the same time as post-process anti-aliasing. This is because MSAA is a hardware feature. To control post-process anti-aliasing, use the [Frame Settings](Frame-Settings.md).
• **No Anti-aliasing**: This Camera processes MSAA but does not process any post-process anti-aliasing.
• **Fast Approximate Anti-aliasing (FXAA)**: Smooths edges on a per-pixel level. This is the most efficient anti-aliasing technique in HDRP.
• **Temporal Anti-aliasing (TAA)**: Uses frames from a history buffer to smooth edges more effectively than fast approximate anti-aliasing.
• **Subpixel Morphological Anti-aliasing (SMAA)**: Finds patterns in borders of the image and blends the pixels on these borders according to the pattern. || +| **Post Anti-aliasing** || This Camera can use [multisample anti-aliasing (MSAA)](Anti-Aliasing.md#MSAA), at the same time as post-process anti-aliasing. This is because MSAA is a hardware feature. To control post-process anti-aliasing, use the [Frame Settings](Frame-Settings.md).
• **No Anti-aliasing**: This Camera processes MSAA but does not process any post-process anti-aliasing.
• **Fast Approximate Anti-aliasing (FXAA)**: Smooths edges on a per-pixel level. This is the most efficient anti-aliasing technique in HDRP.
• **Temporal Anti-aliasing (TAA)**: Uses frames from a history buffer to smooth edges more effectively than fast approximate anti-aliasing.
• **Subpixel Morphological Anti-aliasing (SMAA)**: Finds patterns in borders of the image and blends the pixels on these borders according to the pattern. | || **SMAA Quality Preset** | Use the drop-down to select the quality of SMAA. The difference in resource intensity is small between **Low** and **High**.
• **Low**: The lowest SMAA quality. This is the least resource-intensive option.
• **Medium**: A good balance between SMAA quality and resource intensity.
• **High**: The highest SMAA quality. This is the most resource-intensive option.This property only appears when you select **Subpixel Morphological Anti-aliasing (SMAA)** from the **Anti-aliasing** drop-down. | | |**TAA Quality Preset** | The quality level of TAA. The default settings for higher presets are not guaranteed to produce better results than lower presets. The result depends on the content in your scene. However, the high quality presets give you more options that you can use to adapt the anti-aliasing to your content. | | |**TAA Sharpen Strength** | The intensity of the sharpening filter that Unity applies to the result of TAA. This reduces the soft look that TAA can produce. High values can cause ringing issues (dark lines along the edges of geometry) | @@ -67,6 +67,7 @@ The Camera Inspector includes the following groups of properties: | |**TAA Anti-flickering** | The strength of TAA's anti-flickering effect. Use this to reduce some cases of flickering. When you increase this value, the risk o [ghosting](Glossary.md#Ghosting) or [disocclusion](Glossary.md#Disocclusion) artifacts.
This property is only visible when **TAA Quality Preset** is set to a value above **Low**. | | |**TAA Speed rejection** | Controls the threshold at which Unity rejects history buffer contribution for TAA. You can increase this value to remove ghosting artifacts. This works because Unity rejects history buffer contribution when a GameObject's current speed and reprojected speed history are very different. When you increase this value, it might also reintroduce some aliasing for fast-moving GameObjects. Controls the threshold at which Unity rejects history buffer contribution for TAA. Increasing this value can help to remove ghosting artifacts because Unity rejects history buffer contribution when a GameObject's current speed and reprojected speed history are very different. While this can be effective in reducing ghosting, it might also reintroduce some aliasing for fast-moving GameObject. When you set this value to 0, it increases the performance of TAA because Unity does not process speed rejection. | | |**TAA Anti-ringing** | Enable this property to reduce the ringing artifacts caused by high history sharpening values. When you enable this property, it reduces the effect of the history sharpening. This property is only visible when TAA Quality Preset is set to High. | +| |**TAA Base blend factor** | Determines how much the history buffer is blended together with current frame result. Higher values means more history contribution, which leads to better anti aliasing, but also more prone to ghosting.
This property is only visible when Advanced properties are displayed for the camera. | | **Dithering** | |Enable the checkbox to apply 8-bit dithering to the final render. This can help reduce banding on wide gradients and low light areas. | | **Stop NaNs** | |Enable the checkbox to make this Camera replace values that are not a number (NaN) with a black pixel. This stops certain effects from breaking, but is a resource-intensive process. Only enable this feature if you experience NaN issues that you can not fix. | | **Culling Mask** | |Use the drop-down to set the Layer Mask that the Camera uses to exclude GameObjects from the rendering process. The Camera only renders Layers that you include in the Layer Mask. | From b0fd4c6ca4c079c19f33629a7710a47a283cba24 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 6 Jul 2021 11:31:17 +0200 Subject: [PATCH 18/41] Missing 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 92c4f5a453a..f123eebada0 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -373,6 +373,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Various improvements to the volumetric clouds. - Slightly improved TAA flickering. - Reduced ringing of TAA sharpening. +- Improved TAA High quality central color filtering. ## [11.0.0] - 2020-10-21 From 974b5d76aa4269fbe1d0407d16653b813a39e316 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 6 Jul 2021 12:09:04 +0200 Subject: [PATCH 19/41] Fix confidence factor (remove a tmp test I did and committed) --- .../Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl | 2 +- .../Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index 31044a8d45f..7c99899cefb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -798,7 +798,7 @@ CTYPE SharpenColor(NeighbourhoodSamples samples, CTYPE color, float sharpenStren float BoxKernelConfidence(float2 inputToOutputVec, float confidenceThreshold) { // Binary (TODO: Smooth it?) - float confidenceScore = dot(inputToOutputVec, inputToOutputVec) < (confidenceThreshold); + float confidenceScore = abs(inputToOutputVec.x) <= confidenceThreshold && abs(inputToOutputVec.y) <= confidenceThreshold; return confidenceScore; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 30c1fc586f2..fe6342ee1df 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1604,7 +1604,7 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.finalViewport = camera.finalViewport; var resScale = DynamicResolutionHandler.instance.GetCurrentScale(); float stdDev = 0.4f; - passData.taauParams = new Vector4(1.0f / (stdDev * stdDev), 1.0f / resScale, 0.5f * resScale * resScale, resScale); + passData.taauParams = new Vector4(1.0f / (stdDev * stdDev), 1.0f / resScale, 0.5f / resScale, resScale); } TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle sourceTexture, bool postDoF, string outputName) From a29eb8eb958c92a952d19c8a4ce2b32038ab98a7 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 6 Jul 2021 15:12:57 +0200 Subject: [PATCH 20/41] Add comment --- .../PostProcessing/Shaders/TemporalAntiAliasing.shader | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index a10dbd107e1..127a20eab20 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -135,6 +135,11 @@ Shader "Hidden/HDRP/TemporalAA" float4 _TaaScales; + // NOTE: We need to define custom scales instead of using the default ones for several reasons. + // 1- This shader is shared by TAA and Temporal Upscaling, having a single scale defined in C# instead helps readability. + // 2- Especially with history, when doing temporal upscaling we have an unusal situation in which the history size doesn't match the input size. + // This in turns lead to some rounding issue (final viewport is not rounded, while the render target size is) that cause artifacts. + // To fix said artifacts we recompute manually the scales as we need them. #define _RTHandleScaleForTAAHistory _TaaScales.xy #define _RTHandleScaleForTAA _TaaScales.zw From 212e9d3ef3d1880534f1f44408bc316a9cc470db Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Wed, 7 Jul 2021 12:30:03 +0200 Subject: [PATCH 21/41] Review comments --- .../Camera/HDCameraUI.Rendering.Drawers.cs | 23 +++++++++++++------ .../Shaders/TemporalAntiAliasing.shader | 9 +++++++- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 14 ++++++++--- .../HDRenderPipeline.PostProcess.cs | 14 ++++------- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Drawers.cs index f01d176fb20..6af1f96a0f0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Rendering.Drawers.cs @@ -76,7 +76,10 @@ static void Drawer_Rendering_AllowDynamicResolution(SerializedHDCamera p, Editor s_IsRunningTAAU = p.allowDynamicResolution.boolValue && dynamicResSettings.upsampleFilter == UnityEngine.Rendering.DynamicResUpscaleFilter.TAAU && dynamicResSettings.enabled; if (s_IsRunningTAAU) + { EditorGUILayout.HelpBox(Styles.taauInfoBox, MessageType.Info); + p.antialiasing.intValue = (int)HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing; + } #if ENABLE_NVIDIA && ENABLE_NVIDIA_MODULE EditorGUI.indentLevel++; @@ -152,14 +155,17 @@ static void Drawer_Rendering_Antialiasing(SerializedHDCamera p, Editor owner) showAntialiasContentAsFallback = isDLSSEnabled; #endif - Rect antiAliasingRect = EditorGUILayout.GetControlRect(); - EditorGUI.BeginProperty(antiAliasingRect, Styles.antialiasing, p.antialiasing); + using (new EditorGUI.DisabledScope(s_IsRunningTAAU)) { - EditorGUI.BeginChangeCheck(); - int selectedValue = (int)(HDAdditionalCameraData.AntialiasingMode)EditorGUI.EnumPopup(antiAliasingRect, showAntialiasContentAsFallback ? Styles.antialiasingContentFallback : Styles.antialiasing, (HDAdditionalCameraData.AntialiasingMode)p.antialiasing.intValue); + Rect antiAliasingRect = EditorGUILayout.GetControlRect(); + EditorGUI.BeginProperty(antiAliasingRect, Styles.antialiasing, p.antialiasing); + { + EditorGUI.BeginChangeCheck(); + int selectedValue = (int)(HDAdditionalCameraData.AntialiasingMode)EditorGUI.EnumPopup(antiAliasingRect, showAntialiasContentAsFallback ? Styles.antialiasingContentFallback : Styles.antialiasing, (HDAdditionalCameraData.AntialiasingMode)p.antialiasing.intValue); - if (EditorGUI.EndChangeCheck()) - p.antialiasing.intValue = selectedValue; + if (EditorGUI.EndChangeCheck()) + p.antialiasing.intValue = selectedValue; + } } } @@ -186,7 +192,10 @@ static void Draw_Rendering_Antialiasing_TAA_Advanced(SerializedHDCamera p, Edito static void Drawer_Rendering_Antialiasing_TAA(SerializedHDCamera p, Editor owner) { - EditorGUILayout.PropertyField(p.taaQualityLevel, Styles.TAAQualityLevel); + using (new EditorGUI.DisabledScope(s_IsRunningTAAU)) + { + EditorGUILayout.PropertyField(p.taaQualityLevel, Styles.TAAQualityLevel); + } if (s_IsRunningTAAU) p.taaQualityLevel.intValue = (int)HDAdditionalCameraData.TAAQualityLevel.High; diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index 127a20eab20..1454152bda0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -213,7 +213,13 @@ Shader "Hidden/HDRP/TemporalAA" #if ORTHOGRAPHIC float2 closestOffset = 0; #else - float2 closestOffset = GetClosestFragmentOffset(_DepthTexture, int2(input.positionCS.xy)); + int2 samplePos; +#ifdef TAA_UPSCALE + samplePos = outputPixInInput; +#else + samplePos = input.positionCS.xy; +#endif + float2 closestOffset = GetClosestFragmentOffset(_DepthTexture, samplePos); #endif DecodeMotionVector(SAMPLE_TEXTURE2D_X_LOD(_CameraMotionVectorsTexture, s_point_clamp_sampler, ClampAndScaleUVForPoint(uv + closestOffset * _InputSize.zw), 0), motionVector); @@ -293,6 +299,7 @@ Shader "Hidden/HDRP/TemporalAA" // --------------- Blend to final value and output --------------- #if VELOCITY_REJECTION + // The 10 multiplier serves a double purpose, it is an empirical scale value used to perform the rejection and it also helps with storing the value itself. float lengthMV = motionVectorLength * 10; blendFactor = ModifyBlendWithMotionVectorRejection(_InputVelocityMagnitudeHistory, lengthMV, prevUV, blendFactor, _SpeedRejectionIntensity, _RTHandleScaleForTAAHistory); #endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 8f9c3850621..aaa5899e4e0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -249,7 +249,8 @@ internal struct VolumetricCloudsAnimationData internal Vector4 screenParams; internal int volumeLayerMask; internal Transform volumeAnchor; - internal Rect finalViewport; // This will have the correct viewport position and the size will be full resolution (ie : not taking dynamic rez into account) + internal Rect finalViewport = new Rect(Vector2.zero, -1.0f * Vector2.one); // This will have the correct viewport position and the size will be full resolution (ie : not taking dynamic rez into account) + internal Rect prevFinalViewport; internal int colorPyramidHistoryMipCount = 0; internal VBufferParameters[] vBufferParams; // Double-buffered; needed even if reprojection is off internal RTHandle[] volumetricHistoryBuffers; // Double-buffered; only used for reprojection @@ -678,9 +679,14 @@ internal bool IsDLSSEnabled() return m_AdditionalCameraData == null ? false : m_AdditionalCameraData.cameraCanRenderDLSS; } + internal bool IsTAAUEnabled() + { + return DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; + } + internal bool UpsampleHappensBeforePost() { - return IsDLSSEnabled() || DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; + return IsDLSSEnabled() || IsTAAUEnabled(); } internal bool allowDeepLearningSuperSampling => m_AdditionalCameraData == null ? false : m_AdditionalCameraData.allowDeepLearningSuperSampling; @@ -692,7 +698,7 @@ internal bool UpsampleHappensBeforePost() internal bool RequiresCameraJitter() { - return antialiasing == AntialiasingMode.TemporalAntialiasing || IsDLSSEnabled() || (DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU); + return antialiasing == AntialiasingMode.TemporalAntialiasing || IsDLSSEnabled() || IsTAAUEnabled(); } internal bool IsSSREnabled(bool transparent = false) @@ -879,6 +885,8 @@ internal void Update(FrameSettings currentFrameSettings, HDRenderPipeline hdrp, // Update viewport { + prevFinalViewport = finalViewport; + if (xr.enabled) { finalViewport = xr.GetViewport(); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index fe6342ee1df..7da206fccdb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -66,13 +66,9 @@ private enum SMAAStage HableCurve m_HableCurve; //Viewport information - Rect m_PrevFinalViewport = new Rect(Vector2.zero, Vector2.one * -1); Vector2Int m_AfterDynamicResUpscaleRes = new Vector2Int(1, 1); Vector2Int m_BeforeDynamicResUpscaleRes = new Vector2Int(1, 1); - Dictionary m_WasRunningTAAU = new Dictionary(); - Dictionary m_WillNeedToClearHistoryBuffers = new Dictionary(); - private enum ResolutionGroup { BeforeDynamicResUpscale, @@ -482,7 +478,7 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, if (hdCamera.antialiasing == HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing) { source = DoTemporalAntialiasing(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, postDoF: false, "TAA Destination"); - if (DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU) + if (hdCamera.IsTAAUEnabled()) { SetCurrentResolutionGroup(renderGraph, hdCamera, ResolutionGroup.AfterDynamicResUpscale); } @@ -530,14 +526,12 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, FinalPass(renderGraph, hdCamera, afterPostProcessBuffer, alphaTexture, dest, source, m_BlueNoise, flipYInPostProcess); - bool currFrameIsTAAUpsampled = DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; + bool currFrameIsTAAUpsampled = hdCamera.IsTAAUEnabled(); bool cameraWasRunningTAA = hdCamera.previousFrameWasTAAUpsampled; hdCamera.previousFrameWasTAAUpsampled = currFrameIsTAAUpsampled; hdCamera.resetPostProcessingHistory = (cameraWasRunningTAA != currFrameIsTAAUpsampled); - m_PrevFinalViewport = hdCamera.finalViewport; - renderGraph.EndProfilingSampler(ProfilingSampler.Get(HDProfileId.PostProcessing)); // Reset the post process size if needed, so any passes that read this data during Render Graph execute will have the expected data @@ -1447,7 +1441,7 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem // The anti flicker becomes much more aggressive on higher values float temporalContrastForMaxAntiFlicker = 0.7f - Mathf.Lerp(0.0f, 0.3f, Mathf.SmoothStep(0.5f, 1.0f, camera.taaAntiFlicker)); - bool TAAU = DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; + bool TAAU = camera.IsTAAUEnabled(); passData.taaParameters = new Vector4(TAAU && postDoF ? 0.25f : camera.taaHistorySharpening, postDoF ? maxAntiflicker : Mathf.Lerp(minAntiflicker, maxAntiflicker, camera.taaAntiFlicker), motionRejectionMultiplier, temporalContrastForMaxAntiFlicker); @@ -1587,7 +1581,7 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem bool needToUseCurrFrameSizeForHistory = camera.resetPostProcessingHistory || TAAU != camera.previousFrameWasTAAUpsampled; - passData.prevFinalViewport = (m_PrevFinalViewport.width < 0 || needToUseCurrFrameSizeForHistory) ? camera.finalViewport : m_PrevFinalViewport; + passData.prevFinalViewport = (camera.prevFinalViewport.width < 0 || needToUseCurrFrameSizeForHistory) ? camera.finalViewport : camera.prevFinalViewport; var mainRTScales = RTHandles.CalculateRatioAgainstMaxSize(camera.actualWidth, camera.actualHeight); var historyRenderingViewport = TAAU ? new Vector2(passData.prevFinalViewport.width, passData.prevFinalViewport.height) : From 753dce5dc594c6ac399e2e33b7bea57aa5c78a57 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Wed, 7 Jul 2021 13:23:52 +0200 Subject: [PATCH 22/41] Force TAA when TAAU --- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index aaa5899e4e0..74a3f89e950 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -1411,6 +1411,10 @@ void UpdateAntialiasing() taaJitter = Vector4.zero; } + // If we have TAAU enabled, we need to force TAA to make it work. + if (IsTAAUEnabled()) + antialiasing = AntialiasingMode.TemporalAntialiasing; + // When changing antialiasing mode to TemporalAA we must reset the history, otherwise we get one frame of garbage if ((previousAntialiasing != antialiasing && antialiasing == AntialiasingMode.TemporalAntialiasing) || (m_PreviousClearColorMode != clearColorMode)) From c3fc9ff70fc6e887f022869811ffd35b241aae74 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Wed, 7 Jul 2021 14:40:12 +0200 Subject: [PATCH 23/41] Fix DoF --- .../Runtime/PostProcessing/Shaders/DoFCircleOfConfusion.compute | 2 +- .../Runtime/PostProcessing/Shaders/DoFMinMaxDilate.compute | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DoFCircleOfConfusion.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DoFCircleOfConfusion.compute index 0c562225c2c..e4ae9a70bcd 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DoFCircleOfConfusion.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DoFCircleOfConfusion.compute @@ -30,7 +30,7 @@ RW_TEXTURE2D_X(float, _OutputTexture); void KMainCoCPhysical(uint3 dispatchThreadId : SV_DispatchThreadID) { UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z); - PositionInputs posInputs = GetPositionInput(float2(dispatchThreadId.xy), _ScreenSize.zw, uint2(GROUP_RES, GROUP_RES)); + PositionInputs posInputs = GetPositionInput(float2(dispatchThreadId.xy), _PostProcessScreenSize.zw, uint2(GROUP_RES, GROUP_RES)); float depth = LoadCameraDepth(FromOutputPosSSToPreupsamplePosSS(dispatchThreadId.xy)); diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DoFMinMaxDilate.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DoFMinMaxDilate.compute index a842cc43875..2dac5ef1584 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DoFMinMaxDilate.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DoFMinMaxDilate.compute @@ -34,7 +34,7 @@ void KMain(uint3 dispatchThreadId : SV_DispatchThreadID) float4 tileInfo = _InputTexture[COORD_TEXTURE2D_X(dispatchThreadId.xy)]; int2 startIndex = max((int2)dispatchThreadId.xy - int2(1, 1), int2(0, 0)); - int2 endIndex = min((int2)dispatchThreadId.xy + int2(1, 1), _ScreenSize.xy / TILE_RES - int2(1, 1)); + int2 endIndex = min((int2)dispatchThreadId.xy + int2(1, 1), _PostProcessScreenSize.xy / TILE_RES - int2(1, 1)); for (int i = startIndex.x; i <= endIndex.x; i++) { From 78b0efeb72284d024cee3bf3827751b2da54d4ed Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Wed, 7 Jul 2021 15:17:16 +0200 Subject: [PATCH 24/41] More fix for DoF --- .../Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 7da206fccdb..ad164a8866c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -2879,10 +2879,10 @@ TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, Textu passData.pingFarRGB = builder.CreateTransientTexture(GetPostprocessOutputHandle(renderGraph, "DoF Source Pyramid", GetPostprocessTextureFormat(), true)); float scaleFactor = 1.0f / passData.parameters.minMaxCoCTileSize; - passData.pingNearRGB = builder.CreateTransientTexture(new TextureDesc(Vector2.one * scaleFactor, true, true) + passData.pingNearRGB = builder.CreateTransientTexture(new TextureDesc(Vector2.one * scaleFactor, IsDynamicResUpscaleTargetEnabled(), true) { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, useMipMap = false, enableRandomWrite = true, name = "CoC Min Max Tiles" }); - passData.pongNearRGB = builder.CreateTransientTexture(new TextureDesc(Vector2.one * scaleFactor, true, true) + passData.pongNearRGB = builder.CreateTransientTexture(new TextureDesc(Vector2.one * scaleFactor, IsDynamicResUpscaleTargetEnabled(), true) { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, useMipMap = false, enableRandomWrite = true, name = "CoC Min Max Tiles" }); builder.SetRenderFunc( From dd8ff50a930e979d2337967df8a55f17b67941aa Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Wed, 7 Jul 2021 15:25:43 +0200 Subject: [PATCH 25/41] Tests --- .../4096_DRS-TAAU-Hardware.unity | 1532 +++++++++++++++++ .../4096_DRS-TAAU-Hardware.unity.meta | 7 + .../4097_DRS-TAAU-Software.unity | 1532 +++++++++++++++++ .../4097_DRS-TAAU-Software.unity.meta | 7 + .../ProjectSettings/EditorBuildSettings.asset | 8 +- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 2 +- .../HDRP_Test_Def_TAAU_Hardware.asset | 464 +++++ .../HDRP_Test_Def_TAAU_Hardware.asset.meta | 8 + .../HDRP_Test_Def_TAAU_Software.asset | 464 +++++ .../HDRP_Test_Def_TAAU_Software.asset.meta | 8 + 10 files changed, 4030 insertions(+), 2 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4096_DRS-TAAU-Hardware.unity create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4096_DRS-TAAU-Hardware.unity.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4097_DRS-TAAU-Software.unity create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4097_DRS-TAAU-Software.unity.meta create mode 100644 com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Hardware.asset create mode 100644 com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Hardware.asset.meta create mode 100644 com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Software.asset create mode 100644 com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Software.asset.meta diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4096_DRS-TAAU-Hardware.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4096_DRS-TAAU-Hardware.unity new file mode 100644 index 00000000000..4033a0c7578 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4096_DRS-TAAU-Hardware.unity @@ -0,0 +1,1532 @@ +%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, g: 0, b: 0, 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: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_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: 0} +--- !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 &54497423 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 54497427} + - component: {fileID: 54497426} + - component: {fileID: 54497425} + - component: {fileID: 54497424} + m_Layer: 0 + m_Name: Sphere (7) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &54497424 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 54497423} + 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 &54497425 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 54497423} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0f535213bbe21e64b9ed01036e9425c6, 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 &54497426 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 54497423} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &54497427 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 54497423} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.545, y: 0, z: -8.685} + m_LocalScale: {x: 0.70917, y: 0.70917, z: 0.70917} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &223038177 +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: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_RootOrder + value: 0 + 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: -10 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 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_AllowDynamicResolution + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_Version + value: 8 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: TAAQuality + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: antialiasing + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: clearColorMode + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: taaAntiFlicker + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: taaSharpenStrength + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: taaHistorySharpening + value: 0.377 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: taaAntiHistoryRinging + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: allowDynamicResolution + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: customRenderingSettings + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: allowDeepLearningSuperSampling + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_RenderingPathCustomFrameSettings.bitDatas.data1 + value: 70005819440989 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: renderingPathCustomFrameSettingsOverrideMask.mask.data1 + value: 655360 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: waitFrames + value: 64 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: renderPipelineAsset + value: + objectReference: {fileID: 11400000, guid: 595b7210a76055442ae0f4f98f9f2633, + type: 2} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: ImageComparisonSettings.TargetWidth + value: 1920 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: ImageComparisonSettings.TargetHeight + value: 1080 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} +--- !u!1 &256746375 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 256746379} + - component: {fileID: 256746378} + - component: {fileID: 256746377} + - component: {fileID: 256746376} + m_Layer: 0 + m_Name: Sphere (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &256746376 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 256746375} + 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 &256746377 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 256746375} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 25fb8e0210182b74cb06398df1696a04, 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 &256746378 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 256746375} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &256746379 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 256746375} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.78, y: 0.26, z: -7.41} + m_LocalScale: {x: 0.20514722, y: 0.20514722, z: 0.20514722} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &503710626 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 503710630} + - component: {fileID: 503710629} + - component: {fileID: 503710628} + - component: {fileID: 503710627} + m_Layer: 0 + m_Name: WE + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &503710627 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 503710626} + 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 &503710628 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 503710626} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0d23b508459f5b7498803b2e21416a05, 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 &503710629 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 503710626} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &503710630 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 503710626} + m_LocalRotation: {x: -0, y: -0.8556675, z: -0, w: 0.517526} + m_LocalPosition: {x: 0.826, y: 1.59, z: -5.35} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: -117.667, z: 0} +--- !u!1 &661411982 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 661411985} + - component: {fileID: 661411984} + - component: {fileID: 661411983} + m_Layer: 0 + m_Name: Directional Light (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &661411983 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 661411982} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Intensity: 0.9696518 + m_EnableSpotReflector: 1 + m_LuxAtDistance: 1 + m_InnerSpotPercent: 0 + m_SpotIESCutoffPercent: 100 + m_LightDimmer: 1 + m_VolumetricDimmer: 1 + m_LightUnit: 2 + m_FadeDistance: 10000 + m_VolumetricFadeDistance: 10000 + m_AffectDiffuse: 1 + m_AffectSpecular: 1 + m_NonLightmappedOnly: 0 + m_ShapeWidth: 0.5 + m_ShapeHeight: 0.5 + m_AspectRatio: 1 + m_ShapeRadius: 0.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_IESPoint: {fileID: 0} + m_IESSpot: {fileID: 0} + m_IncludeForRayTracing: 1 + 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_AlwaysDrawDynamicShadows: 0 + m_UpdateShadowOnLightMovement: 0 + m_CachedShadowTranslationThreshold: 0.01 + m_CachedShadowAngularThreshold: 0.5 + m_BarnDoorAngle: 90 + m_BarnDoorLength: 0.05 + m_preserveCachedShadow: 0 + m_OnDemandShadowRenderOnPlacement: 1 + m_ShadowCascadeRatios: + - 0.05 + - 0.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 + m_AreaLightEmissiveMeshShadowCastingMode: 0 + m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 + m_AreaLightEmissiveMeshLayer: -1 + m_Version: 11 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 + m_PointlightHDType: 0 + m_SpotLightShape: 0 + m_AreaLightShape: 0 +--- !u!108 &661411984 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 661411982} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0.9696518 + 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: 0.5, y: 0.5} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 1 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &661411985 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 661411982} + m_LocalRotation: {x: 0.13875811, y: 0.5250831, z: -0.42723507, w: 0.72284454} + m_LocalPosition: {x: 0.26, y: 2.95, z: -6.32} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 40.487, y: 57.373, z: -38.353} +--- !u!1 &1145805900 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1145805903} + - component: {fileID: 1145805902} + - component: {fileID: 1145805901} + 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 &1145805901 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1145805900} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Intensity: 0.9696518 + m_EnableSpotReflector: 1 + m_LuxAtDistance: 1 + m_InnerSpotPercent: 0 + m_SpotIESCutoffPercent: 100 + m_LightDimmer: 1 + m_VolumetricDimmer: 1 + m_LightUnit: 2 + m_FadeDistance: 10000 + m_VolumetricFadeDistance: 10000 + m_AffectDiffuse: 1 + m_AffectSpecular: 1 + m_NonLightmappedOnly: 0 + m_ShapeWidth: 0.5 + m_ShapeHeight: 0.5 + m_AspectRatio: 1 + m_ShapeRadius: 0.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_IESPoint: {fileID: 0} + m_IESSpot: {fileID: 0} + m_IncludeForRayTracing: 1 + 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_AlwaysDrawDynamicShadows: 0 + m_UpdateShadowOnLightMovement: 0 + m_CachedShadowTranslationThreshold: 0.01 + m_CachedShadowAngularThreshold: 0.5 + m_BarnDoorAngle: 90 + m_BarnDoorLength: 0.05 + m_preserveCachedShadow: 0 + m_OnDemandShadowRenderOnPlacement: 1 + m_ShadowCascadeRatios: + - 0.05 + - 0.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 + m_AreaLightEmissiveMeshShadowCastingMode: 0 + m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 + m_AreaLightEmissiveMeshLayer: -1 + m_Version: 11 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 + m_PointlightHDType: 0 + m_SpotLightShape: 0 + m_AreaLightShape: 0 +--- !u!108 &1145805902 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1145805900} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0.9696518 + 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: 0.5, y: 0.5} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 1 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1145805903 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1145805900} + m_LocalRotation: {x: 0.13875811, y: 0.5250831, z: -0.42723507, w: 0.72284454} + m_LocalPosition: {x: 0.26, y: 2.95, z: -6.32} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 40.487, y: 57.373, z: -38.353} +--- !u!1 &1174766768 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1174766772} + - component: {fileID: 1174766771} + - component: {fileID: 1174766770} + - component: {fileID: 1174766769} + m_Layer: 0 + m_Name: Cube (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1174766769 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1174766768} + 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 &1174766770 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1174766768} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + 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 &1174766771 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1174766768} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1174766772 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1174766768} + m_LocalRotation: {x: 0.03723274, y: 0.23044106, z: -0.23368219, w: 0.94387674} + m_LocalPosition: {x: 1.06, y: -0.5408558, z: -7.61} + m_LocalScale: {x: 0.08, y: 1.15, z: 0.14751203} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 10.252, y: 25.112, z: -25.522} +--- !u!1 &1261607508 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1261607512} + - component: {fileID: 1261607511} + - component: {fileID: 1261607510} + - component: {fileID: 1261607509} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1261607509 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1261607508} + 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 &1261607510 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1261607508} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + 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 &1261607511 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1261607508} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1261607512 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1261607508} + m_LocalRotation: {x: 0.09152149, y: 0.21473974, z: 0.000000055850244, w: 0.9723737} + m_LocalPosition: {x: 1.06, y: -0.5408558, z: -7.61} + m_LocalScale: {x: 0.08, y: 1.15, z: 0.14751203} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 10.252, y: 25.112, z: 2.289} +--- !u!1 &1356837729 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1356837733} + - component: {fileID: 1356837732} + - component: {fileID: 1356837731} + - component: {fileID: 1356837730} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1356837730 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1356837729} + 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 &1356837731 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1356837729} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + 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 &1356837732 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1356837729} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1356837733 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1356837729} + m_LocalRotation: {x: -0.02853702, y: 0.23167865, z: -0.48773798, w: 0.84120286} + m_LocalPosition: {x: 1.06, y: -0.5408558, z: -7.61} + m_LocalScale: {x: 0.08, y: 1.15, z: 0.14751203} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 10.252, y: 25.112, z: -57.922} +--- !u!1 &1399711486 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1399711490} + - component: {fileID: 1399711489} + - component: {fileID: 1399711488} + - component: {fileID: 1399711487} + m_Layer: 0 + m_Name: Sphere (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &1399711487 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1399711486} + 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 &1399711488 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1399711486} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0f535213bbe21e64b9ed01036e9425c6, 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 &1399711489 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1399711486} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1399711490 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1399711486} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -7.5} + m_LocalScale: {x: 0.70917, y: 0.70917, z: 0.70917} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1570772418 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1570772420} + - component: {fileID: 1570772419} + m_Layer: 0 + m_Name: GlobalVolume + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1570772419 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1570772418} + 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: 4f7d7e6c5fda6c146a2813c17fa7f3ad, type: 2} +--- !u!4 &1570772420 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1570772418} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.9665136, y: -0.4799956, z: -2.8057647} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1703385987 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1703385991} + - component: {fileID: 1703385990} + - component: {fileID: 1703385989} + - component: {fileID: 1703385988} + m_Layer: 0 + m_Name: Sphere (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &1703385988 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703385987} + 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 &1703385989 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703385987} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92b5df07e8ea39c489360085bff45ecc, 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 &1703385990 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703385987} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1703385991 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703385987} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.92, y: -0.11, z: -6.937189} + m_LocalScale: {x: 0.5389684, y: 0.5389684, z: 0.5389684} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4096_DRS-TAAU-Hardware.unity.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4096_DRS-TAAU-Hardware.unity.meta new file mode 100644 index 00000000000..ff9e8767163 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4096_DRS-TAAU-Hardware.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4dee1c4da3598c24f9fdd58a675d6547 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4097_DRS-TAAU-Software.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4097_DRS-TAAU-Software.unity new file mode 100644 index 00000000000..6fe279c69de --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4097_DRS-TAAU-Software.unity @@ -0,0 +1,1532 @@ +%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, g: 0, b: 0, 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: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_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: 0} +--- !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 &54497423 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 54497427} + - component: {fileID: 54497426} + - component: {fileID: 54497425} + - component: {fileID: 54497424} + m_Layer: 0 + m_Name: Sphere (7) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &54497424 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 54497423} + 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 &54497425 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 54497423} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0f535213bbe21e64b9ed01036e9425c6, 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 &54497426 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 54497423} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &54497427 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 54497423} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.545, y: 0, z: -8.685} + m_LocalScale: {x: 0.70917, y: 0.70917, z: 0.70917} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &223038177 +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: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_RootOrder + value: 0 + 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: -10 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 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_AllowDynamicResolution + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_Version + value: 8 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: TAAQuality + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: antialiasing + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: clearColorMode + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: taaAntiFlicker + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: taaSharpenStrength + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: taaHistorySharpening + value: 0.377 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: taaAntiHistoryRinging + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: allowDynamicResolution + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: customRenderingSettings + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: allowDeepLearningSuperSampling + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_RenderingPathCustomFrameSettings.bitDatas.data1 + value: 70005819440989 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: renderingPathCustomFrameSettingsOverrideMask.mask.data1 + value: 655360 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: waitFrames + value: 64 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: renderPipelineAsset + value: + objectReference: {fileID: 11400000, guid: 253d374c89bd7ca4bb61beb4c14905e0, + type: 2} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: ImageComparisonSettings.TargetWidth + value: 1920 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: ImageComparisonSettings.TargetHeight + value: 1080 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} +--- !u!1 &256746375 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 256746379} + - component: {fileID: 256746378} + - component: {fileID: 256746377} + - component: {fileID: 256746376} + m_Layer: 0 + m_Name: Sphere (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &256746376 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 256746375} + 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 &256746377 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 256746375} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 25fb8e0210182b74cb06398df1696a04, 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 &256746378 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 256746375} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &256746379 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 256746375} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.78, y: 0.26, z: -7.41} + m_LocalScale: {x: 0.20514722, y: 0.20514722, z: 0.20514722} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &503710626 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 503710630} + - component: {fileID: 503710629} + - component: {fileID: 503710628} + - component: {fileID: 503710627} + m_Layer: 0 + m_Name: WE + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &503710627 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 503710626} + 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 &503710628 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 503710626} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0d23b508459f5b7498803b2e21416a05, 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 &503710629 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 503710626} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &503710630 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 503710626} + m_LocalRotation: {x: -0, y: -0.8556675, z: -0, w: 0.517526} + m_LocalPosition: {x: 0.826, y: 1.59, z: -5.35} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: -117.667, z: 0} +--- !u!1 &661411982 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 661411985} + - component: {fileID: 661411984} + - component: {fileID: 661411983} + m_Layer: 0 + m_Name: Directional Light (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &661411983 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 661411982} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Intensity: 0.9696518 + m_EnableSpotReflector: 1 + m_LuxAtDistance: 1 + m_InnerSpotPercent: 0 + m_SpotIESCutoffPercent: 100 + m_LightDimmer: 1 + m_VolumetricDimmer: 1 + m_LightUnit: 2 + m_FadeDistance: 10000 + m_VolumetricFadeDistance: 10000 + m_AffectDiffuse: 1 + m_AffectSpecular: 1 + m_NonLightmappedOnly: 0 + m_ShapeWidth: 0.5 + m_ShapeHeight: 0.5 + m_AspectRatio: 1 + m_ShapeRadius: 0.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_IESPoint: {fileID: 0} + m_IESSpot: {fileID: 0} + m_IncludeForRayTracing: 1 + 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_AlwaysDrawDynamicShadows: 0 + m_UpdateShadowOnLightMovement: 0 + m_CachedShadowTranslationThreshold: 0.01 + m_CachedShadowAngularThreshold: 0.5 + m_BarnDoorAngle: 90 + m_BarnDoorLength: 0.05 + m_preserveCachedShadow: 0 + m_OnDemandShadowRenderOnPlacement: 1 + m_ShadowCascadeRatios: + - 0.05 + - 0.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 + m_AreaLightEmissiveMeshShadowCastingMode: 0 + m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 + m_AreaLightEmissiveMeshLayer: -1 + m_Version: 11 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 + m_PointlightHDType: 0 + m_SpotLightShape: 0 + m_AreaLightShape: 0 +--- !u!108 &661411984 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 661411982} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0.9696518 + 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: 0.5, y: 0.5} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 1 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &661411985 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 661411982} + m_LocalRotation: {x: 0.13875811, y: 0.5250831, z: -0.42723507, w: 0.72284454} + m_LocalPosition: {x: 0.26, y: 2.95, z: -6.32} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 40.487, y: 57.373, z: -38.353} +--- !u!1 &1145805900 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1145805903} + - component: {fileID: 1145805902} + - component: {fileID: 1145805901} + 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 &1145805901 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1145805900} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Intensity: 0.9696518 + m_EnableSpotReflector: 1 + m_LuxAtDistance: 1 + m_InnerSpotPercent: 0 + m_SpotIESCutoffPercent: 100 + m_LightDimmer: 1 + m_VolumetricDimmer: 1 + m_LightUnit: 2 + m_FadeDistance: 10000 + m_VolumetricFadeDistance: 10000 + m_AffectDiffuse: 1 + m_AffectSpecular: 1 + m_NonLightmappedOnly: 0 + m_ShapeWidth: 0.5 + m_ShapeHeight: 0.5 + m_AspectRatio: 1 + m_ShapeRadius: 0.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_IESPoint: {fileID: 0} + m_IESSpot: {fileID: 0} + m_IncludeForRayTracing: 1 + 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_AlwaysDrawDynamicShadows: 0 + m_UpdateShadowOnLightMovement: 0 + m_CachedShadowTranslationThreshold: 0.01 + m_CachedShadowAngularThreshold: 0.5 + m_BarnDoorAngle: 90 + m_BarnDoorLength: 0.05 + m_preserveCachedShadow: 0 + m_OnDemandShadowRenderOnPlacement: 1 + m_ShadowCascadeRatios: + - 0.05 + - 0.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 + m_AreaLightEmissiveMeshShadowCastingMode: 0 + m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 + m_AreaLightEmissiveMeshLayer: -1 + m_Version: 11 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 + m_PointlightHDType: 0 + m_SpotLightShape: 0 + m_AreaLightShape: 0 +--- !u!108 &1145805902 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1145805900} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0.9696518 + 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: 0.5, y: 0.5} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 1 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1145805903 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1145805900} + m_LocalRotation: {x: 0.13875811, y: 0.5250831, z: -0.42723507, w: 0.72284454} + m_LocalPosition: {x: 0.26, y: 2.95, z: -6.32} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 40.487, y: 57.373, z: -38.353} +--- !u!1 &1174766768 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1174766772} + - component: {fileID: 1174766771} + - component: {fileID: 1174766770} + - component: {fileID: 1174766769} + m_Layer: 0 + m_Name: Cube (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1174766769 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1174766768} + 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 &1174766770 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1174766768} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + 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 &1174766771 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1174766768} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1174766772 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1174766768} + m_LocalRotation: {x: 0.03723274, y: 0.23044106, z: -0.23368219, w: 0.94387674} + m_LocalPosition: {x: 1.06, y: -0.5408558, z: -7.61} + m_LocalScale: {x: 0.08, y: 1.15, z: 0.14751203} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 10.252, y: 25.112, z: -25.522} +--- !u!1 &1261607508 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1261607512} + - component: {fileID: 1261607511} + - component: {fileID: 1261607510} + - component: {fileID: 1261607509} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1261607509 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1261607508} + 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 &1261607510 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1261607508} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + 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 &1261607511 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1261607508} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1261607512 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1261607508} + m_LocalRotation: {x: 0.09152149, y: 0.21473974, z: 0.000000055850244, w: 0.9723737} + m_LocalPosition: {x: 1.06, y: -0.5408558, z: -7.61} + m_LocalScale: {x: 0.08, y: 1.15, z: 0.14751203} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 10.252, y: 25.112, z: 2.289} +--- !u!1 &1356837729 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1356837733} + - component: {fileID: 1356837732} + - component: {fileID: 1356837731} + - component: {fileID: 1356837730} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1356837730 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1356837729} + 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 &1356837731 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1356837729} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + 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 &1356837732 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1356837729} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1356837733 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1356837729} + m_LocalRotation: {x: -0.02853702, y: 0.23167865, z: -0.48773798, w: 0.84120286} + m_LocalPosition: {x: 1.06, y: -0.5408558, z: -7.61} + m_LocalScale: {x: 0.08, y: 1.15, z: 0.14751203} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 10.252, y: 25.112, z: -57.922} +--- !u!1 &1399711486 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1399711490} + - component: {fileID: 1399711489} + - component: {fileID: 1399711488} + - component: {fileID: 1399711487} + m_Layer: 0 + m_Name: Sphere (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &1399711487 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1399711486} + 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 &1399711488 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1399711486} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0f535213bbe21e64b9ed01036e9425c6, 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 &1399711489 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1399711486} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1399711490 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1399711486} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -7.5} + m_LocalScale: {x: 0.70917, y: 0.70917, z: 0.70917} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1570772418 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1570772420} + - component: {fileID: 1570772419} + m_Layer: 0 + m_Name: GlobalVolume + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1570772419 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1570772418} + 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: 4f7d7e6c5fda6c146a2813c17fa7f3ad, type: 2} +--- !u!4 &1570772420 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1570772418} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.9665136, y: -0.4799956, z: -2.8057647} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1703385987 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1703385991} + - component: {fileID: 1703385990} + - component: {fileID: 1703385989} + - component: {fileID: 1703385988} + m_Layer: 0 + m_Name: Sphere (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &1703385988 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703385987} + 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 &1703385989 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703385987} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92b5df07e8ea39c489360085bff45ecc, 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 &1703385990 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703385987} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1703385991 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703385987} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.92, y: -0.11, z: -6.937189} + m_LocalScale: {x: 0.5389684, y: 0.5389684, z: 0.5389684} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4097_DRS-TAAU-Software.unity.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4097_DRS-TAAU-Software.unity.meta new file mode 100644 index 00000000000..7b4b17d92d8 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4097_DRS-TAAU-Software.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a50807faa70f2a441aba00a405914c6b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset b/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset index d0f0a0ddf09..3558697cc37 100644 --- a/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset +++ b/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset @@ -771,6 +771,12 @@ EditorBuildSettings: path: Assets/GraphicTests/Scenes/9x_Other/9910_GlobalMipBias.unity guid: 3f9d18568d46df044847954b624b6152 - enabled: 1 - path: Assets/GraphicTests/Scenes/1x_Materials/1226_LitTessellation_Displacement.unity + path: Assets/GraphicTests/Scenes/1x_Materials/1226_Lit_UVMapping_Displacement.unity guid: 2a9e6d17d05c12b428a235cc1edae5b9 + - enabled: 1 + path: Assets/GraphicTests/Scenes/4x_PostProcessing/4096_DRS-TAAU-Hardware.unity + guid: 4dee1c4da3598c24f9fdd58a675d6547 + - enabled: 1 + path: Assets/GraphicTests/Scenes/4x_PostProcessing/4097_DRS-TAAU-Software.unity + guid: a50807faa70f2a441aba00a405914c6b m_configObjects: {} diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 74a3f89e950..b4ace9dd5fc 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -834,7 +834,7 @@ internal void Update(FrameSettings currentFrameSettings, HDRenderPipeline hdrp, } // If we change the upscale schedule, refresh the history buffers. We need to do this, because if postprocess is after upscale, the size of some buffers needs to change. - if (m_PrevUpsamplerSchedule != DynamicResolutionHandler.instance.upsamplerSchedule) + if (m_PrevUpsamplerSchedule != DynamicResolutionHandler.instance.upsamplerSchedule || previousFrameWasTAAUpsampled != IsTAAUEnabled()) { forceReallocPyramid = true; m_PrevUpsamplerSchedule = DynamicResolutionHandler.instance.upsamplerSchedule; diff --git a/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Hardware.asset b/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Hardware.asset new file mode 100644 index 00000000000..e8aceb345d4 --- /dev/null +++ b/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Hardware.asset @@ -0,0 +1,464 @@ +%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: 0cf1dab834d4ec34195b920ea7bbf9ec, type: 3} + m_Name: HDRP_Test_Def_TAAU_Hardware + m_EditorClassIdentifier: + m_RenderPipelineSettings: + supportShadowMask: 1 + supportSSR: 0 + supportSSRTransparent: 0 + supportSSAO: 1 + supportSSGI: 0 + supportSubsurfaceScattering: 1 + sssSampleBudget: + m_Values: 140000002800000050000000 + m_SchemaId: + m_Id: With3Levels + supportVolumetrics: 1 + supportVolumetricClouds: 0 + supportLightLayers: 0 + supportDistortion: 1 + supportTransparentBackface: 1 + supportTransparentDepthPrepass: 1 + supportTransparentDepthPostpass: 1 + colorBufferFormat: 74 + supportCustomPass: 1 + customBufferFormat: 12 + supportedLitShaderMode: 2 + planarReflectionResolution: + m_Values: 000100000004000000040000 + m_SchemaId: + m_Id: With3Levels + supportDecals: 1 + supportDecalLayers: 0 + supportSurfaceGradient: 0 + decalNormalBufferHP: 0 + msaaSampleCount: 1 + supportMotionVectors: 1 + supportRuntimeAOVAPI: 0 + supportDitheringCrossFade: 1 + supportTerrainHole: 0 + supportProbeVolume: 0 + probeVolumeMemoryBudget: 1024 + probeVolumeSHBands: 1 + supportRayTracing: 0 + supportedRayTracingMode: 3 + lightLoopSettings: + cookieAtlasSize: 2048 + cookieFormat: 74 + cookieAtlasLastValidMip: 0 + cookieTexArraySize: 1 + planarReflectionAtlasSize: 1024 + reflectionProbeCacheSize: 64 + reflectionCubemapSize: 256 + reflectionCacheCompressed: 0 + reflectionProbeFormat: 74 + skyReflectionSize: 256 + skyLightingOverrideLayerMask: + serializedVersion: 2 + m_Bits: 0 + supportFabricConvolution: 0 + maxDirectionalLightsOnScreen: 16 + maxPunctualLightsOnScreen: 512 + maxAreaLightsOnScreen: 64 + maxEnvLightsOnScreen: 64 + maxDecalsOnScreen: 512 + maxPlanarReflectionOnScreen: 16 + maxLightsPerClusterCell: 8 + maxLocalVolumetricFogSize: 32 + maxLocalVolumetricFogOnScreen: 64 + hdShadowInitParams: + maxShadowRequests: 128 + directionalShadowsDepthBits: 32 + shadowFilteringQuality: 1 + punctualLightShadowAtlas: + shadowAtlasResolution: 4096 + shadowAtlasDepthBits: 32 + useDynamicViewportRescale: 1 + areaLightShadowAtlas: + shadowAtlasResolution: 4096 + shadowAtlasDepthBits: 32 + useDynamicViewportRescale: 1 + cachedPunctualLightShadowAtlas: 2048 + cachedAreaLightShadowAtlas: 1024 + shadowResolutionDirectional: + m_Values: 00010000000200000004000000080000 + m_SchemaId: + m_Id: With4Levels + shadowResolutionPunctual: + m_Values: 00010000000200000004000000080000 + m_SchemaId: + m_Id: With4Levels + shadowResolutionArea: + m_Values: 00010000000200000004000000080000 + m_SchemaId: + m_Id: With4Levels + maxDirectionalShadowMapResolution: 2048 + maxPunctualShadowMapResolution: 2048 + maxAreaShadowMapResolution: 2048 + supportScreenSpaceShadows: 0 + maxScreenSpaceShadowSlots: 4 + screenSpaceShadowBufferFormat: 48 + decalSettings: + drawDistance: 1000 + atlasWidth: 4096 + atlasHeight: 4096 + perChannelMask: 0 + postProcessSettings: + m_LutSize: 32 + lutFormat: 48 + bufferFormat: 74 + dynamicResolutionSettings: + enabled: 1 + useMipBias: 1 + enableDLSS: 0 + DLSSPerfQualitySetting: 0 + DLSSUseOptimalSettings: 1 + DLSSSharpness: 0 + maxPercentage: 100 + minPercentage: 100 + dynResType: 1 + upsampleFilter: 5 + forceResolution: 1 + forcedPercentage: 50 + lowResTransparencyMinimumThreshold: 0 + lowresTransparentSettings: + enabled: 1 + checkerboardDepthBuffer: 1 + upsampleType: 1 + xrSettings: + singlePass: 1 + occlusionMesh: 1 + cameraJitter: 0 + postProcessQualitySettings: + NearBlurSampleCount: 030000000500000008000000 + NearBlurMaxRadius: + - 2 + - 4 + - 7 + FarBlurSampleCount: 04000000070000000e000000 + FarBlurMaxRadius: + - 5 + - 8 + - 13 + DoFResolution: 040000000200000001000000 + DoFHighQualityFiltering: 000101 + DoFPhysicallyBased: 000000 + MotionBlurSampleCount: 04000000080000000c000000 + BloomRes: 040000000200000002000000 + BloomHighQualityFiltering: 000101 + BloomHighQualityPrefiltering: 000001 + ChromaticAberrationMaxSamples: 03000000060000000c000000 + lightSettings: + useContactShadow: + m_Values: 000001 + m_SchemaId: + m_Id: With3Levels + maximumLODLevel: + m_Values: 000000000000000000000000 + m_SchemaId: + m_Id: With3Levels + lodBias: + m_Values: + - 1 + - 1 + - 1 + m_SchemaId: + m_Id: With3Levels + lightingQualitySettings: + AOStepCount: 040000000600000010000000 + AOFullRes: 000001 + AOMaximumRadiusPixels: 200000002800000050000000 + AOBilateralUpsample: 000101 + AODirectionCount: 010000000200000004000000 + ContactShadowSampleCount: 060000000a00000010000000 + SSRMaxRaySteps: 100000002000000040000000 + SSGIRaySteps: 200000004000000080000000 + SSGIFilterRadius: 100000000e0000000c000000 + RTAORayLength: + - 0.5 + - 3 + - 20 + RTAOSampleCount: 010000000200000008000000 + RTAODenoise: 010101 + RTAODenoiserRadius: + - 0.25 + - 0.5 + - 0.65 + RTGIRayLength: + - 50 + - 50 + - 50 + RTGIFullResolution: 000001 + RTGIClampValue: + - 0.5 + - 0.8 + - 1.5 + RTGIUpScaleRadius: 040000000400000004000000 + RTGIRaySteps: 200000003000000040000000 + RTGIDenoise: 010101 + RTGIHalfResDenoise: 010000 + RTGIDenoiserRadius: + - 0.75 + - 0.5 + - 0.25 + RTGISecondDenoise: 010101 + RTRMinSmoothness: + - 0.6 + - 0.4 + - 0 + RTRSmoothnessFadeStart: + - 0.7 + - 0.5 + - 0 + RTRRayLength: + - 50 + - 50 + - 50 + RTRClampValue: + - 0.8 + - 1 + - 1.2 + RTRFullResolution: 000001 + RTRRayMaxIterations: 200000003000000040000000 + RTRDenoise: 010101 + RTRDenoiserRadius: 080000000c00000010000000 + RTRSmoothDenoising: 010000 + Fog_ControlMode: 000000000000000000000000 + Fog_Budget: + - 0.166 + - 0.33 + - 0.666 + Fog_DepthRatio: + - 0.666 + - 0.666 + - 0.5 + m_ObsoleteLightLayerName0: + m_ObsoleteLightLayerName1: + m_ObsoleteLightLayerName2: + m_ObsoleteLightLayerName3: + m_ObsoleteLightLayerName4: + m_ObsoleteLightLayerName5: + m_ObsoleteLightLayerName6: + m_ObsoleteLightLayerName7: + m_ObsoleteDecalLayerName0: + m_ObsoleteDecalLayerName1: + m_ObsoleteDecalLayerName2: + m_ObsoleteDecalLayerName3: + m_ObsoleteDecalLayerName4: + m_ObsoleteDecalLayerName5: + m_ObsoleteDecalLayerName6: + m_ObsoleteDecalLayerName7: + m_ObsoleteSupportRuntimeDebugDisplay: 0 + allowShaderVariantStripping: 1 + enableSRPBatcher: 1 + availableMaterialQualityLevels: -1 + m_DefaultMaterialQualityLevel: 4 + diffusionProfileSettings: {fileID: 0} + virtualTexturingSettings: + streamingCpuCacheSizeInMegaBytes: 256 + streamingGpuCacheSettings: + - format: 0 + sizeInMegaBytes: 128 + m_UseRenderGraph: 1 + m_Version: 20 + 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_ObsoleteBakedOrCustomReflectionFrameSettings: + 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_ObsoleteRealtimeReflectionFrameSettings: + 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_ObsoleteDefaultVolumeProfile: {fileID: 0} + m_ObsoleteDefaultLookDevProfile: {fileID: 0} + m_ObsoleteFrameSettingsMovedToDefaultSettings: + bitDatas: + data1: 0 + data2: 0 + lodBias: 0 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 0 + msaaMode: 0 + materialQuality: 0 + m_ObsoleteBakedOrCustomReflectionFrameSettingsMovedToDefaultSettings: + bitDatas: + data1: 0 + data2: 0 + lodBias: 0 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 0 + msaaMode: 0 + materialQuality: 0 + m_ObsoleteRealtimeReflectionFrameSettingsMovedToDefaultSettings: + bitDatas: + data1: 0 + data2: 0 + lodBias: 0 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 0 + msaaMode: 0 + materialQuality: 0 + m_ObsoleteRenderPipelineResources: {fileID: 0} + m_ObsoleteRenderPipelineRayTracingResources: {fileID: 0} + m_ObsoleteBeforeTransparentCustomPostProcesses: [] + m_ObsoleteBeforePostProcessCustomPostProcesses: [] + m_ObsoleteAfterPostProcessCustomPostProcesses: [] + m_ObsoleteBeforeTAACustomPostProcesses: [] + m_ObsoleteShaderVariantLogLevel: 0 + m_ObsoleteLensAttenuation: 0 + m_ObsoleteDiffusionProfileSettingsList: [] diff --git a/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Hardware.asset.meta b/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Hardware.asset.meta new file mode 100644 index 00000000000..54fc66c05ea --- /dev/null +++ b/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Hardware.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 595b7210a76055442ae0f4f98f9f2633 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Software.asset b/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Software.asset new file mode 100644 index 00000000000..577ff4c2803 --- /dev/null +++ b/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Software.asset @@ -0,0 +1,464 @@ +%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: 0cf1dab834d4ec34195b920ea7bbf9ec, type: 3} + m_Name: HDRP_Test_Def_TAAU_Software + m_EditorClassIdentifier: + m_RenderPipelineSettings: + supportShadowMask: 1 + supportSSR: 0 + supportSSRTransparent: 0 + supportSSAO: 1 + supportSSGI: 0 + supportSubsurfaceScattering: 1 + sssSampleBudget: + m_Values: 140000002800000050000000 + m_SchemaId: + m_Id: With3Levels + supportVolumetrics: 1 + supportVolumetricClouds: 0 + supportLightLayers: 0 + supportDistortion: 1 + supportTransparentBackface: 1 + supportTransparentDepthPrepass: 1 + supportTransparentDepthPostpass: 1 + colorBufferFormat: 74 + supportCustomPass: 1 + customBufferFormat: 12 + supportedLitShaderMode: 2 + planarReflectionResolution: + m_Values: 000100000004000000040000 + m_SchemaId: + m_Id: With3Levels + supportDecals: 1 + supportDecalLayers: 0 + supportSurfaceGradient: 0 + decalNormalBufferHP: 0 + msaaSampleCount: 1 + supportMotionVectors: 1 + supportRuntimeAOVAPI: 0 + supportDitheringCrossFade: 1 + supportTerrainHole: 0 + supportProbeVolume: 0 + probeVolumeMemoryBudget: 1024 + probeVolumeSHBands: 1 + supportRayTracing: 0 + supportedRayTracingMode: 3 + lightLoopSettings: + cookieAtlasSize: 2048 + cookieFormat: 74 + cookieAtlasLastValidMip: 0 + cookieTexArraySize: 1 + planarReflectionAtlasSize: 1024 + reflectionProbeCacheSize: 64 + reflectionCubemapSize: 256 + reflectionCacheCompressed: 0 + reflectionProbeFormat: 74 + skyReflectionSize: 256 + skyLightingOverrideLayerMask: + serializedVersion: 2 + m_Bits: 0 + supportFabricConvolution: 0 + maxDirectionalLightsOnScreen: 16 + maxPunctualLightsOnScreen: 512 + maxAreaLightsOnScreen: 64 + maxEnvLightsOnScreen: 64 + maxDecalsOnScreen: 512 + maxPlanarReflectionOnScreen: 16 + maxLightsPerClusterCell: 8 + maxLocalVolumetricFogSize: 32 + maxLocalVolumetricFogOnScreen: 64 + hdShadowInitParams: + maxShadowRequests: 128 + directionalShadowsDepthBits: 32 + shadowFilteringQuality: 1 + punctualLightShadowAtlas: + shadowAtlasResolution: 4096 + shadowAtlasDepthBits: 32 + useDynamicViewportRescale: 1 + areaLightShadowAtlas: + shadowAtlasResolution: 4096 + shadowAtlasDepthBits: 32 + useDynamicViewportRescale: 1 + cachedPunctualLightShadowAtlas: 2048 + cachedAreaLightShadowAtlas: 1024 + shadowResolutionDirectional: + m_Values: 00010000000200000004000000080000 + m_SchemaId: + m_Id: With4Levels + shadowResolutionPunctual: + m_Values: 00010000000200000004000000080000 + m_SchemaId: + m_Id: With4Levels + shadowResolutionArea: + m_Values: 00010000000200000004000000080000 + m_SchemaId: + m_Id: With4Levels + maxDirectionalShadowMapResolution: 2048 + maxPunctualShadowMapResolution: 2048 + maxAreaShadowMapResolution: 2048 + supportScreenSpaceShadows: 0 + maxScreenSpaceShadowSlots: 4 + screenSpaceShadowBufferFormat: 48 + decalSettings: + drawDistance: 1000 + atlasWidth: 4096 + atlasHeight: 4096 + perChannelMask: 0 + postProcessSettings: + m_LutSize: 32 + lutFormat: 48 + bufferFormat: 74 + dynamicResolutionSettings: + enabled: 1 + useMipBias: 1 + enableDLSS: 0 + DLSSPerfQualitySetting: 0 + DLSSUseOptimalSettings: 1 + DLSSSharpness: 0 + maxPercentage: 100 + minPercentage: 100 + dynResType: 0 + upsampleFilter: 5 + forceResolution: 1 + forcedPercentage: 50 + lowResTransparencyMinimumThreshold: 0 + lowresTransparentSettings: + enabled: 1 + checkerboardDepthBuffer: 1 + upsampleType: 1 + xrSettings: + singlePass: 1 + occlusionMesh: 1 + cameraJitter: 0 + postProcessQualitySettings: + NearBlurSampleCount: 030000000500000008000000 + NearBlurMaxRadius: + - 2 + - 4 + - 7 + FarBlurSampleCount: 04000000070000000e000000 + FarBlurMaxRadius: + - 5 + - 8 + - 13 + DoFResolution: 040000000200000001000000 + DoFHighQualityFiltering: 000101 + DoFPhysicallyBased: 000000 + MotionBlurSampleCount: 04000000080000000c000000 + BloomRes: 040000000200000002000000 + BloomHighQualityFiltering: 000101 + BloomHighQualityPrefiltering: 000001 + ChromaticAberrationMaxSamples: 03000000060000000c000000 + lightSettings: + useContactShadow: + m_Values: 000001 + m_SchemaId: + m_Id: With3Levels + maximumLODLevel: + m_Values: 000000000000000000000000 + m_SchemaId: + m_Id: With3Levels + lodBias: + m_Values: + - 1 + - 1 + - 1 + m_SchemaId: + m_Id: With3Levels + lightingQualitySettings: + AOStepCount: 040000000600000010000000 + AOFullRes: 000001 + AOMaximumRadiusPixels: 200000002800000050000000 + AOBilateralUpsample: 000101 + AODirectionCount: 010000000200000004000000 + ContactShadowSampleCount: 060000000a00000010000000 + SSRMaxRaySteps: 100000002000000040000000 + SSGIRaySteps: 200000004000000080000000 + SSGIFilterRadius: 100000000e0000000c000000 + RTAORayLength: + - 0.5 + - 3 + - 20 + RTAOSampleCount: 010000000200000008000000 + RTAODenoise: 010101 + RTAODenoiserRadius: + - 0.25 + - 0.5 + - 0.65 + RTGIRayLength: + - 50 + - 50 + - 50 + RTGIFullResolution: 000001 + RTGIClampValue: + - 0.5 + - 0.8 + - 1.5 + RTGIUpScaleRadius: 040000000400000004000000 + RTGIRaySteps: 200000003000000040000000 + RTGIDenoise: 010101 + RTGIHalfResDenoise: 010000 + RTGIDenoiserRadius: + - 0.75 + - 0.5 + - 0.25 + RTGISecondDenoise: 010101 + RTRMinSmoothness: + - 0.6 + - 0.4 + - 0 + RTRSmoothnessFadeStart: + - 0.7 + - 0.5 + - 0 + RTRRayLength: + - 50 + - 50 + - 50 + RTRClampValue: + - 0.8 + - 1 + - 1.2 + RTRFullResolution: 000001 + RTRRayMaxIterations: 200000003000000040000000 + RTRDenoise: 010101 + RTRDenoiserRadius: 080000000c00000010000000 + RTRSmoothDenoising: 010000 + Fog_ControlMode: 000000000000000000000000 + Fog_Budget: + - 0.166 + - 0.33 + - 0.666 + Fog_DepthRatio: + - 0.666 + - 0.666 + - 0.5 + m_ObsoleteLightLayerName0: + m_ObsoleteLightLayerName1: + m_ObsoleteLightLayerName2: + m_ObsoleteLightLayerName3: + m_ObsoleteLightLayerName4: + m_ObsoleteLightLayerName5: + m_ObsoleteLightLayerName6: + m_ObsoleteLightLayerName7: + m_ObsoleteDecalLayerName0: + m_ObsoleteDecalLayerName1: + m_ObsoleteDecalLayerName2: + m_ObsoleteDecalLayerName3: + m_ObsoleteDecalLayerName4: + m_ObsoleteDecalLayerName5: + m_ObsoleteDecalLayerName6: + m_ObsoleteDecalLayerName7: + m_ObsoleteSupportRuntimeDebugDisplay: 0 + allowShaderVariantStripping: 1 + enableSRPBatcher: 1 + availableMaterialQualityLevels: -1 + m_DefaultMaterialQualityLevel: 4 + diffusionProfileSettings: {fileID: 0} + virtualTexturingSettings: + streamingCpuCacheSizeInMegaBytes: 256 + streamingGpuCacheSettings: + - format: 0 + sizeInMegaBytes: 128 + m_UseRenderGraph: 1 + m_Version: 20 + 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_ObsoleteBakedOrCustomReflectionFrameSettings: + 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_ObsoleteRealtimeReflectionFrameSettings: + 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_ObsoleteDefaultVolumeProfile: {fileID: 0} + m_ObsoleteDefaultLookDevProfile: {fileID: 0} + m_ObsoleteFrameSettingsMovedToDefaultSettings: + bitDatas: + data1: 0 + data2: 0 + lodBias: 0 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 0 + msaaMode: 0 + materialQuality: 0 + m_ObsoleteBakedOrCustomReflectionFrameSettingsMovedToDefaultSettings: + bitDatas: + data1: 0 + data2: 0 + lodBias: 0 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 0 + msaaMode: 0 + materialQuality: 0 + m_ObsoleteRealtimeReflectionFrameSettingsMovedToDefaultSettings: + bitDatas: + data1: 0 + data2: 0 + lodBias: 0 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 0 + msaaMode: 0 + materialQuality: 0 + m_ObsoleteRenderPipelineResources: {fileID: 0} + m_ObsoleteRenderPipelineRayTracingResources: {fileID: 0} + m_ObsoleteBeforeTransparentCustomPostProcesses: [] + m_ObsoleteBeforePostProcessCustomPostProcesses: [] + m_ObsoleteAfterPostProcessCustomPostProcesses: [] + m_ObsoleteBeforeTAACustomPostProcesses: [] + m_ObsoleteShaderVariantLogLevel: 0 + m_ObsoleteLensAttenuation: 0 + m_ObsoleteDiffusionProfileSettingsList: [] diff --git a/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Software.asset.meta b/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Software.asset.meta new file mode 100644 index 00000000000..20889903cd4 --- /dev/null +++ b/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_TAAU_Software.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 253d374c89bd7ca4bb61beb4c14905e0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 1d681128b27d3a8c7ee64e3f4d22fa9b16ddb436 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Wed, 7 Jul 2021 16:11:04 +0200 Subject: [PATCH 26/41] Fix editmode test fail. --- .../Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs index 556da28dddd..567ee41dd91 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs @@ -595,6 +595,7 @@ public void CopyTo(HDAdditionalCameraData data) data.taaAntiFlicker = taaAntiFlicker; data.taaMotionVectorRejection = taaMotionVectorRejection; data.taaAntiHistoryRinging = taaAntiHistoryRinging; + data.taaBaseBlendFactor = taaBaseBlendFactor; data.flipYMode = flipYMode; data.fullscreenPassthrough = fullscreenPassthrough; data.allowDynamicResolution = allowDynamicResolution; From e82dd979161c599aff676f197fb11f3c01835dc0 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 8 Jul 2021 14:58:47 +0200 Subject: [PATCH 27/41] References except OSX --- .../Linear/WindowsEditor/Direct3D11/None/4052_TAA.png | 4 ++-- .../WindowsEditor/Direct3D11/None/4060_CustomPostProcess.png | 4 ++-- .../WindowsEditor/Direct3D11/None/4096_DRS-TAAU-Hardware.png | 3 +++ .../WindowsEditor/Direct3D11/None/4097_DRS-TAAU-Software.png | 3 +++ .../Linear/WindowsEditor/Direct3D11/None/4101_FP16Alpha.png | 4 ++-- .../WindowsEditor/Direct3D11/None/9702_CustomPass_API.png | 4 ++-- .../Linear/WindowsEditor/Direct3D12/None/4052_TAA.png | 4 ++-- .../WindowsEditor/Direct3D12/None/4060_CustomPostProcess.png | 4 ++-- .../WindowsEditor/Direct3D12/None/4096_DRS-TAAU-Hardware.png | 3 +++ .../WindowsEditor/Direct3D12/None/4097_DRS-TAAU-Software.png | 3 +++ .../Linear/WindowsEditor/Direct3D12/None/4101_FP16Alpha.png | 4 ++-- .../WindowsEditor/Direct3D12/None/9702_CustomPass_API.png | 4 ++-- .../Linear/WindowsEditor/Vulkan/None/4052_TAA.png | 4 ++-- .../WindowsEditor/Vulkan/None/4060_CustomPostProcess.png | 4 ++-- .../WindowsEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png | 3 +++ .../WindowsEditor/Vulkan/None/4097_DRS-TAAU-Software.png | 3 +++ .../Linear/WindowsEditor/Vulkan/None/4101_FP16Alpha.png | 4 ++-- .../Linear/WindowsEditor/Vulkan/None/9702_CustomPass_API.png | 4 ++-- 18 files changed, 42 insertions(+), 24 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4096_DRS-TAAU-Hardware.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4097_DRS-TAAU-Software.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4096_DRS-TAAU-Hardware.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4097_DRS-TAAU-Software.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4097_DRS-TAAU-Software.png diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4052_TAA.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4052_TAA.png index 20eecb08a33..ac7bb0f0dfa 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4052_TAA.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4052_TAA.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a805241f883ffd2806dc4b72eb8adc29e42be21834b8fa0167d00947571ccc63 -size 194522 +oid sha256:3f80be48dfec485c0102a435d759b03731f0db642f72b45829087c3f34ca1627 +size 177640 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4060_CustomPostProcess.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4060_CustomPostProcess.png index ca4b519c9e5..175643be918 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4060_CustomPostProcess.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4060_CustomPostProcess.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4bb050dd35325d0f3bf2d405683804ca3408acbfcc885beb9bad07f32e6dc082 -size 90558 +oid sha256:d6df7c9942caee5e8b28021dd59fc770a2fa3ddb02dc66e9fd6867abf19b9bc3 +size 91610 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4096_DRS-TAAU-Hardware.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4096_DRS-TAAU-Hardware.png new file mode 100644 index 00000000000..e812144c4f2 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4096_DRS-TAAU-Hardware.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dee73a3f8dd75b39837c151a76767ce7047078ca94feb7d32687e998561c7930 +size 620686 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4097_DRS-TAAU-Software.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4097_DRS-TAAU-Software.png new file mode 100644 index 00000000000..ae520944477 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4097_DRS-TAAU-Software.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5771845598443de7f14cc18ff427411c5d5a23258079700b9e23b3318763e207 +size 620659 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4101_FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4101_FP16Alpha.png index 599629e8ace..6f976ceaa66 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4101_FP16Alpha.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4101_FP16Alpha.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8aa52d125182c0bdfdad548bcbf14eb942528236ef40ea667b27b7f73f8c4dd2 -size 493615 +oid sha256:92f8f2cb436ccf621fced05d2ff81d022ba0538e063c66413e15452d32911c9b +size 480984 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 index d4328d90604..cc53e49eb84 100644 --- 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 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ce4585d08d316535c54e09c183d8b36d6c799f01c2bcaa0775ff96f7ebe37a34 -size 213505 +oid sha256:2a65fca541f03a39485b94689b937c8bdf9cc8591ea381f10b18181056ee7ebf +size 209183 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4052_TAA.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4052_TAA.png index 20eecb08a33..ac7bb0f0dfa 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4052_TAA.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4052_TAA.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a805241f883ffd2806dc4b72eb8adc29e42be21834b8fa0167d00947571ccc63 -size 194522 +oid sha256:3f80be48dfec485c0102a435d759b03731f0db642f72b45829087c3f34ca1627 +size 177640 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4060_CustomPostProcess.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4060_CustomPostProcess.png index ca4b519c9e5..175643be918 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4060_CustomPostProcess.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4060_CustomPostProcess.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4bb050dd35325d0f3bf2d405683804ca3408acbfcc885beb9bad07f32e6dc082 -size 90558 +oid sha256:d6df7c9942caee5e8b28021dd59fc770a2fa3ddb02dc66e9fd6867abf19b9bc3 +size 91610 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4096_DRS-TAAU-Hardware.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4096_DRS-TAAU-Hardware.png new file mode 100644 index 00000000000..d81eea10114 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4096_DRS-TAAU-Hardware.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f578d63ab12f624532396b65643728da61259c3450ce7e8cda48d370a531d4f0 +size 618841 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4097_DRS-TAAU-Software.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4097_DRS-TAAU-Software.png new file mode 100644 index 00000000000..156e8d3aa24 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4097_DRS-TAAU-Software.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be3de724c8d4b22dcd28b1ea90d4656add188771eb9f75db97412e61bd8c1934 +size 620769 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4101_FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4101_FP16Alpha.png index 599629e8ace..b036dfb246e 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4101_FP16Alpha.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4101_FP16Alpha.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8aa52d125182c0bdfdad548bcbf14eb942528236ef40ea667b27b7f73f8c4dd2 -size 493615 +oid sha256:c2786df17b71acef4e64d3822bc7e4fe29e64589c5570e8d92f6d866df5f6995 +size 480996 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/9702_CustomPass_API.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/9702_CustomPass_API.png index f91499c642a..92c4ec6686d 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/9702_CustomPass_API.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/9702_CustomPass_API.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd497a640b849c49e84e7face12aa1756e83877891e59030d7192c377cf77c55 -size 213482 +oid sha256:623eed7fd2ad67e89d9e1a939ed14063f9c5c77840010c7348fc3af63530c51c +size 209172 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4052_TAA.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4052_TAA.png index 337facbd7c4..f17ea4fb197 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4052_TAA.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4052_TAA.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0e2ef1a6674cac364252eaaf750ec9a3eaed84ef386eb919eb988ccc885c3583 -size 195066 +oid sha256:e22b5621cabf1d1ed2293edadee39b3b28e050d9488cc94cca78eb9fba94501e +size 177387 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4060_CustomPostProcess.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4060_CustomPostProcess.png index a47136b4eaa..1b78cf278a4 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4060_CustomPostProcess.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4060_CustomPostProcess.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b8a00f436ded05ba40edd79f43772ea7e31216feac5aa0c6b2bd599cf8a51e0 -size 90407 +oid sha256:68d550efcc48d375fe68311c2c9fe9c5fe68f2a784c82e37e37e692fe7d3529e +size 91480 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png new file mode 100644 index 00000000000..9f6a2abc2ce --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb9451f4dbe8b01d1560f88dc2d92599c5473826a4831f7dc2cc71963684ef93 +size 619325 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4097_DRS-TAAU-Software.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4097_DRS-TAAU-Software.png new file mode 100644 index 00000000000..9f6a2abc2ce --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4097_DRS-TAAU-Software.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb9451f4dbe8b01d1560f88dc2d92599c5473826a4831f7dc2cc71963684ef93 +size 619325 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4101_FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4101_FP16Alpha.png index 599629e8ace..bdeffc9eea4 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4101_FP16Alpha.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4101_FP16Alpha.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8aa52d125182c0bdfdad548bcbf14eb942528236ef40ea667b27b7f73f8c4dd2 -size 493615 +oid sha256:a2cd1a93437683b80c4083b87b995ab797e5c1624799d3aafacd561ff901ed7d +size 475813 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 index 6992b8f16e4..c8d2f55fff2 100644 --- 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 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a4cc90a3d01a0e6b2e119559e03c67bfde767380e3e5a5b27c6c60cf60a06e0e -size 212679 +oid sha256:0dd77c654c606b417db63db5efd8363369f54687b9e14236d2ebfeeb11b0d440 +size 208250 From 4c7570ae6a9813aa38f13e8a943377612a4d4503 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 8 Jul 2021 16:29:13 +0200 Subject: [PATCH 28/41] OSX refs --- .../ReferenceImages/Linear/OSXEditor/Metal/None/4052_TAA.png | 4 ++-- .../Linear/OSXEditor/Metal/None/4060_CustomPostProcess.png | 4 ++-- .../Linear/OSXEditor/Metal/None/4096_DRS-TAAU-Hardware.png | 3 +++ .../Linear/OSXEditor/Metal/None/4097_DRS-TAAU-Software.png | 3 +++ .../Linear/OSXEditor/Metal/None/4101_FP16Alpha.png | 4 ++-- .../Linear/OSXEditor/Metal/None/9702_CustomPass_API.png | 4 ++-- 6 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4096_DRS-TAAU-Hardware.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4097_DRS-TAAU-Software.png diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4052_TAA.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4052_TAA.png index 70877d9f47e..b2755a6dc3a 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4052_TAA.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4052_TAA.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:67c9894ff1ce395e74bb73a76f6693886b6cc183357776fbdf8b43201061fe6e -size 196476 +oid sha256:14fee5ea58febd5fdcd3d962fc327476471e79ca67947234cab4e9e2dc7c3526 +size 179115 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4060_CustomPostProcess.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4060_CustomPostProcess.png index d6313bbab9d..9fef062c4bb 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4060_CustomPostProcess.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4060_CustomPostProcess.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ebfae7d8520a68db3f2f70e1cae7d808d9dfca1478a1672fa8430d9511484d0c -size 83301 +oid sha256:8333782bb4ffd0311f31bd7bf155eca1e767415556afc19a7ae2e707d0859d72 +size 84688 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4096_DRS-TAAU-Hardware.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4096_DRS-TAAU-Hardware.png new file mode 100644 index 00000000000..852081d3bbf --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4096_DRS-TAAU-Hardware.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1afa6b88b235f2fdea2e85aee3655df9882cb803675b9435f4b5be6d35508ced +size 613935 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4097_DRS-TAAU-Software.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4097_DRS-TAAU-Software.png new file mode 100644 index 00000000000..13e7adbf277 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4097_DRS-TAAU-Software.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5aa121fa10274f0f7a9f6101f99c41e306073f095e69ace458657baa32af211 +size 616655 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4101_FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4101_FP16Alpha.png index 1c91cb44085..77cc7eccf13 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4101_FP16Alpha.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4101_FP16Alpha.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e43d50a25d382c1d342a9e19faa1128ea6889dcdbb4a146feaa45e392f8ec50f -size 552725 +oid sha256:a77c249f5ff9d84c6cebb0724eb55238a30972a44c3447e0538de5750b4007b8 +size 529815 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 index 05f4f4bc9c6..2cd1ab6e4c9 100644 --- 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 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2ca6d59266d4bf27d4a24eaefdf540b1558bd548a2283780b72af1bb932f571c -size 214004 +oid sha256:5580f5680456a5495facd9c83c3856b6f926b27fd43b22b02e8753a9186c2367 +size 209477 From eec176867ff11f7d843620e5793064fbd1c99c6c Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 8 Jul 2021 17:30:18 +0200 Subject: [PATCH 29/41] Fix GCAlloc issues --- .../None/4096_DRS-TAAU-Hardware.png.meta | 110 ++++++++++++++++++ .../None/4097_DRS-TAAU-Software.png.meta | 110 ++++++++++++++++++ .../Runtime/RenderPipeline/Camera/HDCamera.cs | 47 +++----- .../HDRenderPipeline.PostProcess.cs | 72 +++++------- 4 files changed, 264 insertions(+), 75 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4096_DRS-TAAU-Hardware.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4097_DRS-TAAU-Software.png.meta diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4096_DRS-TAAU-Hardware.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4096_DRS-TAAU-Hardware.png.meta new file mode 100644 index 00000000000..b0a0d8f405f --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4096_DRS-TAAU-Hardware.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: fab1891278b38b34287f45c7ce7a45f2 +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 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + 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 + flipbookRows: 1 + flipbookColumns: 1 + 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 + - serializedVersion: 3 + buildTarget: Standalone + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4097_DRS-TAAU-Software.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4097_DRS-TAAU-Software.png.meta new file mode 100644 index 00000000000..b45bdaecdde --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4097_DRS-TAAU-Software.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 87d0015e61640974fb4c9487726834ae +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 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + 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 + flipbookRows: 1 + flipbookColumns: 1 + 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 + - serializedVersion: 3 + buildTarget: Standalone + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index b4ace9dd5fc..c36522d5cd0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -1166,7 +1166,7 @@ internal bool AllocateAmbientOcclusionHistoryBuffer(float scaleFactor) { ReleaseHistoryFrameRT((int)HDCameraFrameHistoryType.AmbientOcclusion); - var aoAlloc = new AmbientOcclusionAllocator(scaleFactor); + var aoAlloc = new CustomHistoryAllocator(new Vector2(scaleFactor, scaleFactor), GraphicsFormat.R32_UInt, "AO Packed history"); AllocHistoryFrameRT((int)HDCameraFrameHistoryType.AmbientOcclusion, aoAlloc.Allocator, 2); m_AmbientOcclusionResolutionScale = scaleFactor; @@ -1182,28 +1182,13 @@ internal void AllocateScreenSpaceAccumulationHistoryBuffer(float scaleFactor) { ReleaseHistoryFrameRT((int)HDCameraFrameHistoryType.ScreenSpaceReflectionAccumulation); - var ssrAlloc = new ScreenSpaceAccumulationAllocator(scaleFactor); + var ssrAlloc = new CustomHistoryAllocator(new Vector2(scaleFactor, scaleFactor), GraphicsFormat.R16G16B16A16_SFloat, "SSR_Accum Packed history"); AllocHistoryFrameRT((int)HDCameraFrameHistoryType.ScreenSpaceReflectionAccumulation, ssrAlloc.Allocator, 2); m_ScreenSpaceAccumulationResolutionScale = scaleFactor; } } - #region Private API - // Workaround for the Allocator callback so it doesn't allocate memory because of the capture of scaleFactor. - struct ScreenSpaceAllocator - { - float scaleFactor; - - public ScreenSpaceAllocator(float scaleFactor) => this.scaleFactor = scaleFactor; - - public RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) - { - return rtHandleSystem.Alloc(Vector2.one * scaleFactor, TextureXR.slices, filterMode: FilterMode.Point, colorFormat: GraphicsFormat.R16G16B16A16_SFloat, dimension: TextureXR.dimension, useDynamicScale: true, enableRandomWrite: true, name: string.Format("{0}_ScreenSpaceReflection history_{1}", id, frameIndex)); - } - } - #endregion - internal void ReleaseHistoryFrameRT(int id) { m_HistoryRTSystem.ReleaseBuffer(id); @@ -1301,33 +1286,31 @@ internal void UpdateCurrentSky(SkyManager skyManager) internal void OverridePixelRect(Rect newPixelRect) => m_OverridePixelRect = newPixelRect; internal void ResetPixelRect() => m_OverridePixelRect = null; - #endregion - #region Private API // Workaround for the Allocator callback so it doesn't allocate memory because of the capture of scaleFactor. - struct AmbientOcclusionAllocator + internal struct CustomHistoryAllocator { - float scaleFactor; + Vector2 scaleFactor; + GraphicsFormat format; + string name; - public AmbientOcclusionAllocator(float scaleFactor) => this.scaleFactor = scaleFactor; + public CustomHistoryAllocator(Vector2 scaleFactor, GraphicsFormat format, string name) + { + this.scaleFactor = scaleFactor; + this.format = format; + this.name = name; + } public RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) { - return rtHandleSystem.Alloc(Vector2.one * scaleFactor, TextureXR.slices, filterMode: FilterMode.Point, colorFormat: GraphicsFormat.R32_UInt, dimension: TextureXR.dimension, useDynamicScale: true, enableRandomWrite: true, name: string.Format("{0}_AO Packed history_{1}", id, frameIndex)); + return rtHandleSystem.Alloc(Vector2.one * scaleFactor, TextureXR.slices, filterMode: FilterMode.Point, colorFormat: format, dimension: TextureXR.dimension, useDynamicScale: true, enableRandomWrite: true, name: string.Format("{0}_{1}_{2}", id, name, frameIndex)); } } + #endregion - struct ScreenSpaceAccumulationAllocator - { - float scaleFactor; - public ScreenSpaceAccumulationAllocator(float scaleFactor) => this.scaleFactor = scaleFactor; + #region Private API - public RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) - { - return rtHandleSystem.Alloc(Vector2.one * scaleFactor, TextureXR.slices, filterMode: FilterMode.Point, colorFormat: GraphicsFormat.R16G16B16A16_SFloat, dimension: TextureXR.dimension, useDynamicScale: true, enableRandomWrite: true, name: string.Format("{0}_SSR_Accum Packed history_{1}", id, frameIndex)); - } - } static Dictionary<(Camera, int), HDCamera> s_Cameras = new Dictionary<(Camera, int), HDCamera>(); static List<(Camera, int)> s_Cleanup = new List<(Camera, int)>(); // Recycled to reduce GC pressure diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index ad164a8866c..484a139130f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -69,6 +69,9 @@ private enum SMAAStage Vector2Int m_AfterDynamicResUpscaleRes = new Vector2Int(1, 1); Vector2Int m_BeforeDynamicResUpscaleRes = new Vector2Int(1, 1); + // TAA + float[] taaSampleWeights = new float[9]; + private enum ResolutionGroup { BeforeDynamicResUpscale, @@ -1360,36 +1363,22 @@ TextureHandle CustomPostProcessPass(RenderGraph renderGraph, HDCamera hdCamera, void GrabTemporalAntialiasingHistoryTextures(HDCamera camera, out RTHandle previous, out RTHandle next, Vector2 customScale, bool postDoF = false) { - RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) - { - return rtHandleSystem.Alloc( - Vector2.one * customScale, TextureXR.slices, DepthBits.None, dimension: TextureXR.dimension, - filterMode: FilterMode.Bilinear, colorFormat: GetPostprocessTextureFormat(), - enableRandomWrite: true, useDynamicScale: true, name: $"{id} TAA History" - ); - } - int historyType = (int)(postDoF ? HDCameraFrameHistoryType.TemporalAntialiasingPostDoF : HDCameraFrameHistoryType.TemporalAntialiasing); + var taaAllocator = new HDCamera.CustomHistoryAllocator(customScale, GetPostprocessTextureFormat(), "TAA History"); + next = camera.GetCurrentFrameRT(historyType) - ?? camera.AllocHistoryFrameRT(historyType, Allocator, 2); + ?? camera.AllocHistoryFrameRT(historyType, taaAllocator.Allocator, 2); previous = camera.GetPreviousFrameRT(historyType); } void GrabVelocityMagnitudeHistoryTextures(HDCamera camera, Vector2 customScale, out RTHandle previous, out RTHandle next) { - RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) - { - return rtHandleSystem.Alloc( - Vector2.one * customScale, TextureXR.slices, DepthBits.None, dimension: TextureXR.dimension, - filterMode: FilterMode.Bilinear, colorFormat: GraphicsFormat.R16_SFloat, - enableRandomWrite: true, useDynamicScale: true, name: $"{id} Velocity magnitude" - ); - } + var taaAllocator = new HDCamera.CustomHistoryAllocator(customScale, GraphicsFormat.R16_SFloat, "Velocity magnitude"); next = camera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude) - ?? camera.AllocHistoryFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude, Allocator, 2); + ?? camera.AllocHistoryFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude, taaAllocator.Allocator, 2); previous = camera.GetPreviousFrameRT((int)HDCameraFrameHistoryType.TAAMotionVectorMagnitude); } @@ -1429,6 +1418,19 @@ class TemporalAntiAliasingData public TextureHandle nextMVLen; } + static readonly Vector2Int[] TAASampleOffsets = new Vector2Int[] + { + new Vector2Int(0, 0), + new Vector2Int(0, 1), + new Vector2Int(1, 0), + new Vector2Int(-1, 0), + new Vector2Int(0, -1), + new Vector2Int(-1, 1), + new Vector2Int(1, -1), + new Vector2Int(1, 1), + new Vector2Int(-1, -1) + }; + void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, TemporalAntiAliasingData passData, HDCamera camera, TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle sourceTexture, bool postDoF, string outputName) { @@ -1446,41 +1448,25 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem passData.taaParameters = new Vector4(TAAU && postDoF ? 0.25f : camera.taaHistorySharpening, postDoF ? maxAntiflicker : Mathf.Lerp(minAntiflicker, maxAntiflicker, camera.taaAntiFlicker), motionRejectionMultiplier, temporalContrastForMaxAntiFlicker); // Precompute weights used for the Blackman-Harris filter. - - Vector2Int[] offsets = new Vector2Int[] - { - new Vector2Int(0, 0), - new Vector2Int(0, 1), - new Vector2Int(1, 0), - new Vector2Int(-1, 0), - new Vector2Int(0, -1), - new Vector2Int(-1, 1), - new Vector2Int(1, -1), - new Vector2Int(1, 1), - new Vector2Int(-1, -1) - }; - - - float[] weights = new float[9]; float totalWeight = 0; for (int i = 0; i < 9; ++i) { - float x = offsets[i].x - camera.taaJitter.x; - float y = offsets[i].y - camera.taaJitter.y; + float x = TAASampleOffsets[i].x - camera.taaJitter.x; + float y = TAASampleOffsets[i].y - camera.taaJitter.y; float d = (x * x + y * y); - weights[i] = Mathf.Exp((-0.5f / (0.22f)) * d); - totalWeight += weights[i]; + taaSampleWeights[i] = Mathf.Exp((-0.5f / (0.22f)) * d); + totalWeight += taaSampleWeights[i]; } for (int i = 0; i < 9; ++i) { - weights[i] /= totalWeight; + taaSampleWeights[i] /= totalWeight; } - passData.taaParameters1 = new Vector4(1.0f - camera.taaBaseBlendFactor, weights[0], 0, 0); - passData.taaFilterWeights = new Vector4(weights[1], weights[2], weights[3], weights[4]); - passData.taaFilterWeights1 = new Vector4(weights[5], weights[6], weights[7], weights[8]); + passData.taaParameters1 = new Vector4(1.0f - camera.taaBaseBlendFactor, taaSampleWeights[0], 0, 0); + passData.taaFilterWeights = new Vector4(taaSampleWeights[1], taaSampleWeights[2], taaSampleWeights[3], taaSampleWeights[4]); + passData.taaFilterWeights1 = new Vector4(taaSampleWeights[5], taaSampleWeights[6], taaSampleWeights[7], taaSampleWeights[8]); passData.temporalAAMaterial = m_TemporalAAMaterial; passData.temporalAAMaterial.shaderKeywords = null; From 3a57b7b362018b06f26c25ccdbc8c41788a752d9 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 8 Jul 2021 17:31:59 +0200 Subject: [PATCH 30/41] Missing meta --- .../None/4096_DRS-TAAU-Hardware.png.meta | 110 ++++++++++++++++++ .../None/4097_DRS-TAAU-Software.png.meta | 110 ++++++++++++++++++ .../None/4096_DRS-TAAU-Hardware.png.meta | 110 ++++++++++++++++++ .../None/4097_DRS-TAAU-Software.png.meta | 110 ++++++++++++++++++ .../None/4096_DRS-TAAU-Hardware.png.meta | 110 ++++++++++++++++++ .../None/4097_DRS-TAAU-Software.png.meta | 110 ++++++++++++++++++ 6 files changed, 660 insertions(+) create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4096_DRS-TAAU-Hardware.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4097_DRS-TAAU-Software.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4096_DRS-TAAU-Hardware.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4097_DRS-TAAU-Software.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4097_DRS-TAAU-Software.png.meta diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4096_DRS-TAAU-Hardware.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4096_DRS-TAAU-Hardware.png.meta new file mode 100644 index 00000000000..f3f88854640 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4096_DRS-TAAU-Hardware.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 27313e41d1b2a9b4d8c0c619cd66c9ea +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 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + 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 + flipbookRows: 1 + flipbookColumns: 1 + 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 + - serializedVersion: 3 + buildTarget: Standalone + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4097_DRS-TAAU-Software.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4097_DRS-TAAU-Software.png.meta new file mode 100644 index 00000000000..d7e1acca657 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4097_DRS-TAAU-Software.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 12d9728f31ac33b4aaefd7bc0aef01b4 +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 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + 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 + flipbookRows: 1 + flipbookColumns: 1 + 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 + - serializedVersion: 3 + buildTarget: Standalone + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4096_DRS-TAAU-Hardware.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4096_DRS-TAAU-Hardware.png.meta new file mode 100644 index 00000000000..743d17616ce --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4096_DRS-TAAU-Hardware.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: a1e7eb8695e995341858b0ed854400d6 +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 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + 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 + flipbookRows: 1 + flipbookColumns: 1 + 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 + - serializedVersion: 3 + buildTarget: Standalone + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4097_DRS-TAAU-Software.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4097_DRS-TAAU-Software.png.meta new file mode 100644 index 00000000000..79ee82a0144 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4097_DRS-TAAU-Software.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 1548cee190fdbe24d9d90117ec55cfc2 +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 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + 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 + flipbookRows: 1 + flipbookColumns: 1 + 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 + - serializedVersion: 3 + buildTarget: Standalone + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png.meta new file mode 100644 index 00000000000..d1fe17f4b18 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: c5ebbd80c9dc3404bb06b7e494ac5214 +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 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + 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 + flipbookRows: 1 + flipbookColumns: 1 + 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 + - serializedVersion: 3 + buildTarget: Standalone + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4097_DRS-TAAU-Software.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4097_DRS-TAAU-Software.png.meta new file mode 100644 index 00000000000..d6799f1681b --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4097_DRS-TAAU-Software.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: d16fe2b419d33e94da684d039bfcb63a +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 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + 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 + flipbookRows: 1 + flipbookColumns: 1 + 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 + - serializedVersion: 3 + buildTarget: Standalone + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: From 4e3f39a48fc4c491eca0c31703a55f3ade836d70 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Fri, 9 Jul 2021 09:26:28 +0200 Subject: [PATCH 31/41] Third time's a charm --- .../Linear/LinuxEditor/Vulkan/None/4052_TAA.png | 4 ++-- .../Linear/LinuxEditor/Vulkan/None/4060_CustomPostProcess.png | 4 ++-- .../Linear/LinuxEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png | 3 +++ .../Linear/LinuxEditor/Vulkan/None/4097_DRS-TAAU-Software.png | 3 +++ .../Linear/LinuxEditor/Vulkan/None/4101_FP16Alpha.png | 4 ++-- .../Linear/LinuxEditor/Vulkan/None/9702_CustomPass_API.png | 4 ++-- .../Linear/OSXEditor/Metal/None/9702_CustomPass_API.png | 4 ++-- .../WindowsEditor/Direct3D11/None/9702_CustomPass_API.png | 4 ++-- .../WindowsEditor/Direct3D12/None/9702_CustomPass_API.png | 4 ++-- .../Linear/WindowsEditor/Vulkan/None/9702_CustomPass_API.png | 4 ++-- 10 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4097_DRS-TAAU-Software.png diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4052_TAA.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4052_TAA.png index 5d6486e1ee3..f17ea4fb197 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4052_TAA.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4052_TAA.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:305228b6adef25219e41ce47b279ef47b852c6ea80f454f1b6e91ed0cfbd59d4 -size 215576 +oid sha256:e22b5621cabf1d1ed2293edadee39b3b28e050d9488cc94cca78eb9fba94501e +size 177387 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4060_CustomPostProcess.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4060_CustomPostProcess.png index a47136b4eaa..1b78cf278a4 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4060_CustomPostProcess.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4060_CustomPostProcess.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b8a00f436ded05ba40edd79f43772ea7e31216feac5aa0c6b2bd599cf8a51e0 -size 90407 +oid sha256:68d550efcc48d375fe68311c2c9fe9c5fe68f2a784c82e37e37e692fe7d3529e +size 91480 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png new file mode 100644 index 00000000000..9f6a2abc2ce --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4096_DRS-TAAU-Hardware.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb9451f4dbe8b01d1560f88dc2d92599c5473826a4831f7dc2cc71963684ef93 +size 619325 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4097_DRS-TAAU-Software.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4097_DRS-TAAU-Software.png new file mode 100644 index 00000000000..9f6a2abc2ce --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4097_DRS-TAAU-Software.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb9451f4dbe8b01d1560f88dc2d92599c5473826a4831f7dc2cc71963684ef93 +size 619325 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4101_FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4101_FP16Alpha.png index 599629e8ace..bdeffc9eea4 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4101_FP16Alpha.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4101_FP16Alpha.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8aa52d125182c0bdfdad548bcbf14eb942528236ef40ea667b27b7f73f8c4dd2 -size 493615 +oid sha256:a2cd1a93437683b80c4083b87b995ab797e5c1624799d3aafacd561ff901ed7d +size 475813 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/9702_CustomPass_API.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/9702_CustomPass_API.png index a063a51e3e7..76030017556 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/9702_CustomPass_API.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/9702_CustomPass_API.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c76d38d7338a3be3c01ca482dd9dd767f81f93dc8ca018a1d78d54371ddf6ef7 -size 190895 +oid sha256:e8081d07475659c831bda6fd74f1010b366cc926c096f677e24a8f09ed28c07b +size 188504 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 index 926e74188db..d2d255c2c64 100644 --- 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 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ea0ab509538e066671c7bf5cb6171c1bf8e1b5b3c98cd04ad341ac60c2498ec4 -size 191676 +oid sha256:c87dfdf75b61c12611903030969da2de15aa214dd82472a1f25e74a69f2fc08e +size 189375 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 index 2b0263271c3..b3a8983e524 100644 --- 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 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e22d018c50a6adbe6ce155e8e02fce07b8ee35fc382d5632a48809a8beb37328 -size 191699 +oid sha256:a099577023e97b246dd6f8316a576e5e25806d6b8d04a060068df55c5750e639 +size 189212 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/9702_CustomPass_API.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/9702_CustomPass_API.png index 2b0263271c3..b46a67002f0 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/9702_CustomPass_API.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/9702_CustomPass_API.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e22d018c50a6adbe6ce155e8e02fce07b8ee35fc382d5632a48809a8beb37328 -size 191699 +oid sha256:a19023a793f6aa6bb48be2c5f59ad519426d74dfae37e3a6350a08eb1f6751e5 +size 189233 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 index 7820fa0078e..821210d3f8c 100644 --- 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 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1e3b02d2b603bf74d89f625fe61860cfa2d5387a5242d5fe49655403b8ee439a -size 190827 +oid sha256:780450337ef24b94d59de3fd3c913c1d075755f3e0276a9103f9dc42c4a0f339 +size 188411 From ee6f79c121d0dd7415cf91fd0e9d3f2fd98ee683 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Fri, 9 Jul 2021 15:22:13 +0200 Subject: [PATCH 32/41] Remove experimental ( even though still improvable ) --- .../Runtime/Common/GlobalDynamicResolutionSettings.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.core/Runtime/Common/GlobalDynamicResolutionSettings.cs b/com.unity.render-pipelines.core/Runtime/Common/GlobalDynamicResolutionSettings.cs index 6390c755c0e..24d5fa25af7 100644 --- a/com.unity.render-pipelines.core/Runtime/Common/GlobalDynamicResolutionSettings.cs +++ b/com.unity.render-pipelines.core/Runtime/Common/GlobalDynamicResolutionSettings.cs @@ -44,9 +44,9 @@ public enum DynamicResUpscaleFilter : byte [InspectorName("Edge Adaptive Scaling Upres")] EdgeAdaptiveScalingUpres, /// - /// Edge Adaptive Scaling Upres. + /// Temporal Upscaling. /// - [InspectorName("TAA Upsample (Experimental)")] + [InspectorName("TAA Upscale")] TAAU } From d2e0c4d4932fa539c8d900b59a454e99ba18c26b Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 22 Jul 2021 12:23:42 +0200 Subject: [PATCH 33/41] Fix for when PP is disabled. --- .../HDRenderPipeline.PostProcess.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 9e221426272..cff5dbe139a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -341,20 +341,20 @@ void BeginPostProcessFrame(CommandBuffer cmd, HDCamera camera, HDRenderPipeline // Prefetch frame settings - these aren't free to pull so we want to do it only once // per frame var frameSettings = camera.frameSettings; - m_StopNaNFS = frameSettings.IsEnabled(FrameSettingsField.StopNaN); - m_DepthOfFieldFS = frameSettings.IsEnabled(FrameSettingsField.DepthOfField); - m_MotionBlurFS = frameSettings.IsEnabled(FrameSettingsField.MotionBlur); - m_PaniniProjectionFS = frameSettings.IsEnabled(FrameSettingsField.PaniniProjection); - m_BloomFS = frameSettings.IsEnabled(FrameSettingsField.Bloom); - m_LensFlareDataDataDrivenFS = frameSettings.IsEnabled(FrameSettingsField.LensFlareDataDriven); - m_ChromaticAberrationFS = frameSettings.IsEnabled(FrameSettingsField.ChromaticAberration); - m_LensDistortionFS = frameSettings.IsEnabled(FrameSettingsField.LensDistortion); - m_VignetteFS = frameSettings.IsEnabled(FrameSettingsField.Vignette); - m_ColorGradingFS = frameSettings.IsEnabled(FrameSettingsField.ColorGrading); - m_TonemappingFS = frameSettings.IsEnabled(FrameSettingsField.Tonemapping); - m_FilmGrainFS = frameSettings.IsEnabled(FrameSettingsField.FilmGrain); - m_DitheringFS = frameSettings.IsEnabled(FrameSettingsField.Dithering); - m_AntialiasingFS = frameSettings.IsEnabled(FrameSettingsField.Antialiasing); + m_StopNaNFS = frameSettings.IsEnabled(FrameSettingsField.StopNaN) && m_PostProcessEnabled; + m_DepthOfFieldFS = frameSettings.IsEnabled(FrameSettingsField.DepthOfField) && m_PostProcessEnabled; + m_MotionBlurFS = frameSettings.IsEnabled(FrameSettingsField.MotionBlur) && m_PostProcessEnabled; + m_PaniniProjectionFS = frameSettings.IsEnabled(FrameSettingsField.PaniniProjection) && m_PostProcessEnabled; + m_BloomFS = frameSettings.IsEnabled(FrameSettingsField.Bloom) && m_PostProcessEnabled; + m_LensFlareDataDataDrivenFS = frameSettings.IsEnabled(FrameSettingsField.LensFlareDataDriven) && m_PostProcessEnabled; + m_ChromaticAberrationFS = frameSettings.IsEnabled(FrameSettingsField.ChromaticAberration) && m_PostProcessEnabled; + m_LensDistortionFS = frameSettings.IsEnabled(FrameSettingsField.LensDistortion) && m_PostProcessEnabled; + m_VignetteFS = frameSettings.IsEnabled(FrameSettingsField.Vignette) && m_PostProcessEnabled; + m_ColorGradingFS = frameSettings.IsEnabled(FrameSettingsField.ColorGrading) && m_PostProcessEnabled; + m_TonemappingFS = frameSettings.IsEnabled(FrameSettingsField.Tonemapping) && m_PostProcessEnabled; + m_FilmGrainFS = frameSettings.IsEnabled(FrameSettingsField.FilmGrain) && m_PostProcessEnabled; + m_DitheringFS = frameSettings.IsEnabled(FrameSettingsField.Dithering) && m_PostProcessEnabled; + m_AntialiasingFS = frameSettings.IsEnabled(FrameSettingsField.Antialiasing) || camera.IsTAAUEnabled(); // Override full screen anti-aliasing when doing path tracing (which is naturally anti-aliased already) m_AntialiasingFS &= !m_PathTracing.enable.value; @@ -462,7 +462,7 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, // Note: whether a pass is really executed or not is generally inside the Do* functions. // with few exceptions. - if (m_PostProcessEnabled) + if (m_PostProcessEnabled || m_AntialiasingFS) { source = StopNaNsPass(renderGraph, hdCamera, source); From de9d5ad72abba5d030b81c45b56f1caf1a5f4239 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 22 Jul 2021 13:39:51 +0200 Subject: [PATCH 34/41] Fix flash --- .../RenderPipeline/HDRenderPipeline.PostProcess.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index cff5dbe139a..75e5db861e4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1194,6 +1194,8 @@ TextureHandle DynamicExposurePass(RenderGraph renderGraph, HDCamera hdCamera, Te { // Dynamic exposure - will be applied in the next frame // Not considered as a post-process so it's not affected by its enabled state + + TextureHandle exposureForImmediateApplication = TextureHandle.nullHandle; if (!IsExposureFixed(hdCamera) && hdCamera.exposureControlFS) { using (var builder = renderGraph.AddRenderPass("Dynamic Exposure", out var passData, ProfilingSampler.Get(HDProfileId.DynamicExposure))) @@ -1208,6 +1210,7 @@ TextureHandle DynamicExposurePass(RenderGraph renderGraph, HDCamera hdCamera, Te { DoHistogramBasedExposure(data, ctx.cmd); }); + exposureForImmediateApplication = passData.nextExposure; } else { @@ -1221,6 +1224,7 @@ TextureHandle DynamicExposurePass(RenderGraph renderGraph, HDCamera hdCamera, Te { DoDynamicExposure(data, ctx.cmd); }); + exposureForImmediateApplication = passData.nextExposure; } } @@ -1236,7 +1240,7 @@ TextureHandle DynamicExposurePass(RenderGraph renderGraph, HDCamera hdCamera, Te passData.height = hdCamera.actualHeight; passData.viewCount = hdCamera.viewCount; passData.source = builder.ReadTexture(source); - passData.prevExposure = builder.ReadTexture(renderGraph.ImportTexture(GetPreviousExposureTexture(hdCamera))); + passData.prevExposure = exposureForImmediateApplication; TextureHandle dest = GetPostprocessOutputHandle(renderGraph, "Apply Exposure Destination"); passData.destination = builder.WriteTexture(dest); @@ -1244,10 +1248,6 @@ TextureHandle DynamicExposurePass(RenderGraph renderGraph, HDCamera hdCamera, Te builder.SetRenderFunc( (ApplyExposureData data, RenderGraphContext ctx) => { - // Note: we use previous instead of current because the textures - // are swapped internally as the system expects the texture will be used - // on the next frame. So the actual "current" for this frame is in - // "previous". ctx.cmd.SetComputeTextureParam(data.applyExposureCS, data.applyExposureKernel, HDShaderIDs._ExposureTexture, data.prevExposure); ctx.cmd.SetComputeTextureParam(data.applyExposureCS, data.applyExposureKernel, HDShaderIDs._InputTexture, data.source); ctx.cmd.SetComputeTextureParam(data.applyExposureCS, data.applyExposureKernel, HDShaderIDs._OutputTexture, data.destination); From 3040f8fb8f1f8aaaaf4574647feca210473c51ad Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 22 Jul 2021 17:12:53 +0200 Subject: [PATCH 35/41] Fix exclude TAA with TAAU --- .../Shaders/TemporalAntiAliasing.shader | 136 ++++++++++-------- .../HDRenderPipeline.PostProcess.cs | 32 +++-- 2 files changed, 100 insertions(+), 68 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index 1454152bda0..8beccebc3fe 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -14,6 +14,7 @@ Shader "Hidden/HDRP/TemporalAA" #pragma multi_compile_local_fragment _ FORCE_BILINEAR_HISTORY #pragma multi_compile_local_fragment _ ENABLE_MV_REJECTION #pragma multi_compile_local_fragment _ ANTI_RINGING + #pragma multi_compile_local_fragment _ DIRECT_STENCIL_SAMPLE #pragma multi_compile_local_fragment LOW_QUALITY MEDIUM_QUALITY HIGH_QUALITY TAA_UPSCALE POST_DOF #pragma editor_sync_compilation @@ -111,6 +112,10 @@ Shader "Hidden/HDRP/TemporalAA" RW_TEXTURE2D_X(CTYPE, _OutputHistoryTexture) : register(u1); #endif + #if DIRECT_STENCIL_SAMPLE + TEXTURE2D_X_UINT2(_StencilTexture); + #endif + float4 _TaaPostParameters; float4 _TaaPostParameters1; float4 _TaaHistorySize; @@ -124,6 +129,7 @@ Shader "Hidden/HDRP/TemporalAA" #define _BaseBlendFactor _TaaPostParameters1.x #define _CentralWeight _TaaPostParameters1.y + #define _ExcludeTAABit _TaaPostParameters1.z // TAAU specific float4 _TaauParameters; @@ -221,6 +227,13 @@ Shader "Hidden/HDRP/TemporalAA" #endif float2 closestOffset = GetClosestFragmentOffset(_DepthTexture, samplePos); #endif + bool excludeTAABit = false; +#if DIRECT_STENCIL_SAMPLE + uint stencil = GetStencilValue(LOAD_TEXTURE2D_X(_StencilTexture, samplePos)); + excludeTAABit = (stencil == _ExcludeTAABit); +#endif + + float lengthMV = 0; DecodeMotionVector(SAMPLE_TEXTURE2D_X_LOD(_CameraMotionVectorsTexture, s_point_clamp_sampler, ClampAndScaleUVForPoint(uv + closestOffset * _InputSize.zw), 0), motionVector); // -------------------------------------------------------- @@ -235,95 +248,98 @@ Shader "Hidden/HDRP/TemporalAA" // --------------- Gather neigbourhood data --------------- CTYPE color = Fetch4(_InputTexture, uv, 0.0, _RTHandleScaleForTAA).CTYPE_SWIZZLE; - color = clamp(color, 0, CLAMP_MAX); - color = ConvertToWorkingSpace(color); + if (!excludeTAABit) + { + color = clamp(color, 0, CLAMP_MAX); + color = ConvertToWorkingSpace(color); - NeighbourhoodSamples samples; - GatherNeighbourhood(_InputTexture, uv, floor(input.positionCS.xy), color, _RTHandleScaleForTAA, samples); - // -------------------------------------------------------- + NeighbourhoodSamples samples; + GatherNeighbourhood(_InputTexture, uv, floor(input.positionCS.xy), color, _RTHandleScaleForTAA, samples); + // -------------------------------------------------------- - // --------------- Filter central sample --------------- - float4 filterParams = _TaaFilterWeights; - float4 filterParams1 = _TaaFilterWeights1; - float centralWeight = _CentralWeight; - #ifdef TAA_UPSCALE - filterParams.x = _TAAUFilterRcpSigma2; - filterParams.y = _TAAUScale; - filterParams.zw = outputPixInInput - (floor(outputPixInInput) + 0.5f); + // --------------- Filter central sample --------------- + float4 filterParams = _TaaFilterWeights; + float4 filterParams1 = _TaaFilterWeights1; + float centralWeight = _CentralWeight; +#ifdef TAA_UPSCALE + filterParams.x = _TAAUFilterRcpSigma2; + filterParams.y = _TAAUScale; + filterParams.zw = outputPixInInput - (floor(outputPixInInput) + 0.5f); - #elif CENTRAL_FILTERING == BLACKMAN_HARRIS - // We need to swizzle weights as we use quad communication to access neighbours, so the order of neighbours is not always the same (this needs to go away when moving back to compute) - SwizzleFilterWeights(floor(input.positionCS.xy), filterParams, filterParams1); - #endif - CTYPE filteredColor = FilterCentralColor(samples, filterParams, filterParams1, centralWeight); - // ------------------------------------------------------ +#elif CENTRAL_FILTERING == BLACKMAN_HARRIS + // We need to swizzle weights as we use quad communication to access neighbours, so the order of neighbours is not always the same (this needs to go away when moving back to compute) + SwizzleFilterWeights(floor(input.positionCS.xy), filterParams, filterParams1); +#endif + CTYPE filteredColor = FilterCentralColor(samples, filterParams, filterParams1, centralWeight); + // ------------------------------------------------------ - if (offScreen) - history = filteredColor; + if (offScreen) + history = filteredColor; - // --------------- Get neighbourhood information and clamp history --------------- - float colorLuma = GetLuma(filteredColor); - float historyLuma = GetLuma(history); + // --------------- Get neighbourhood information and clamp history --------------- + float colorLuma = GetLuma(filteredColor); + float historyLuma = GetLuma(history); - float motionVectorLength = 0.0f; - float motionVectorLenInPixels = 0.0f; + float motionVectorLength = 0.0f; + float motionVectorLenInPixels = 0.0f; #if ANTI_FLICKER_MV_DEPENDENT || VELOCITY_REJECTION - motionVectorLength = length(motionVector); - motionVectorLenInPixels = motionVectorLength * length(_InputSize.xy); + motionVectorLength = length(motionVector); + motionVectorLenInPixels = motionVectorLength * length(_InputSize.xy); #endif - GetNeighbourhoodCorners(samples, historyLuma, colorLuma, float2(_AntiFlickerIntensity, _ContrastForMaxAntiFlicker), motionVectorLenInPixels, _TAAURenderScale); + GetNeighbourhoodCorners(samples, historyLuma, colorLuma, float2(_AntiFlickerIntensity, _ContrastForMaxAntiFlicker), motionVectorLenInPixels, _TAAURenderScale); - history = GetClippedHistory(filteredColor, history, samples.minNeighbour, samples.maxNeighbour); - filteredColor = SharpenColor(samples, filteredColor, sharpenStrength); - // ------------------------------------------------------------------------------ + history = GetClippedHistory(filteredColor, history, samples.minNeighbour, samples.maxNeighbour); + filteredColor = SharpenColor(samples, filteredColor, sharpenStrength); + // ------------------------------------------------------------------------------ - // --------------- Compute blend factor for history --------------- - float blendFactor = GetBlendFactor(colorLuma, historyLuma, GetLuma(samples.minNeighbour), GetLuma(samples.maxNeighbour), _BaseBlendFactor); - // -------------------------------------------------------- + // --------------- Compute blend factor for history --------------- + float blendFactor = GetBlendFactor(colorLuma, historyLuma, GetLuma(samples.minNeighbour), GetLuma(samples.maxNeighbour), _BaseBlendFactor); + // -------------------------------------------------------- - // ------------------- Alpha handling --------------------------- + // ------------------- Alpha handling --------------------------- #if defined(ENABLE_ALPHA) - // Compute the antialiased alpha value - filteredColor.w = lerp(history.w, filteredColor.w, blendFactor); - // TAA should not overwrite pixels with zero alpha. This allows camera stacking with mixed TAA settings (bottom camera with TAA OFF and top camera with TAA ON). - CTYPE unjitteredColor = Fetch4(_InputTexture, input.texcoord - color.w * jitter, 0.0, _RTHandleScale.xy).CTYPE_SWIZZLE; - unjitteredColor = ConvertToWorkingSpace(unjitteredColor); - unjitteredColor.xyz *= PerceptualWeight(unjitteredColor); - filteredColor.xyz = lerp(unjitteredColor.xyz, filteredColor.xyz, filteredColor.w); - blendFactor = color.w > 0 ? blendFactor : 1; + // Compute the antialiased alpha value + filteredColor.w = lerp(history.w, filteredColor.w, blendFactor); + // TAA should not overwrite pixels with zero alpha. This allows camera stacking with mixed TAA settings (bottom camera with TAA OFF and top camera with TAA ON). + CTYPE unjitteredColor = Fetch4(_InputTexture, input.texcoord - color.w * jitter, 0.0, _RTHandleScale.xy).CTYPE_SWIZZLE; + unjitteredColor = ConvertToWorkingSpace(unjitteredColor); + unjitteredColor.xyz *= PerceptualWeight(unjitteredColor); + filteredColor.xyz = lerp(unjitteredColor.xyz, filteredColor.xyz, filteredColor.w); + blendFactor = color.w > 0 ? blendFactor : 1; #endif - // --------------------------------------------------------------- + // --------------------------------------------------------------- - // --------------- Blend to final value and output --------------- + // --------------- Blend to final value and output --------------- #if VELOCITY_REJECTION - // The 10 multiplier serves a double purpose, it is an empirical scale value used to perform the rejection and it also helps with storing the value itself. - float lengthMV = motionVectorLength * 10; - blendFactor = ModifyBlendWithMotionVectorRejection(_InputVelocityMagnitudeHistory, lengthMV, prevUV, blendFactor, _SpeedRejectionIntensity, _RTHandleScaleForTAAHistory); + // The 10 multiplier serves a double purpose, it is an empirical scale value used to perform the rejection and it also helps with storing the value itself. + lengthMV = motionVectorLength * 10; + blendFactor = ModifyBlendWithMotionVectorRejection(_InputVelocityMagnitudeHistory, lengthMV, prevUV, blendFactor, _SpeedRejectionIntensity, _RTHandleScaleForTAAHistory); #endif #ifdef TAA_UPSCALE - blendFactor *= GetUpsampleConfidence(filterParams.zw, _TAAUBoxConfidenceThresh, _TAAUFilterRcpSigma2, _TAAUScale); + blendFactor *= GetUpsampleConfidence(filterParams.zw, _TAAUBoxConfidenceThresh, _TAAUFilterRcpSigma2, _TAAUScale); #endif - blendFactor = max(blendFactor, 0.03); + blendFactor = max(blendFactor, 0.03); - CTYPE finalColor; + CTYPE finalColor; #if PERCEPTUAL_SPACE_ONLY_END - finalColor.xyz = lerp(ReinhardToneMap(history).xyz, ReinhardToneMap(filteredColor).xyz, blendFactor); - finalColor.xyz = InverseReinhardToneMap(finalColor).xyz; + finalColor.xyz = lerp(ReinhardToneMap(history).xyz, ReinhardToneMap(filteredColor).xyz, blendFactor); + finalColor.xyz = InverseReinhardToneMap(finalColor).xyz; #else - finalColor.xyz = lerp(history.xyz, filteredColor.xyz, blendFactor); - finalColor.xyz *= PerceptualInvWeight(finalColor); + finalColor.xyz = lerp(history.xyz, filteredColor.xyz, blendFactor); + finalColor.xyz *= PerceptualInvWeight(finalColor); #endif - color.xyz = ConvertToOutputSpace(finalColor.xyz); - color.xyz = clamp(color.xyz, 0, CLAMP_MAX); + color.xyz = ConvertToOutputSpace(finalColor.xyz); + color.xyz = clamp(color.xyz, 0, CLAMP_MAX); #if defined(ENABLE_ALPHA) - // Set output alpha to the antialiased alpha. - color.w = filteredColor.w; + // Set output alpha to the antialiased alpha. + color.w = filteredColor.w; #endif + } _OutputHistoryTexture[COORD_TEXTURE2D_X(input.positionCS.xy)] = color.CTYPE_SWIZZLE; outColor = color.CTYPE_SWIZZLE; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 75e5db861e4..2472c470c4c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -481,7 +481,7 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, { if (hdCamera.antialiasing == HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing) { - source = DoTemporalAntialiasing(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, postDoF: false, "TAA Destination"); + source = DoTemporalAntialiasing(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, prepassOutput.stencilBuffer, postDoF: false, "TAA Destination"); if (hdCamera.IsTAAUEnabled()) { SetCurrentResolutionGroup(renderGraph, hdCamera, ResolutionGroup.AfterDynamicResUpscale); @@ -495,7 +495,7 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, source = CustomPostProcessPass(renderGraph, hdCamera, source, depthBuffer, normalBuffer, motionVectors, m_GlobalSettings.beforePostProcessCustomPostProcesses, HDProfileId.CustomPostProcessBeforePP); - source = DepthOfFieldPass(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, depthMinMaxAvgMSAA); + source = DepthOfFieldPass(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, prepassOutput.stencilBuffer, depthMinMaxAvgMSAA); // Motion blur after depth of field for aesthetic reasons (better to see motion // blurred bokeh rather than out of focus motion blur) @@ -1416,6 +1416,7 @@ class TemporalAntiAliasingData public TextureHandle destination; public TextureHandle motionVecTexture; public TextureHandle depthBuffer; + public TextureHandle stencilBuffer; public TextureHandle depthMipChain; public TextureHandle prevHistory; public TextureHandle nextHistory; @@ -1437,7 +1438,7 @@ class TemporalAntiAliasingData }; void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, TemporalAntiAliasingData passData, HDCamera camera, - TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle sourceTexture, bool postDoF, string outputName) + TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle sourceTexture, TextureHandle stencilTexture, bool postDoF, string outputName) { passData.resetPostProcessingHistory = camera.resetPostProcessingHistory; @@ -1469,7 +1470,7 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem taaSampleWeights[i] /= totalWeight; } - passData.taaParameters1 = new Vector4(1.0f - camera.taaBaseBlendFactor, taaSampleWeights[0], 0, 0); + passData.taaParameters1 = new Vector4(1.0f - camera.taaBaseBlendFactor, taaSampleWeights[0], (int)StencilUsage.ExcludeFromTAA, 0); passData.taaFilterWeights = new Vector4(taaSampleWeights[1], taaSampleWeights[2], taaSampleWeights[3], taaSampleWeights[4]); passData.taaFilterWeights1 = new Vector4(taaSampleWeights[5], taaSampleWeights[6], taaSampleWeights[7], taaSampleWeights[8]); @@ -1525,6 +1526,11 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem } } + if (TAAU) + { + passData.temporalAAMaterial.EnableKeyword("DIRECT_STENCIL_SAMPLE"); + } + RTHandle prevHistory, nextHistory; Vector2 historyScale = Vector2.one; @@ -1590,13 +1596,15 @@ void PrepareTAAPassData(RenderGraph renderGraph, RenderGraphBuilder builder, Tem var resScale = DynamicResolutionHandler.instance.GetCurrentScale(); float stdDev = 0.4f; passData.taauParams = new Vector4(1.0f / (stdDev * stdDev), 1.0f / resScale, 0.5f / resScale, resScale); + + passData.stencilBuffer = stencilTexture; } - TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle sourceTexture, bool postDoF, string outputName) + TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle sourceTexture, TextureHandle stencilBuffer, bool postDoF, string outputName) { using (var builder = renderGraph.AddRenderPass("Temporal Anti-Aliasing", out var passData, ProfilingSampler.Get(HDProfileId.TemporalAntialiasing))) { - PrepareTAAPassData(renderGraph, builder, passData, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, sourceTexture, postDoF, outputName); + PrepareTAAPassData(renderGraph, builder, passData, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, sourceTexture, stencilBuffer, postDoF, outputName); builder.SetRenderFunc( (TemporalAntiAliasingData data, RenderGraphContext ctx) => @@ -1672,6 +1680,14 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, if (data.runsTAAU) { rect = data.finalViewport; + + RTHandle stencil = data.stencilBuffer; + if (stencil.rt.stencilFormat == GraphicsFormat.None) // We are accessing MSAA resolved version and not the depth stencil buffer directly. + mpb.SetTexture(HDShaderIDs._StencilTexture, stencilBuffer); + else + mpb.SetTexture(HDShaderIDs._StencilTexture, stencilBuffer, RenderTextureSubElement.Stencil); + + HDUtils.DrawFullScreen(ctx.cmd, rect, data.temporalAAMaterial, data.destination, mpb, taauPass); } else @@ -2716,7 +2732,7 @@ class DepthofFieldData public bool taaEnabled; } - TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle source, TextureHandle depthMinMaxAvgMSAA) + TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBuffer, TextureHandle motionVectors, TextureHandle depthBufferMipChain, TextureHandle source, TextureHandle depthMinMaxAvgMSAA, TextureHandle stencilTexture) { bool postDoFTAAEnabled = false; bool isSceneView = hdCamera.camera.cameraType == CameraType.SceneView; @@ -2909,7 +2925,7 @@ TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, Textu // When physically based DoF is enabled, TAA runs two times, first to stabilize the color buffer before DoF and then after DoF to accumulate more aperture samples if (taaEnabled && m_DepthOfField.physicallyBased) { - source = DoTemporalAntialiasing(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, postDoF: true, "Post-DoF TAA Destination"); + source = DoTemporalAntialiasing(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, stencilTexture, postDoF: true, "Post-DoF TAA Destination"); hdCamera.dofHistoryIsValid = true; postDoFTAAEnabled = true; } From 78c60057ac724e8a924791b3351c59d76f9db8af Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Fri, 23 Jul 2021 12:20:37 +0200 Subject: [PATCH 36/41] Cheaper approx of the upsample weights --- .../Shaders/TemporalAntialiasing.hlsl | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index 7c99899cefb..f29271c35e4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -624,17 +624,27 @@ void GetNeighbourhoodCorners(inout NeighbourhoodSamples samples, float historyLu // --------------------------------------------------- // Filter main color // --------------------------------------------------- - +#define APPROX_WEIGHT 1 float GetSampleWeight(NeighbourhoodSamples samples, int neighbourIdx, float4 filterParameters, bool centralPixel = false) { #ifdef UPSAMPLE - // Very spiky gaussian (See for honor presentation) - const float rcpStdDev2 = filterParameters.x; // (1/(sigma*sigma)) - const float resolutionScale2 = filterParameters.y * filterParameters.y; - const float2 inputToOutputVec = filterParameters.zw; + const float2 inputToOutputVec = filterParameters.zw; + const float resolutionScale2 = filterParameters.y * filterParameters.y; float2 d = (centralPixel ? 0 : samples.offsets[neighbourIdx]) - inputToOutputVec; + +#if APPROX_WEIGHT + // A bit fatter and shorter tail, but significantly cheaper and close enough for the use case. + // https://www.desmos.com/calculator/g2hr2hzj84 + float x2 = saturate(resolutionScale2 * dot(d, d)); + float f = 0.9656852f * x2 - 1; + return f * f; +#else + // Spiky gaussian (See for honor presentation) + const float rcpStdDev2 = filterParameters.x; // (1/(sigma*sigma)) return exp2(-0.5f * dot(d, d) * resolutionScale2 * rcpStdDev2); +#endif + #else return 1; #endif From 3782ee6b1f521c265c37f7916b4b86201aa31084 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Fri, 23 Jul 2021 17:02:19 +0200 Subject: [PATCH 37/41] Check if DLSS is enabled to see if TAAU is. --- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 575def9cdfb..d80cf5eab5f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -682,7 +682,7 @@ internal bool IsDLSSEnabled() internal bool IsTAAUEnabled() { - return DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU; + return DynamicResolutionHandler.instance.DynamicResolutionEnabled() && DynamicResolutionHandler.instance.filter == DynamicResUpscaleFilter.TAAU && !IsDLSSEnabled(); } internal bool UpsampleHappensBeforePost() From 791bbac3b82d95f3d650c3ec9062dc16f39a3d4f Mon Sep 17 00:00:00 2001 From: sebastienlagarde Date: Mon, 26 Jul 2021 12:33:03 +0200 Subject: [PATCH 38/41] Update CHANGELOG.md --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index f05b49fb3e6..bb49d50b1af 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -79,8 +79,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added a better support for LODs in the ray tracing acceleration structure. - Added a property on the HDRP asset to allow users to avoid ray tracing effects running at too low percentages (case 1342588). - Added dependency to mathematics and burst, HDRP now will utilize this to improve on CPU cost. First implementation of burstified decal projector is here. -- Added Blend factor control for TAA. -- Added Experimental Temporal Upscaling. ### Fixed - Fixed Intensity Multiplier not affecting realtime global illumination. @@ -311,6 +309,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed conflicting runtime debug menu command with an option to disable runtime debug window hotkey. - Fixed screen-space shadows with XR single-pass and camera relative rendering (1348260). - Fixed ghosting issues if the exposure changed too much (RTGI). +- Fixed misc TAA issue: Slightly improved TAA flickering, Reduced ringing of TAA sharpening, tweak TAA High quality central color filtering. +- Fixed TAA upsampling algorithm, now work properly ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard @@ -409,9 +409,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Various improvements to SSGI (case 1340851, case 1339297, case 1327919). - Changed the NVIDIA install button to the standard FixMeButton. - Improved a bit the area cookie behavior for higher smoothness values to reduce artifacts. -- Slightly improved TAA flickering. -- Reduced ringing of TAA sharpening. -- Improved TAA High quality central color filtering. ## [11.0.0] - 2020-10-21 From 817d24266de45f8a53c3182b6cb85c63b9899d76 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Mon, 26 Jul 2021 17:26:38 +0200 Subject: [PATCH 39/41] Fix GC alloc --- .../Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index f1567bc52f3..3ed607c25eb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1685,9 +1685,9 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, RTHandle stencil = data.stencilBuffer; if (stencil.rt.stencilFormat == GraphicsFormat.None) // We are accessing MSAA resolved version and not the depth stencil buffer directly. - mpb.SetTexture(HDShaderIDs._StencilTexture, stencilBuffer); + mpb.SetTexture(HDShaderIDs._StencilTexture, stencil); else - mpb.SetTexture(HDShaderIDs._StencilTexture, stencilBuffer, RenderTextureSubElement.Stencil); + mpb.SetTexture(HDShaderIDs._StencilTexture, stencil, RenderTextureSubElement.Stencil); HDUtils.DrawFullScreen(ctx.cmd, rect, data.temporalAAMaterial, data.destination, mpb, taauPass); From 9231f7045885cfa1bbc1ddbe5b0802408bc2ee30 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Mon, 26 Jul 2021 17:49:30 +0200 Subject: [PATCH 40/41] metal guesstimate fix --- .../PostProcessing/Shaders/TemporalAntiAliasing.shader | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index 8beccebc3fe..78d6a7f27f4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -219,11 +219,9 @@ Shader "Hidden/HDRP/TemporalAA" #if ORTHOGRAPHIC float2 closestOffset = 0; #else - int2 samplePos; + int2 samplePos = input.positionCS.xy; #ifdef TAA_UPSCALE samplePos = outputPixInInput; -#else - samplePos = input.positionCS.xy; #endif float2 closestOffset = GetClosestFragmentOffset(_DepthTexture, samplePos); #endif From 375913308dc5f723b69227f6a1ef5500a3f8351a Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 27 Jul 2021 12:17:13 +0200 Subject: [PATCH 41/41] fix bad merge order of texture args --- .../Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index b7af8e998b7..e716efe3e72 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -496,7 +496,7 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph, source = CustomPostProcessPass(renderGraph, hdCamera, source, depthBuffer, normalBuffer, motionVectors, m_GlobalSettings.beforePostProcessCustomPostProcesses, HDProfileId.CustomPostProcessBeforePP); - source = DepthOfFieldPass(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, prepassOutput.stencilBuffer, depthMinMaxAvgMSAA); + source = DepthOfFieldPass(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, depthMinMaxAvgMSAA, prepassOutput.stencilBuffer); // Motion blur after depth of field for aesthetic reasons (better to see motion // blurred bokeh rather than out of focus motion blur)