20-05-2021, 12:56 PM
(20-05-2021, 07:43 AM)josemendez Wrote: Hi!
Being transparent, fluids are renderer after all opaque objects. Then, the z-buffer is used to discard fragments that lie behind already rendered objects.
Whether an object is considered transparent or opaque, depends on the shader it is using. What material/shader are you using for your text?
Fluids are not an "independent" object so to speak, rendering is a full-screen post process. So they're unaffected by culling masks.
Enter/Leave events can be easily calculated from the raw list of contacts: If a contact appears in the list, but didn't appear last frame, it's an "Enter"event. Similarly, if a contact that appeared last frame does not appear in the current frame, it's an "Exit" event.
If a contact was there in the previous frame and is still there, it's an "Stay" event.
If you don't want to write your own, you can use the ObiContactEventDispatcher component for this: sorts the contact lists, and determines enter/exit/stay events in linear time. These are exposed as UnityEvents that you can subscribe to. You will find it at /Obi/Scripts/Common/Utils/ObiContactEventDispatcher.cs.
I'm using the standard shader that come with textmeshpro, I'm using even the overlay that is suppose to be over everything. Take note that it's working when using textMeshpro in a canvas. It's just working when using TextMeshPro as a 3d object whatever the shader I use.
As for the ObiContactEventDispatcher... I feel like it's going to be heavy on the CPU? I'm going to test it today! Is there an example in the fluid scenes that use it?