Horizon Zero Dawn liquid vfx

Hi there!

Any ideas how to make liquid vfx like in the Horizon Zero Dawn - tank with green liquid on the robot spine:

6 Likes

This way (read last post):

2 Likes

or this?

2 Likes

That’s the same way though, isn’t it?

Yeah, I just really like the fancy way in which it is explained :smiley:

1 Like

Don’t think it’s done like that, but I did something about a related issue some time ago:

https://simonschreibt.de/gat/left-4-dead-2-puke/

1 Like

The scaling trick only works on objects that have similar sizes over the region they can move in, but since it’s capped you can have correct lighting work on it.

The world clipping trick works on every shape (although sometimes it might give the trick away). You have to show back faces though, otherwise you kinda look through the liquid.

Another option can be to use the vertex shader. I can’t explain exactly how it was made, but in Invisible Hours our Tech Artist kept the surface of a liquid always perfectly straight in a glass of whisky. Of course, this breaks as soon as the angle is too big (and the whisky would drip out of the water) but held up well for 90% of the cases. I’m sure with more time this system could be extended to react to motion as well.

Maybe we can squeeze more information out of the star citizen guys here because they have awesome stuff: https://twitter.com/simonschreibt/status/885930556097273857

3 Likes

Hmm, My guess is something like this: Vertex colour on the vertices to select them, then average out the values in (world-z - object position) to find an ideal plane, intersect world-z plane with lines the lines from each point in local z. Then lerp each vertex to that position. That might be quite expensive though.
And it would work only on extrusions, no complex objects, To fix that, you would have to supply curves for every point through which they can “flow” To find that world-z plane.

He’s doing a very nice wavy thingy on it, it’s a shame it doesn’t really show up in the shaded version.

1 Like

Pff that liquid in Horizon Dawn looks just too good!

In Unity using the Amplify Shader editor there is also a preset in the examples with this effect:
ezgif-5-0f3d06e49d

11 Likes

YES! I saw this too. He did lava. There was a point at which he hurt my brain because i thought he figured out a way to “cap” the ends, but when i looked closely his shader just pressed everything down to an altitude. So it wouldn’t work for less than a “half full” object.

1 Like

You can make it work for less than half-full and weird shapes if you also add a “pinch” that pushes the verts in on itself to prevent it sticking through the container mesh.
Edit: Hey I got permission to show an old clip of an effect like this I made for a client. It was a feature demo so it’s a bit strange perhaps. Imagine that the ripples would eventually be controlled by the speed of the gun movement and you get the picture.

2 Likes

Did you take that clip down? On Vimeo it says the page can not be found.

2 Likes

Ah! Bad privacy settings on my part. This one should work:

13 Likes

Thanks or the help, guys! Will try to produce my own version

Could you get the same results for this with a container within a container, something like this?

Not easily without intersection.

Could you explain in more detail how exactly you push the vertices in? How do you know how far to push them in to compensate for complex outer glass geometry?

1 Like

How do you handle “weird shapes?”
I get the pinching for primitives, but I don’t know how you would contrive topologically strange objects…Like a bowl with two basins, or a torus that is bent exactly 180 degrees into U shapes.

There are edgecases of course, but a good starting point is to push the verts being pinched in the bitangent direction. The good old normalized double cross.

It won’t work on really thin or complex shapes, but the ones you described should be fine. To a point of course. Eventually the level gets low enough for it to fall apart anyway.