Skip to content

Commit c60a49c

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [6000.4] Graphics/HDRP - [UUM-130925] - Fix null limit.xy values in _ColorPyramidUvScaleAndLimitCurrentFrame after color pyramid for distortion
1 parent 5c632f3 commit c60a49c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,11 @@ void RecordRenderGraph(RenderRequest renderRequest,
313313
GenerateColorPyramid(m_RenderGraph, hdCamera, colorBuffer, distortionColorPyramid, FullScreenDebugMode.PreRefractionColorPyramid, distortionRendererList);
314314
currentColorPyramid = distortionColorPyramid;
315315

316-
317-
// The color pyramid for distortion is not an history, so it need to be sampled appropriate RT handle scale. Thus we need to update it
318-
var newScale = new Vector4(RTHandles.rtHandleProperties.rtHandleScale.x, RTHandles.rtHandleProperties.rtHandleScale.y, 0, 0);
319-
m_ShaderVariablesGlobalCB._ColorPyramidUvScaleAndLimitCurrentFrame = newScale;
316+
// The color pyramid for distortion is not an history buffer, so it needs to be sampled using an appropriate RT handle scale. Thus we need to update the scale and the limit.
317+
// It's relatively straightforward to update the scale because we store it in rtHandleScale but we miss the limit values. For now, we approximate them by setting them to the scale value.
318+
// This is imperfect but resetting limit at (0, 0) gives worse results (UUM-130925).
319+
var newScaleLimits = new Vector4(RTHandles.rtHandleProperties.rtHandleScale.x, RTHandles.rtHandleProperties.rtHandleScale.y, RTHandles.rtHandleProperties.rtHandleScale.x, RTHandles.rtHandleProperties.rtHandleScale.y);
320+
m_ShaderVariablesGlobalCB._ColorPyramidUvScaleAndLimitCurrentFrame = newScaleLimits;
320321
PushGlobalCameraParams(m_RenderGraph, hdCamera);
321322
}
322323

0 commit comments

Comments
 (0)