Slick3d.art - CGI Tutorials

Share this post

Lightwave 3D - Realflow workflow

slick3d.substack.com

Lightwave 3D - Realflow workflow

This is a tutorial about how to export Realflow simulations and import them in Lightwave 3D version 2019 and above.

Luiz Carlos Lobato
Sep 8, 2021
Share

The Last Realflow connection plugin for Lightwave was for the 2018 release. That made to import Realflow simulations a nightmare in Lightwave. A lot of artists use an OBJ sequence as a solution, but because Lightwave’s way of work, shading an OBJ sequence might be problematic.

Alembic is also problematic. Lightwave requires a mdd cache for mesh deformation, and Realflow doesn’t provide it.

Work with the native Realflow format is impossible without the connection plugin.

All this have changed with the introduction of the OpenVDB Toolkit in Lightwave.

Using Lightwave’s OpenVDB toolkit, the artist can replicate Realflow’s VDB Mesher operation in Lightwave, and do the shading without the necessity of plugins or scripts. Actually, with the OpenVDB toolkit, the Realflow worklow to Lightwave has become completely fast and straight.

Let’s see how this work.


In Realflow.

I’m going to use the Basic Ocean Surface project. You can define the project name and project folder of your choice. Here, I named this project as tutorial_01, since this tutorial is the first one of a series dedicated to Realflow-Lightwave 3D workflow.

The ocean created is very small, only 5 by 5 meters. I’ll resize it to 30 by 30 meters and increase the polygon size to 0.1.

The main settings we see by selecting the Realwave01 node.
The main settings we see by selecting the Realwave01 node.
How small is the Polygon size value, how high the mesh resolution will be. I decreased the resolution because I made the ocean mesh bigger.
How small is the Polygon size value, how high the mesh resolution will be. I decreased the resolution because I made the ocean mesh bigger.

Another aspect is the geometry scale multiplier (that will be covered in a lot more detail in the next tutorial). I resized the mesh by a factor of 6. The mesh is bigger, therefore I’ll need much more high values to displace the mesh. To avoid to have to enter with crazy numbers, I decreased the geometry scale mulltiplier to 0.16 (division by 6), to compensate.

The Scale Options icon.
The Scale Options icon.

Hit the Simulate button and we’ve got not so much.

The default values have almost no effect because I made the ocean mesh bigger.
The default values have almost no effect because I made the ocean mesh bigger.

The displacement values must be tweaked. I only did modifications in the OceanStatisticalSpectrum01 subnode. For this tutorial, I altered the Time factor that is a kind of velocity multiplier for the whole scene. I also altered the Vertical scale, which is a very sensitive option (must be modified in very small increments or decrements); the Wind speed and the Choppiness, which is the waves sharpness factor.

In the video above, our Realflow simulation.

We need no more for this tutorial. Neither use a mesh node. We go directly to export our ocean. For this, we must use the Export Central.

Now, here’s the thing: we must export a surface deformation alembic cache. No other cache format will be useful. We find this option in the Realwave rollout. After checked it, we hit Done.

From the cache options list, Lightwave can only read the Alembic surface deformation cache without any problems.
From the cache options list, Lightwave can only read the Alembic surface deformation cache without any problems.

Realflow will save an alembic file for each frame in the meshes folder of the project structure.

We can make this a lot better. How about to have all animation in one single alembic file? Realflow provides a tool to do exactly this: Stitch alembic files.

In the Sticher Tool window, click on Add files and select all alembic files.

Then, choose an output file name and click on Stitch to begin the process.

The output file
The output file
The stitching process
The stitching process

Now we have only one single file cache to be loaded in Lightwave. Note that the single alembic file is much more small than the size of the split files together.

In this example, water.abc has 479MB, while the meshes folder has 1.08GB.
In this example, water.abc has 479MB, while the meshes folder has 1.08GB.

In Lightwave

It’s time to import the alembic cache into Lightwave. It’s important not forget to change the scale to meters.

Scale to meters to match the Realflow setup.
Scale to meters to match the Realflow setup.

But… Oops!

Something is very wrong…
Something is very wrong…
The problem is that Lightwave imported the alembic cache with flipped normals.
The problem is that Lightwave imported the alembic cache with flipped normals.

We can make the mesh double sided though…

We can see that the animation is ok.

Actually, the flipped normals aren’t a problem. We won’t use this mesh directly. I’ll disable it for rendering and hide it from view.

I’ll create a Null and called it ocean.

Next, we add an OpenVDB Evaluator and…

Yes! here is the trick. Here is the new world open to Lightwave 3D with the introduction of OpenVDB in Lightwave 2019. The alembic cache will drive the OpenVDB SDF (Level Set) deformation. Actually, this is the same process that the mesher node do in Realflow, but we are now able to do this directly inside Lightwave. Therefore, importing a surface deformation alembic cache and using the OpenVDB Toolkit as a mesher, we have a straight workflow between Lightwave and Realflow. No need of the Realflow connection plugin anymore. No need of OBJ sequence. Easy to do the shading now. Realflow back to Lightwave wokflow thanks to OpenVDB.

There’s no greater difference between Realflow mesher and Lightwave’s OpenVDB toolkit.
There’s no greater difference between Realflow mesher and Lightwave’s OpenVDB toolkit. Actually, now Lightwave artists have more options.

Continuing, Mesh to Volume node to create the Level Set. We have to be careful with the Voxel Size. Bigger geometry requires greater voxel size: a small voxel size will create millions of voxels that can overload the memory and crash the computer. All depends of the scene and computer hardware power. Here a set up a voxel size of 0.5 (later, I changed to 0.4). Probably, you’ll see nothing. This could be a problem related to the voxel size, but in our case, it’s suffice to use a filter node set up to Dilate. Again, the voxel offset is a scene dependent parameter. Here, a voxel offset value of 1.0 worked for me.

The creation of the Level set is the same process that the mesher node do in Realflow.
The creation of the Level set is the same process that the mesher node do in Realflow.
Probably, we’ll always use Dilate in this workflow.
Probably, we’ll always use Dilate in this workflow.
If the mesh looks coarse, we can smooth it using a gaussian filter, for example.
If the mesh looks coarse, we can smooth it using a gaussian filter, for example.
Here, I did the shading with a Dielectric node.
Here, I did the shading with a Dielectric node.
And we have our Ocean.
And we have our Ocean.

Above: Lightwave’s animation preview.

Below: a test render.


In a near future I’ll publish a tutorial on how to set up foam and export textures from Realflow. Let me know what kind of tutorial you are expecting. Any requests, leave it in the comments. Your feedback is fundamental. That’s all, folks.

Slick3d.art, a space of artistic celebration and artistic knowledge sharing: Only our best!

Share
Comments
Top
New

No posts

Ready for more?

© 2023 Luiz Carlos Lobato
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing