Recreating Underwater Sun Rays From Avatar The Way of Water In Houdini

Nabil Jabour, an FX TD at Framestore, discussed how he managed to recreate underwater sun rays from Avatar: The Way of Water using the power of Houdini.

Introduction

Hey everyone! My name is Nabil Jabour and I’m an FX TD at Framestore. I’ve been working in the VFX industry for the last 3 years and I was lucky enough to have found Houdini very early in my learning journey, about 5 years ago. Since then, I can’t think of using anything else, and I always try to find so free time for some personal projects or RnD. This article is one of those research.

Inspiration

On June 12th, 2023, WetaFX released a short breakdown of some of the FXs from Avatar: The Way of Water. As soon as I watched this video, especially their underwater sun rays, it clicked in my brain. I immediately had a rough idea of how I would do it in Houdini. So I gave it a go!

Goals

  1. REALISM. I think I spent more time tweaking the values than building the setup. I really wanted to perfectly match Weta’s result and also some other real-life references I’ve found.

  2. INTERACTIVITY. This is almost mandatory for all my setups. I always try to build tools that are interactive and that give a very fast preview of what the final effect should look like.

Making The Rays

Let’s now start with the breakdown of the effect. This should be suited for many Houdini artists with a beginner to intermediate level. The following breakdown will not cover every node I used for the setup. If you want a closer look at it, head up to the end of this article for a link to my Gumroad.

Ocean Surface

The first step is to build an ocean surface. Nothing too fancy here! We just need to make sure that we have an ocean that is slow enough. I’d suggest checking the Cusp Attribute and the Visualize Cusp checkboxes which will give a nice color visualization along the way.

Ocean surface view from above. with the cusp attribute activated.

Ocean surface from below with the cusp attribute activated.

Now that we have our ocean surface, we can add a noised attribute by using the Attribute Noise Float. In this case, it’s simply called mask. This will be used later to vary the density and will contribute to a lot of realism.

Curves - Copy

We will copy curves onto this surface or on scattered points (if we want more control). Our final copy workflow will look like this. All the tweaks on the right side connected to the ocean_surface will be covered below.

Curves - Direction

Because we haven’t set the normals and the pscale yet, it’ll first look like this.

That’s obviously not correct, but if we press play, we can see how nicely they move following the waves’s direction. We want to keep this, but making them point below the surface, and be much longer. 

Let’s use a pointVelocity node to generate a direction and a noise.  We should start with a negative Y value, and then add a curl noise with a rather small swirl size. We can also blur the velocity right after, but it’s optional.

Of course, we can customize the direction as we wish. For instance, we could grab direction vector from a point_light to our grid’s points.

The velocity attribute should look like this:

And finally, we must convert this velocity into normals. The easiest way is to grab a pointWrangle node and type:

@N = @v;

Curves - Length

For the length, we will use the @pscale attribute. In this case, It’s set up as uniform for every curve, but we can randomize it or use a noise if we want. The value will depend on the scene scale.

Now you almost have the perfect curves! You need those curves to be resampled with a high point count and to add a curveu attribute (through the resample node).

Volume Setup

This setup is using volumes to get the desired look. We will simply rasterize the points generated before and then art-direct the look of it. In my opinion, the control we have over volumes is part of what makes Houdini such a unique software, so we must take advantage of it.

Density Setup

Before building our volume, we should set up the density attribute. Copy these lines of code in a pointWrangle:

f@density = chramp("density",f@curveu);
f@density *= fit01(f@mask,.25,1);

  1. We set the density by ramping the curveu.
  2. We multiplied the density by the mask attribute we made in the beginning. Note that it’s being clamped from 0.25 to 1.

Building the Volume

Let’s drop a Volume Rasterize Attribute node and grab the density attribute. In the filter tab, we can play with the values until we have something that looks close to this:

Smoothing the Volume

As shown in the ref, it looks like the bottom part of the rays seems more blurred. It might actually not be the case in WetaFX’s setup, and they probably just have a thousand times the number of curves than in this setup. But there’s a cheap trick.

So, how do we procedurally smooth only the bottom part? By using the curveu attribute. 

Here’s how the curveu attribute should look on our curves. It goes from 0 to 1, from top to bottom.

Then if we rasterize this attribute (using again the volume rasterize attribute), it should give us this awesome volume mask. We can of course tweak the curveu attribute to have the desired mask.

Now that we have our mask, let’s smooth! We can wire the nodes like this, and tweak the values in the VDB Smooth node. In this case, the Gaussian Blur was the preferred option, with 4 iterations.

Now we have a volume that is softer on the lower part.

Volume Lookdev

Finally, we can drop a Pyro Bake Volume to colorize our rays. In order to have the desired look, we should use the emission volume instead of the classic density. So, let’s uncheck the smoke and activate the fire. Also, we need to make sure that in the binding tab, we put the density for the intensity and color volume.

Back in the fire tab, we can choose our color and intensity. Here are the precise parameters for the final result below, but we can always tweaks that as we wish.

Final Result and Nodegraph

Thank you for reading this breakdown! I hope you got a rough idea of the workflow used to build these cool underwater sun rays.

If you’d like to get your hand on the hip file, it’s available here on Gumroad.

You can also check my latest showreel and follow me on Twitter.

Bonus

After a few explorations, I figured that this setup wasn’t made only for underwater sun rays, but could be used for any type of sun rays.

Godrays - Clouds

Godrays - Trees

Nabil Jabour, FX TD at Framestore

Join discussion

Comments 0

    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