From 3239ca5a29ff76f08a192189966d45431df40c93 Mon Sep 17 00:00:00 2001 From: Anis Benyoub Date: Thu, 19 Aug 2021 10:35:55 +0200 Subject: [PATCH 1/4] Fixed the clouds missing in the ambient probe and in the static and dynamic sky. --- .../CHANGELOG.md | 1 + .../Sky/HDLightingWindowEnvironmentSection.cs | 4 + .../HDRenderPipeline.VolumetricClouds.cs | 32 +- ...erPipeline.VolumetricCloudsAccumulation.cs | 8 +- ...Pipeline.VolumetricCloudsFullResolution.cs | 26 +- ...RenderPipeline.VolumetricCloudsLighting.cs | 111 +++++- ...rPipeline.VolumetricCloudsLowResolution.cs | 46 +-- ...DRenderPipeline.VolumetricCloudsShadows.cs | 3 +- .../HDRenderPipeline.VolumetricCloudsSky.cs | 344 ++++++++++++++++++ ...RenderPipeline.VolumetricCloudsSky.cs.meta | 11 + .../VolumetricClouds.compute | 179 +++++++-- .../VolumetricCloudsCombine.shader | 130 +++++++ .../VolumetricLighting/VolumetricCloudsDef.cs | 7 +- .../VolumetricCloudsDef.cs.hlsl | 3 +- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 7 +- .../Runtime/RenderPipeline/HDProfileId.cs | 2 + .../RenderPipeline/HDStringConstants.cs | 1 + .../RenderPipeline/Settings/FrameSettings.cs | 9 +- .../Sky/AmbientProbeConvolution.compute | 18 +- .../CloudLayer/CloudLayerRenderer.cs | 12 +- .../Runtime/Sky/SkyManager.cs | 46 +++ .../Runtime/Sky/SkyUpdateContext.cs | 26 ++ .../Runtime/Sky/StaticLightingSky.cs | 49 +++ 23 files changed, 972 insertions(+), 103 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsSky.cs create mode 100644 com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsSky.cs.meta diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 979a58d8502..5d36ae68ab3 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -371,6 +371,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added a new property to control the ghosting reduction for volumetric clouds (case 1357702). - Fixed the earth curvature not being properly taken into account when evaluating the sun attenuation (case 1357927). - Reduced the volumetric clouds pattern repetition frequency (case 1358717). +- Fixed the clouds missing in the ambient probe and in the static and dynamic sky. ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard diff --git a/com.unity.render-pipelines.high-definition/Editor/Sky/HDLightingWindowEnvironmentSection.cs b/com.unity.render-pipelines.high-definition/Editor/Sky/HDLightingWindowEnvironmentSection.cs index d486af0126c..0d1bc9fe8c7 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Sky/HDLightingWindowEnvironmentSection.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Sky/HDLightingWindowEnvironmentSection.cs @@ -33,6 +33,7 @@ class SerializedStaticLightingSky SerializedObject serializedObject; public SerializedProperty skyUniqueID; public SerializedProperty cloudUniqueID; + public SerializedProperty volumetricCloudsToggle; public VolumeProfile volumeProfile { get => (serializedObject.targetObject as StaticLightingSky).profile; @@ -44,6 +45,7 @@ public SerializedStaticLightingSky(StaticLightingSky staticLightingSky) serializedObject = new SerializedObject(staticLightingSky); skyUniqueID = serializedObject.FindProperty("m_StaticLightingSkyUniqueID"); cloudUniqueID = serializedObject.FindProperty("m_StaticLightingCloudsUniqueID"); + volumetricCloudsToggle = serializedObject.FindProperty("m_StaticLightingVolumetricClouds"); } public void Apply() => serializedObject.ApplyModifiedProperties(); @@ -196,6 +198,8 @@ void DrawGUI() EditorGUILayout.IntPopup(m_SerializedActiveSceneLightingSky.cloudUniqueID, m_CloudClassNames.ToArray(), m_CloudUniqueIDs.ToArray(), EditorGUIUtility.TrTextContent("Static Lighting Clouds", "Specify which kind of clouds you want to use for static ambient in the referenced profile for active scene.")); } + EditorGUILayout.PropertyField(m_SerializedActiveSceneLightingSky.volumetricCloudsToggle, EditorGUIUtility.TrTextContent("Static Lighting Volumetric Clouds", "Specify if volumetric clouds should be used for static ambient in the referenced profile for active scene.")); + --EditorGUI.indentLevel; } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricClouds.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricClouds.cs index a3f4b013fa6..ef1175bb30d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricClouds.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricClouds.cs @@ -7,7 +7,6 @@ public partial class HDRenderPipeline { // Intermediate values for ambient probe evaluation Vector4[] m_PackedCoeffsClouds; - ZonalHarmonicsL2 m_PhaseZHClouds; // Cloud preset maps Texture2D m_SparsePresetMap; @@ -25,10 +24,13 @@ public partial class HDRenderPipeline int m_ReprojectCloudsKernel; int m_ReprojectCloudsRejectionKernel; int m_PreUpscaleCloudsKernel; + int m_PreUpscaleCloudsSkyKernel; int m_UpscaleAndCombineCloudsKernelColorCopy; int m_UpscaleAndCombineCloudsKernelColorRW; + int m_UpscaleAndCombineCloudsSkyKernel; int m_CombineCloudsKernelColorCopy; int m_CombineCloudsKernelColorRW; + int m_CombineCloudsSkyKernel; // Combine pass via hardware blending, used in case of MSAA color target. Material m_CloudCombinePass; @@ -64,6 +66,7 @@ public partial class HDRenderPipeline 0.119433f, 0.535261f, 0.324652f, 0.196912f, 0.882497f, 0.535261f, 0.0439369f, 0.196912f, 0.119433f, 0.119433f, 0.196912f, 0.0439369f, 0.535261f, 0.882497f, 0.196912f, 0.324652f, 0.535261f, 0.119433f, 0.0439369f, 0.196912f, 0.119433f, 0.196912f, 0.882497f, 0.535261f, 0.119433f, 0.535261f, 0.324652f}; + struct VolumetricCloudsCameraData { public TVolumetricCloudsCameraType cameraType; @@ -86,8 +89,6 @@ void InitializeVolumetricClouds() // Allocate the buffers for ambient probe evaluation m_PackedCoeffsClouds = new Vector4[7]; - m_PhaseZHClouds = new ZonalHarmonicsL2(); - m_PhaseZHClouds.coeffs = new float[3]; // Grab the kernels we need ComputeShader volumetricCloudsCS = m_Asset.renderPipelineResources.shaders.volumetricCloudsCS; @@ -97,10 +98,13 @@ void InitializeVolumetricClouds() m_ReprojectCloudsKernel = volumetricCloudsCS.FindKernel("ReprojectClouds"); m_ReprojectCloudsRejectionKernel = volumetricCloudsCS.FindKernel("ReprojectCloudsRejection"); m_PreUpscaleCloudsKernel = volumetricCloudsCS.FindKernel("PreUpscaleClouds"); + m_PreUpscaleCloudsSkyKernel = volumetricCloudsCS.FindKernel("PreUpscaleCloudsSky"); m_UpscaleAndCombineCloudsKernelColorCopy = volumetricCloudsCS.FindKernel("UpscaleAndCombineClouds_ColorCopy"); m_UpscaleAndCombineCloudsKernelColorRW = volumetricCloudsCS.FindKernel("UpscaleAndCombineClouds_ColorRW"); + m_UpscaleAndCombineCloudsSkyKernel = volumetricCloudsCS.FindKernel("UpscaleAndCombineCloudsSky"); m_CombineCloudsKernelColorCopy = volumetricCloudsCS.FindKernel("CombineClouds_ColorCopy"); m_CombineCloudsKernelColorRW = volumetricCloudsCS.FindKernel("CombineClouds_ColorRW"); + m_CombineCloudsSkyKernel = volumetricCloudsCS.FindKernel("CombineCloudsSky"); // Create the material needed for the combination m_CloudCombinePass = CoreUtils.CreateEngineMaterial(defaultResources.shaders.volumetricCloudsCombinePS); @@ -111,6 +115,8 @@ void InitializeVolumetricClouds() // Initialize the additional sub components InitializeVolumetricCloudsMap(); InitializeVolumetricCloudsShadows(); + InitializeVolumetricCloudsAmbientProbe(); + InitializeVolumetricCloudsStaticTextures(); } void ReleaseVolumetricClouds() @@ -124,6 +130,8 @@ void ReleaseVolumetricClouds() // Release the additional sub components ReleaseVolumetricCloudsMap(); ReleaseVolumetricCloudsShadows(); + ReleaseVolumetricCloudsAmbientProbe(); + ReleaseVolumetricCloudsStaticTextures(); } void AllocatePresetTextures() @@ -318,7 +326,8 @@ internal enum TVolumetricCloudsCameraType Default, RealtimeReflection, BakedReflection, - PlanarReflection + PlanarReflection, + Sky }; TVolumetricCloudsCameraType GetCameraType(HDCamera hdCamera) @@ -399,17 +408,13 @@ void UpdateShaderVariableslClouds(ref ShaderVariablesClouds cb, HDCamera hdCamer { cb._SunLightColor = m_lightList.directionalLights[0].color; } - - cb._ExposureSunColor = 1; } else { cb._SunDirection = Vector3.up; cb._SunRight = Vector3.right; cb._SunUp = Vector3.forward; - cb._SunLightColor = Vector3.zero; - cb._ExposureSunColor = 0; } // Compute the theta angle for the wind direction @@ -489,7 +494,7 @@ void UpdateShaderVariableslClouds(ref ShaderVariablesClouds cb, HDCamera hdCamer } // Evaluate the ambient probe data - SetPreconvolvedAmbientLightProbe(ref cb, hdCamera, settings); + SetPreconvolvedAmbientLightProbe(ref cb, settings); if (shadowPass) { @@ -514,8 +519,10 @@ void UpdateShaderVariableslClouds(ref ShaderVariablesClouds cb, HDCamera hdCamer } cb._EnableFastToneMapping = cameraData.enableExposureControl ? 1 : 0; + cb._LowResolutionEvaluation = cameraData.lowResolution ? 1 : 0; cb._EnableIntegration = cameraData.enableIntegration ? 1 : 0; + cb._RenderForSky = cameraData.cameraType == TVolumetricCloudsCameraType.Sky ? 1 : 0; unsafe { @@ -559,7 +566,7 @@ Texture3D ErosionNoiseTypeToTexture(VolumetricClouds.CloudErosionNoise noiseType return m_Asset.renderPipelineResources.textures.worleyNoise32RGB; } - void FillVolumetricCloudsCommonData(HDCamera hdCamera, VolumetricClouds settings, TVolumetricCloudsCameraType cameraType, in CloudModelData cloudModelData, ref VolumetricCloudCommonData commonData) + void FillVolumetricCloudsCommonData(bool enableExposureControl, VolumetricClouds settings, TVolumetricCloudsCameraType cameraType, in CloudModelData cloudModelData, ref VolumetricCloudCommonData commonData) { commonData.cameraType = cameraType; commonData.localClouds = settings.localClouds.value; @@ -593,7 +600,7 @@ void FillVolumetricCloudsCommonData(HDCamera hdCamera, VolumetricClouds settings BlueNoise blueNoise = GetBlueNoiseManager(); commonData.ditheredTextureSet = blueNoise.DitheredTextureSet8SPP(); commonData.sunLight = GetMainLight(); - commonData.enableExposureControl = hdCamera.exposureControlFS; + commonData.enableExposureControl = enableExposureControl; } void UpdateVolumetricClouds(HDCamera hdCamera, in VolumetricClouds settings) @@ -674,6 +681,9 @@ void PreRenderVolumetricClouds(RenderGraph renderGraph, HDCamera hdCamera) PushFullScreenDebugTexture(m_RenderGraph, renderGraph.ImportTexture(currentHandle), FullScreenDebugMode.VolumetricCloudsShadow, xrTexture: false); } + // Compute the ambient probe that will be used for clouds + PreRenderVolumetricClouds_AmbientProbe(renderGraph, hdCamera); + // Evaluate the cloud map PreRenderVolumetricCloudMap(renderGraph, hdCamera, in settings); } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsAccumulation.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsAccumulation.cs index df23ab3c6ff..d7a81cd6310 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsAccumulation.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsAccumulation.cs @@ -107,7 +107,7 @@ VolumetricCloudsParameters_Accumulation PrepareVolumetricCloudsParameters_Accumu CloudModelData cloudModelData = GetCloudModelData(settings); // Fill the common data - FillVolumetricCloudsCommonData(hdCamera, settings, cameraType, in cloudModelData, ref parameters.commonData); + FillVolumetricCloudsCommonData(hdCamera.exposureControlFS, settings, cameraType, in cloudModelData, ref parameters.commonData); // We need to make sure that the allocated size of the history buffers and the dispatch size are perfectly equal. // The ideal approach would be to have a function for that returns the converted size from a viewport and texture size. @@ -166,7 +166,7 @@ VolumetricCloudsParameters_Accumulation PrepareVolumetricCloudsParameters_Accumu } static void TraceVolumetricClouds_Accumulation(CommandBuffer cmd, VolumetricCloudsParameters_Accumulation parameters, - RTHandle colorBuffer, RTHandle depthPyramid, TextureHandle motionVectors, TextureHandle volumetricLightingTexture, TextureHandle scatteringFallbackTexture, + RTHandle colorBuffer, RTHandle depthPyramid, RTHandle motionVectors, RTHandle volumetricLightingTexture, RTHandle scatteringFallbackTexture, RTHandle currentHistory0Buffer, RTHandle previousHistory0Buffer, RTHandle currentHistory1Buffer, RTHandle previousHistory1Buffer, RTHandle intermediateLightingBuffer0, RTHandle intermediateLightingBuffer1, RTHandle intermediateDepthBuffer0, RTHandle intermediateDepthBuffer1, RTHandle intermediateDepthBuffer2, @@ -267,7 +267,6 @@ static void TraceVolumetricClouds_Accumulation(CommandBuffer cmd, VolumetricClou cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.upscaleAndCombineKernel, HDShaderIDs._DepthStatusTexture, currentHistory1Buffer); cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.upscaleAndCombineKernel, HDShaderIDs._VolumetricCloudsTexture, currentHistory0Buffer); cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.upscaleAndCombineKernel, HDShaderIDs._DepthTexture, currentDepthBuffer); - cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.upscaleAndCombineKernel, HDShaderIDs._CameraColorTextureRW, colorBuffer); cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.upscaleAndCombineKernel, HDShaderIDs._CameraColorTexture, intermediateColorBuffer); cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.upscaleAndCombineKernel, HDShaderIDs._VBufferLighting, volumetricLightingTexture); if (parameters.commonData.cloudsCB._PhysicallyBasedSun == 0) @@ -299,7 +298,7 @@ static void TraceVolumetricClouds_Accumulation(CommandBuffer cmd, VolumetricClou } else { - cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.upscaleAndCombineKernel, HDShaderIDs._CameraColorTextureRW, colorBuffer); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.upscaleAndCombineKernel, HDShaderIDs._VolumetricCloudsUpscaleTextureRW, colorBuffer); // Perform the upscale and combine with the color buffer in place. cmd.DispatchCompute(parameters.commonData.volumetricCloudsCS, parameters.upscaleAndCombineKernel, finalTX, finalTY, parameters.viewCount); @@ -347,6 +346,7 @@ TextureHandle RenderVolumetricClouds_Accumulation(RenderGraph renderGraph, HDCam passData.colorBuffer = builder.ReadTexture(builder.WriteTexture(colorBuffer)); passData.depthPyramid = builder.ReadTexture(depthPyramid); passData.motionVectors = builder.ReadTexture(motionVectors); + passData.volumetricLighting = builder.ReadTexture(volumetricLighting); passData.scatteringFallbackTexture = renderGraph.defaultResources.blackTexture3DXR; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsFullResolution.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsFullResolution.cs index 893cbf62c7a..4a25b700c2f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsFullResolution.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsFullResolution.cs @@ -11,7 +11,6 @@ struct VolumetricCloudsParameters_FullResolution public int finalWidth; public int finalHeight; public int viewCount; - public bool needExtraColorBufferCopy; // Compute shader and kernels public int renderKernel; @@ -22,10 +21,12 @@ struct VolumetricCloudsParameters_FullResolution // MSAA support public bool needsTemporaryBuffer; + public bool needExtraColorBufferCopy; + public Matrix4x4 pixelCoordToViewDirMatrix; public Material cloudCombinePass; } - VolumetricCloudsParameters_FullResolution PrepareVolumetricCloudsParameters_FullResolutionParameters(HDCamera hdCamera, VolumetricClouds settings, TVolumetricCloudsCameraType cameraType) + VolumetricCloudsParameters_FullResolution PrepareVolumetricCloudsParameters_FullResolution(HDCamera hdCamera, int width, int height, int viewCount, bool exposureControl, VolumetricClouds settings, TVolumetricCloudsCameraType cameraType) { VolumetricCloudsParameters_FullResolution parameters = new VolumetricCloudsParameters_FullResolution(); @@ -33,12 +34,12 @@ VolumetricCloudsParameters_FullResolution PrepareVolumetricCloudsParameters_Full CloudModelData cloudModelData = GetCloudModelData(settings); // Fill the common data - FillVolumetricCloudsCommonData(hdCamera, settings, cameraType, in cloudModelData, ref parameters.commonData); + FillVolumetricCloudsCommonData(exposureControl, settings, cameraType, in cloudModelData, ref parameters.commonData); // If this is a baked reflection, we run everything at full res - parameters.finalWidth = hdCamera.actualWidth; - parameters.finalHeight = hdCamera.actualHeight; - parameters.viewCount = hdCamera.viewCount; + parameters.finalWidth = width; + parameters.finalHeight = height; + parameters.viewCount = viewCount; // MSAA support parameters.needsTemporaryBuffer = hdCamera.msaaEnabled; @@ -77,7 +78,7 @@ VolumetricCloudsParameters_FullResolution PrepareVolumetricCloudsParameters_Full } static void TraceVolumetricClouds_FullResolution(CommandBuffer cmd, VolumetricCloudsParameters_FullResolution parameters, - RTHandle colorBuffer, RTHandle depthPyramid, TextureHandle volumetricLightingTexture, TextureHandle scatteringFallbackTexture, + RTHandle colorBuffer, RTHandle depthPyramid, RTHandle volumetricLightingTexture, RTHandle scatteringFallbackTexture, RTHandle intermediateLightingBuffer0, RTHandle intermediateDepthBuffer0, RTHandle intermediateColorBuffer, RTHandle intermediateUpscaleBuffer) { @@ -94,7 +95,6 @@ static void TraceVolumetricClouds_FullResolution(CommandBuffer cmd, VolumetricCl // Bind the constant buffer ConstantBuffer.Push(cmd, parameters.commonData.cloudsCB, parameters.commonData.volumetricCloudsCS, HDShaderIDs._ShaderVariablesClouds); - RTHandle currentDepthBuffer = depthPyramid; using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.VolumetricCloudsTrace))) { // Ray-march the clouds for this frame @@ -118,9 +118,7 @@ static void TraceVolumetricClouds_FullResolution(CommandBuffer cmd, VolumetricCl // Define which kernel to use cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.combineKernel, HDShaderIDs._VolumetricCloudsTexture, intermediateLightingBuffer0); cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.combineKernel, HDShaderIDs._DepthStatusTexture, intermediateDepthBuffer0); - - cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.combineKernel, HDShaderIDs._DepthTexture, currentDepthBuffer); - cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.combineKernel, HDShaderIDs._CameraColorTextureRW, colorBuffer); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.combineKernel, HDShaderIDs._DepthTexture, depthPyramid); cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.combineKernel, HDShaderIDs._CameraColorTexture, intermediateColorBuffer); cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.combineKernel, HDShaderIDs._VBufferLighting, volumetricLightingTexture); if (parameters.commonData.cloudsCB._PhysicallyBasedSun == 0) @@ -146,13 +144,13 @@ static void TraceVolumetricClouds_FullResolution(CommandBuffer cmd, VolumetricCl parameters.cloudCombinePass.SetTexture(HDShaderIDs._VolumetricCloudsUpscaleTextureRW, intermediateUpscaleBuffer); // Composite the clouds into the MSAA target via hardware blending. - HDUtils.DrawFullScreen(cmd, parameters.cloudCombinePass, colorBuffer); + HDUtils.DrawFullScreen(cmd, parameters.cloudCombinePass, colorBuffer, null, 0); CoreUtils.SetKeyword(cmd, "USE_INTERMEDIATE_BUFFER", false); } else { - cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.combineKernel, HDShaderIDs._CameraColorTextureRW, colorBuffer); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.combineKernel, HDShaderIDs._VolumetricCloudsUpscaleTextureRW, colorBuffer); // Perform the upscale and combine with the color buffer in place. cmd.DispatchCompute(parameters.commonData.volumetricCloudsCS, parameters.combineKernel, finalTX, finalTY, parameters.viewCount); @@ -187,7 +185,7 @@ TextureHandle RenderVolumetricClouds_FullResolution(RenderGraph renderGraph, HDC builder.EnableAsyncCompute(false); VolumetricClouds settings = hdCamera.volumeStack.GetComponent(); - passData.parameters = PrepareVolumetricCloudsParameters_FullResolutionParameters(hdCamera, settings, cameraType); + passData.parameters = PrepareVolumetricCloudsParameters_FullResolution(hdCamera, hdCamera.actualWidth, hdCamera.actualHeight, hdCamera.viewCount, hdCamera.exposureControlFS, settings, cameraType); passData.colorBuffer = builder.ReadTexture(builder.WriteTexture(colorBuffer)); passData.depthPyramid = builder.ReadTexture(depthPyramid); passData.volumetricLighting = builder.ReadTexture(volumetricLighting); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsLighting.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsLighting.cs index e617d8fb23b..fa8f41197bb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsLighting.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsLighting.cs @@ -1,7 +1,38 @@ +using UnityEngine.Experimental.Rendering; +using UnityEngine.Experimental.Rendering.RenderGraphModule; + namespace UnityEngine.Rendering.HighDefinition { public partial class HDRenderPipeline { + // Resources required to evaluate the ambient probe for the clouds + ComputeShader m_ComputeAmbientProbeCS; + int m_AmbientProbeConvolutionNoMipKernel; + internal static readonly int m_AmbientProbeInputCubemap = Shader.PropertyToID("_AmbientProbeInputCubemap"); + internal static readonly int m_AmbientProbeOutputBufferParam = Shader.PropertyToID("_AmbientProbeOutputBuffer"); + + // Buffers required to evaluate the probe + internal ComputeBuffer m_CloudsAmbientProbeBuffer = null; + internal RTHandle m_CloudsAmbientProbeSky = null; + + // Structures to read back the probe from the GPU + static SphericalHarmonicsL2 m_CloudsAmbientProbe = new SphericalHarmonicsL2(); + static bool m_CloudsAmbientProbeIsReady = false; + + void InitializeVolumetricCloudsAmbientProbe() + { + m_ComputeAmbientProbeCS = m_Asset.renderPipelineResources.shaders.ambientProbeConvolutionCS; + m_AmbientProbeConvolutionNoMipKernel = m_ComputeAmbientProbeCS.FindKernel("AmbientProbeConvolutionNoMip"); + m_CloudsAmbientProbeBuffer = new ComputeBuffer(9 * 3, sizeof(float)); + m_CloudsAmbientProbeSky = RTHandles.Alloc(16, 16, TextureXR.slices, dimension: TextureDimension.Cube, colorFormat: GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite: true); + } + + void ReleaseVolumetricCloudsAmbientProbe() + { + CoreUtils.SafeRelease(m_CloudsAmbientProbeBuffer); + RTHandles.Release(m_CloudsAmbientProbeSky); + } + // Ref: "Efficient Evaluation of Irradiance Environment Maps" from ShaderX 2 Vector3 SHEvalLinearL0L1(Vector3 N, Vector4 shAr, Vector4 shAg, Vector4 shAb) { @@ -29,8 +60,8 @@ Vector3 SHEvalLinearL2(Vector3 N, Vector4 shBr, Vector4 shBg, Vector4 shBb, Vect float vC = N.x * N.x - N.y * N.y; Vector3 x3 = new Vector3(0.0f, 0.0f, 0.0f); x3.x = shC.x * vC; - x3.x = shC.y * vC; - x3.x = shC.z * vC; + x3.y = shC.y * vC; + x3.z = shC.z * vC; return x2 + x3; } @@ -55,17 +86,77 @@ Vector3 EvaluateAmbientProbe(Vector3 direction) } // Function that fills the buffer with the ambient probe values - unsafe void SetPreconvolvedAmbientLightProbe(ref ShaderVariablesClouds cb, HDCamera hdCamera, VolumetricClouds settings) + unsafe void SetPreconvolvedAmbientLightProbe(ref ShaderVariablesClouds cb, VolumetricClouds settings) { - SphericalHarmonicsL2 probeSH = SphericalHarmonicMath.UndoCosineRescaling(m_SkyManager.GetAmbientProbe(hdCamera)); - probeSH = SphericalHarmonicMath.RescaleCoefficients(probeSH, settings.ambientLightProbeDimmer.value); - ZonalHarmonicsL2.GetCornetteShanksPhaseFunction(m_PhaseZHClouds, 0.0f); - SphericalHarmonicsL2 finalSH = SphericalHarmonicMath.PremultiplyCoefficients(SphericalHarmonicMath.Convolve(probeSH, m_PhaseZHClouds)); + if (m_CloudsAmbientProbeIsReady) + { + SphericalHarmonicsL2 probeSH = SphericalHarmonicMath.UndoCosineRescaling(m_CloudsAmbientProbe); + probeSH = SphericalHarmonicMath.RescaleCoefficients(probeSH, settings.ambientLightProbeDimmer.value); + SphericalHarmonicMath.PackCoefficients(m_PackedCoeffsClouds, probeSH); + + // Evaluate the probe at the top and bottom (above and under the clouds) + cb._AmbientProbeTop = EvaluateAmbientProbe(Vector3.down); + cb._AmbientProbeBottom = EvaluateAmbientProbe(Vector3.up); + } + else + { + cb._AmbientProbeTop = Vector4.zero; + cb._AmbientProbeBottom = Vector4.zero; + } + } + + public static void OnComputeAmbientProbeDone(AsyncGPUReadbackRequest request) + { + if (!request.hasError) + { + var result = request.GetData(); + for (int channel = 0; channel < 3; ++channel) + for (int coeff = 0; coeff < 9; ++coeff) + m_CloudsAmbientProbe[channel, coeff] = result[channel * 9 + coeff]; + + m_CloudsAmbientProbeIsReady = true; + } + } + + class VolumetricCloudsAmbientProbeData + { + public ComputeShader computeProbeCS; + public int kernel; + public SkyManager skyManager; + public SkyRenderer skyRenderer; + public TextureHandle skyCubemap; + public ComputeBufferHandle skyBuffer; + public ComputeBufferHandle ambientProbeBuffer; + } + + internal void PreRenderVolumetricClouds_AmbientProbe(RenderGraph renderGraph, HDCamera hdCamera) + { + using (var builder = renderGraph.AddRenderPass("Volumetric Clouds Ambient Probe", out var passData, ProfilingSampler.Get(HDProfileId.VolumetricCloudsAmbientProbe))) + { + builder.EnableAsyncCompute(false); + + passData.computeProbeCS = m_ComputeAmbientProbeCS; + passData.skyManager = m_SkyManager; + passData.skyRenderer = hdCamera.lightingSky.skyRenderer; + passData.skyCubemap = builder.ReadWriteTexture(renderGraph.ImportTexture(m_CloudsAmbientProbeSky)); + passData.kernel = m_AmbientProbeConvolutionNoMipKernel; + passData.ambientProbeBuffer = builder.ReadComputeBuffer(builder.WriteComputeBuffer(renderGraph.ImportComputeBuffer(m_CloudsAmbientProbeBuffer))); + + builder.SetRenderFunc( + (VolumetricCloudsAmbientProbeData data, RenderGraphContext ctx) => + { + // Render the sky into a low resolution cubemap + data.skyManager.RenderSkyOnlyToCubemap(ctx.cmd, data.skyCubemap, false, data.skyRenderer); - SphericalHarmonicMath.PackCoefficients(m_PackedCoeffsClouds, finalSH); + // Evaluate the probe + ctx.cmd.SetComputeTextureParam(data.computeProbeCS, data.kernel, m_AmbientProbeInputCubemap, data.skyCubemap); + ctx.cmd.SetComputeBufferParam(data.computeProbeCS, data.kernel, m_AmbientProbeOutputBufferParam, data.ambientProbeBuffer); + ctx.cmd.DispatchCompute(data.computeProbeCS, data.kernel, 1, 1, 1); - cb._AmbientProbeTop = EvaluateAmbientProbe(Vector3.up); - cb._AmbientProbeBottom = EvaluateAmbientProbe(Vector3.down); + // Enqueue the read back + ctx.cmd.RequestAsyncReadback(data.ambientProbeBuffer, OnComputeAmbientProbeDone); + }); + } } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsLowResolution.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsLowResolution.cs index 6ef12af9a7b..abeaab759ac 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsLowResolution.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsLowResolution.cs @@ -31,7 +31,7 @@ struct VolumetricCloudsParameters_LowResolution public Material cloudCombinePass; } - VolumetricCloudsParameters_LowResolution PrepareVolumetricCloudsParameters_LowResolution(HDCamera hdCamera, VolumetricClouds settings, TVolumetricCloudsCameraType cameraType) + VolumetricCloudsParameters_LowResolution PrepareVolumetricCloudsParameters_LowResolution(HDCamera hdCamera, int width, int height, int viewCount, bool exposureControl, VolumetricClouds settings, TVolumetricCloudsCameraType cameraType) { VolumetricCloudsParameters_LowResolution parameters = new VolumetricCloudsParameters_LowResolution(); @@ -39,21 +39,21 @@ VolumetricCloudsParameters_LowResolution PrepareVolumetricCloudsParameters_LowRe CloudModelData cloudModelData = GetCloudModelData(settings); // Fill the common data - FillVolumetricCloudsCommonData(hdCamera, settings, cameraType, in cloudModelData, ref parameters.commonData); + FillVolumetricCloudsCommonData(exposureControl, settings, cameraType, in cloudModelData, ref parameters.commonData); // We need to make sure that the allocated size of the history buffers and the dispatch size are perfectly equal. // The ideal approach would be to have a function for that returns the converted size from a viewport and texture size. // but for now we do it like this. // Final resolution at which the effect should be exported - parameters.finalWidth = hdCamera.actualWidth; - parameters.finalHeight = hdCamera.actualHeight; + parameters.finalWidth = width; + parameters.finalHeight = height; // Intermediate resolution at which the effect is accumulated - parameters.intermediateWidth = Mathf.RoundToInt(0.5f * hdCamera.actualWidth); - parameters.intermediateHeight = Mathf.RoundToInt(0.5f * hdCamera.actualHeight); + parameters.intermediateWidth = Mathf.RoundToInt(0.5f * width); + parameters.intermediateHeight = Mathf.RoundToInt(0.5f * height); // Resolution at which the effect is traced - parameters.traceWidth = Mathf.RoundToInt(0.25f * hdCamera.actualWidth); - parameters.traceHeight = Mathf.RoundToInt(0.25f * hdCamera.actualHeight); - parameters.viewCount = hdCamera.viewCount; + parameters.traceWidth = Mathf.RoundToInt(0.25f * width); + parameters.traceHeight = Mathf.RoundToInt(0.25f * height); + parameters.viewCount = viewCount; // MSAA support parameters.needsTemporaryBuffer = hdCamera.msaaEnabled; @@ -94,7 +94,7 @@ VolumetricCloudsParameters_LowResolution PrepareVolumetricCloudsParameters_LowRe } static void TraceVolumetricClouds_LowResolution(CommandBuffer cmd, VolumetricCloudsParameters_LowResolution parameters, - RTHandle colorBuffer, RTHandle depthPyramid, TextureHandle volumetricLightingTexture, TextureHandle scatteringFallbackTexture, + RTHandle colorBuffer, RTHandle depthPyramid, RTHandle volumetricLightingTexture, RTHandle scatteringFallbackTexture, RTHandle intermediateLightingBuffer0, RTHandle intermediateLightingBuffer1, RTHandle intermediateLightingBuffer2, RTHandle intermediateDepthBuffer0, RTHandle intermediateDepthBuffer1, RTHandle intermediateColorBuffer, RTHandle intermediateUpscaleBuffer) { @@ -110,18 +110,23 @@ static void TraceVolumetricClouds_LowResolution(CommandBuffer cmd, VolumetricClo int finalTX = (parameters.finalWidth + (8 - 1)) / 8; int finalTY = (parameters.finalHeight + (8 - 1)) / 8; + // Bind the sampling textures + BlueNoise.BindDitheredTextureSet(cmd, parameters.commonData.ditheredTextureSet); + // Set the multi compiles CoreUtils.SetKeyword(cmd, "LOCAL_VOLUMETRIC_CLOUDS", parameters.commonData.localClouds); // Bind the constant buffer ConstantBuffer.Push(cmd, parameters.commonData.cloudsCB, parameters.commonData.volumetricCloudsCS, HDShaderIDs._ShaderVariablesClouds); - - using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.VolumetricCloudsPrepare))) + if (parameters.commonData.localClouds) { - // Compute the alternative version of the mip 1 of the depth (min instead of max that is required to handle high frequency meshes (vegetation, hair) - cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.depthDownscaleKernel, HDShaderIDs._DepthTexture, depthPyramid); - cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.depthDownscaleKernel, HDShaderIDs._HalfResDepthBufferRW, intermediateDepthBuffer0); - cmd.DispatchCompute(parameters.commonData.volumetricCloudsCS, parameters.depthDownscaleKernel, intermediateTX, intermediateTY, parameters.viewCount); + using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.VolumetricCloudsPrepare))) + { + // Compute the alternative version of the mip 1 of the depth (min instead of max that is required to handle high frequency meshes (vegetation, hair) + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.depthDownscaleKernel, HDShaderIDs._DepthTexture, depthPyramid); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.depthDownscaleKernel, HDShaderIDs._HalfResDepthBufferRW, intermediateDepthBuffer0); + cmd.DispatchCompute(parameters.commonData.volumetricCloudsCS, parameters.depthDownscaleKernel, intermediateTX, intermediateTY, parameters.viewCount); + } } using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.VolumetricCloudsTrace))) @@ -166,7 +171,6 @@ static void TraceVolumetricClouds_LowResolution(CommandBuffer cmd, VolumetricClo cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, targetKernel, HDShaderIDs._DepthStatusTexture, intermediateLightingBuffer2); cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, targetKernel, HDShaderIDs._DepthTexture, depthPyramid); - cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, targetKernel, HDShaderIDs._CameraColorTextureRW, colorBuffer); cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, targetKernel, HDShaderIDs._CameraColorTexture, intermediateColorBuffer); cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, targetKernel, HDShaderIDs._VBufferLighting, volumetricLightingTexture); if (parameters.commonData.cloudsCB._PhysicallyBasedSun == 0) @@ -182,7 +186,7 @@ static void TraceVolumetricClouds_LowResolution(CommandBuffer cmd, VolumetricClo { CoreUtils.SetKeyword(cmd, "USE_INTERMEDIATE_BUFFER", true); - // Provide this second upscaling + combine strategy in case a temporary buffer is requested (ie MSAA). + // Provide this second upscaling + combine strategy in case a temporary buffer is requested (i.e. MSAA). // In the case of an MSAA color target, we cannot use the in-place blending of the clouds with the color target. cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, targetKernel, HDShaderIDs._VolumetricCloudsUpscaleTextureRW, intermediateUpscaleBuffer); @@ -192,13 +196,13 @@ static void TraceVolumetricClouds_LowResolution(CommandBuffer cmd, VolumetricClo parameters.cloudCombinePass.SetTexture(HDShaderIDs._VolumetricCloudsUpscaleTextureRW, intermediateUpscaleBuffer); // Composite the clouds into the MSAA target via hardware blending. - HDUtils.DrawFullScreen(cmd, parameters.cloudCombinePass, colorBuffer); + HDUtils.DrawFullScreen(cmd, parameters.cloudCombinePass, colorBuffer, null, 0); CoreUtils.SetKeyword(cmd, "USE_INTERMEDIATE_BUFFER", false); } else { - cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.upscaleAndCombineKernel, HDShaderIDs._CameraColorTextureRW, colorBuffer); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.upscaleAndCombineKernel, HDShaderIDs._VolumetricCloudsUpscaleTextureRW, colorBuffer); // Perform the upscale and combine with the color buffer in place. cmd.DispatchCompute(parameters.commonData.volumetricCloudsCS, targetKernel, finalTX, finalTY, parameters.viewCount); @@ -236,7 +240,7 @@ TextureHandle RenderVolumetricClouds_LowResolution(RenderGraph renderGraph, HDCa builder.EnableAsyncCompute(false); VolumetricClouds settings = hdCamera.volumeStack.GetComponent(); - passData.parameters = PrepareVolumetricCloudsParameters_LowResolution(hdCamera, settings, cameraType); + passData.parameters = PrepareVolumetricCloudsParameters_LowResolution(hdCamera, hdCamera.actualWidth, hdCamera.actualHeight, hdCamera.viewCount, hdCamera.exposureControlFS, settings, cameraType); passData.colorBuffer = builder.ReadTexture(builder.WriteTexture(colorBuffer)); passData.depthPyramid = builder.ReadTexture(depthPyramid); passData.volumetricLighting = builder.ReadTexture(volumetricLighting); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsShadows.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsShadows.cs index 296438695ab..ecd67027d88 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsShadows.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsShadows.cs @@ -65,7 +65,8 @@ VolumetricCloudsShadowsParameters PrepareVolumetricCloudsShadowsParameters(HDCam CloudModelData cloudModelData = GetCloudModelData(settings); // Fill the common data - FillVolumetricCloudsCommonData(hdCamera, settings, TVolumetricCloudsCameraType.Default, in cloudModelData, ref parameters.commonData); + FillVolumetricCloudsCommonData(false, settings, TVolumetricCloudsCameraType.Default, in cloudModelData, ref parameters.commonData); + parameters.shadowsKernel = m_ComputeShadowCloudsKernel; // Update the constant buffer diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsSky.cs new file mode 100644 index 00000000000..47b87c6b6a9 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsSky.cs @@ -0,0 +1,344 @@ +using UnityEngine.Experimental.Rendering; +using UnityEngine.Experimental.Rendering.RenderGraphModule; + +namespace UnityEngine.Rendering.HighDefinition +{ + public partial class HDRenderPipeline + { + // Intermediate textures required for baking the clouds into the cubemap + RTHandle m_IntermediateCloudsLighting0Buffer = null; + RTHandle m_IntermediateCloudsLighting1Buffer = null; + RTHandle m_IntermediateCloudsDepthBuffer = null; + RTHandle m_IntermediateCloudsLightingCube0Buffer = null; + RTHandle m_IntermediateCloudsLightingCube1Buffer = null; + MaterialPropertyBlock m_MpbClouds = new MaterialPropertyBlock(); + + void ReleaseVolumetricCloudsStaticTextures() + { + if (m_Asset.currentPlatformRenderPipelineSettings.supportVolumetricClouds) + { + RTHandles.Release(m_IntermediateCloudsLighting0Buffer); + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal) + RTHandles.Release(m_IntermediateCloudsLighting1Buffer); + RTHandles.Release(m_IntermediateCloudsDepthBuffer); + RTHandles.Release(m_IntermediateCloudsLightingCube0Buffer); + RTHandles.Release(m_IntermediateCloudsLightingCube1Buffer); + } + } + + void InitializeVolumetricCloudsStaticTextures() + { + if (m_Asset.currentPlatformRenderPipelineSettings.supportVolumetricClouds) + { + int skyResolution = (int)m_Asset.currentPlatformRenderPipelineSettings.lightLoopSettings.skyReflectionSize; + m_IntermediateCloudsLighting0Buffer = RTHandles.Alloc(skyResolution, skyResolution, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite: true); + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal) + m_IntermediateCloudsLighting1Buffer = RTHandles.Alloc(skyResolution, skyResolution, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite: true); + m_IntermediateCloudsDepthBuffer = RTHandles.Alloc(skyResolution, skyResolution, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GraphicsFormat.R32_SFloat, enableRandomWrite: true); + m_IntermediateCloudsLightingCube0Buffer = RTHandles.Alloc(skyResolution, skyResolution, TextureXR.slices, dimension: TextureDimension.Cube, colorFormat: GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite: true, useMipMap: true, autoGenerateMips: false); + m_IntermediateCloudsLightingCube1Buffer = RTHandles.Alloc(skyResolution, skyResolution, TextureXR.slices, dimension: TextureDimension.Cube, colorFormat: GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite: true, useMipMap: true, autoGenerateMips: false); + } + } + + struct VolumetricCloudsParameters_Sky_Low + { + // Resolution parameters + public int traceWidth; + public int traceHeight; + public int intermediateWidth; + public int intermediateHeight; + public int finalWidth; + public int finalHeight; + + // Used kernels + public int renderKernel; + public int preUpscaleKernel; + public int finalUpscaleKernel; + + // Data common to all volumetric cloud passes + public VolumetricCloudCommonData commonData; + + // Sky + public Material cloudCombinePass; + public CubemapFace cubemapFace; + } + + VolumetricCloudsParameters_Sky_Low PrepareVolumetricCloudsParameters_Sky_Low(HDCamera hdCamera, int width, int height, CubemapFace cubemapFace, VolumetricClouds settings) + { + VolumetricCloudsParameters_Sky_Low parameters = new VolumetricCloudsParameters_Sky_Low(); + + // Compute the cloud model data + CloudModelData cloudModelData = GetCloudModelData(settings); + + // Fill the common data + FillVolumetricCloudsCommonData(false, settings, TVolumetricCloudsCameraType.Sky, in cloudModelData, ref parameters.commonData); + + // We need to make sure that the allocated size of the history buffers and the dispatch size are perfectly equal. + // The ideal approach would be to have a function for that returns the converted size from a viewport and texture size. + // but for now we do it like this. + // Final resolution at which the effect should be exported + parameters.finalWidth = width; + parameters.finalHeight = height; + // Intermediate resolution at which the effect is accumulated + parameters.intermediateWidth = Mathf.RoundToInt(0.5f * width); + parameters.intermediateHeight = Mathf.RoundToInt(0.5f * height); + // Resolution at which the effect is traced + parameters.traceWidth = Mathf.RoundToInt(0.25f * width); + parameters.traceHeight = Mathf.RoundToInt(0.25f * height); + + // Sky + parameters.cubemapFace = cubemapFace; + parameters.cloudCombinePass = m_CloudCombinePass; + + // Kernels + parameters.renderKernel = m_CloudRenderKernel; + parameters.preUpscaleKernel = m_PreUpscaleCloudsSkyKernel; + parameters.finalUpscaleKernel = m_UpscaleAndCombineCloudsSkyKernel; + + + // Update the constant buffer + VolumetricCloudsCameraData cameraData; + cameraData.cameraType = parameters.commonData.cameraType; + cameraData.traceWidth = parameters.traceWidth; + cameraData.traceHeight = parameters.traceHeight; + cameraData.intermediateWidth = parameters.intermediateWidth; + cameraData.intermediateHeight = parameters.intermediateHeight; + cameraData.finalWidth = parameters.finalWidth; + cameraData.finalHeight = parameters.finalHeight; + cameraData.viewCount = 1; + cameraData.enableExposureControl = parameters.commonData.enableExposureControl; + cameraData.lowResolution = true; + cameraData.enableIntegration = false; + UpdateShaderVariableslClouds(ref parameters.commonData.cloudsCB, hdCamera, settings, cameraData, cloudModelData, false); + + return parameters; + } + + static void TraceVolumetricClouds_Sky_Low(CommandBuffer cmd, in VolumetricCloudsParameters_Sky_Low parameters, MaterialPropertyBlock mpb, RTHandle intermediateLightingBuffer0, RTHandle intermediateDepthBuffer0, RTHandle intermediateCubeMap) + { + // Compute the number of tiles to evaluate + int traceTX = (parameters.traceWidth + (8 - 1)) / 8; + int traceTY = (parameters.traceHeight + (8 - 1)) / 8; + + // Bind the sampling textures + BlueNoise.BindDitheredTextureSet(cmd, parameters.commonData.ditheredTextureSet); + + // Bind the constant buffer + ConstantBuffer.Push(cmd, parameters.commonData.cloudsCB, parameters.commonData.volumetricCloudsCS, HDShaderIDs._ShaderVariablesClouds); + + CoreUtils.SetKeyword(cmd, "LOCAL_VOLUMETRIC_CLOUDS", false); + + // Ray-march the clouds for this frame + CoreUtils.SetKeyword(cmd, "PHYSICALLY_BASED_SUN", parameters.commonData.cloudsCB._PhysicallyBasedSun == 1); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, HDShaderIDs._Worley128RGBA, parameters.commonData.worley128RGBA); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, HDShaderIDs._ErosionNoise, parameters.commonData.erosionNoise); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, HDShaderIDs._CloudMapTexture, parameters.commonData.cloudMapTexture); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, HDShaderIDs._CloudLutTexture, parameters.commonData.cloudLutTexture); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, HDShaderIDs._CloudsLightingTextureRW, intermediateLightingBuffer0); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, HDShaderIDs._CloudsDepthTextureRW, intermediateDepthBuffer0); + cmd.DispatchCompute(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, traceTX, traceTY, 1); + CoreUtils.SetKeyword(cmd, "PHYSICALLY_BASED_SUN", false); + + mpb.Clear(); + mpb.SetTexture(HDShaderIDs._VolumetricCloudsUpscaleTextureRW, intermediateLightingBuffer0); + CoreUtils.SetRenderTarget(cmd, intermediateCubeMap, ClearFlag.None, miplevel: 2, cubemapFace: parameters.cubemapFace); + CoreUtils.DrawFullScreen(cmd, parameters.cloudCombinePass, mpb, 3); + } + + struct VolumetricCloudsParameters_Sky_High + { + // Resolution parameters + public int finalWidth; + public int finalHeight; + + // Compute shader and kernels + public int renderKernel; + public int combineKernel; + + // Data common to all volumetric cloud passes + public VolumetricCloudCommonData commonData; + + // Sky + public bool renderForCubeMap; + public CubemapFace cubemapFace; + public Material cloudCombinePass; + } + + VolumetricCloudsParameters_Sky_High PrepareVolumetricCloudsParameters_Sky_High(HDCamera hdCamera, int width, int height, CubemapFace cubemapFace, VolumetricClouds settings) + { + VolumetricCloudsParameters_Sky_High parameters = new VolumetricCloudsParameters_Sky_High(); + + // Compute the cloud model data + CloudModelData cloudModelData = GetCloudModelData(settings); + + // Fill the common data + FillVolumetricCloudsCommonData(false, settings, TVolumetricCloudsCameraType.Sky, in cloudModelData, ref parameters.commonData); + + // If this is a baked reflection, we run everything at full res + parameters.finalWidth = width; + parameters.finalHeight = height; + + // Sky + parameters.cubemapFace = cubemapFace; + parameters.cloudCombinePass = m_CloudCombinePass; + + // Compute shader and kernels + parameters.renderKernel = m_CloudRenderKernel; + parameters.combineKernel = m_CombineCloudsSkyKernel; + + // Update the constant buffer + VolumetricCloudsCameraData cameraData; + cameraData.cameraType = parameters.commonData.cameraType; + cameraData.traceWidth = parameters.finalWidth; + cameraData.traceHeight = parameters.finalHeight; + cameraData.intermediateWidth = parameters.finalWidth; + cameraData.intermediateHeight = parameters.finalHeight; + cameraData.finalWidth = parameters.finalWidth; + cameraData.finalHeight = parameters.finalHeight; + cameraData.viewCount = 1; + cameraData.enableExposureControl = parameters.commonData.enableExposureControl; + cameraData.lowResolution = false; + cameraData.enableIntegration = false; + UpdateShaderVariableslClouds(ref parameters.commonData.cloudsCB, hdCamera, settings, cameraData, cloudModelData, false); + + return parameters; + } + + static void RenderVolumetricClouds_Sky_High(CommandBuffer cmd, in VolumetricCloudsParameters_Sky_High parameters, MaterialPropertyBlock mpb, RTHandle intermediateLightingBuffer0, RTHandle intermediateLightingBuffer1, RTHandle intermediateDepthBuffer0, RTHandle colorBuffer) + { + // Compute the number of tiles to evaluate + int finalTX = (parameters.finalWidth + (8 - 1)) / 8; + int finalTY = (parameters.finalHeight + (8 - 1)) / 8; + + // Bind the sampling textures + BlueNoise.BindDitheredTextureSet(cmd, parameters.commonData.ditheredTextureSet); + + // Set the multi compile + CoreUtils.SetKeyword(cmd, "LOCAL_VOLUMETRIC_CLOUDS", false); + + // Bind the constant buffer + ConstantBuffer.Push(cmd, parameters.commonData.cloudsCB, parameters.commonData.volumetricCloudsCS, HDShaderIDs._ShaderVariablesClouds); + + // Ray-march the clouds for this frame + CoreUtils.SetKeyword(cmd, "PHYSICALLY_BASED_SUN", parameters.commonData.cloudsCB._PhysicallyBasedSun == 1); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, HDShaderIDs._Worley128RGBA, parameters.commonData.worley128RGBA); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, HDShaderIDs._ErosionNoise, parameters.commonData.erosionNoise); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, HDShaderIDs._CloudMapTexture, parameters.commonData.cloudMapTexture); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, HDShaderIDs._CloudLutTexture, parameters.commonData.cloudLutTexture); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, HDShaderIDs._CloudsLightingTextureRW, intermediateLightingBuffer0); + cmd.SetComputeTextureParam(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, HDShaderIDs._CloudsDepthTextureRW, intermediateDepthBuffer0); + cmd.DispatchCompute(parameters.commonData.volumetricCloudsCS, parameters.renderKernel, finalTX, finalTY, 1); + CoreUtils.SetKeyword(cmd, "PHYSICALLY_BASED_SUN", false); + + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal) + { + // On Intel GPUs on OSX, due to the fact that we cannot always rely on pre-exposure the hardware blending fails and turns into Nans when + // the values are close to the max fp16 value. We do the blending manually on metal to avoid that behavior. + // Copy the target face of the cubemap into a temporary texture + cmd.CopyTexture(colorBuffer, (int)parameters.cubemapFace, 0, intermediateLightingBuffer1, 0, 0); + + // Output the result into the output buffer + mpb.Clear(); + mpb.SetTexture(HDShaderIDs._CameraColorTexture, intermediateLightingBuffer1); + mpb.SetTexture(HDShaderIDs._VolumetricCloudsUpscaleTextureRW, intermediateLightingBuffer0); + CoreUtils.SetRenderTarget(cmd, colorBuffer, ClearFlag.None, 0, parameters.cubemapFace); + CoreUtils.DrawFullScreen(cmd, parameters.cloudCombinePass, mpb, 1); + } + else + { + // Output the result into the output buffer + mpb.Clear(); + mpb.SetTexture(HDShaderIDs._VolumetricCloudsUpscaleTextureRW, intermediateLightingBuffer0); + CoreUtils.SetRenderTarget(cmd, colorBuffer, ClearFlag.None, 0, parameters.cubemapFace); + CoreUtils.DrawFullScreen(cmd, parameters.cloudCombinePass, mpb, 2); + } + } + + internal void RenderVolumetricClouds_Sky(CommandBuffer cmd, HDCamera hdCamera, Matrix4x4[] pixelCoordToViewDir, VolumetricClouds settings, int width, int height, RTHandle skyboxCubemap) + { + // If the current volume does not enable the feature, quit right away. + if (!HasVolumetricClouds(hdCamera, in settings)) + return; + + if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.FullResolutionCloudsForSky)) + { + // Prepare the parameters + VolumetricCloudsParameters_Sky_High parameters = PrepareVolumetricCloudsParameters_Sky_High(hdCamera, width, height, CubemapFace.Unknown, settings); + + using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.VolumetricCloudsTrace))) + { + for (int faceIdx = 0; faceIdx < 6; ++faceIdx) + { + // Update the cubemap face and the inverse projection matrix + parameters.cubemapFace = (CubemapFace)faceIdx; + parameters.commonData.cloudsCB._CloudsPixelCoordToViewDirWS = pixelCoordToViewDir[faceIdx]; + + // Render the face straight to the output cubemap + RenderVolumetricClouds_Sky_High(cmd, parameters, m_MpbClouds, m_IntermediateCloudsLighting0Buffer, m_IntermediateCloudsLighting1Buffer, m_IntermediateCloudsDepthBuffer, skyboxCubemap); + } + } + } + else + { + VolumetricCloudsParameters_Sky_Low parameters = PrepareVolumetricCloudsParameters_Sky_Low(hdCamera, width, height, CubemapFace.Unknown, settings); + + using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.VolumetricCloudsTrace))) + { + for (int faceIdx = 0; faceIdx < 6; ++faceIdx) + { + // Update the cubemap face and the inverse projection matrix + parameters.cubemapFace = (CubemapFace)faceIdx; + parameters.commonData.cloudsCB._CloudsPixelCoordToViewDirWS = pixelCoordToViewDir[faceIdx]; + + // Render the face straight to the output cubemap + TraceVolumetricClouds_Sky_Low(cmd, parameters, m_MpbClouds, m_IntermediateCloudsLighting0Buffer, m_IntermediateCloudsDepthBuffer, m_IntermediateCloudsLightingCube0Buffer); + } + } + + using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.VolumetricCloudsPreUpscale))) + { + for (int faceIdx = 0; faceIdx < 6; ++faceIdx) + { + m_MpbClouds.Clear(); + m_MpbClouds.SetTexture(HDShaderIDs._VolumetricCloudsTexture, m_IntermediateCloudsLightingCube0Buffer); + m_MpbClouds.SetMatrix(HDShaderIDs._PixelCoordToViewDirWS, pixelCoordToViewDir[faceIdx]); + m_MpbClouds.SetInt(HDShaderIDs._Mipmap, 2); + CoreUtils.SetRenderTarget(cmd, m_IntermediateCloudsLightingCube1Buffer, ClearFlag.None, 1, (CubemapFace)faceIdx); + CoreUtils.DrawFullScreen(cmd, parameters.cloudCombinePass, m_MpbClouds, 4); + } + } + + using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.VolumetricCloudsUpscaleAndCombine))) + { + for (int faceIdx = 0; faceIdx < 6; ++faceIdx) + { + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal) + { + // On Intel GPUs on OSX, due to the fact that we cannot always rely on pre-exposure the hardware blending fails and turns into Nans when + // the values are close to the max fp16 value. We do the blending manually on metal to avoid that behavior. + // Copy the target face of the cubemap into a temporary texture + cmd.CopyTexture(skyboxCubemap, faceIdx, 0, m_IntermediateCloudsLighting1Buffer, 0, 0); + + m_MpbClouds.Clear(); + m_MpbClouds.SetTexture(HDShaderIDs._CameraColorTexture, m_IntermediateCloudsLighting1Buffer); + m_MpbClouds.SetTexture(HDShaderIDs._VolumetricCloudsTexture, m_IntermediateCloudsLightingCube1Buffer); + m_MpbClouds.SetMatrix(HDShaderIDs._PixelCoordToViewDirWS, pixelCoordToViewDir[faceIdx]); + m_MpbClouds.SetInt(HDShaderIDs._Mipmap, 1); + CoreUtils.SetRenderTarget(cmd, skyboxCubemap, ClearFlag.None, 0, (CubemapFace)faceIdx); + CoreUtils.DrawFullScreen(cmd, parameters.cloudCombinePass, m_MpbClouds, 5); + } + else + { + m_MpbClouds.Clear(); + m_MpbClouds.SetTexture(HDShaderIDs._VolumetricCloudsTexture, m_IntermediateCloudsLightingCube1Buffer); + m_MpbClouds.SetMatrix(HDShaderIDs._PixelCoordToViewDirWS, pixelCoordToViewDir[faceIdx]); + m_MpbClouds.SetInt(HDShaderIDs._Mipmap, 1); + CoreUtils.SetRenderTarget(cmd, skyboxCubemap, ClearFlag.None, 0, (CubemapFace)faceIdx); + CoreUtils.DrawFullScreen(cmd, parameters.cloudCombinePass, m_MpbClouds, 6); + } + } + } + } + } + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsSky.cs.meta b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsSky.cs.meta new file mode 100644 index 00000000000..105c1fa6fba --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricCloudsSky.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 55146d6398166ce45ac827dacc01a3ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.compute index e1e17e67650..37f652e4c6b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.compute @@ -1,13 +1,27 @@ +// Depth related kernels #pragma kernel ConvertObliqueDepth #pragma kernel DownscaleDepth + +// Render clouds #pragma kernel RenderClouds + +// Trace to intermedaite #pragma kernel ReprojectClouds REPROJECT_CLOUDS=ReprojectClouds #pragma kernel ReprojectCloudsRejection REPROJECT_CLOUDS=ReprojectCloudsRejection WITH_REJECTION #pragma kernel PreUpscaleClouds +#pragma kernel PreUpscaleCloudsSky + +// Intermediate to Full resolution #pragma kernel UpscaleAndCombineClouds_ColorRW UPSAMPLE_KERNEL=UpscaleAndCombineClouds_ColorRW CAN_RW_ON_COLOR_BUFFER #pragma kernel UpscaleAndCombineClouds_ColorCopy UPSAMPLE_KERNEL=UpscaleAndCombineClouds_ColorCopy +#pragma kernel UpscaleAndCombineCloudsSky UPSAMPLE_KERNEL_SKY=UpscaleAndCombineCloudsSky + +// Full resolution combination #pragma kernel CombineClouds_ColorRW COMBINE_KERNEL=CombineClouds_ColorRW CAN_RW_ON_COLOR_BUFFER #pragma kernel CombineClouds_ColorCopy COMBINE_KERNEL=CombineClouds_ColorCopy +#pragma kernel CombineCloudsSky COMBINE_KERNEL_SKY=CombineCloudsSky + +// Shadows #pragma kernel ComputeVolumetricCloudsShadow #pragma multi_compile _ PHYSICALLY_BASED_SUN @@ -85,11 +99,17 @@ RW_TEXTURE2D_X(float3, _CloudsAdditionalTextureRW); #define REAL_TIME_VOLUMETRIC_CLOUDS #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsUtilities.hlsl" +float3 GetCloudViewDirWS(float2 positionCS) +{ + float4 viewDirWS = mul(float4(positionCS.xy, 1.0f, 1.0f), _CloudsPixelCoordToViewDirWS); + return -normalize(viewDirWS.xyz); +} + float ConvertObliqueDepthToNonOblique(int2 currentCoord, float obliqueDepth) { // Compute the world position of the tapped pixel // Note: the view matrix here is not really used, but a valid matrix needs to be passed to this function. - PositionInputs centralPosInput = GetPositionInput(currentCoord, _ScreenSize.zw, obliqueDepth, UNITY_MATRIX_I_VP, UNITY_MATRIX_V); + PositionInputs centralPosInput = GetPositionInput(currentCoord, _FinalScreenSize.zw, obliqueDepth, UNITY_MATRIX_I_VP, UNITY_MATRIX_V); // For some reason, with oblique matrices, when the point is on the background the reconstructed position ends up behind the camera and at the wrong position float3 rayDirection = normalize(-centralPosInput.positionWS); @@ -110,7 +130,7 @@ void ConvertObliqueDepth(uint3 currentCoord : SV_DispatchThreadID, uint2 groupTh UNITY_XR_ASSIGN_VIEW_INDEX(currentCoord.z); // If this is bigger than the trace size, we are done - if (any(currentCoord.xy > uint2(_ScreenSize.xy))) + if (any(currentCoord.xy >= uint2(_FinalScreenSize.xy))) return; // Combine it with the current shift to define which half res depth should be used @@ -123,7 +143,7 @@ void DownscaleDepth(uint3 intermediateCoord : SV_DispatchThreadID, uint2 groupTh UNITY_XR_ASSIGN_VIEW_INDEX(intermediateCoord.z); // If this is bigger than the trace size, we are done - if (any(intermediateCoord.xy > uint2(_IntermediateScreenSize.xy))) + if (any(intermediateCoord.xy >= uint2(_IntermediateScreenSize.xy))) return; // TODO USE LDS for this @@ -190,18 +210,29 @@ CloudRay BuildRay(uint2 intermediateCoord, float integrationNoise) float isOccluded = 0.0; #endif - // Compute the world space position of the pixel (or at a virtual position is it the sky) - float3 pos = ComputeWorldSpacePosition((intermediateCoord + 0.5) * _IntermediateScreenSize.zw, lerp(0.5, ray.depthValue, isOccluded), _IsPlanarReflection ? _CameraInverseViewProjection_NO : UNITY_MATRIX_I_VP); + if (_RenderForSky) + { + // normalize to get the direction + ray.direction = GetCloudViewDirWS(_LowResolutionEvaluation ? intermediateCoord * 2 : intermediateCoord); - // normalize to get the direction - ray.direction = normalize(pos); + // Compute the max cloud ray length + ray.maxRayLength = MAX_SKYBOX_VOLUMETRIC_CLOUDS_DISTANCE; + } + else + { + // Compute the world space position of the pixel (or at a virtual position is it the sky) + float3 pos = ComputeWorldSpacePosition((intermediateCoord + 0.5) * _IntermediateScreenSize.zw, lerp(0.5, ray.depthValue, isOccluded), _IsPlanarReflection ? _CameraInverseViewProjection_NO : UNITY_MATRIX_I_VP); - // Compute the max cloud ray length -#ifdef LOCAL_VOLUMETRIC_CLOUDS - ray.maxRayLength = lerp(_ProjectionParams.z, length(pos), isOccluded); -#else - ray.maxRayLength = MAX_SKYBOX_VOLUMETRIC_CLOUDS_DISTANCE; -#endif + // normalize to get the direction + ray.direction = normalize(pos); + + // Compute the max cloud ray length + #ifdef LOCAL_VOLUMETRIC_CLOUDS + ray.maxRayLength = lerp(_ProjectionParams.z, length(pos), isOccluded); + #else + ray.maxRayLength = MAX_SKYBOX_VOLUMETRIC_CLOUDS_DISTANCE; + #endif + } // Compute the position of the point from which the ray will start #ifdef LOCAL_VOLUMETRIC_CLOUDS @@ -394,7 +425,7 @@ float3 unapplyFastTonemapping(float3 input) void EvaluateSunColorAttenuation(float3 evaluationPointWS, float3 sunDirection, inout float3 sunColor) { - #ifdef PHYSICALLY_BASED_SUN +#ifdef PHYSICALLY_BASED_SUN if(_PhysicallyBasedSun == 1) // TODO: move this into a shared function { @@ -427,7 +458,7 @@ EnvironmentLighting EvaluateEnvironmentLighting(CloudRay ray, float3 entryEvalua // Sun parameters EnvironmentLighting environmentLight; environmentLight.sunDirection = _SunDirection.xyz; - environmentLight.sunColor0 = _SunLightColor.xyz * (_ExposureSunColor ? GetCurrentExposureMultiplier() : 1.0); + environmentLight.sunColor0 = _SunLightColor.xyz * GetCurrentExposureMultiplier(); environmentLight.sunColor1 = environmentLight.sunColor0; environmentLight.ambientTermTop = _AmbientProbeTop.xyz * GetCurrentExposureMultiplier(); environmentLight.ambientTermBottom = _AmbientProbeBottom.xyz * GetCurrentExposureMultiplier(); @@ -802,7 +833,7 @@ void RenderClouds(uint3 traceCoord : SV_DispatchThreadID, uint2 groupThreadId : UNITY_XR_ASSIGN_VIEW_INDEX(traceCoord.z); // If this is bigger than the trace size, we are done - if (any(traceCoord.xy > uint2(_TraceScreenSize.xy))) + if (any(traceCoord.xy >= uint2(_TraceScreenSize.xy))) return; // Depending on if we are in full res or not, use a different intermediate coord @@ -1104,7 +1135,6 @@ void PreUpscaleClouds(uint3 dispatchThreadId : SV_DispatchThreadID, // Compute the set of coordinates we need uint2 intermediateCoord = dispatchThreadId.xy; - uint2 fullResCoord = intermediateCoord * 2; uint2 traceCoord = intermediateCoord / 2; #ifndef WITHOUT_LDS @@ -1183,6 +1213,44 @@ void PreUpscaleClouds(uint3 dispatchThreadId : SV_DispatchThreadID, _CloudsAdditionalTextureRW[COORD_TEXTURE2D_X(intermediateCoord)] = float3(1, currentDepth, cloudCloudDepth); } +[numthreads(8, 8, 1)] +void PreUpscaleCloudsSky(uint3 dispatchThreadId : SV_DispatchThreadID, + int groupIndex : SV_GroupIndex, + uint2 groupThreadId : SV_GroupThreadID, + uint2 groupId : SV_GroupID) +{ + UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z); + + // Compute the set of coordinates we need + uint2 intermediateCoord = dispatchThreadId.xy; + uint2 traceCoord = intermediateCoord / 2; + +#ifndef WITHOUT_LDS + // Only 36 workers of the 64 do the pre-fetching + if (groupIndex < 36) + { + // Load 1 value per thread + FillCloudReprojectionLDS(groupIndex, groupId * 8); + } + // Make sure all values are loaded in LDS by now. + GroupMemoryBarrierWithGroupSync(); +#endif + + // If out of bounds, leave right away + if (any(intermediateCoord.xy >= uint2(_IntermediateScreenSize.xy))) + return; + + // Grab the cloud data +#ifdef WITHOUT_LDS + float4 cloudLighting = LOAD_TEXTURE2D_X(_CloudsLightingTexture, traceCoord); +#else + float4 cloudLighting = GetCloudLighting_LDS(groupThreadId, int2(0, 0)); +#endif + + // Accumulate the result with the previous frame + _CloudsLightingTextureRW[COORD_TEXTURE2D_X(intermediateCoord)] = cloudLighting; +} + // Constant buffer where all variables should land CBUFFER_START(VolumetricCloudsUpscaleConstantBuffer) float2 _UpperScreenSize; @@ -1192,15 +1260,11 @@ CBUFFER_END TEXTURE2D_X(_VolumetricCloudsTexture); TEXTURE2D_X(_DepthStatusTexture); -#ifdef USE_INTERMEDIATE_BUFFER -RW_TEXTURE2D_X(float4, _VolumetricCloudsUpscaleTextureRW); -#else // Input output camera color buffer #ifndef CAN_RW_ON_COLOR_BUFFER TEXTURE2D_X(_CameraColorTexture); #endif -RW_TEXTURE2D_X(float4, _CameraColorTextureRW); -#endif +RW_TEXTURE2D_X(float4, _VolumetricCloudsUpscaleTextureRW); void FillLDSUpscale(uint groupIndex, uint2 groupOrigin) { @@ -1250,7 +1314,7 @@ void UPSAMPLE_KERNEL(uint3 finalCoord : SV_DispatchThreadID, GroupMemoryBarrierWithGroupSync(); // If out of bounds, leave right away - if (any(finalCoord.xy > uint2(_ScreenSize.xy))) + if (any(finalCoord.xy >= uint2(_FinalScreenSize.xy))) return; // Grab the depth value of the pixel @@ -1311,15 +1375,47 @@ void UPSAMPLE_KERNEL(uint3 finalCoord : SV_DispatchThreadID, #else // Read the color buffer #ifdef CAN_RW_ON_COLOR_BUFFER - float4 currentColor = _CameraColorTextureRW[COORD_TEXTURE2D_X(finalCoord.xy)]; + float4 currentColor = _VolumetricCloudsUpscaleTextureRW[COORD_TEXTURE2D_X(finalCoord.xy)]; #else float4 currentColor = _CameraColorTexture[COORD_TEXTURE2D_X(finalCoord.xy)]; #endif // If this is a background pixel, we want the cloud value, otherwise we do not. - _CameraColorTextureRW[COORD_TEXTURE2D_X(finalCoord.xy)] = float4(currentColor.xyz * currentClouds.a + currentClouds.xyz, currentColor.a); + _VolumetricCloudsUpscaleTextureRW[COORD_TEXTURE2D_X(finalCoord.xy)] = float4(currentColor.xyz * currentClouds.a + currentClouds.xyz, currentColor.a); #endif } +[numthreads(8, 8, 1)] +void UPSAMPLE_KERNEL_SKY(uint3 finalCoord : SV_DispatchThreadID, + int groupIndex : SV_GroupIndex, + uint2 groupThreadId : SV_GroupThreadID, + uint2 groupId : SV_GroupID) +{ + UNITY_XR_ASSIGN_VIEW_INDEX(finalCoord.z); + + // Only 36 workers of the 64 do the pre-fetching + if (groupIndex < 36) + { + // Load 1 value per thread + FillLDSUpscale(groupIndex, groupId * 8); + } + + // Make sure all values are loaded in LDS by now. + GroupMemoryBarrierWithGroupSync(); + + // If out of bounds, leave right away + if (any(finalCoord.xy >= uint2(_FinalScreenSize.xy))) + return; + + float4 currentClouds = GetCloudLighting_LDS(groupThreadId, int2(0, 0)); + + // De-tonemap the inscattering value + currentClouds.xyz = unapplyFastTonemapping(currentClouds.xyz); + currentClouds.w = saturate(currentClouds.w); + + // Store the upscaled result only, composite in later pass. + _VolumetricCloudsUpscaleTextureRW[COORD_TEXTURE2D_X(finalCoord.xy)] = currentClouds; +} + [numthreads(8, 8, 1)] void COMBINE_KERNEL(uint3 finalCoord : SV_DispatchThreadID, int groupIndex : SV_GroupIndex, @@ -1329,13 +1425,12 @@ void COMBINE_KERNEL(uint3 finalCoord : SV_DispatchThreadID, UNITY_XR_ASSIGN_VIEW_INDEX(finalCoord.z); // If out of bounds, leave right away - if (any(finalCoord.xy > uint2(_ScreenSize.xy))) + if (any(finalCoord.xy >= uint2(_FinalScreenSize.xy))) return; // Grab the depth value of the pixel float highDepth = LOAD_TEXTURE2D_X(_DepthTexture, finalCoord.xy).x; float4 sampleVal = LOAD_TEXTURE2D_X(_VolumetricCloudsTexture, finalCoord.xy); - float cloudsDepth = LOAD_TEXTURE2D_X(_DepthStatusTexture, finalCoord.xy).x; #ifdef LOCAL_VOLUMETRIC_CLOUDS // Do the bilateral upscale @@ -1348,8 +1443,10 @@ void COMBINE_KERNEL(uint3 finalCoord : SV_DispatchThreadID, currentClouds.xyz = unapplyFastTonemapping(currentClouds.xyz); currentClouds.w = saturate(currentClouds.w); -#ifndef LOCAL_VOLUMETRIC_CLOUDS - cloudsDepth = UNITY_RAW_FAR_CLIP_VALUE; +#ifdef LOCAL_VOLUMETRIC_CLOUDS + float cloudsDepth = LOAD_TEXTURE2D_X(_DepthStatusTexture, finalCoord.xy).x; +#else + float cloudsDepth = UNITY_RAW_FAR_CLIP_VALUE; #endif // Compute the pos input of the cloud position @@ -1370,15 +1467,35 @@ void COMBINE_KERNEL(uint3 finalCoord : SV_DispatchThreadID, #else // Read the color buffer #ifdef CAN_RW_ON_COLOR_BUFFER - float4 currentColor = _CameraColorTextureRW[COORD_TEXTURE2D_X(finalCoord.xy)]; + float4 currentColor = _VolumetricCloudsUpscaleTextureRW[COORD_TEXTURE2D_X(finalCoord.xy)]; #else float4 currentColor = _CameraColorTexture[COORD_TEXTURE2D_X(finalCoord.xy)]; #endif // If this is a background pixel, we want the cloud value, otherwise we do not. - _CameraColorTextureRW[COORD_TEXTURE2D_X(finalCoord.xy)] = float4(currentColor.xyz * currentClouds.a + currentClouds.xyz, currentColor.a); + _VolumetricCloudsUpscaleTextureRW[COORD_TEXTURE2D_X(finalCoord.xy)] = float4(currentColor.xyz * currentClouds.a + currentClouds.xyz, currentColor.a); #endif } +[numthreads(8, 8, 1)] +void COMBINE_KERNEL_SKY(uint3 finalCoord : SV_DispatchThreadID) +{ + UNITY_XR_ASSIGN_VIEW_INDEX(finalCoord.z); + + // If out of bounds, leave right away + if (any(finalCoord.xy >= uint2(_FinalScreenSize.xy))) + return; + + // Grab the depth value of the pixel + float4 currentClouds = LOAD_TEXTURE2D_X(_VolumetricCloudsTexture, finalCoord.xy); + + // De-tonemap the inscattering value + currentClouds.xyz = unapplyFastTonemapping(currentClouds.xyz); + currentClouds.w = saturate(currentClouds.w); + + // Store the upscaled result only, composite in later pass. + _VolumetricCloudsUpscaleTextureRW[COORD_TEXTURE2D_X(finalCoord.xy)] = currentClouds; +} + RW_TEXTURE2D(float3, _VolumetricCloudsShadowRW); [numthreads(8, 8, 1)] diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsCombine.shader b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsCombine.shader index e8a9d9c236c..74b08af5263 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsCombine.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsCombine.shader @@ -13,8 +13,13 @@ Shader "Hidden/HDRP/VolumetricCloudsCombine" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsDef.cs.hlsl" + TEXTURE2D_X(_CameraColorTexture); TEXTURE2D_X(_VolumetricCloudsUpscaleTextureRW); + TEXTURECUBE(_VolumetricCloudsTexture); + float4x4 _PixelCoordToViewDirWS; + int _Mipmap; struct Attributes { @@ -42,6 +47,7 @@ Shader "Hidden/HDRP/VolumetricCloudsCombine" Pass { + // Pass 0 Cull Off ZTest Less // Required for XR occlusion mesh optimization ZWrite Off @@ -60,6 +66,130 @@ Shader "Hidden/HDRP/VolumetricCloudsCombine" } ENDHLSL } + + Pass + { + // Pass 1 + Cull Off + ZWrite Off + ZTest Always + Blend Off + + HLSLPROGRAM + + float4 Frag(Varyings input) : SV_Target + { + // Composite the result via hardware blending. + float4 clouds = LOAD_TEXTURE2D_X(_VolumetricCloudsUpscaleTextureRW, input.positionCS.xy); + clouds.rgb *= GetInverseCurrentExposureMultiplier(); + float4 color = LOAD_TEXTURE2D_X(_CameraColorTexture, input.positionCS.xy); + return float4(clouds.xyz + color.xyz * clouds.w, 1.0); + } + ENDHLSL + } + + Pass + { + // Pass 2 + Cull Off + ZWrite Off + ZTest Always + + // If this is a background pixel, we want the cloud value, otherwise we do not. + Blend One SrcAlpha, Zero One + + HLSLPROGRAM + + float4 Frag(Varyings input) : SV_Target + { + // Composite the result via hardware blending. + float4 clouds = LOAD_TEXTURE2D_X(_VolumetricCloudsUpscaleTextureRW, input.positionCS.xy); + clouds.rgb *= GetInverseCurrentExposureMultiplier(); + return clouds; + } + ENDHLSL + } + + Pass + { + // Pass 3 + Cull Off + ZWrite Off + Blend Off + + HLSLPROGRAM + float4 Frag(Varyings input) : SV_Target + { + return LOAD_TEXTURE2D_X(_VolumetricCloudsUpscaleTextureRW, input.positionCS.xy); + } + ENDHLSL + } + + Pass + { + // Pass 4 + Cull Off + ZWrite Off + Blend Off + + HLSLPROGRAM + float4 Frag(Varyings input) : SV_Target + { + // Points towards the camera + float3 viewDirWS = -normalize(mul(float4(input.positionCS.xy * (float)_Mipmap, 1.0, 1.0), _PixelCoordToViewDirWS)); + // Fetch the clouds + return SAMPLE_TEXTURECUBE_LOD(_VolumetricCloudsTexture, s_linear_clamp_sampler, viewDirWS, _Mipmap); + } + ENDHLSL + } + + Pass + { + // Pass 5 + Cull Off + ZWrite Off + Blend Off + + HLSLPROGRAM + + float4 Frag(Varyings input) : SV_Target + { + // Construct the view direction + float3 viewDirWS = -normalize(mul(float4(input.positionCS.xy * (float)_Mipmap, 1.0, 1.0), _PixelCoordToViewDirWS)); + // Fetch the clouds + float4 clouds = SAMPLE_TEXTURECUBE_LOD(_VolumetricCloudsTexture, s_linear_clamp_sampler, viewDirWS, _Mipmap); + // Inverse the exposure + clouds.rgb *= GetInverseCurrentExposureMultiplier(); + // Read the color value + float4 color = LOAD_TEXTURE2D_X(_CameraColorTexture, input.positionCS.xy); + // Combine the clouds + return float4(clouds.xyz + color.xyz * clouds.w, 1.0); + } + ENDHLSL + } + + Pass + { + // Pass 6 + Cull Off + ZWrite Off + // If this is a background pixel, we want the cloud value, otherwise we do not. + Blend One SrcAlpha, Zero One + + HLSLPROGRAM + + float4 Frag(Varyings input) : SV_Target + { + // Construct the view direction + float3 viewDirWS = -normalize(mul(float4(input.positionCS.xy * (float)_Mipmap, 1.0, 1.0), _PixelCoordToViewDirWS)); + // Fetch the clouds + float4 clouds = SAMPLE_TEXTURECUBE_LOD(_VolumetricCloudsTexture, s_linear_clamp_sampler, viewDirWS, _Mipmap); + // Inverse the exposure + clouds.rgb *= GetInverseCurrentExposureMultiplier(); + return clouds; + } + ENDHLSL + } } Fallback Off } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsDef.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsDef.cs index beb7e38cc3b..eb8a1bc0f0a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsDef.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsDef.cs @@ -98,8 +98,8 @@ unsafe struct ShaderVariablesClouds public int _AccumulationFrameIndex; // Index for which of the 4 local pixels should be evaluated public int _SubPixelIndex; - // Padding - public int _Padding; + // Render the clouds for the sky + public int _RenderForSky; // Fade in parameters public float _FadeInStart; @@ -138,12 +138,13 @@ unsafe struct ShaderVariablesClouds public Matrix4x4 _CameraViewProjection_NO; public Matrix4x4 _CameraInverseViewProjection_NO; public Matrix4x4 _CameraPrevViewProjection_NO; + public Matrix4x4 _CloudsPixelCoordToViewDirWS; // Controls the intensity of the wind distortion at high altitudes public float _AltitudeDistortion; // Internal parameters that compensates the erosion factor to match between the different erosion noises public float _ErosionFactorCompensation; - // Fast tonemapping settings + // Fast tone mapping settings public int _EnableFastToneMapping; // Flag that defines if the current camera is a planar reflection public int _IsPlanarReflection; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsDef.cs.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsDef.cs.hlsl index b5d9af5b862..dcec331e5ca 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsDef.cs.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricCloudsDef.cs.hlsl @@ -47,7 +47,7 @@ CBUFFER_START(ShaderVariablesClouds) int _ExposureSunColor; int _AccumulationFrameIndex; int _SubPixelIndex; - int Padding0; + int _RenderForSky; float _FadeInStart; float _FadeInDistance; int _LowResolutionEvaluation; @@ -65,6 +65,7 @@ CBUFFER_START(ShaderVariablesClouds) float4x4 _CameraViewProjection_NO; float4x4 _CameraInverseViewProjection_NO; float4x4 _CameraPrevViewProjection_NO; + float4x4 _CloudsPixelCoordToViewDirWS; float _AltitudeDistortion; float _ErosionFactorCompensation; int _EnableFastToneMapping; 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 a3cb35460be..f77441ad13f 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 @@ -1262,6 +1262,7 @@ internal void UpdateCurrentSky(SkyManager skyManager) { visualSky.skySettings = skyManager.GetDefaultPreviewSkyInstance(); visualSky.cloudSettings = null; + visualSky.volumetricClouds = null; lightingSky = visualSky; skyAmbientMode = SkyAmbientMode.Dynamic; } @@ -1272,6 +1273,7 @@ internal void UpdateCurrentSky(SkyManager skyManager) visualSky.skySettings = SkyManager.GetSkySetting(volumeStack); visualSky.cloudSettings = SkyManager.GetCloudSetting(volumeStack); + visualSky.volumetricClouds = SkyManager.GetVolumetricClouds(volumeStack); lightingSky = visualSky; @@ -1285,9 +1287,11 @@ internal void UpdateCurrentSky(SkyManager skyManager) { SkySettings newSkyOverride = SkyManager.GetSkySetting(skyManager.lightingOverrideVolumeStack); CloudSettings newCloudOverride = SkyManager.GetCloudSetting(skyManager.lightingOverrideVolumeStack); + VolumetricClouds newVolumetricCloudsOverride = SkyManager.GetVolumetricClouds(skyManager.lightingOverrideVolumeStack); if ((m_LightingOverrideSky.skySettings != null && newSkyOverride == null) || - (m_LightingOverrideSky.cloudSettings != null && newCloudOverride == null)) + (m_LightingOverrideSky.cloudSettings != null && newCloudOverride == null) || + (m_LightingOverrideSky.volumetricClouds != null && newVolumetricCloudsOverride == null)) { // When we switch from override to no override, we need to make sure that the visual sky will actually be properly re-rendered. // Resetting the visual sky hash will ensure that. @@ -1295,6 +1299,7 @@ internal void UpdateCurrentSky(SkyManager skyManager) m_LightingOverrideSky.skySettings = newSkyOverride; m_LightingOverrideSky.cloudSettings = newCloudOverride; + m_LightingOverrideSky.volumetricClouds = newVolumetricCloudsOverride; lightingSky = m_LightingOverrideSky; } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDProfileId.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDProfileId.cs index f2f8e620af3..c21d63a87f7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDProfileId.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDProfileId.cs @@ -90,6 +90,7 @@ internal enum HDProfileId PrepareVisibleLocalVolumetricFogList, UpdateLocalVolumetricFogAtlas, + // Volumetric clouds VolumetricClouds, VolumetricCloudsPrepare, VolumetricCloudsTrace, @@ -98,6 +99,7 @@ internal enum HDProfileId VolumetricCloudsUpscaleAndCombine, VolumetricCloudsShadow, VolumetricCloudMapGeneration, + VolumetricCloudsAmbientProbe, // RT Cluster RaytracingBuildCluster, 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 bdcf09a6179..e06e5d423c9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -498,6 +498,7 @@ static class HDShaderIDs public static readonly int _CumulonimbusMapMultiplier = Shader.PropertyToID("_CumulonimbusMapMultiplier"); public static readonly int _RainMap = Shader.PropertyToID("_RainMap"); public static readonly int _CloudMapResolution = Shader.PropertyToID("_CloudMapResolution"); + public static readonly int _CloudsPixelCoordToViewDirWS = Shader.PropertyToID("_CloudsPixelCoordToViewDirWS"); public static readonly int _Flowmap = Shader.PropertyToID("_Flowmap"); public static readonly int _FlowmapParam = Shader.PropertyToID("_FlowmapParam"); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs index a94f0244af1..7a04c3788c1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs @@ -300,8 +300,11 @@ public enum FrameSettingsField tooltip: "Sets the custom sample budget of the Subsurface Scattering algorithm.")] SssCustomSampleBudget = 49, /// When enabled, Cameras using these Frame Settings calculate Volumetric Clouds. - [FrameSettingsField(1, autoName: VolumetricClouds, tooltip: "When enabled, Cameras using these Frame Settings calculate Volumetric Clouds.")] + [FrameSettingsField(1, autoName: VolumetricClouds, customOrderInGroup: 50, tooltip: "When enabled, Cameras using these Frame Settings calculate Volumetric Clouds.")] VolumetricClouds = 79, + /// When enabled, Cameras using these Frame Settings calculate Volumetric Clouds at full resolution when evaluating the sky texture. + [FrameSettingsField(1, autoName: FullResolutionCloudsForSky, customOrderInGroup: 51, positiveDependencies: new[] { VolumetricClouds }, tooltip: "When enabled, Cameras using these Frame Settings calculate Volumetric Clouds at full resolution when evaluating the sky texture.")] + FullResolutionCloudsForSky = 98, /// When enabled, Cameras using these Frame Settings render subsurface scattering (SSS) Materials with an added transmission effect (only if you enable Transmission on the SSS Material in the Material's Inspector). [FrameSettingsField(1, autoName: Transmission, tooltip: "When enabled, Cameras using these Frame Settings render subsurface scattering (SSS) Materials with an added transmission effect (only if you enable Transmission on the SSS Material in the Material's Inspector).")] @@ -476,6 +479,7 @@ partial struct FrameSettings (uint)FrameSettingsField.AlphaToMask, (uint)FrameSettingsField.ProbeVolume, (uint)FrameSettingsField.VolumetricClouds, + // (uint)FullResolutionCloudsForSky }), lodBias = 1, sssQualityMode = SssQualityMode.FromQualitySettings, @@ -536,6 +540,7 @@ partial struct FrameSettings (uint)FrameSettingsField.ProbeVolume, (uint)FrameSettingsField.DirectSpecularLighting, // (uint)FrameSettingsField.VolumetricClouds, + // (uint)FullResolutionCloudsForSky }), lodBias = 1, sssQualityMode = SssQualityMode.FromQualitySettings, @@ -593,6 +598,7 @@ partial struct FrameSettings // (uint)FrameSettingsField.EnableSkyReflection, // (uint)FrameSettingsField.DirectSpecularLighting, (uint)FrameSettingsField.VolumetricClouds, + // (uint)FullResolutionCloudsForSky }), lodBias = 1, sssQualityMode = SssQualityMode.FromQualitySettings, @@ -831,6 +837,7 @@ internal static void Sanitize(ref FrameSettings sanitizedFrameSettings, Camera c sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.SSGI] &= renderPipelineSettings.supportSSGI && !preview && sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.OpaqueObjects] && temporalAccumulationAllowed; sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.SubsurfaceScattering] &= renderPipelineSettings.supportSubsurfaceScattering; sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.VolumetricClouds] &= renderPipelineSettings.supportVolumetricClouds && !preview; + sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.FullResolutionCloudsForSky] &= sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.VolumetricClouds]; // We must take care of the scene view fog flags in the editor bool atmosphericScattering = sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.AtmosphericScattering] &= sceneViewFog && !preview; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/AmbientProbeConvolution.compute b/com.unity.render-pipelines.high-definition/Runtime/Sky/AmbientProbeConvolution.compute index 859fe2e5594..d758da63c25 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/AmbientProbeConvolution.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/AmbientProbeConvolution.compute @@ -6,9 +6,12 @@ #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch #pragma kernel AmbientProbeConvolution KERNEL_NAME=AmbientProbeConvolution +#pragma kernel AmbientProbeConvolutionNoMip KERNEL_NAME=AmbientProbeConvolutionNoMip NO_MIPS -RWStructuredBuffer _AmbientProbeOutputBuffer; +// Input Cubemap TEXTURECUBE(_AmbientProbeInputCubemap); +// Output buffer +RWStructuredBuffer _AmbientProbeOutputBuffer; // Constants from SetSHEMapConstants function in the Stupid Spherical Harmonics Tricks paper: // http://www.ppsloan.org/publications/StupidSH36.pdf @@ -37,6 +40,15 @@ void KERNEL_NAME(uint dispatchThreadId : SV_DispatchThreadID) { uint sampleCount = SAMPLE_COUNT; + // Construct the direction + float2 u = Hammersley2d(dispatchThreadId, sampleCount); + float3 n = SampleSphereUniform(u.x, u.y); + +#if defined(NO_MIPS) + // Sample once per thread + float4 value = SAMPLE_TEXTURECUBE_LOD(_AmbientProbeInputCubemap, s_linear_clamp_sampler, n, 0); +#else + // Grab the cubemap size float2 cubeSize; _AmbientProbeInputCubemap.GetDimensions(cubeSize.x, cubeSize.y); @@ -52,11 +64,9 @@ void KERNEL_NAME(uint dispatchThreadId : SV_DispatchThreadID) float omegaS = rcp(sampleCount) * rcp(pdf); float mipLevel = 0.5 * log2(omegaS * invOmegaP); - float2 u = Hammersley2d(dispatchThreadId, sampleCount); - float3 n = SampleSphereUniform(u.x, u.y); - // Sample once per thread float4 value = SAMPLE_TEXTURECUBE_LOD(_AmbientProbeInputCubemap, s_linear_clamp_sampler, n, mipLevel); +#endif float outputSHCoeffs[SH_COEFF_COUNT]; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/CloudSystem/CloudLayer/CloudLayerRenderer.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/CloudSystem/CloudLayer/CloudLayerRenderer.cs index 4d2dccd39f9..5bd3ba32b77 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/CloudSystem/CloudLayer/CloudLayerRenderer.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/CloudSystem/CloudLayer/CloudLayerRenderer.cs @@ -130,7 +130,17 @@ public override void RenderClouds(BuiltinSkyParameters builtinParams, bool rende // This matrix needs to be updated at the draw call frequency. m_PropertyBlock.SetMatrix(HDShaderIDs._PixelCoordToViewDirWS, builtinParams.pixelCoordToViewDirMatrix); - CoreUtils.DrawFullScreen(cmd, m_CloudLayerMaterial, m_PropertyBlock, renderForCubemap ? 0 : 1); + + if (renderForCubemap) + { + CoreUtils.SetRenderTarget(cmd, builtinParams.colorBuffer, ClearFlag.None, 0, builtinParams.cubemapFace); + CoreUtils.DrawFullScreen(cmd, m_CloudLayerMaterial, m_PropertyBlock, 0); + } + else + { + CoreUtils.SetRenderTarget(cmd, builtinParams.colorBuffer); + CoreUtils.DrawFullScreen(cmd, m_CloudLayerMaterial, m_PropertyBlock, 1); + } } class PrecomputationCache diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs index 49812044e03..626d7708e9c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs @@ -67,10 +67,14 @@ public class BuiltinSkyParameters public SkySettings skySettings; /// Current cloud settings. public CloudSettings cloudSettings; + /// Current volumetric cloud settings. + public VolumetricClouds volumetricClouds; /// Current debug dsplay settings. public DebugDisplaySettings debugSettings; /// Null color buffer render target identifier. public static RenderTargetIdentifier nullRT = -1; + /// Index of the current cubemap face to render (Unknown for texture2D). + public CubemapFace cubemapFace = CubemapFace.Unknown; } /// @@ -211,6 +215,11 @@ internal static CloudSettings GetCloudSetting(VolumeStack stack) return null; } + internal static VolumetricClouds GetVolumetricClouds(VolumeStack stack) + { + return stack.GetComponent(); + } + static void UpdateSkyTypes() { if (m_SkyTypesDict == null) @@ -297,6 +306,7 @@ void SetGlobalSkyData(CommandBuffer cmd, HDCamera hdCamera) { m_BuiltinParameters.skySettings = hdCamera.lightingSky.skySettings; m_BuiltinParameters.cloudSettings = hdCamera.lightingSky.cloudSettings; + m_BuiltinParameters.volumetricClouds = hdCamera.lightingSky.volumetricClouds; renderer.SetGlobalSkyData(cmd, m_BuiltinParameters); } } @@ -547,6 +557,22 @@ void BlitCubemap(CommandBuffer cmd, Cubemap source, RenderTexture dest) cmd.GenerateMips(dest); } + internal void RenderSkyOnlyToCubemap(CommandBuffer commandBuffer, RTHandle outputCubemap, bool includeSunInBaking, SkyRenderer skyRenderer) + { + for (int i = 0; i < 6; ++i) + { + m_BuiltinParameters.commandBuffer = commandBuffer; + m_BuiltinParameters.pixelCoordToViewDirMatrix = m_facePixelCoordToViewDirMatrices[i]; + m_BuiltinParameters.viewMatrix = m_CameraRelativeViewMatrices[i]; + m_BuiltinParameters.colorBuffer = outputCubemap; + m_BuiltinParameters.depthBuffer = null; + m_BuiltinParameters.cubemapFace = (CubemapFace)i; + + CoreUtils.SetRenderTarget(m_BuiltinParameters.commandBuffer, outputCubemap, ClearFlag.None, 0, (CubemapFace)i); + skyRenderer.RenderSky(m_BuiltinParameters, true, includeSunInBaking); + } + } + void RenderSkyToCubemap(SkyUpdateContext skyContext) { using (new ProfilingScope(m_BuiltinParameters.commandBuffer, ProfilingSampler.Get(HDProfileId.RenderSkyToCubemap))) @@ -554,6 +580,7 @@ void RenderSkyToCubemap(SkyUpdateContext skyContext) var renderingContext = m_CachedSkyContexts[skyContext.cachedSkyRenderingContextId].renderingContext; var skyRenderer = skyContext.skyRenderer; var cloudRenderer = skyContext.cloudRenderer; + var volumetricClouds = skyContext.volumetricClouds; for (int i = 0; i < 6; ++i) { @@ -561,6 +588,7 @@ void RenderSkyToCubemap(SkyUpdateContext skyContext) m_BuiltinParameters.viewMatrix = m_CameraRelativeViewMatrices[i]; m_BuiltinParameters.colorBuffer = renderingContext.skyboxCubemapRT; m_BuiltinParameters.depthBuffer = null; + m_BuiltinParameters.cubemapFace = (CubemapFace)i; CoreUtils.SetRenderTarget(m_BuiltinParameters.commandBuffer, renderingContext.skyboxCubemapRT, ClearFlag.None, 0, (CubemapFace)i); skyRenderer.RenderSky(m_BuiltinParameters, true, skyContext.skySettings.includeSunInBaking.value); @@ -568,6 +596,16 @@ void RenderSkyToCubemap(SkyUpdateContext skyContext) cloudRenderer.RenderClouds(m_BuiltinParameters, true); } + // Render the volumetric clouds into the cubemap + if (volumetricClouds != null) + { + // The volumetric clouds explicitly rely on the physically based sky. We need to make sure that the sun textures are properly bound. + // Unfortunately, the global binding happens too late, so we need to bind it here. + skyRenderer.SetGlobalSkyData(m_BuiltinParameters.commandBuffer, m_BuiltinParameters); + HDRenderPipeline.currentPipeline.RenderVolumetricClouds_Sky(m_BuiltinParameters.commandBuffer, m_BuiltinParameters.hdCamera, m_facePixelCoordToViewDirMatrices, + m_BuiltinParameters.volumetricClouds, (int)m_BuiltinParameters.screenSize.x, (int)m_BuiltinParameters.screenSize.y, renderingContext.skyboxCubemapRT); + } + // Generate mipmap for our cubemap Debug.Assert(renderingContext.skyboxCubemapRT.rt.autoGenerateMips == false); m_BuiltinParameters.commandBuffer.GenerateMips(renderingContext.skyboxCubemapRT); @@ -748,6 +786,11 @@ int ComputeSkyHash(HDCamera camera, SkyUpdateContext skyContext, Light sunLight, int skyHash = sunHash * 23 + skyContext.skySettings.GetHashCode(cameraForHash); if (skyContext.HasClouds()) skyHash = skyHash * 23 + skyContext.cloudSettings.GetHashCode(cameraForHash); + if (skyContext.HasVolumetricClouds()) + { + skyHash = skyHash * 23 + skyContext.volumetricClouds.GetHashCode(); + skyHash = skyHash * 23 + camera.frameSettings.IsEnabled(FrameSettingsField.FullResolutionCloudsForSky).GetHashCode(); + } skyHash = skyHash * 23 + (staticSky ? 1 : 0); skyHash = skyHash * 23 + (ambientMode == SkyAmbientMode.Static ? 1 : 0); return skyHash; @@ -801,6 +844,7 @@ public void UpdateEnvironment(HDCamera hdCamera, m_BuiltinParameters.frameIndex = (int)hdCamera.GetCameraFrameCount(); m_BuiltinParameters.skySettings = skyContext.skySettings; m_BuiltinParameters.cloudSettings = skyContext.cloudSettings; + m_BuiltinParameters.volumetricClouds = skyContext.volumetricClouds; // When update is not requested and the context is already valid (ie: already computed at least once), // we need to early out in two cases: @@ -916,6 +960,7 @@ public void UpdateEnvironment(HDCamera hdCamera, ScriptableRenderContext renderC { m_StaticLightingSky.skySettings = staticLightingSky != null ? staticLightingSky.skySettings : null; m_StaticLightingSky.cloudSettings = staticLightingSky != null ? staticLightingSky.cloudSettings : null; + m_StaticLightingSky.volumetricClouds = staticLightingSky != null ? staticLightingSky.volumetricClouds : null; UpdateEnvironment(hdCamera, renderContext, m_StaticLightingSky, sunLight, m_StaticSkyUpdateRequired || m_UpdateRequired, true, true, SkyAmbientMode.Static, cmd); m_StaticSkyUpdateRequired = false; } @@ -943,6 +988,7 @@ internal void UpdateBuiltinParameters(SkyUpdateContext skyContext, HDCamera hdCa m_BuiltinParameters.frameIndex = (int)hdCamera.GetCameraFrameCount(); m_BuiltinParameters.skySettings = skyContext.skySettings; m_BuiltinParameters.cloudSettings = skyContext.cloudSettings; + m_BuiltinParameters.volumetricClouds = skyContext.volumetricClouds; } public bool TryGetCloudSettings(HDCamera hdCamera, out CloudSettings cloudSettings, out CloudRenderer cloudRenderer) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyUpdateContext.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyUpdateContext.cs index e007fb11524..71c9f26a589 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyUpdateContext.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyUpdateContext.cs @@ -14,6 +14,8 @@ internal class SkyUpdateContext public int skyParametersHash = -1; public float currentUpdateTime = 0.0f; + VolumetricClouds m_VolumetricClouds; + public bool settingsHadBigDifferenceWithPrev { get; private set; } public SkySettings skySettings @@ -77,6 +79,25 @@ public CloudSettings cloudSettings } } + public VolumetricClouds volumetricClouds + { + get { return m_VolumetricClouds; } + set + { + if (m_VolumetricClouds == value) + return; + + m_VolumetricClouds = value; + + if (m_CloudSettings != null && cloudRenderer == null) + { + var rendererType = m_CloudSettings.GetCloudRendererType(); + cloudRenderer = (CloudRenderer)Activator.CreateInstance(rendererType); + cloudRenderer.Build(); + } + } + } + public void Cleanup() { if (skyRenderer != null) @@ -100,5 +121,10 @@ public bool HasClouds() { return m_CloudSettings != null; } + + public bool HasVolumetricClouds() + { + return m_VolumetricClouds != null; + } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs index 6575df5ba03..351eb291f02 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs @@ -30,6 +30,13 @@ public class StaticLightingSky : MonoBehaviour CloudSettings m_CloudSettings; // This one contain only property values from overridden properties in the original profile component CloudSettings m_CloudSettingsFromProfile; + // Volumetric Clouds + [SerializeField] + bool m_StaticLightingVolumetricClouds = false; + int m_LastComputedVolumetricCloudHash; + VolumetricClouds m_VolumetricClouds; + VolumetricClouds m_VolumetricCloudSettingsFromProfile; + internal SkySettings skySettings { get @@ -68,6 +75,14 @@ internal CloudSettings cloudSettings } } + internal VolumetricClouds volumetricClouds + { + get + { + return m_StaticLightingVolumetricClouds ? m_VolumetricClouds : null; + } + } + List m_VolumeSkyList = new List(); List m_VolumeCloudsList = new List(); @@ -177,6 +192,13 @@ void GetCloudFromIDAndVolume(int cloudUniqueID, VolumeProfile profile, out Cloud } } + void GetVolumetricCloudVolume(VolumeProfile profile, out VolumetricClouds volumetricClouds) + { + volumetricClouds = null; + if (profile != null) + profile.TryGet(out volumetricClouds); + } + private int InitComponentFromProfile(T component, T componentFromProfile, Type type) where T : VolumeComponent { @@ -250,6 +272,21 @@ void UpdateCurrentStaticLightingClouds() } } + void UpdateCurrentStaticLightingVolumetricClouds() + { + // First, grab the cloud settings of the right type in the profile. + CoreUtils.Destroy(m_VolumetricClouds); + m_VolumetricClouds = null; + m_LastComputedVolumetricCloudHash = 0; + GetVolumetricCloudVolume(m_Profile, out m_VolumetricCloudSettingsFromProfile); + + if (m_VolumetricCloudSettingsFromProfile != null) + { + m_VolumetricClouds = (VolumetricClouds)ScriptableObject.CreateInstance(typeof(VolumetricClouds)); + m_LastComputedVolumetricCloudHash = InitComponentFromProfile(m_VolumetricClouds, m_VolumetricCloudSettingsFromProfile, typeof(VolumetricClouds)); + } + } + // All actions done in this method are because Editor won't go through setters so we need to manually check consistency of our data. void OnValidate() { @@ -261,6 +298,7 @@ void OnValidate() { m_StaticLightingSkyUniqueID = 0; m_StaticLightingCloudsUniqueID = 0; + m_StaticLightingVolumetricClouds = false; } // If we detect that the profile has changed, we need to reset the static lighting sky. @@ -282,6 +320,7 @@ void OnEnable() { UpdateCurrentStaticLightingSky(); UpdateCurrentStaticLightingClouds(); + UpdateCurrentStaticLightingVolumetricClouds(); if (m_Profile != null) SkyManager.RegisterStaticLightingSky(this); } @@ -293,6 +332,7 @@ void OnDisable() ResetSky(); ResetCloud(); + ResetVolumetricCloud(); } void Update() @@ -301,6 +341,7 @@ void Update() { UpdateCurrentStaticLightingSky(); UpdateCurrentStaticLightingClouds(); + UpdateCurrentStaticLightingVolumetricClouds(); m_NeedUpdateStaticLightingSky = false; } } @@ -320,5 +361,13 @@ void ResetCloud() m_CloudSettingsFromProfile = null; m_LastComputedCloudHash = 0; } + + void ResetVolumetricCloud() + { + CoreUtils.Destroy(m_VolumetricClouds); + m_VolumetricClouds = null; + m_CloudSettingsFromProfile = null; + m_LastComputedVolumetricCloudHash = 0; + } } } From 0c55536ebdbd329fb87a6035de2f9ae748a59521 Mon Sep 17 00:00:00 2001 From: Anis Benyoub Date: Thu, 19 Aug 2021 10:36:39 +0200 Subject: [PATCH 2/4] Update test scenes --- .../Clouds Profile.asset | 36 +- .../5011_VolumetricClouds/LocalVolume0.asset | 13 +- .../5011_VolumetricClouds/LocalVolume1.asset | 13 +- .../5011_VolumetricClouds/LocalVolume2.asset | 13 +- .../5011_VolumetricClouds/LocalVolume3.asset | 13 +- .../Global Volume Profile.asset | 11 +- .../5011_VolumetricCloudsShadowsBake.unity | 141 +++- .../LightingData.asset | Bin 0 -> 19608 bytes .../LightingData.asset.meta | 8 + .../Global Volume Profile.asset | 11 +- .../5014_VolumetricCloudsBanding.unity | 5 + .../Global Volume Profile.asset | 13 +- .../5015_VolumetricCloudsProbeAndSky.meta | 8 + .../5015_VolumetricCloudsProbeAndSky.unity | 772 ++++++++++++++++++ ...015_VolumetricCloudsProbeAndSky.unity.meta | 7 + .../Global Volume Profile.asset | 645 +++++++++++++++ .../Global Volume Profile.asset.meta | 8 + .../M_Diffuse.mat | 265 ++++++ .../M_Diffuse.mat.meta | 8 + .../M_Metallic.mat | 265 ++++++ .../M_Metallic.mat.meta | 8 + .../5015_VolumetricClouds_ProbeGradient.meta | 8 + .../5015_VolumetricClouds_ProbeGradient.unity | 772 ++++++++++++++++++ ..._VolumetricClouds_ProbeGradient.unity.meta | 7 + .../Global Volume Profile.asset | 645 +++++++++++++++ .../Global Volume Profile.asset.meta | 8 + .../ProjectSettings/EditorBuildSettings.asset | 6 + 27 files changed, 3689 insertions(+), 20 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricCloudsShadowsBake/LightingData.asset create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricCloudsShadowsBake/LightingData.asset.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricCloudsProbeAndSky.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricCloudsProbeAndSky.unity create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricCloudsProbeAndSky.unity.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricCloudsProbeAndSky/Global Volume Profile.asset create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricCloudsProbeAndSky/Global Volume Profile.asset.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricCloudsProbeAndSky/M_Diffuse.mat create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricCloudsProbeAndSky/M_Diffuse.mat.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricCloudsProbeAndSky/M_Metallic.mat create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricCloudsProbeAndSky/M_Metallic.mat.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricClouds_ProbeGradient.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricClouds_ProbeGradient.unity create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricClouds_ProbeGradient.unity.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricClouds_ProbeGradient/Global Volume Profile.asset create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5015_VolumetricClouds_ProbeGradient/Global Volume Profile.asset.meta diff --git a/TestProjects/HDRP_RuntimeTests/Assets/Scenes/004-CloudsFlaresDecals/Clouds Profile.asset b/TestProjects/HDRP_RuntimeTests/Assets/Scenes/004-CloudsFlaresDecals/Clouds Profile.asset index dd9c0cc7a02..226424adf40 100644 --- a/TestProjects/HDRP_RuntimeTests/Assets/Scenes/004-CloudsFlaresDecals/Clouds Profile.asset +++ b/TestProjects/HDRP_RuntimeTests/Assets/Scenes/004-CloudsFlaresDecals/Clouds Profile.asset @@ -34,6 +34,15 @@ MonoBehaviour: cloudThickness: m_OverrideState: 1 m_Value: 6000 + fadeInMode: + m_OverrideState: 0 + m_Value: 0 + fadeInStart: + m_OverrideState: 0 + m_Value: 0 + fadeInDistance: + m_OverrideState: 0 + m_Value: 0 numPrimarySteps: m_OverrideState: 1 m_Value: 128 @@ -220,18 +229,32 @@ MonoBehaviour: erosionScale: m_OverrideState: 1 m_Value: 0.5 + erosionNoiseType: + m_OverrideState: 0 + m_Value: 1 ambientLightProbeDimmer: m_OverrideState: 1 - m_Value: 1 + m_Value: 0 erosionOcclusion: m_OverrideState: 0 m_Value: 0.5 globalWindSpeed: m_OverrideState: 1 - m_Value: 0 + m_Value: + mode: 0 + customValue: 0 + additiveValue: 0 + multiplyValue: 0 orientation: m_OverrideState: 1 - m_Value: 0 + m_Value: + mode: 0 + customValue: 0 + additiveValue: 0 + multiplyValue: 0 + altitudeDistortion: + m_OverrideState: 0 + m_Value: 0.5 cloudMapSpeedMultiplier: m_OverrideState: 1 m_Value: 1 @@ -262,6 +285,13 @@ MonoBehaviour: shadowOpacityFallback: m_OverrideState: 1 m_Value: 0 + m_Version: 1 + m_ObsoleteWindSpeed: + m_OverrideState: 1 + m_Value: 0 + m_ObsoleteOrientation: + m_OverrideState: 1 + m_Value: 0 --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume0.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume0.asset index 34b092efa48..c3119bdb5e9 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume0.asset +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume0.asset @@ -48,6 +48,15 @@ MonoBehaviour: cloudThickness: m_OverrideState: 0 m_Value: 6000 + fadeInMode: + m_OverrideState: 0 + m_Value: 0 + fadeInStart: + m_OverrideState: 0 + m_Value: 0 + fadeInDistance: + m_OverrideState: 0 + m_Value: 0 numPrimarySteps: m_OverrideState: 0 m_Value: 48 @@ -256,8 +265,8 @@ MonoBehaviour: m_OverrideState: 0 m_Value: 1 ambientLightProbeDimmer: - m_OverrideState: 0 - m_Value: 1 + m_OverrideState: 1 + m_Value: 0 erosionOcclusion: m_OverrideState: 1 m_Value: 0 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume1.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume1.asset index b09687ec666..2a288a90b14 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume1.asset +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume1.asset @@ -48,6 +48,15 @@ MonoBehaviour: cloudThickness: m_OverrideState: 0 m_Value: 3000 + fadeInMode: + m_OverrideState: 0 + m_Value: 0 + fadeInStart: + m_OverrideState: 0 + m_Value: 0 + fadeInDistance: + m_OverrideState: 0 + m_Value: 0 numPrimarySteps: m_OverrideState: 1 m_Value: 64 @@ -256,8 +265,8 @@ MonoBehaviour: m_OverrideState: 0 m_Value: 1 ambientLightProbeDimmer: - m_OverrideState: 0 - m_Value: 1 + m_OverrideState: 1 + m_Value: 0 erosionOcclusion: m_OverrideState: 1 m_Value: 0 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume2.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume2.asset index ce8940649ee..82a908e7b74 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume2.asset +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume2.asset @@ -48,6 +48,15 @@ MonoBehaviour: cloudThickness: m_OverrideState: 0 m_Value: 3000 + fadeInMode: + m_OverrideState: 0 + m_Value: 0 + fadeInStart: + m_OverrideState: 0 + m_Value: 0 + fadeInDistance: + m_OverrideState: 0 + m_Value: 0 numPrimarySteps: m_OverrideState: 0 m_Value: 48 @@ -238,8 +247,8 @@ MonoBehaviour: m_OverrideState: 0 m_Value: 1 ambientLightProbeDimmer: - m_OverrideState: 0 - m_Value: 1 + m_OverrideState: 1 + m_Value: 0 erosionOcclusion: m_OverrideState: 1 m_Value: 0 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume3.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume3.asset index 8b8073db843..72426c55f27 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume3.asset +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricClouds/LocalVolume3.asset @@ -48,6 +48,15 @@ MonoBehaviour: cloudThickness: m_OverrideState: 0 m_Value: 3000 + fadeInMode: + m_OverrideState: 0 + m_Value: 0 + fadeInStart: + m_OverrideState: 0 + m_Value: 0 + fadeInDistance: + m_OverrideState: 0 + m_Value: 0 numPrimarySteps: m_OverrideState: 0 m_Value: 48 @@ -238,8 +247,8 @@ MonoBehaviour: m_OverrideState: 0 m_Value: 1 ambientLightProbeDimmer: - m_OverrideState: 0 - m_Value: 1 + m_OverrideState: 1 + m_Value: 0 erosionOcclusion: m_OverrideState: 1 m_Value: 0 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricCloudsShadows/Global Volume Profile.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricCloudsShadows/Global Volume Profile.asset index dd7e619f37a..ab630395e05 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricCloudsShadows/Global Volume Profile.asset +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricCloudsShadows/Global Volume Profile.asset @@ -65,6 +65,15 @@ MonoBehaviour: cloudThickness: m_OverrideState: 1 m_Value: 6500 + fadeInMode: + m_OverrideState: 0 + m_Value: 0 + fadeInStart: + m_OverrideState: 0 + m_Value: 0 + fadeInDistance: + m_OverrideState: 0 + m_Value: 0 numPrimarySteps: m_OverrideState: 0 m_Value: 48 @@ -274,7 +283,7 @@ MonoBehaviour: m_Value: 1 ambientLightProbeDimmer: m_OverrideState: 1 - m_Value: 1 + m_Value: 0 erosionOcclusion: m_OverrideState: 1 m_Value: 0 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricCloudsShadowsBake.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricCloudsShadowsBake.unity index 60dcb4ed795..a45feed64b0 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricCloudsShadowsBake.unity +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricCloudsShadowsBake.unity @@ -97,7 +97,7 @@ LightmapSettings: m_ExportTrainingData: 0 m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 112000004, guid: 5dacd5b5b7e0b34429d371a78fc1922d, + m_LightingDataAsset: {fileID: 112000004, guid: 28a4a33f282de1648a05ae44a489b6db, type: 2} m_LightingSettings: {fileID: 4890085278179872738, guid: 9744438e18dda59499f4cec2def09605, type: 2} @@ -223,6 +223,57 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &138614858 +GameObject: + m_ObjectHideFlags: 19 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 138614860} + - component: {fileID: 138614859} + m_Layer: 0 + m_Name: SceneIDMap + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &138614859 +MonoBehaviour: + m_ObjectHideFlags: 19 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 138614858} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 644295329} + m_Name: + m_EditorClassIdentifier: + m_Entries: + - id: 0 + category: 0 + gameObject: {fileID: 152581472} + - id: 1 + category: 0 + gameObject: {fileID: 1332358517} +--- !u!4 &138614860 +Transform: + m_ObjectHideFlags: 19 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 138614858} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &152581472 GameObject: m_ObjectHideFlags: 0 @@ -444,7 +495,7 @@ MonoBehaviour: camera: camera: 0 m_ProxyVolume: {fileID: 0} - m_BakedTexture: {fileID: 8900000, guid: 4cf1a5892060d1542a1c76cddea9f6c8, type: 3} + m_BakedTexture: {fileID: 8900000, guid: 4c2bb9810fd65f34988fcfd11a6be827, type: 3} m_CustomTexture: {fileID: 0} m_BakedRenderData: m_WorldToCameraRHS: @@ -860,6 +911,7 @@ MonoBehaviour: m_Profile: {fileID: 11400000, guid: 543962d842d8f324d891c1f726aee798, type: 2} m_StaticLightingSkyUniqueID: 4 m_StaticLightingCloudsUniqueID: 0 + m_StaticLightingVolumetricClouds: 0 --- !u!4 &260152582 Transform: m_ObjectHideFlags: 1 @@ -905,7 +957,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} m_Name: m_EditorClassIdentifier: - isGlobal: 1 + m_IsGlobal: 1 priority: 0 blendDistance: 0 weight: 1 @@ -937,11 +989,76 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} m_Name: m_EditorClassIdentifier: - isGlobal: 1 + m_IsGlobal: 1 priority: -100 blendDistance: 0 weight: 1 sharedProfile: {fileID: 11400000, guid: f940a8037e6cda542891dc1aac1fa4e8, type: 2} +--- !u!115 &644295329 +MonoScript: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + serializedVersion: 5 + m_Script: + m_DefaultReferences: {} + m_Icon: {fileID: 0} + m_ExecutionOrder: 0 + m_ClassName: SceneObjectIDMapSceneAsset + m_Namespace: UnityEngine.Rendering.HighDefinition +--- !u!1 &726228995 +GameObject: + m_ObjectHideFlags: 19 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 726228997} + - component: {fileID: 726228996} + m_Layer: 0 + m_Name: SceneIDMap + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &726228996 +MonoBehaviour: + m_ObjectHideFlags: 19 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 726228995} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1647656851} + m_Name: + m_EditorClassIdentifier: + m_Entries: + - id: 0 + category: 0 + gameObject: {fileID: 152581472} + - id: 1 + category: 0 + gameObject: {fileID: 1332358517} +--- !u!4 &726228997 +Transform: + m_ObjectHideFlags: 19 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 726228995} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &755354872 GameObject: m_ObjectHideFlags: 0 @@ -1439,7 +1556,7 @@ MonoBehaviour: camera: camera: 0 m_ProxyVolume: {fileID: 0} - m_BakedTexture: {fileID: 8900000, guid: accba8ad2e097864c81dba5bf0f86ef1, type: 3} + m_BakedTexture: {fileID: 8900000, guid: cb671a8506149b74284b29c9dac7d6b7, type: 3} m_CustomTexture: {fileID: 0} m_BakedRenderData: m_WorldToCameraRHS: @@ -2398,6 +2515,20 @@ MonoBehaviour: m_PointlightHDType: 0 m_SpotLightShape: 0 m_AreaLightShape: 0 +--- !u!115 &1647656851 +MonoScript: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + serializedVersion: 5 + m_Script: + m_DefaultReferences: {} + m_Icon: {fileID: 0} + m_ExecutionOrder: 0 + m_ClassName: SceneObjectIDMapSceneAsset + m_Namespace: UnityEngine.Rendering.HighDefinition --- !u!115 &1955490829 MonoScript: m_ObjectHideFlags: 0 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricCloudsShadowsBake/LightingData.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5011_VolumetricCloudsShadowsBake/LightingData.asset new file mode 100644 index 0000000000000000000000000000000000000000..f11bc8276d1094421449205a588155892b781d5e GIT binary patch literal 19608 zcmeI451drhb;sYZyC6md|MO2=R8&Ba8UDy0h2gI(@_!eEfWqwVTXtl3cAc4(U7|1= zMG0z*p*99JVp5SN{)y4p5JN~w($ogqG$l=KBsEcMO*A!4QmfSM`Q3ZY%)4{G`#Gj_jVys*UhL}FZg-1yYQ;Jxnd z?pOtZ*Uvh(Bea9A`q|Ek5%K$$ul?q}U;J(Wp&Hs^T=tS6C{U4Zb6DU^+QsPK z!xcf{$yiXRG{>bfI1Bs)+Rv*D3fT8Cc@%MoQO;44eGVO?JeowJD7FE79LXO;hsV)o z>nK=AG2~CAeTwB*nYdNnHc%gVgx%_?}j|JQN1cfZiM;l~JAf#M=f3LjT{^LC! z3l>oSzDS+M_oX&VJsQt6=wW~k_?Q^iQs0Wqx!puy=D2^*S|C1f!K7a_z4<#P=pVnOQ%rz z_tT{d=^WIh=@N~ls!P*|y`L_Ld`*``{vWDKB45)bk^f=SCD`Ip8ov#+K~LdBqCsp$ z`ZthZPqr@oJK5v0;0Wn?Gv&h;pbN1AMI6d)zTig6NB`h+qvc~km9a(X-hxYID9?Y5Bbm&SAM1A>qmhnO9Etm#Mh4oFJVeoIldm(Oqa)k=P2(dv|;=% z^0>WLivEr@yg;!Hu;1wTjic=H@x!(Jb;^hTz1VPyIKV%=L+Jt3s21AezQk=`pI{G_ zA48ca4?F3JCzvM`K9%_dg(sQgzM&`imouNF@FmPAD|{t$y3X||e;xBF3U6RORpHk# z$F+)*#en(QL*sWX^XUrjWPYi_w=us=;oF(xqEE?UkoxanK2zblm?ss!oB1q-Kg4{t z!uK(sqwpt~&sF#{%;zcm0Q30@{|@uZ75;tZ3l#oC=F$6aI+e!S&hHD%7b@jnVt$3k zt$%xsIQ-8d@B&2~NWSBL7E`|Ke_a2z1Y8Q6bVbmIZt$-m9o#_2xEFAFWiWvF5Zd5> zmU-O0el9n>K(P(*Z&ClVg0fxzQyIKT{&fV&$Gt_Z;nft|fbx5&Z4-&Zztqtd3#u(N zY0D=wU#ajZ%vULV8uKeXZrgV$akOu>$KCd=QMk14qY9VytyQ?RZ=J_0gPk;fb<{rk z1y>nP5eHm9!Rwh{P5I^Xi}Byg{abH%HJ8S@ZvQqYT>6(%xb&}H;nKebkK6ITiQCuc zakqV;!livp3YYe6RJgRS+2fVL4tmbq#qCQQP7w!;--9&1`-o%Q$L%@E8{xA)IkI_EfITNS>I`8JQog4>BbL>t;)07t|D*Ec-h?Pq=?<-5GXxjx+l zp5($vlYhefr`#WZ+~m3ZyCfU^OH%gD9i~qUZS7yq_@~b(T>R6$3K#$MS%r&#+O2T$PxmQY{L}pk7ytBt$E|)0 zWBvG?;RT9qfPP1>Uk_5YYaf=2evmEn$VERMQn={H=M^sc@dbs8e*B5TML!-^xah}T zg^PYXqHxiVeF_)-_)~?8etc2kq90#Uxah~D3K#u&OyQy*k9*wu_fe!D@c&PM7bxOD z*C)rnf0^=QNukgM*S|jrUc!b?AldNmc((tF$E(b{iY0Uo{eq_yzK;3RJ#buK(#*fA z@I3Qp6n-P~KkI?Rzurk4{`G4fckO4t!o_~Ru5huRXB95?^9_ZI{TxuZ*v~f=F7|U! z;bK4EQn=X9pDSGK=a9n1e!i`6v7hfKTt7#W{dmsf zu73QL!bLy6uW-?i!wMJucwXV6AAhZI(T~4Txah|Z6fXMlw+a{i_@Tl@KmJbPq8~>T zF8c8!g^Paty~0I5eyniOkAG0O=*J5lxBm4>(hvC8e*`a3#G%~3{)F;-^RF+0OJS3? z&!_OO@K59m%eeb|`cs9A{{54}MgLw>xai-{6fXMrbA^lky{vH2zgHA4`uD2BMgRU; z;i7-9DO~jLUlcC-_qxJG|9+ux(Z63RT=ee^g^T{Z>2a%n2U!1p1zw~TYmeLKmpADg`UU^i1IP9CZGzC>-+0{hpTAYO=|_i^+B8*N(sFZ%pB$ zzkL)g`dguJ(cemsTm9)%W%Z}Z<5s^15{G~73tpg3awymDe&9)==&O7GdYmV}GN>lm z(C-tdSbvYZ?K@uKv$_2rQTS5kCwSbhFRdev{+$S3h_>H-KX4LwGRoccCA{aOUop`5 z1kv@SfgX3)mrho=tS_D7aohfF-2PL+3&rZGEpGcy15ZY|+y2u%`EL8q@VMLlGZilF zALMb{{@b|ygTZ@g{}Awldi#f#$;bB%_mgbs*U40Dm?z)r=i_t^{O4I^4xk=l?wLgHi6z|48r>rgVk*Rtw_?`R9A`-S_twfG0}=uzrT;M_He|(39`JzaQms z+rJguztLX(ZvXHe-L2p4-$kDMir|UJ_Z4G3ZuR3r>Js#0oZ*FH2caL)_j4C}+_wK( zZvS}jQgLs7;^4`mcr*Ud@xylj^ecvP|1!bju6<5axY*|;kK6X|;Py`jFBGfy+J6an zGRocYpW?}{FzaK`FG2ynW58Yl^c(%Zm+Hs(Pb=e#(i@xe>CDEtseEcyE*E~lFZ#@9 zezgr@CN#qEC7?N?y{V}+)t(C^g*qdEl5^8pfhgIWYHZuQIF;K(2eX#eg`N41Y?zA_ z$<0YMG>7=sFlWCoG^Lki+v>v{>W&=B5n8agtuYL0+nd8|x*^rFAeC)x%cL7}ixPCw z?9`^PaaL=6I?Uvapqk90bS6w?gIx34>hV{ZUEJ;xb~nN9CfeO3yPIrxm)PADyPIlu zaVsTmrNph2xRnyOQsP!h+)9aCDRC<$Zlxrwl!TR%uu>9MO2SG>SSbmTQX2pEuyIA0 zX$-Sr)=YqNVCHXem}{O9bX_M$TNiW&UBQ-Mv!FT69hps0 z-U6MXajv0SIs@m3Pb+4UG~u;%0>jSsmUKhf4u5T!Uy!19)OY2>+*<0hO;E3Gg8FR} z)N`AlzS{)#-X^I3HbLWP6Eu=GL1SqXm=sPGWn*eMuP7Z8#CarN9oCw;xxi??{Z6)~ zk<=;Oln%2&K9$`V=K1qkdtkqd4d!LcScDl8Y)&$<%h`@?mR`GrO9`AkE+Anjzm9wzY=&Y?nD8b2KMKDzh0q zRb^*hDy~g$34>I=C6%-JCb_h!iM-8fn{N-+Q1$H{c`MdbnoTvP+j8lAS0s-U z=HUq}m<8eF14<)h+G?_+?K3r(nq%r{N@sIiCk;UB`Z}xdMyn$do$RR0Oh>Cdw53S8i+A(dDJh;m_&8bW# zY$-Zg_%!45#MXMusOxGEgVuCs*l6TZJ4~5$4rgOz%zj1K)IuMAQ|)FN=5*ADWa<$= z-0OMhXis90Uz|L?E;z@l!Yq1hE^By(qnovjhgY34d+U9VZXG-F&>JswAH}P;eHEq4 z-z9X}!!4I7Q!ufKa7q0CKR+n_`9yyj75A0ehx^YDFn=}F=GC-eeg|My3y5sMCjsjz zxrH`xEZexe!rbzIk~to0T<+eIp8}plWJCEa`KbaT9Ir`nOSYW$r+M6d67UG+w<5d94W7#Vj@Jbc8gjmW39~_007XA|RAqvM*9?B0@IF^#YhxNd* zjDbh(@x;#Zct7(=10GdTez?N%C<%VH!ttmFUafFEih++%I3AV2&rvuYWx&r>xO{Sa zp2G1cfbt_1j$3u`^A$dW`2`A}%^Z(j(GUyl_|9iODher$`Nt#kLgMrbMjKu*F(N!N z;gNX-LD<(AWEK$FK#z3JE7^;XowN*bx&4eSA(H}sh2+D2u%tE4N!5(?EOMg;rbLp6&1E;gjv#E688{Vp-2+Qf*2i~TM&q}s%YV83sX{K?$E zWkq5W<@SqfbTpLrZ$%VR8vJZt^1`*f*5lTGcT*c+zjYpW?RTZZ#eP>QT6URL?NYxi~W97;bOmQ6)yI>PT^v|S1DZV_iBZU{o-CP8l?SVzZ;^E(!#}l zQwkURtyj3%Z-c_cej7b*?e}={(Xijp<95k#E$eR+c%gJs`I7WTpk$Q0ONPxQWKy_( zw~=gIe_ALf?eR)upEuJvXdj*D1n58PcPH~r4z>0Hem8T}5e-uQUgoV)NNM2@GPe(X zrIUp3W!_doCMEna=Isi9n)$T~f0lVx;fI*#6#g9ZyuyFLyhGtXW`3Q*@yZtSvsvM< zGVfIQ8_c^D{u}0aj*12u-*=gRED9+tybnE#qkY#ayg&0B6h4soR)yo0FXV4i_;BV0 zg^y%@qrxv@ev`r{F#ov1r!l|TEpA(MiAUrDlI z-;jTs$18*ByAq7W&0aHuBB!Ocbfz)gVAtFwNh{-$q@{65(%N_? zq($ZWwyas9FCEbNr2{HaI-oL(Q~7MVb3*6DrhrzeDH(+0$I}+4EkWCaAdJ&-oQ~sk z9H-+19Vh5GLC1*+K{~gJI)|mn1syFdD^guKemB8u#54-@UI-d9uzZ75mAI&-Lkd#dYe9^SEk z*dv!6Bu9=grRMO_7n_swzH#eGbu;&jTxD~I54?J2zo{eVKRo93$2W{_fj6gcWbg9l z&buMIc=yrI-&1J+$}Ki`-7D{HoH%&p(%n}K{?&Egy8ocfJ%2;}^Lw9}v+%L5x`vn2 z$6mC#M$GRYoj^s*@bb&#|E`3S%F2x$Z^x>71U}jDgUkgFt$)IYC}$zHWo3q5U(Gkq zi2Wvw>m1h^ME*x5ZY$0^p0+`>9XjlW;iNgs_`LEvS Date: Thu, 19 Aug 2021 17:37:31 +0200 Subject: [PATCH 3/4] Standalone screenshots --- .../Linear/LinuxPlayer/Vulkan/None/004-CloudsFlaresDecals.png | 4 ++-- .../Linear/OSXPlayer/Metal/None/004-CloudsFlaresDecals.png | 4 ++-- .../WindowsPlayer/Direct3D11/None/004-CloudsFlaresDecals.png | 4 ++-- .../WindowsPlayer/Direct3D12/None/004-CloudsFlaresDecals.png | 4 ++-- .../WindowsPlayer/Vulkan/None/004-CloudsFlaresDecals.png | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/004-CloudsFlaresDecals.png b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/004-CloudsFlaresDecals.png index dee5dd48ced..68de28eeffb 100644 --- a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/004-CloudsFlaresDecals.png +++ b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/004-CloudsFlaresDecals.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:54e74faf302fc76a532143e4cb576ebb2c5f6c6d1eb0b634cec1e078681b2bc6 -size 2360259 +oid sha256:42acf27136830d9677f49a97e4e823d5b5fe25ab633c21e19fdfe57ccf1bb252 +size 2365588 diff --git a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/004-CloudsFlaresDecals.png b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/004-CloudsFlaresDecals.png index 48016a3b2ef..21cca1eed09 100644 --- a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/004-CloudsFlaresDecals.png +++ b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/004-CloudsFlaresDecals.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a54ab574af607302ee7b4fd24a3875c59f5ea645f3bddeedff46e91ade297a1b -size 2386675 +oid sha256:abd975aba11b73067d1a273d9cd858988227a243db976bbec184ef1f3577968e +size 2379819 diff --git a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/004-CloudsFlaresDecals.png b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/004-CloudsFlaresDecals.png index 67303f1eabd..5ebf8a3ee28 100644 --- a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/004-CloudsFlaresDecals.png +++ b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/004-CloudsFlaresDecals.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:134e4edb1fd0df7aa1a4a4fa7d01551d53f0394f4f7f714233e4bf2cce51e0f9 -size 2359313 +oid sha256:05f67ba5caba7e98e15b2941cae9457f12d66c91e9631ef5aff4bf3801ce1eb2 +size 2350965 diff --git a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/004-CloudsFlaresDecals.png b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/004-CloudsFlaresDecals.png index bdfa0cb03c7..2d3ee94904b 100644 --- a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/004-CloudsFlaresDecals.png +++ b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/004-CloudsFlaresDecals.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0c0347e7ecda3fa941b48ccec7c8573123c6afe7bb767dcc32dd5ecf53cb159c -size 2416617 +oid sha256:a25c2f33952fc6608304b46288446b1ee569fe289f1a20d880d9cd14a07fc51e +size 2400244 diff --git a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/004-CloudsFlaresDecals.png b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/004-CloudsFlaresDecals.png index 8fe8b4f59d4..ccf938d824a 100644 --- a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/004-CloudsFlaresDecals.png +++ b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/004-CloudsFlaresDecals.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:459dd1bee7401f535a4ce73ed0f49f62b8a11de6179f9ffc956593310ab7cac5 -size 2405680 +oid sha256:29e60f6bbb299a2ed9ad7741427160e771dbfe82c1b0700b466f8344f3ce8ebf +size 2385551 From 0ad7faaab794aff8fdef81cefdb706d754a4c783 Mon Sep 17 00:00:00 2001 From: Anis Benyoub Date: Thu, 19 Aug 2021 17:47:16 +0200 Subject: [PATCH 4/4] Update playmode screenshots --- .../LinuxEditor/Vulkan/None/5011_VolumetricCloudsShadows.png | 4 ++-- .../Vulkan/None/5011_VolumetricCloudsShadowsBake.png | 4 ++-- .../None/5013_VolumetricCloudsShadowsNoExposureControl.png | 4 ++-- .../Vulkan/None/5015_VolumetricCloudsProbeAndSky.png | 3 +++ .../Vulkan/None/5015_VolumetricClouds_ProbeGradient.png | 3 +++ .../OSXEditor/Metal/None/5011_VolumetricCloudsShadows.png | 4 ++-- .../OSXEditor/Metal/None/5011_VolumetricCloudsShadowsBake.png | 4 ++-- .../None/5013_VolumetricCloudsShadowsNoExposureControl.png | 4 ++-- .../OSXEditor/Metal/None/5015_VolumetricCloudsProbeAndSky.png | 3 +++ .../Metal/None/5015_VolumetricClouds_ProbeGradient.png | 3 +++ .../Direct3D11/None/5011_VolumetricCloudsShadows.png | 4 ++-- .../Direct3D11/None/5011_VolumetricCloudsShadowsBake.png | 4 ++-- .../None/5013_VolumetricCloudsShadowsNoExposureControl.png | 4 ++-- .../Direct3D11/None/5015_VolumetricCloudsProbeAndSky.png | 3 +++ .../Direct3D11/None/5015_VolumetricClouds_ProbeGradient.png | 3 +++ .../Direct3D12/None/5011_VolumetricCloudsShadows.png | 4 ++-- .../Direct3D12/None/5011_VolumetricCloudsShadowsBake.png | 4 ++-- .../None/5013_VolumetricCloudsShadowsNoExposureControl.png | 4 ++-- .../Direct3D12/None/5015_VolumetricCloudsProbeAndSky.png | 3 +++ .../Direct3D12/None/5015_VolumetricClouds_ProbeGradient.png | 3 +++ .../Vulkan/None/5011_VolumetricCloudsShadows.png | 4 ++-- .../Vulkan/None/5011_VolumetricCloudsShadowsBake.png | 4 ++-- .../None/5013_VolumetricCloudsShadowsNoExposureControl.png | 4 ++-- .../Vulkan/None/5015_VolumetricCloudsProbeAndSky.png | 3 +++ .../Vulkan/None/5015_VolumetricClouds_ProbeGradient.png | 3 +++ 25 files changed, 60 insertions(+), 30 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5015_VolumetricCloudsProbeAndSky.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5015_VolumetricClouds_ProbeGradient.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5015_VolumetricCloudsProbeAndSky.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5015_VolumetricClouds_ProbeGradient.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5015_VolumetricCloudsProbeAndSky.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5015_VolumetricClouds_ProbeGradient.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5015_VolumetricCloudsProbeAndSky.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5015_VolumetricClouds_ProbeGradient.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5015_VolumetricCloudsProbeAndSky.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5015_VolumetricClouds_ProbeGradient.png diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5011_VolumetricCloudsShadows.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5011_VolumetricCloudsShadows.png index 790f11c059d..f32cb3a3d91 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5011_VolumetricCloudsShadows.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5011_VolumetricCloudsShadows.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f0e3f5e39ec06a1112c5eba01bfc54952704aae05c1a3356e6f3db67742ab0fa -size 172126 +oid sha256:67840b167f9a74840596f7d0512320213c4230f04d6db075c63b05ce3b472f8e +size 174307 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5011_VolumetricCloudsShadowsBake.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5011_VolumetricCloudsShadowsBake.png index 6826e2b1454..fd804bdbca1 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5011_VolumetricCloudsShadowsBake.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5011_VolumetricCloudsShadowsBake.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0ad50a0486136c32d765d381265ef77538686ffc312f4af86302c1c5a6530afa -size 172249 +oid sha256:2014f975cf29583ea5ba8b2de02bd229bff6b3a237c9f7b54382b04caccc1a56 +size 173606 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5013_VolumetricCloudsShadowsNoExposureControl.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5013_VolumetricCloudsShadowsNoExposureControl.png index eb41cb8dce2..2a708b96dbc 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5013_VolumetricCloudsShadowsNoExposureControl.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5013_VolumetricCloudsShadowsNoExposureControl.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:98353c7793497b16624df8cf38cc453a5d5170b05aa69d08de033483be10b51a -size 157073 +oid sha256:ac7f5ba7588a4c8914fd0f5adf858a32ad547914e266a8d5b622757ab874ad8e +size 162784 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5015_VolumetricCloudsProbeAndSky.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5015_VolumetricCloudsProbeAndSky.png new file mode 100644 index 00000000000..bd9804145bb --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5015_VolumetricCloudsProbeAndSky.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27e53adc1132bfa08902bb5b286c70d9ccfc32a802c98e64a1b1c1d8055052b3 +size 185688 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5015_VolumetricClouds_ProbeGradient.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5015_VolumetricClouds_ProbeGradient.png new file mode 100644 index 00000000000..e21c23bd3ce --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/5015_VolumetricClouds_ProbeGradient.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a22834f9c1b0fbf5221592164af0d4329f973355bb0e73a1ce355ec759a226f +size 178969 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5011_VolumetricCloudsShadows.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5011_VolumetricCloudsShadows.png index beef46ed92c..ff794cf0a2c 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5011_VolumetricCloudsShadows.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5011_VolumetricCloudsShadows.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8f1e5c4cafd3e4552e5d743285e8909cf441cbf5de6807d153bec6b19febba75 -size 185801 +oid sha256:97710fa019810803a76436427c9290cb37b2fc4447659a4a1f5ddb4a441ea7ae +size 188253 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5011_VolumetricCloudsShadowsBake.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5011_VolumetricCloudsShadowsBake.png index 97a35939d30..d8d04b3411a 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5011_VolumetricCloudsShadowsBake.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5011_VolumetricCloudsShadowsBake.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:703377ab6e00fe0b547e4596104b60a871cf2a4dd20f220d054f5eae668187ae -size 187301 +oid sha256:b15c91bdf69338349752a011971ddc458f5bc9d141d49b0c11fc51de594f7e79 +size 188292 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5013_VolumetricCloudsShadowsNoExposureControl.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5013_VolumetricCloudsShadowsNoExposureControl.png index 72d98d66822..9456d7e59e9 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5013_VolumetricCloudsShadowsNoExposureControl.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5013_VolumetricCloudsShadowsNoExposureControl.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8e28eef9d5621a40e8ae8d216caff0179e9ce724588d337eb440e1ed1075dfdb -size 173249 +oid sha256:fb755f519388a305d662fa0c48441f9da97a01280eb0df2924e7e6b2094860bb +size 180374 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5015_VolumetricCloudsProbeAndSky.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5015_VolumetricCloudsProbeAndSky.png new file mode 100644 index 00000000000..d8cc70b5cce --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5015_VolumetricCloudsProbeAndSky.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5496be764c5bb85fb268956e890ee65eb6df521ad0dcd3f2095e596b6b80e057 +size 184265 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5015_VolumetricClouds_ProbeGradient.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5015_VolumetricClouds_ProbeGradient.png new file mode 100644 index 00000000000..25045c16949 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5015_VolumetricClouds_ProbeGradient.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd049b83db48af9af2325fea5b3811ac8644b9e1cc15b055af81a44ca12bb2f1 +size 177294 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5011_VolumetricCloudsShadows.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5011_VolumetricCloudsShadows.png index 77ef5e95fe8..f87654840d8 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5011_VolumetricCloudsShadows.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5011_VolumetricCloudsShadows.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2350fbfbeca8b3a97c3bb41749a4dbc9f441e86e8f92744b01f9b6b206f35ca3 -size 172184 +oid sha256:6b156e972d2c563c7351a5573ac9935a7402670477dae2e35d697eac30295e56 +size 174434 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5011_VolumetricCloudsShadowsBake.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5011_VolumetricCloudsShadowsBake.png index 790173133dc..0c20d10c765 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5011_VolumetricCloudsShadowsBake.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5011_VolumetricCloudsShadowsBake.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c65de66d5cdde5206db0e9f62f34242e9a46cfd08fb878f9468c766496c10bef -size 172702 +oid sha256:0d085c76cb19123dbc4730d1c468491d7b761bdf286db3623f20a9c864fea322 +size 174012 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5013_VolumetricCloudsShadowsNoExposureControl.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5013_VolumetricCloudsShadowsNoExposureControl.png index 7fbba225652..20aa7edace1 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5013_VolumetricCloudsShadowsNoExposureControl.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5013_VolumetricCloudsShadowsNoExposureControl.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:874cf4b35f56af9a87284d79ebbf2d0c6052eacb10d860a2c6513e87e9ae6bf7 -size 157078 +oid sha256:8bfb13696d09c10ca6a54e4269e4db27bf171daa59a3fdb75b164f0e4e93a0b0 +size 162940 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5015_VolumetricCloudsProbeAndSky.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5015_VolumetricCloudsProbeAndSky.png new file mode 100644 index 00000000000..3016b483ab3 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5015_VolumetricCloudsProbeAndSky.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3f7f4d046496a6540e8114145c67384b4b5a7f0d8135ea01e4645b3ea946f48 +size 185794 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5015_VolumetricClouds_ProbeGradient.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5015_VolumetricClouds_ProbeGradient.png new file mode 100644 index 00000000000..a53e0734ccd --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/5015_VolumetricClouds_ProbeGradient.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:223144ba5e5c54233caceef3704fd8ee38f82860282e5e08d9f3d6add6b50800 +size 179075 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5011_VolumetricCloudsShadows.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5011_VolumetricCloudsShadows.png index 1eaca2a31be..b431a57a281 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5011_VolumetricCloudsShadows.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5011_VolumetricCloudsShadows.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:13ededd0eb45b22a3f2f3b4753922b4111380e013593c6aeb9441603c84d35c8 -size 172165 +oid sha256:8217a18cd51954fda19f93515f58ff4f004601631e6cb23b5570544126c9ea0b +size 174452 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5011_VolumetricCloudsShadowsBake.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5011_VolumetricCloudsShadowsBake.png index b96093c8bd6..497149c8443 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5011_VolumetricCloudsShadowsBake.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5011_VolumetricCloudsShadowsBake.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:87b0e98ec565aa15369cdbde9b1cf3bc6bff70ed3780eba0463c7e17690adf16 -size 172302 +oid sha256:175b5114d7ce1d1d0408c48916695acbfd80095d5d9dbdafef910facc3f52012 +size 174092 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5013_VolumetricCloudsShadowsNoExposureControl.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5013_VolumetricCloudsShadowsNoExposureControl.png index 86ac79a955f..23ff271f6c1 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5013_VolumetricCloudsShadowsNoExposureControl.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5013_VolumetricCloudsShadowsNoExposureControl.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:42c36ea69c6e92345e7ba8e0af7fc1522a3fb2eb3b6609ea058f1812b471cf3c -size 157004 +oid sha256:f2be394c8c64f2c78e41497e8a8d0208a5915d4a64c5cb2bb9685196a4969986 +size 162918 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5015_VolumetricCloudsProbeAndSky.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5015_VolumetricCloudsProbeAndSky.png new file mode 100644 index 00000000000..8ca5b9b658b --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5015_VolumetricCloudsProbeAndSky.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:411c487a9f0ff2d8e5f43bf31f7d89938f7aa2c528eb110c35a44ae085ac3c52 +size 185765 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5015_VolumetricClouds_ProbeGradient.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5015_VolumetricClouds_ProbeGradient.png new file mode 100644 index 00000000000..79974eee7a8 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/5015_VolumetricClouds_ProbeGradient.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24b24f234b644725761fcbdc845554cfe6c07ea1dbd38fde3c5a9110d0c66976 +size 179012 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5011_VolumetricCloudsShadows.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5011_VolumetricCloudsShadows.png index c68dfe4818a..c8db8f26a1a 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5011_VolumetricCloudsShadows.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5011_VolumetricCloudsShadows.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4e5cfed21b1ee8e43f79eaa7dcb9866d695b26a37aab28d8bb18e3ec375da818 -size 171943 +oid sha256:0a844362bad30e26fa3a3ad3fca18b8c1024e3df0543d079a603c1ab1b0fe64f +size 174201 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5011_VolumetricCloudsShadowsBake.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5011_VolumetricCloudsShadowsBake.png index 8eff59b309b..2aef85307c7 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5011_VolumetricCloudsShadowsBake.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5011_VolumetricCloudsShadowsBake.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a5ef2494538825d9b6865426b5d11147412ed4b2cca41909e04cf26fa7009337 -size 172454 +oid sha256:bddd7faa041d9e538e2c7e8914f3b9869bf75b6a20ba6ffdc2a4c2290166a1c9 +size 173780 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5013_VolumetricCloudsShadowsNoExposureControl.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5013_VolumetricCloudsShadowsNoExposureControl.png index f9394aca8ba..2a708b96dbc 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5013_VolumetricCloudsShadowsNoExposureControl.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5013_VolumetricCloudsShadowsNoExposureControl.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f2bf8a7024cb6f209392b08ad5fa5df58699d97f36924b4212f330429732db00 -size 156917 +oid sha256:ac7f5ba7588a4c8914fd0f5adf858a32ad547914e266a8d5b622757ab874ad8e +size 162784 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5015_VolumetricCloudsProbeAndSky.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5015_VolumetricCloudsProbeAndSky.png new file mode 100644 index 00000000000..bd9804145bb --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5015_VolumetricCloudsProbeAndSky.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27e53adc1132bfa08902bb5b286c70d9ccfc32a802c98e64a1b1c1d8055052b3 +size 185688 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5015_VolumetricClouds_ProbeGradient.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5015_VolumetricClouds_ProbeGradient.png new file mode 100644 index 00000000000..8d1421d5f64 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/5015_VolumetricClouds_ProbeGradient.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f726ead7ecb755a07ed7e773571ed0a576a42d98357f0fba306bd9a174373241 +size 179115