logo80lv
Articlesclick_arrow
Research
Talentsclick_arrow
Events
Workshops
Aboutclick_arrow
profile_loginLogIn

Creating a River Simulation in Houdini & Unreal Engine 5

Victor Reguera shared the breakdown of the project titled A River in Utah, explained how the initial environment was assembled, and detailed how he set up the stream and added foam.

Introduction

Hi you all! I’m Victor Reguera, a Junior VFX Artist from Spain. I recently graduated in VFX at Lightbox Academy, Madrid. At this time, I’m starting my career in the VFX industry, so it’s an absolute pleasure to be here talking about my last personal project, the first of this year.

As I'm a photography enthusiast, 3D has always represented unlimited possibilities for me, and with the advancing technologies, this sense of limitlessness is starting to feel real – or perhaps, I should say "unreal."  I try to keep this feeling at the forefront of my projects, especially personal ones. This is what I aimed to achieve when I decided to create a river simulation in Houdini for my demo reel and render it in Unreal Engine 5.

A River in Utah

The project was born when I decided to include a river simulation in my demo reel. Although at first it was only meant to be that, I quickly started to think about the possibility of improving the final quality by creating a natural-themed environment. I started exploring possibilities, and after watching some videos of the Colorado River on Youtube, I knew that the theme was perfect.

Blocking

The first thing I usually do is define a roadmap, and then make corrections as needed while staying true to the original idea. This is the best way to avoid wasting time and energy.

I wanted the viewer to feel like a photographer who travels to the Colorado River for the first time to take THAT photograph, even if it means getting their feet wet. It's like a postcard. Thanks to UE5, I could easily render different camera angles, and I had a lot of fun playing in real-time inside UE5 and taking other shots.

Environment Layout

I decided to create the environment using Houdini. It allowed me to work efficiently and dynamically, and I could easily use Quixel assets with the Megascans Houdini plugin. This was very useful as it allowed for a fluid trial-and-error process.

I experimented with various assets, transforming, bending, and blending them together to achieve the final result. I used several different assets to accomplish this.

River Flip Simulation

I attempted to create a natural collision and proper initial velocity for my project to simulate realistic water behavior. I set up the river using Quixel assets to introduce natural variety and imperfections. After that, I started the simulations. Before talking about the simulation itself, I have to give credit to Steven Knipping. I used the workflow I learned back in time when I studied Liquids with Steven's Applied Houdini: Liquids II tutorial, which was a great help for me.

Firstly, I created a low-quality simulation consisting of 240 frames and used it as the initial state for the high-quality flip sim. For the preroll, I used custom settings for particle separation (0.02) and voxel size (0.04). Due to limited RAM using Houdini, the highest quality sim I could achieve had particle separation of 0.01 and voxel size of 0.02. Ideally, I would have preferred particle separation of 0.05 and voxel size of 0.01, but I am still satisfied with the results.

To determine the direction for the initial state points, I used the curve that defined the riverbed in the blocking part and transferred an attribute from the curve to get the necessary data. After clamping and removing some values to obtain the appropriate velocity, Houdini performed the simulation flawlessly.

Once I had completed the final simulation, I was ready to export the project to Unreal Engine. Some of you may wonder why I am not discussing whitewater, but although I simulated it, I ultimately did not use it.

Exporting the Project to Unreal Engine 5

When I initially planned the project, it was not intended to be rendered with UE5. However, my curiosity led me to try to combine Houdini with Unreal Engine, and I did so as soon as I could.

I decided to export the environment as a glTF scene. The glTF Importer plugin worked perfectly. It was quite satisfying to have all the materials automatically assigned.

The river mesh was exported from Houdini as an alembic cache after I reduced the polygon count by eliminating unneeded attributes to lighten the size.  I could also reduce the polygon number, but since it worked well before that, I did not make further reductions. I found this solution from Dylan Browne – he has a video explaining this idea.

Here is an early version of the environment and the alembic cache river once imported in Unreal Engine:

Creating Foam in Unreal Engine 5

As mentioned earlier, I did not use the whitewater simulation from Houdini. Although Houdini's whitewater quality is excellent and superior to what I achieved, I think my approach is still acceptable and cost-effective.

What I did in Houdini was to utilize the vorticity attribute from the flip simulation as a mask. Vorticity is one of the sources for a whitewater simulation, and it is also the most common source in rivers like this. I realized that by transferring the vorticity to the color attribute in Houdini and then clamping the value, I could generate a color mask to use later on when creating the water material in Unreal Engine. This is precisely what I did. I created a material in which the animated foam appeared (or did not appear) based on the vertex color of the mesh.

Shading

For the river mesh, I created a Single Layer Water Material. This may seem confusing, but the truth is that this worked better than any other approach, so I decided to use it.

The foam shader that I used is based on a video by Ben Cloward, whose channel is akin to The Alexandria Library of shading. You should check it out. Note the Vertex Color node is utilized as an alpha – the foam is emerging thanks to that.

As for the wetness maps, I was unsure how to import Houdini's dynamic wet map into Unreal Engine. If anyone knows how to do it, please inform me – I would be delighted to learn. Instead, I created a decal actor with appropriate specular and roughness and applied it to the riverbed.

Niagara FX and General Atmosphere

For lightning and atmosphere, I kept it simple. I just used the Sun light and tweaked these actors: Sky Light, Sky Atmosphere, and Exponential Height Fog. I also used a Volumetric Cloud actor with a custom Cloud Mask for achieving the result that I wanted for the sky. Remember to activate the Volumetrics plugin if you want to do the same.

Once the atmosphere was finished, I decided to add some real-time FX with Niagara. Simple particle dust and low fog for finishing the environment.

I also added a lens flare and some grain with Nuke, but nothing special.

Conclusion

I hope you enjoyed this breakdown as much as I enjoyed the process behind this work. For me, these were great weeks trying to achieve the result that I wanted for my demo reel. I was also stuck more than once, but it always happens. In the end, it is the result and the experience that lasts.

Victor Reguera, VFX Artist

Interview conducted by Ana Kessler

Join discussion

Comments 2

  • Reguera Victor

    It has been a pleasure to share the breakdown and some thoughts with you guys!

    2

    Reguera Victor

    ·a year ago·
  • Webb Matt

    Very interesting read. Thank you Victor.

    1

    Webb Matt

    ·a year ago·

You might also like

We need your consent

We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more