diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b349f909121..fa4523fb432 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -150,6 +150,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed Render Graph Debug UI not refreshing correctly in the Render Pipeline Debugger. - Fixed SSS materials in planar reflections (case 1319027). - Fixed Decal's pivot edit mode 2D slider gizmo not supporting multi-edition +- Fixed issue were the final image is inverted in the Y axis. Occurred only on final Player (non-dev for any platform) that use Dynamic Resolution Scaling with Contrast Adaptive Sharpening filter. +- Fixed a bug with Reflection Probe baking would result in an incorrect baking reusing other's Reflection Probe baking +- Fixed volumetric fog being visually chopped or missing when using hardware Dynamic Resolution Scaling. +- Fixed generation of the packed depth pyramid when hardware Dynamic Resolution Scaling is enabled. ### Changed - Removed the material pass probe volumes evaluation mode. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLit.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLit.hlsl index 26b525a4e56..36e7afbc2c2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLit.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLit.hlsl @@ -4231,7 +4231,7 @@ IndirectLighting EvaluateBSDF_ScreenSpaceReflection(PositionInputs posInput, } lighting.specularReflected = ssrLighting.rgb * lerp(reflectanceFactorB, reflectanceFactorC, bsdfData.coatMask); - reflectionHierarchyWeight = lerp(ssrLighting.a, ssrLighting.a * reflectanceFactorC, bsdfData.coatMask); + reflectionHierarchyWeight = lerp(ssrLighting.a, ssrLighting.a * reflectanceFactorC.x, bsdfData.coatMask); } else { diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader index ed1ceb01585..ce772432ee5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader @@ -93,7 +93,7 @@ Shader "Hidden/HDRP/FinalPass" #if defined(BILINEAR) || defined(CATMULL_ROM_4) || defined(LANCZOS) CTYPE outColor = UpscaledResult(positionNDC.xy); #elif defined(CONTRASTADAPTIVESHARPEN) - CTYPE outColor = LOAD_TEXTURE2D_X(_InputTexture, round(input.texcoord * _ViewPortSize.xy)).CTYPE_SWIZZLE; + CTYPE outColor = LOAD_TEXTURE2D_X(_InputTexture, ((input.texcoord.xy * _UVTransform.xy) + _UVTransform.zw) * _ViewPortSize.xy).CTYPE_SWIZZLE; #else CTYPE outColor = LOAD_TEXTURE2D_X(_InputTexture, positionSS).CTYPE_SWIZZLE; #endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs index 6c5a837bf78..bc65796eff1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs @@ -608,6 +608,7 @@ internal static void RestoreRenderPipelineAsset(bool wasUnsetFromQuality, Render internal struct PackedMipChainInfo { public Vector2Int textureSize; + public Vector2Int hardwareTextureSize; public int mipLevelCount; public Vector2Int[] mipLevelSizes; public Vector2Int[] mipLevelOffsets; @@ -630,12 +631,15 @@ public void ComputePackedMipChainInfo(Vector2Int viewportSize) if (viewportSize == mipLevelSizes[0]) return; - textureSize = viewportSize; - mipLevelSizes[0] = viewportSize; + bool isHardwareDrsOn = DynamicResolutionHandler.instance.HardwareDynamicResIsEnabled(); + hardwareTextureSize = isHardwareDrsOn ? DynamicResolutionHandler.instance.ApplyScalesOnSize(viewportSize) : viewportSize; + Vector2 textureScale = isHardwareDrsOn ? new Vector2((float)viewportSize.x / (float)hardwareTextureSize.x, (float)viewportSize.y / (float)hardwareTextureSize.y) : new Vector2(1.0f, 1.0f); + + mipLevelSizes[0] = hardwareTextureSize; mipLevelOffsets[0] = Vector2Int.zero; int mipLevel = 0; - Vector2Int mipSize = viewportSize; + Vector2Int mipSize = hardwareTextureSize; do { @@ -665,11 +669,13 @@ public void ComputePackedMipChainInfo(Vector2Int viewportSize) mipLevelOffsets[mipLevel] = mipBegin; - textureSize.x = Math.Max(textureSize.x, mipBegin.x + mipSize.x); - textureSize.y = Math.Max(textureSize.y, mipBegin.y + mipSize.y); + hardwareTextureSize.x = Math.Max(hardwareTextureSize.x, mipBegin.x + mipSize.x); + hardwareTextureSize.y = Math.Max(hardwareTextureSize.y, mipBegin.y + mipSize.y); } while ((mipSize.x > 1) || (mipSize.y > 1)); + textureSize = new Vector2Int((int)((float)hardwareTextureSize.x * textureScale.x), (int)((float)hardwareTextureSize.y * textureScale.y)); + mipLevelCount = mipLevel + 1; m_OffsetBufferWillNeedUpdate = true; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/SceneObjectIDMap.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/SceneObjectIDMap.cs index 57642b82a45..4c15b9241bf 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Utilities/SceneObjectIDMap.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/SceneObjectIDMap.cs @@ -260,6 +260,11 @@ int Insert(GameObject gameObject, TCategory category) m_IndexByGameObject.Add(gameObject, index); m_Entries.Insert(index, entry); + for (int i = index + 1; i < m_Entries.Count; ++i) + { + // Upon insertion, all index by game object entries after the insertion point need their index updated. + m_IndexByGameObject[m_Entries[i].gameObject] = i; + } return m_Entries[index].id; }