Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Realflow Lava Flow Tutorial

Hi, and welcome to this tutorial guide. My name is Chris and I’ll be showing you how to create a realistic lava
flow. This guide’s main focus is to teach you how to texture realflow meshes and render them in Autodesk
Maya. You will need a copy of both Next Limit Realflow and Autodesk Maya. For this tutorial I’m making a
few basic assumptions. First, I assume you have a basic grasp of Realflow liquid simulation. Second, I assume
that you have a rudimentary understanding of Maya. And last, I assume you also know how to read. But let’s
begin.

We are going to start with a simulation. We are going to simulate lava that flows through a dry riverbed. You
will have to model your own riverbed, if you don’t know how to make a riverbed, basic modeling skills can
be acquired by following modeling tutorials on highend3d.com. At any rate you need to export you geom-
etry from Maya using the Realflow SD plugin.
Ok, open realflow and make a new scene. Import your dry riverbed and delete the camera as you won’t be
needing it. At this point you may notice that your riverbed is huge. Realflow simulates in meters and maya
has exported your scene in centimeters. What this means is Realflow scaled your centimeters to meters! You
need to set your scene scale back down to an appropriate level. Now I say “appropriate” because you don’t
have to be mathematically precise. In my example I want my lava flow to feel bigger. So instead of scaling to
0.01, I’m scaling to 0.333. You can play with the scaling until it’s a size you like.

Once your scene is scaled, you can start adding emitters. We will only need one emitter. Create a square
emitter. Place it at one of the ends to your riverbed and scale it so it will fill the bed with particles. Next we
going to add a few deamons to the scene. First, add a gravity deamon, I don’t think I need to explain why.
Second, add a noise deamon. This deamon will add a little bit of randomness to the sim. Next, add a kill Vol-
ume deamon and scale it to fill the whole scene. This kills particles that might wonder off into infinity.
Run the simulation. You’ll notice that your
emitter spits out particles, but the particles
don’t really flow down the riverbed.

To encourage the particles to flow down the


riverbed, your riverbed has to be on a slope.
There are two ways of accomplishing this. One
is to just rotate your geometry so that it has
a slope to it. The other way is to add another
gravity deamon that points down the riverbed
to “simulate” a slope. Sweet, eh?

So add another gravity deamon and rotate it *Note* It’s importanted to set up the particle interaction
so that it faces down stream. Set its strength to on your geometry. This is how you make your particles
a low value like 1 or 2. react to surfaces in realistic ways. For lava, its a good idea
to increase the friction and roughness of your surfaces.
Before running the simulation you may want It may be a good idea to turn down the bounce as well.
to decrease you emitter resolution to 0.01. When was the last time you saw bouncing lava?
This will make your simulation run faster, but it
will be less accurate. Run the simulation. Your
particles should start flowing down stream.
Now to set up the emitter to behave like lava. If you’ve ever watched a volcano video, and I know you have,
you’ll notice some characteristics about lava that make it different from water. (Realflow’s default settings
simulate water.) Lava is more dense than water and it is much more viscous. Lava can have a variety of looks
and feels, it can move both fast or slow and it can be almost solid or very gooey. It depends on what look
you want to achieve as to what settings to use. For my lava, I’ve set my density to 10,000 and my viscosity to
50. This will produce a heavy, thicker lava.

Run the simulation using different settings until your particles feel “right.” Since we’re simulating in low res it
only takes a few minutes per sim so you can quickly see what’s working and what’s not.

Once your simulation is feeling the way you like it. Crank up the resolution. And run the simulation until your
lava runs off the far end of your riverbed. You may want to grab a cup of coffee or go pick up a girl or get
yourself a nice massage, cus this is going to take awhile.

All right, your lava has made it to the other side. Now,
select you emitter. Under initial state you want to
turn “use initial state” to “yes” and press the “set from
current” button. Press the arrow next to the reset
simulation button and make sure “reset to initial state”
is checked. Now, reset your simulation. This will clear
your simulation cache but now your frame one is in
the same state as the last frame of your simulation.

Now, run the simulation for another 200 frames or as


long as you want your end lava flow to be. Yes, this
means more waiting; so go get another girlfriend, or
learn to play guitar.
Now that your particle simulation is done, open Maya. We’re going to start building a texture. Start by cre-
ating a poly plane that is the same size as your scene. Make sure to keep the scale values even, i.e. keep it
square.

Now open the Hypershade and create a lambert


shader. Create a Solid Fractal. Open the Attribute
Editor for the Solid Fractal and under the Color
Balance tab change the Color Gain to these val-
ues: H 23.95; S 0.891; V 2.5. Now middle mouse
drag the Solid Fractal over the lamber shader and
select “color” from the pop up menu. Rename your
lambert shader to something that is easier to keep
track of like “hot lava”. Open the attribute editor for
your “hot lava” and under Special Effects change
the Glow Intensity to something in the range of
0.2.

Now to explain why you just did all of that. You’ve


just created the base for your hot lava. The solid
fractal is a 3D shader, which means it textures
your geometry in 3 dimensions. So to make it stick
to your geometry, you will need to make it a 2D
texture; and we’ll get to that in a bit. The color gain
changes the overall color of the texture. You can
make it more red or more yellow if you like. The
key part is changing the value attribute higher
than 1. A value of 0 is black and value of 1 is white,
but Maya allows from values greater then 1. This is
referred to as “super white” and it’s a must have to
things that are “hot” like fire or in this case: molten
lava. We then connect texture’s color values to the
color values of the lambert shader and give it a
glow for good measure.

Next we are going to make the cooled lava. Make


another lambert shader. Create a Noise Texture. Open
the Attribute Editor for the Noise Texture and change
its “Noise Type” to “Perlin Noise”. Under Color Balance,
change the Color Gain to a dark grey color or a dark
red. Middle mouse drag the Noise Texture over the
lambert shader and choose “color” from the pop up
menu. Rename your lambert shader to something
easier to remember like “cold lava”.
Now that you’ve made you cooled lava shader, we are going to put them together. Create a Layered Shader.
Open the Attribute Editor for the Layered Shader. Middle mouse drag your hot lava and cold lava into the
Layered Shader Atributes. Delete the ugly green shader by pressing the “x” underneath it. Make sure your
hot lava is the first shader (the one on the far left) in the Layered Shader. Go ahead in rename the Layered
Shader to “Lava” or something like that.

Now create a Stucco Texture. In its Attributes change its channel 1 to white and its channel 2 to black and
the Shaker to 30. Now open the Lava Shader (layered shader) Attributes. Middle mouse drag the stucco tex-
ture into the Transparency for the hot lava. Change the Compositing Flag from Layer Shader to Layer Texture.

What you have just done is create a layered texture. On top is the hot lava and below is the cooled lava. I
know this sounds backwards and in-fact it probably doesn’t matter which way you layer them. The hot lava
has a transparency mask that is driven by the stucco texture. The white areas are opaque, while the black
areas are transparent. I.E. anything that is white will be the hot lava and anything that is black will be the
cooled lava. By modifying the stucco shader in different ways you can achieve different looks to your lava.
Try different settings or even different textures to see what kind of effects you can achieve.

Apply you lava shader to the poly plane. It should look something like this.
Play with the transparency texture until you like it. Make a new lambert shader and middle mouse drag the
stucco texture over it and select “color” from the pop up menu. Apply this shader to the poly plane. Select
both the poly plane and the new lambert shader and in the Hypershade window select Edit>Convert File
to Texture (Maya Software)>q. Under X and Y resolution: change them to the value 1028x1028; and change
your file format to JPEG. Convert and Close. Maya has now made a JPEG image of your transparency texture.
Now it’s time you go back to realflow.

Open you lava flow scene in realflow. Create a plane and size it to you scene just like you did in Maya. In the
Node Params for the Plane go to texture and load the texture you just export from Maya (it should be in your
Maya scene directory). Now create a Texture Gizmo. You can find this under the deamons menu. Translate
and scale your Textrue Gizmo so that it is directly over your lava flow and is covering the whole flow. In the
Texture Gizmo Node Params select “Texture from object” and select your plane. Press Texture now.

Create a Mesh and add your lava emitter to the mesh. Under the Mesh Params open up the texture attri-
butes and Load the texture that you exported from Maya. Set UVW Mapping to UV particle and make sure
Tiling is enabled. Build a mesh at your current frame. You will immediately see your mesh is textured the
same way as your plane (assuming you built your mesh at frame 1). If it’s the way you like it then build the
meshes for the rest of the lavaflow (I suggest using the command line). If it’s not the way you like it; don’t
worry to much; build your mesh and make the adjustments to your texture in Maya. We’re more interested in
the UV particle information at this point.

Now what is going to happen is this: the texture gizmo takes the UV information from the plane and projects
it on the particles at frame 0. The particles then move along they’re routes taking their UV information with
them. The best part is you don’t have to re-sim. This is all post process! The UV information is then passed on
to you mesh. The meshes UVs are animated on the texture making the appearance that the texture is flow-
ing with the lava.
After your mesh is completed, open Maya. You’ll notice that your Solid Fractal and Stucco are both 3D shad-
ers. Like I said this means they texture geometry in 3 dimensions. In laymen’s terms a 3D texture is contained
in a “Cube”. It’s a volume. This “cube” is then repeated infinitely in your scene. It looks great until something
moves. If the geometry that its applied to moves; the texture stays put. So the geometry has the appearance
of “swimming” through the texture. You need to make these textures 2D so they can stick to your geometry.

We’ve already made you transparency texture a 2D texture, so what we need to do now is replace the stucco
texture with its 2D counterpart. Open the lava (layered shader) Attributes and set the file texture as the
transparency of the hotlava (or whichever lava is likes it on top). Now apply your hot lava shader to the poly
plane and select both the plane and the shader. In the Hypershade window select Edit>Convert File to Tex-
ture (Maya Software)>q. Export it with same settings you used last time. Now replace your Solid Fractal with
you new file texture.

My final shader network

Import you realflow mesh. Apply your lava shader to the realflow mesh. Playblast your mesh to make sure
that it’s sticking. If you don’t like how your textures look you can change them here without having to go
back to realflow. You just have to remember that only 2D textures will stick to your lava flow.

*Advanced* If you really want to make your lava flow awesome, make a displacement map out of the trans-
parency texture.

I hope this tutorial was at very least informative. If you want to see my final textured lava flow (and my many
attempts to get here) you can see it on youTube <http://www.youtube.com/watch?v=ZewWypjo0SY>. If you
have any questions you can email me at calibrix@mac.com or message me on the realflow forum.

Good luck!

Chris Wombold (Calibrix)

You might also like