Skip to content

Commit c397b69

Browse files
patrickp-unity3dEvergreen
authored andcommitted
UUM-61466 Set depth format for cameras with motion vectors
JIRA: UUM-61466 When motion vectors are required and a depth-less offscreen texture is used as the camera target, a default depth format should be provided to motion vectors.
1 parent 9ff2bb4 commit c397b69

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,6 +1747,10 @@ void CreateCameraRenderTarget(ScriptableRenderContext context, ref RenderTexture
17471747
depthDescriptor.depthStencilFormat = k_DepthStencilFormat;
17481748
RenderingUtils.ReAllocateIfNeeded(ref m_CameraDepthAttachment, depthDescriptor, FilterMode.Point, TextureWrapMode.Clamp, name: "_CameraDepthAttachment");
17491749
cmd.SetGlobalTexture(m_CameraDepthAttachment.name, m_CameraDepthAttachment.nameID);
1750+
1751+
// update the descriptor to match the depth attachment
1752+
descriptor.depthStencilFormat = depthDescriptor.depthStencilFormat;
1753+
descriptor.depthBufferBits = depthDescriptor.depthBufferBits;
17501754
}
17511755
}
17521756

0 commit comments

Comments
 (0)