Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Strange shadow rendering issue when world-space UI element is visible (URP)
#4
Hi there!

You need to enable the depth/opaque texture generation in your pipeline for fluids to be rendered correctly. Right now, they're not transparent because the rendered does not have access to the scene's opaque texture, and won't perform correct depth-testing because they don't have access to the scene's depth texture. See:

https://www.youtube.com/watch?v=k5Uv5ecjVM0
http://obi.virtualmethodstudio.com/tutor...ering.html

Even with these enabled sorting with UI won't work as expected. The reason for this is that in URP the opaque texture is generated during RenderPassEvent.BeforeRenderingTransparents, just as the default UI material (which is transparent) is being rendered. For fluid to have access to the opaque texture at all and blend correctly with the scene, it must be rendered after this event, that is, once world-space UI has been drawn. This is a URP limitation.

Things do not work the same way in the built-in pipeline (UI is rendered after all transparent objects), so there UI will be rendered correctly by default.

If you only need opaque fluids, you can work around this by opening ObiFluidRendererFeature.cs and setting the renderPassEvent in all fluid rendering passes to RenderPassEvent.BeforeRenderingTransparents, instead of RenderPassEvent.BeforeRenderingTransparents+1. This will prevent the fluid renderer from accessing the opaque texture, but will be rendered before the default UI material.

Another workaround would be using a custom shader for the UI, which renders together with opaque objects and uses alpha testing for transparency.

kind regards,
Reply


Messages In This Thread
RE: Strange shadow rendering issue when world-space UI element is visible (URP) - by josemendez - 21-12-2020, 09:35 AM