Liquid Animation

Post your own tools and resources, as well as your cars and tracks.
User avatar
javildesign
Posts: 49
From: Holland

Liquid Animation

Unread post by javildesign » Sun May 03, 2020 3:12 pm

Seamless liquid animation

I've been working on liquid animation for a while. Since Route-77 I've been experimenting with it.
I noticed when I rendered out a grid of 16 frames in one texture, that there is always a little seam visible in Revolt.
I wanted that seam gone.

Image
Seam visible in RVGL

Technical details

During development of Route-77 I create a solution to shrink every frame-section (256x256px) 98,5%, duplicate every grid section and copy connect it on the north, west, south and east side of itself. Position it back on it's on place.
Every grid-frame is 252x252px so the overlap of 2px on both sides of the frame causes that the seam to disappears and the animation will be smooth.

Image
Grid setup for every frame (16) Each grid-frame is 252x252px

To create a grid animation in the blender plugin, the UV square on each frame needs to be resized (0.984)
This way there will be a 100% seamless animation in RVGL.

Image
All ugly seams gone

I created an action for Photoshop that automate the whole process.
I also saved out the UV coordinates for the .CSV so no need to adjust the UV's manually.

How to create a liquid texture sequence?

In Blender 2.8 I began experimenting with the Ocean Modifier.
There are some tutorials online to learn how to create a seamless repeating sequence.
But when you have created a great repeating sequence, you need to render out to a 2d texture.
I managed to render it out with an orthographic camera pointing on the 3x3 grid of the Ocean Modifier.
So with the Ocean Modifier set to a spatial size of 50 and the camera set to orthographic scale of 50, I was able
to place the camera anywhere above the ocean and always get a repeating sequence on every side.
Trouble with getting a sequence correct, is to setup 17 frames and finally render out 16 frames.

Image
Camera alignment to render out the sequence

Image
Experimenting with Ocean Modifier in Blender

I thought this all out and it works fantastic now. All I have to do is adjust the Ocean Modifier a bit, change the color and render out millions of different water/liquid sequences.

I also create Photoshop action to get rid of edges using gradient masking. (seen in Route-77)

Here are some in-game examples which all uses some transparency in the final output (70-90%):

Image
Ocean modifier with foam (to make foam repeating is difficult)

Image
Clear blue water

Image
River floating

Image
River with waves

Image
Top view of repeating ocean

I hope to make a complete tutorial for this topic in the future.
For anyone who's interested, just contact me and I will share anything that could help you to create awesome liquids for RVGL!
User avatar
revolting1
Posts: 60

Re: Liquid Animation

Unread post by revolting1 » Wed May 06, 2020 3:02 am

Wow that's awesome
User avatar
607
Posts: 388

Re: Liquid Animation

Unread post by 607 » Wed May 06, 2020 8:35 am

Very cool, congrats on figuring it out! I hope this will keep working in future versions of RVGL...
Post Reply