Following this official example Graphics/com.unity.render-pipelines.universal/Documentation~/renderer-features/how-to-fullscreen-blit-in-xr-spi.md at 5002201f9cac57e2c77ea453090aa695f6a7a5f6 · Unity-Technologies/Graphics · GitHub
result in a UI maskable element no longer working on a world space canvas when the Render Pass event is set to BeforeRenderingTransparents.
This is a link to a full repro project, just extract it and hit play in SampleScene.
https://drive.google.com/file/d/1iP6t2L00xHjV_yVY9a-tgJLogL3jMK2S/view?usp=sharing
It seems like the depth-stencil (?) buffer gets cleared when renderer feature is enabled, probably wiping the stencil data needed for the mask to work. No idea on how to fix this though.
Well I poked and poked but cant get anything concrete. At first I tought that the stencil lives in the alpha of the opaque texture so I cached it and restored the alpha but it still broke. Not setting a render target for the feature works because we are literally drawing a fullscreen mesh so there is no need to write to the buffer. Only explanation is that setting the render target to the color rt nukes the stencil and that the stencil get written to way back in the chain like before rendering opaques.
pretty sure I just saw blank stencil buffer after renderer feature was ran (so it probably gets cleared there).
Hi @YuriyPopov ,
Thanks for reporting! I have looked into the repro case. And that is indeed an issue in the example code
Please add the following to the ColorBlitPass and that should fix it. I will update the sample code to address this issue soon.
public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData)
{
ConfigureTarget(new RenderTargetIdentifier(m_CameraColorTarget, 0, CubemapFace.Unknown, -1));
}
The issue is that the feature switched render target without notifying the URP. So in transparent pass URP assumes depth stencil buffer is still binded however that is no longer the case.
By calling ConfigureTarget, URP knows the feature’s final target and will bind targets for the following passes if needed.
Thank you again to let us know and we appreciate your feedback!
Best,
Thomas
Hey @ThomasZeng thanks for this update! We are having the same issue and the fix you gave didn’t seem to work ![]()
Has the sample code been updated? I don’t see it including this line.
Thanks!