Hi everyone, this is Igor from hdhead.com. In this have a DS tutorial, we're going to
learn how to make a waving flag. This tutorial goes out to DS artist Sean Stahl who convinced
me using very colorful language in a thread at the DS Google list that the particular
tool that we need for this job is actually still in DS version 10, which for some reason
I thought was removed, but he was right, I was wrong, but let's look at the waving flag.
Here's an example of what you can do in the DS creating a waving flag. This kind of a
look was popular for a while for lower thirds in sporting events. Now, I don't really watch
too much sports other than World Cup skiing and they haven't been using this for a while,
so I'm not sure if this is still hot or not. It is a little dated, but let's look at what
forces are at play. A blowing flag is affixed at least two corners like this, so those are
fixed points that don't move and across the flag, one of the forces is wind that makes
the flag flap and it's fairly random and of course the flag will always position itself
so it's moving downstream from the wind. This particular force is possible to simulate in
DS. The other force is the force of gravity which pulls the flag down and that's something
that we can't really simulate in DS, so the type of flag we can create is not terribly
realistic, but it could be useful for some applications, as I mentioned, lower thirds,
things of that nature. The tools that we need for this exercise are Fractal Noise Generator
and 3DDVE. At this point, if you're not familiar with Fractal Noise Generator, it would be
worthwhile to check out a tutorial I did a little while ago called Fog and Smoke, where
we use Fractal Noise Generator to create fog and smoke effects in DS and another useful
tutorial would be the one on creating composite containers. Everything we do in here will
do it within a tree context, so you need to know how to work in this particular mode
of DS, although what we're set to achieve is very simple. So let's look at each one
of our pieces in here. To do that, we'll select the node and click letter V on the keyboard.
This is just a flag and it could be any picture, it could be moving video. This here is a rendered
cache of the Fractal Noise, which creates the motion of the flag and this node here
combines these two things into a waving flag. 3DDVE does most of the heavy lifting, so we'll
look at that first. We'll take it from up there, bring it down here, connect the output
of the node to the output of the tree. So far, everything's good. We're seeing black
because nothing's going into the 3DDVE. We'll take our flag and feed it into input one,
so here this flag is coming through unaltered. We'll double click 3DDVE to enter the effect
and we're going to set up a couple of things in here. First of all, this is a three dimensional
environment where we can rotate our virtual camera and we can set the surface properties
which is important for a waving flag because without highlights and shading you wouldn't
really see much of the folds. To do that, we'll select the object which is now movable
and click on the first button which will bring up the surface properties for this particular
input. We will enable lighting to see that we're actually able to light this thing up.
I will click here on this lamp icon which allows me to see light. I can move this light
and you can see it's lighting up the object in real time. At this point, I'm going to
lift this light up, right click and add a light, so we have two lights. We're going
to change the intensities of these two lights. I'll set the top one at 40% and I will also
make this one slightly blue and I'm going to set the bottom one at 30%. Maybe we'll
alter those values later, we'll see. Select the object and click on the second button
down that has an icon of page peel that says DV property editor. This is where we can change
the displacement mapping for this object. Displacement mapping is a technique where
geometry of an object is altered by a grayscale image fed into, in this case, 3D-DVE. In order
to do this, we actually need to feed a black and white matte. They will do the warping
of the image. There are some built-in displacement effects like page curl, ripple and sphere.
Ripple can be used to some extent to create a very stylized looking flag. We will create
the concentric ripples emanating from the center, but we will leave this in the default
position so we can feed another image in there. I'm going to close up all these windows and
go back to our tree and we're going to take another graphics effect down here, connect
this black generator into the graphics. Double-click that, set up brush, turn off the fill. Let's
take a, let's create a large brush and the color is white. So we'll paint with white
over black. We'll exit out. Select the 3D-DVE. We can right-click and say add, remove inputs,
add inputs. Shortcut for this is letter A on the keyboard. We'll feed the output of
the graphics into the newly created inputs 2 and 3D-DVE and then we'll double-click
the 3D-DVE. So now you see what's going on is there are two objects sandwiched in here.
We can actually select our stroke and delete it. It's not consequential for what we're
going to do. Now we'll select the remaining flag. Click on the DVE properties and as displacement
texture select input 2. And as you can see the shape that we created is now creating
embossment in our flag. It's very rough because the filtering is set to very low detail but
if we change the detail values to 10 and 10 you'll get a fairly smooth looking shape.
So that's the idea. If the black and white mat we're feeding into 3D-DVE is animated
as it is with the flag that will cause the flag to move. Now let's quickly look at these
other values that we can adjust. I'm going to select the flag and we'll knock down the
detail to 5 and 5 which will allow me to move a little faster here. The scale amplifies
the extrusion effect. Remember white will produce fully extruded shapes. Black will
not affect the geometry at all and everything in between will stretch between the maximum
extrusion and no extrusion at all but we can multiply that with the scale factor. So scale
of 100 will create that and let's put it back to a more reasonable amount, maybe 12. Offset
actually moves the zero value base. See offset was I believe at 50 by default and you can
see the difference in position between the flag and the bounding wireframe. If I put
offset back to zero it will snap in and lastly softness we can make this thing very sharp
or we can add a whole bunch of softness which will smooth out the relief. So now see the
walls of the extrusion are not as sharp as they used to be. For example if you were to
bring in topographical elevation data you can use softness to improve the model by softening
over adjacent samples. Then we have the surface properties for the object and as we saw earlier
enable lighting allows us to see shading. This is what the same thing looks like with
lighting disabled. It's very difficult to see what's going on. Although the geometry
is there, if you see the profile of you you can see that the thing is raised but until
you enable the shading you really can't see it. This is the color of specular highlight.
Let's see if I make the specular highlight red what that does. This is the emissive color
of the object itself. Sort of an object glowing from within. You probably want to have that
at a fairly low level. And shininess affects the sheen of the object. This is a low value
of 1. High value of 100 for more metallic looking objects. Maybe that's a little too
high for this one. 40. That's a little better. You can see how that affects the specular
highlight. We're going to look at fractal noise now. I'll click on fractal noise and
bring it down here. We'll connect the output of the fractal noise to our output node. We're
going to tweak a couple of parameters to make it more flag like. We'll double click the
fractal noise and this is getting messy down here. Just so you have an idea what I'm doing
I'll put the fractal noise node up there. These two things are the only thing we're
concerned with right now. The number of octaves is, see with high number of octaves this already
starts looking like smoke which is not going to help us with the flags. We need a lower
number but for the complexity of the wave surface and the randomness it's good to use
more than one octave and 2.1 works particularly well. The base animation velocity is what
makes the fractal noise move. So high number will make it move fast, lower number will
make it move slower and I will try 0.5. We'll leave the octave mixing weight, octave scaling
ratio and the velocity ratio at the default settings. We'll move to the transform tab.
This one is important for the flag. If you want to make it appear as if the wave is moving
from the left to the right we're going to keyframe the X position at 0 and then we'll
move some number of frames and increase this value to let's try 12. This is largely trial
and error until you find a speed that works well. We'll keyframe that. We'll right click
on to the key and convert this to linear and we're just going to scrub the timeline and
see if this works well. I think I need to increase the number quite a bit so let's try
120, 10 times more, keyframe that and now you can see there's a sense of the texture
moving from left to right. If I push play you can see it moving to the right. Another
thing we're going to do is we'll change the vertical scale to 150 or 200, something like
that so we have vertical waves and everything else we can leave in default. The color really
needs to be black and white. We can play with density and offset later but for now this
is good. So what I'm going to do is I will lock the properties of fractal noise and put
this back here and connect it in place of the graphics node into input 2 and we'll take
the output of the 3DDV to the outputs. Go back to the 3DDV, select the object which by
the way now is distorted. You can see the little bumps and valleys in the flag. I will
move the detail back to 1 and 1 and if you put a higher softness that smooths over all
these bumps we'll go back to the tree. At this point I'm going to play with the fractal
noise to see how changes here affect a flag. So for example if we produce a number of octaves
we get a less complex wave surface. This is getting more turbulent with higher frequency
waves. So we'll put that back to 2.1. Then we'll play with the octave mixing weight and
octave scaling ratio to smoother surface. Pull this number down, go to transform. Let's
try to, instead of 150, go 300 on the vertical scale. So this gives us what we expect of
a flag, at least of a stylized cartoony flag, to have nearly parallel wave fronts across
the surface of the flag. Let's render this and see what it looks like when it plays
back in real time. We'll loop that. So it's kind of a very slow motion flag and death
can be easily adjusted using the base animation velocity. Let's try just to see how that works.
Let's go, instead of 0.5, let's go to 4 and make it really fast. Also if you advance to
the second key frame of this X translation, instead of 120, let's say 500 for this key
frame to render that. So that's kind of getting there. In the end, if you feel like I was
a lousy instructor and you didn't learn much or if simply you don't have time to mess
with these fractal noise parameters or the client sitting behind you, you can just go
to HDHead.com and download the waving flag preset.
