diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index f65a221d12d..bdc607c101b 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -731,6 +731,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed path-traced subsurface scattering mixing with diffuse and specular BRDFs (1250601). - Fixed custom pass re-ordering issues. - Improved robustness of normal mapping when scale is 0, and mapping is extreme (normals in or below the tangent plane). +- Fixed rendering breaking when disabling tonemapping in the frame settings. ### Changed - Improve MIP selection for decals on Transparents diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs index 0a9b847a38d..9f2f247d185 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs @@ -617,7 +617,7 @@ void PoolSource(ref RTHandle src, RTHandle dst) { using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.DepthOfField))) { - // If we switch DoF modes and the old one was not using TAA, make sure we invalidate the history + // If we switch DoF modes and the old one was not using TAA, make sure we invalidate the history if (taaEnabled && m_IsDoFHisotoryValid != m_DepthOfField.physicallyBased) { camera.resetPostProcessingHistory = true; @@ -636,7 +636,7 @@ void PoolSource(ref RTHandle src, RTHandle dst) var taaDestination = m_Pool.Get(Vector2.one, m_ColorFormat); bool postDof = true; var taaParams = PrepareTAAParameters(camera, postDof); - + GrabTemporalAntialiasingHistoryTextures(camera, out var prevHistory, out var nextHistory, postDof); DoTemporalAntialiasing(taaParams, cmd, source, taaDestination, motionVecTexture, depthBuffer, depthMipChain, prevHistory, nextHistory, prevMVLen:null, nextMVLen:null); PoolSource(ref source, taaDestination); @@ -651,7 +651,7 @@ void PoolSource(ref RTHandle src, RTHandle dst) { ReleasePostDoFTAAHistoryTextures(camera); } - + // Motion blur after depth of field for aesthetic reasons (better to see motion // blurred bokeh rather than out of focus motion blur) if (m_MotionBlur.IsActive() && m_AnimatedMaterialsEnabled && !camera.resetPostProcessingHistory && m_MotionBlurFS) @@ -667,7 +667,7 @@ void PoolSource(ref RTHandle src, RTHandle dst) out tileToScatterMin); DoMotionBlur(PrepareMotionBlurParameters(camera), cmd, source, destination, motionVecTexture, preppedMotionVec, minMaxTileVel, maxTileNeigbourhood, tileToScatterMax, tileToScatterMin); RecycleMotionBlurRenderTargets(preppedMotionVec, minMaxTileVel, maxTileNeigbourhood, tileToScatterMax, tileToScatterMin); - + PoolSource(ref source, destination); } } @@ -1339,7 +1339,7 @@ static void DoDynamicExposure(in ExposureParameters exposureParameters, CommandB { var cs = exposureParameters.exposureCS; int kernel; - + var sourceTex = colorBuffer; kernel = exposureParameters.exposurePreparationKernel; @@ -1599,7 +1599,7 @@ static void DoTemporalAntialiasing(in TemporalAntiAliasingParameters taaParams, { cmd.SetRandomWriteTarget(2, nextMVLen); } - + cmd.DrawProcedural(Matrix4x4.identity, taaParams.temporalAAMaterial, 0, MeshTopology.Triangles, 3, 1, taaParams.taaPropertyBlock); cmd.DrawProcedural(Matrix4x4.identity, taaParams.temporalAAMaterial, 1, MeshTopology.Triangles, 3, 1, taaParams.taaPropertyBlock); cmd.ClearRandomWriteTargets(); @@ -2274,7 +2274,7 @@ void ReprojectCoCHistory(CommandBuffer cmd, HDCamera camera, bool useMips, ref R GrabCoCHistory(camera, out var prevCoCTex, out var nextCoCTex, useMips); var cocHistoryScale = new Vector2(camera.historyRTHandleProperties.rtHandleScale.z, camera.historyRTHandleProperties.rtHandleScale.w); - //Note: this reprojection creates some ghosting, we should replace it with something based on the new TAA + //Note: this reprojection creates some ghosting, we should replace it with something based on the new TAA ComputeShader cs = m_Resources.shaders.depthOfFieldCoCReprojectCS; int kernel = cs.FindKernel("KMain"); cmd.SetComputeVectorParam(cs, HDShaderIDs._Params, new Vector4(camera.resetPostProcessingHistory ? 0f : 0.91f, cocHistoryScale.x, cocHistoryScale.y, 0f)); @@ -2333,7 +2333,7 @@ void DoPhysicallyBasedDepthOfField(CommandBuffer cmd, HDCamera camera, RTHandle // The sensor scale is used to convert the CoC size from mm to screen pixels float sensorScale; if( camera.camera.gateFit == Camera.GateFitMode.Horizontal ) - sensorScale = (0.5f / camera.camera.sensorSize.x) * camera.camera.pixelWidth; + sensorScale = (0.5f / camera.camera.sensorSize.x) * camera.camera.pixelWidth; else sensorScale = (0.5f / camera.camera.sensorSize.y) * camera.camera.pixelHeight; @@ -3208,7 +3208,7 @@ ColorGradingParameters PrepareColorGradingParameters() // Setup lut builder compute & grab the kernel we need parameters.builderCS.shaderKeywords = null; - if (m_Tonemapping.IsActive()) + if (m_Tonemapping.IsActive() && m_TonemappingFS) { switch (parameters.tonemappingMode) { @@ -3325,7 +3325,7 @@ static void DoColorGrading(in ColorGradingParameters parameters, // Generate the lut // See the note about Metal & Intel in LutBuilder3D.compute - // GetKernelThreadGroupSizes is currently broken on some binary versions. + // GetKernelThreadGroupSizes is currently broken on some binary versions. //builderCS.GetKernelThreadGroupSizes(builderKernel, out uint threadX, out uint threadY, out uint threadZ); uint threadX = 4; uint threadY = 4;