Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obi Fluid renderer and World Space canvas
#1
Hello!

I am using Obi fluid and today noticed that it is rendered over my world space canvas object.
I've checked with renderer enabled and particles don't touch the object. Only obi fluid renderer draws over it.
Build-in pipline, Unity 2022.3.12

White disk in the attachment pic -- on world space canvas

   
Reply
#2
(30-10-2023, 04:58 PM)Apoll0 Wrote: Hello!

I am using Obi fluid and today noticed that it is rendered over my world space canvas object.
I've checked with renderer enabled and particles don't touch the object. Only obi fluid renderer draws over it.
Build-in pipline, Unity 2022.3.12

White disk in the attachment pic -- on world space canvas

Hi,

Transparent objects need to be sorted back-to-front when rendering, since they don't use the depth buffer to discard fragments. Unfortunately, sorting fluid by distance to camera is not possible so it will either render always on top or behind. You might want to use a custom shader on your UI that does alpha clipping instead of blending, or change the fluid's render event. See:
http://obi.virtualmethodstudio.com/forum...ansparency

kind regards,
Reply
#3
(31-10-2023, 09:46 AM)josemendez Wrote: Hi,

Transparent objects need to be sorted back-to-front when rendering, since they don't use the depth buffer to discard fragments. Unfortunately, sorting fluid by distance to camera is not possible so it will either render always on top or behind. You might want to use a custom shader on your UI that does alpha clipping instead of blending, or change the fluid's render event. See:
http://obi.virtualmethodstudio.com/forum...ansparency

kind regards,

It seems that ObiFluidRendererFeature.cs is for URP. I use buildin pipeline. Any workarounds?
I tried custom UI shader with cliping and nothing changed (
Reply
#4
(31-10-2023, 10:55 AM)Apoll0 Wrote: It seems that ObiFluidRendererFeature.cs is for URP. I use buildin pipeline. Any workarounds?
I tried custom UI shader with cliping and nothing changed (

Hi,

The principle is the same regardless of the render pipeline used, since transparent objects are drawn the exact same way in all of them: typically transparent objects need to be sorted back to front for correct rendering, and they won't intersect properly with each other since they don't write to the depth buffer.

I tried an alpha clipping UI shader and it works correctly for me. Since alpha-clipped objects write to the depth buffer you'll also get correct intersections between UI and fluid (this is in the built-in render pipeline):

[Image: 7FsB8sT.png]

Could you elaborate about your setup? Are you using sorting layers for the canvas? Could you share the shader you're using for the UI?

kind regards,
Reply