How to create a generic "liquid fill" shader that adapts to object scale (using Remap in Shader Graph)?

Hi everyone,

I’m working on a shader in Shader Graph to simulate a liquid filling effect (for things like a glass, a coffee pot, etc.). The idea is to have a generic solution where the liquid level correctly adjusts based on the object’s scale.

Currently, I’m using the Remap node to transform a float value (0–1) into world/object space positions for the fill effect. My problem is making sure the In Min/Max values match the actual object bounds so that the liquid always fills correctly, no matter the mesh’s size or scale.

Questions:

What’s the best way to feed the correct object bounds into the shader so the remap works properly?

Is there a standard approach in Shader Graph (or via script) to make this kind of shader truly scale-independent?

Has anyone implemented something similar for glasses, bottles, or containers?

My goal is to avoid hardcoding values per object and instead make a reusable shader that just works on any scaled mesh.

Thanks a lot for any advice or examples!

Here’s the actual Shader Graph (Unity 6.2.4):

Hi! Hopefully you’ve already found a solution by now, but Unity actually has an online tutorial that I think solves your issue (specifically Step 14 - Fix issue with Fill Volume): Create a simple liquid shader - Unity Learn