Skip to content

Commit 8911a42

Browse files
alelievrEvergreen
authored andcommitted
Fixed _ScreenParams after upscaling and update screen node doc
As in title
1 parent 6bd5c88 commit 8911a42

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2329,7 +2329,9 @@ void ResetCameraDataAfterPostProcess(RenderGraph renderGraph, HDCamera hdCamera,
23292329
builder.SetRenderFunc(
23302330
(ResetCameraSizeForAfterPostProcessPassData data, RenderGraphContext ctx) =>
23312331
{
2332-
data.shaderVariablesGlobal._ScreenSize = new Vector4(data.hdCamera.finalViewport.width, data.hdCamera.finalViewport.height, 1.0f / data.hdCamera.finalViewport.width, 1.0f / data.hdCamera.finalViewport.height);
2332+
var screenSize = new Vector4(data.hdCamera.finalViewport.width, data.hdCamera.finalViewport.height, 1.0f / data.hdCamera.finalViewport.width, 1.0f / data.hdCamera.finalViewport.height);
2333+
data.shaderVariablesGlobal._ScreenSize = screenSize;
2334+
data.shaderVariablesGlobal._ScreenParams = new Vector4(screenSize.x, screenSize.y, 1 + screenSize.z, 1 + screenSize.w);
23332335
data.shaderVariablesGlobal._RTHandleScale = RTHandles.rtHandleProperties.rtHandleScale;
23342336
data.hdCamera.UpdateGlobalMipBiasCB(ref data.shaderVariablesGlobal, 0);
23352337
ConstantBuffer.PushGlobal(ctx.cmd, data.shaderVariablesGlobal, HDShaderIDs._ShaderVariablesGlobal);

Packages/com.unity.shadergraph/Documentation~/Screen-Node.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Provides access to parameters of the screen.
77
#### Unity Render Pipelines Support
88
- Universal Render Pipeline
99

10-
The High Definition Render Pipeline does **not** support this Node.
10+
Note: when dynamic resolution is enabled, this node will return the current viewport of the rendering camera. After the upscaling pass, the output of this node will be equal to the screen size.
1111

1212
## Ports
1313

0 commit comments

Comments
 (0)