From 0cb3e87f2399f74fb211dafc97d69e75664720f1 Mon Sep 17 00:00:00 2001 From: Kleber Garcia Date: Tue, 27 Apr 2021 15:45:24 -0400 Subject: [PATCH 1/2] Fixing bad pyramid color source texture size. DRS hanlder must be queried since the mip levels depend on the source hardware resolution --- .../Runtime/RenderPipeline/RenderPass/MipGenerator.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MipGenerator.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MipGenerator.cs index 4c38acc9baa..37b1e975ffd 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MipGenerator.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MipGenerator.cs @@ -165,8 +165,13 @@ public int RenderColorGaussianPyramid(CommandBuffer cmd, Vector2Int size, Textur cmd.ClearRenderTarget(false, true, Color.black); } - float sourceScaleX = (float)size.x / source.width; - float sourceScaleY = (float)size.y / source.height; + bool isHardwareDrsOn = DynamicResolutionHandler.instance.HardwareDynamicResIsEnabled(); + var hardwareTextureSize = new Vector2Int(source.width, source.height); + if (isHardwareDrsOn) + hardwareTextureSize = DynamicResolutionHandler.instance.ApplyScalesOnSize(hardwareTextureSize); + + float sourceScaleX = (float)size.x / (float)hardwareTextureSize.x; + float sourceScaleY = (float)size.y / (float)hardwareTextureSize.y; // Copies src mip0 to dst mip0 m_PropertyBlock.SetTexture(HDShaderIDs._BlitTexture, source); From c0c743da51612286280bd7e0abd367d7a713352f Mon Sep 17 00:00:00 2001 From: Kleber Garcia Date: Tue, 27 Apr 2021 15:47:56 -0400 Subject: [PATCH 2/2] Changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b807e81c3aa..34f9756b912 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -166,6 +166,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed issue with RAS build fail when LOD was missing a renderer - Fixed an issue where sometime a docked lookdev could be rendered at zero size and break. - Fixed an issue where runtime debug window UI would leak game objects. +- Fixed pyramid color being incorrect when hardware dynamic resolution is enabled. ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard