Ryan Brucks Profile picture
Technical Art Fellow, Epic Games

Jun 5, 2020, 9 tweets

This thread has a breakdown of a simplified version of the fake fluid effect. Here it is just drawing a fluid profile (need to add a bumpboffset to actually draw the fluid surface cheaply next).

This is here only adding rotational forces. It's not super robust, just a quick way to get started. BP Image 1/2

This is the 2/2 shot of the BP update. The strength value are just faded down. Overall wave strength fades to 0, directional (x,y mask) fades to 0.5 so if no dominant activity, waves are equal

This is the material render target part. This could also just be passed straight to the object shader, but I was writing it to an RT for the step where I made it into a volume texture (simple version does not use). Notice it only computes 3 sine waves, but each wave has X and Y

Ok forgot one BP part (3/3), this function draws the RT of the waves each frame, nothing special, just sets the above params to an MID and draws. Next render mat:

And finally, here is the material on the bottle to display the waves. You could also move the wave function here instead, but having the texture like this will make doing more advanced rendering much easier:

So for a hint on how the additional bubbles were done: A second 'Strength' param was tracked, and its FInterpTo node had a lower Interp Speed. But instead of adding waves, 2nd 'Strength' acted as Bias for bubble height, with a bit of noise texture to break it up.

I really should have normalized the direction vector before the dot product up top. The way this example makes a hard edge it doesnt matter, but failing to normalize would mess up gradient with. oops.

Should have mentioned this too, but adding movement forces is really easy. Basically you just also do "Actor Location" - "Previous Actor Location", multiply that by some small scale value, then also add this to the vector right before the "Vector Length" and "Abs" part.

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling