How can I make a shader to fill a bottle?

I want to make the famous shader that fills containers. I am only interested in the top part, to make the effect of filling a pot. All the tutorials I found include wave animations and I couldn’t make something without them. I only want the fill effect, no bubbles, no waves, no reaction to physics. just fill, bottom to top. How should I go about it?

You can make a mesh that fills the container, and change it’s look with WPO.

Can you please provide an example? I have never done this before, I am not familiar with the required nodes.

What shape is the container?

In fact, if it’s basically a cylinder, you could just scale the Z.

No, it is a witch’s pot, starts narrow, gets wider, then narrow again. I would like it to follow the shape of the mesh, if I needed to fill a cylinder I would just animate a round plane going up. I hope it doesn’t get too complicated.

So you only see the “liquid” from the top, right?

Make a planar circle mesh, create a curve that will follow the cauldron shape, and change the circle scale when you lift it from the bottom of the cauldron. You’ll probably have a timeline for lifting anyway, so you can use two curves instead of one.

Yes, however this is not something I can use with different meshes, I will have to make a new curve and timeline every time, that’s why I want to make it into a material.

How many different meshes are we talking about?

I guess you can make duplicate shape of liquid for every mesh you’ll have, create a volumetric material and change its visibility based on the desired liquid height, but such a method has more drawbacks than advantages: 1. You’ll spend time creating a volumetric material that doesn’t suck; 2. Volumetric materials are quite expensive and since you don’t need the volume anyway it seems like an overkill; 3. You still need to create additional meshed for each vessel shape.

So if it’s ten or so meshes, I’d personally go with curves. If we’re talking hundreds, it’s different. But it’s up to you.

I want it to be a single material because I want to be able to control it from Blueprints. The fill percentage, opacity, color, everything. The liquid mesh is already in a Blueprint that is a child BP of a basic parent BP and so on. I don’t want to mix in child Blueprints and all that.

I have to also be able to store its current state because the pot will be off the game often since it’s in a sub-level so everything is cooked inside game instance and the pot pulls the info everytime the sub-level loads.

I already have a complex system so simplicity is the way to go. Unless it can’t be done with just one material but I think it can. I was using Liquid X asset so far but I can’t make it simpler, I always get stuck. It has liquid and foam, two colors, lots of things that I don’t need because they can’t be seen from the top anyway.