You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 'draw on top' option works fine EXCEPT when Unity does a 'CopyDepth' pass.
For example with these setting (depth texture enabled and MSAA off)
Then the 'draw on top' option does not work, the outlines will always be on top. This only happens in the game view.
When MSAA is enabled, the issue is not there or when the depth texture is disabled and post processing is also disabled on the camera, it's also fine.
I did some research and found that whether or not the 'draw on top' option works, is related to whether or not Unity does a 'CopyDepth' pass. The pass is here.
which corressponds to the issue not being active when the scene view is active or when unity can't copy depth. So when unity does a deph prepass instead of the copy depth pass, all works fine..
The text was updated successfully, but these errors were encountered:
Snapchip
changed the title
'Draw On Top' doesn't work in URP
'Draw On Top' doesn't work in URP when Unity does a 'CopyDepth' pass
Oct 7, 2020
The 'draw on top' option works fine EXCEPT when Unity does a 'CopyDepth' pass.
For example with these setting (depth texture enabled and MSAA off)
Then the 'draw on top' option does not work, the outlines will always be on top. This only happens in the game view.
When MSAA is enabled, the issue is not there or when the depth texture is disabled and post processing is also disabled on the camera, it's also fine.
I did some research and found that whether or not the 'draw on top' option works, is related to whether or not Unity does a 'CopyDepth' pass. The pass is here.
https://github.com/Unity-Technologies/Graphics/blob/716e8e06a2ba235052572dff41b98074e6065dee/com.unity.render-pipelines.universal/Runtime/Passes/CopyDepthPass.cs
And here in this script
https://github.com/Unity-Technologies/Graphics/blob/716e8e06a2ba235052572dff41b98074e6065dee/com.unity.render-pipelines.universal/Runtime/ForwardRenderer.cs
you see they do some logic like this
bool requiresDepthPrepass = requiresDepthTexture && !CanCopyDepth(ref renderingData.cameraData); requiresDepthPrepass |= isSceneViewCamera; requiresDepthPrepass |= isPreviewCamera; requiresDepthPrepass |= renderPassInputs.requiresDepthPrepass; requiresDepthPrepass |= renderPassInputs.requiresNormalsTexture;
which corressponds to the issue not being active when the scene view is active or when unity can't copy depth. So when unity does a deph prepass instead of the copy depth pass, all works fine..
The text was updated successfully, but these errors were encountered: