navigate site menu

Start learning with our library of video tutorials taught by experts. Get started

Creating Fluid Effects in Maya

Creating Fluid Effects in Maya

with Aaron F. Ross

 


Learn to render realistic bodies of water such as ponds and oceans and underwater shots with Maya—essential skills in a visual effects artist's toolkit. In this course, Aaron F. Ross shows how to work with the Fluid node attributes, control the simulation quality, make collisions that mimic surface wake or waves, float objects, and improve the realism of your scenes with shaders and reflectivity.
Topics include:
  • Simulating convincing surfaces of water and other liquids
  • Creating dynamic ripples with fluid pond and wake emitters
  • Testing simulations with interactive playback
  • Rendering water surfaces
  • Controlling render tessellation
  • Floating objects dynamically
  • Rendering an underwater scene

show more

author
Aaron F. Ross
subject
3D + Animation, Animation, Particles, Visual Effects
software
Maya 2013
level
Intermediate
duration
2h 16m
released
May 01, 2013

Share this course

Ready to join? get started


Keep up with news, tips, and latest courses.

submit Course details submit clicked more info

Please wait...

Search the closed captioning text for this course by entering the keyword you’d like to search, or browse the closed captioning text by selecting the chapter name below and choosing the video title you’d like to review.



Introduction
Welcome
00:04Welcome to Creating Fluid Effects in Maya.
00:07My name is Aaron F. Ross.
00:09In this course will explore the Maya Pond and Ocean features to create
00:13convincing surfaces of water and other liquids.
00:16Here are a few of the topics we'll cover:
00:19understanding fluid node attributes, simulating dynamic ripples with a fluid
00:23pond and wake, testing simulations with interactive playback, previewing an
00:30ocean in Maya viewport, rendering water surfaces, controlling render
00:37tessellation, floating objects dynamically, driving a dynamic motorboat, and
00:45rendering an underwater scene.
00:46Maya's pond and ocean tools make it easy to create complex shots that
00:52require liquid surfaces.
00:54These features of Maya are essential to a visual effects artist's toolkit.
00:59So let's get our feet wet in the Maya Pond and Ocean.
Collapse this transcript
Using the exercise files
00:01If you are a premium subscriber to lynda.com, then you can download the Exercise
00:05Files that are included with this course.
00:08If you don't have a premium subscription, then you'll need to create a Maya
00:12project and build your own assets as you progress through the course.
00:15Let's take a quick look at building a Maya project folder.
00:20We'll go to the File menu, and choose Project Window. This shows me the
00:25Current Project, it's just the default project.
00:28We want to build a new one then will click New, and then will give it a name,
00:32then I'll call it fluid_effects_Project. I just created in the default
00:39location here in my documents Maya projects.
00:43If we needed to place it somewhere else we could browse for different location.
00:47And now the Maya project folder structure has been created, and all the scene
00:51files that you build we saved into that project folder structure.
00:56If you download the exercise files, then you'll need to point Maya at that
01:01folder; the project folder of course in Maya is the home base for all of the assets.
01:07If you've got the exercise files then you can set the Maya Project.
01:10We'll go to the File menu, and choose Set Project, and then navigate.
01:16In this case I've got the files on my desktop, select Desktop, and then choose exercise files, and Set.
01:25And now Maya is going to look into that exercise files folder to find any assets.
01:32Now if I go to the File menu and choose Open Scene it takes me to exercise files Scenes
01:37and here all the seen files for the course.
01:42I mention one more thing in passing, which is that you may notice my Maya
01:46interface is a light color.
01:48It's got a light gray background with black text. That's not a requirement for
01:53the course its just a preference of mine.
01:55If you want to use a different Maya Interface, then you'll do that by modifying
02:01the Maya shortcut, and I cover that in a different course, which is Maya 2011
02:06Creating Natural Environments. All right.
02:09With our preliminaries out of the way we can go ahead and get started with
02:13Creating Fluid Effects in Maya.
Collapse this transcript
1. Fluid Pond Simulation
Setting up the scene
00:01Let's take a look at this scene file that I have created for the first exercise
00:05in fluid pond simulation.
00:07I just want get you oriented to best practices for Maya dynamics so that you'll
00:13have a minimum of issues when you build your own scenes.
00:16The first thing I want to point out is scale.
00:19In this scene I've built my models to one-to-one scale and that means that the
00:26bathtub is approximately you know 150cm wide. Let's take a look at the
00:33Preferences for that.
00:34I am going to go into Window Settings/ Preferences>Preferences and go to the
00:40Settings Section here, and you'll see that the Working Units are set to Linear
00:44centimeter and in fact it doesn't matter what value you choose here in the linear working units.
00:51You could choose a different value such as inch, and what that will do is, it
00:55will just make Maya interpret a grid line as 1 inch long and you'll see it
01:01doesn't change the scale of the scene itself.
01:04I just prefer to work in centimeters, its just easier.
01:07The next thing I want to point out is just the grid itself. Having a grid setup
01:12properly makes it a lot easier for you to understand how large something is in
01:17your world just at a glance's.
01:18So let's go into the grid settings, Display>Grid Options. I've already set
01:24them here and you'll see I've got a Length and width of 200 units; that's just
01:28the size of the grid in the perspective view.
01:30So if I dolly back in the perspective view here you'll see it only extends to
01:34200 cm from center to edge.
01:37Then we've got a Grid line every 100 units, or 100 cm, so a major grid line every 1 m,
01:43and then Subdivisions of 10.
01:47So in other words we have a major grid line here every 100 units, or 100 cm and
01:53then the minor grid line or Subdivision lines every 100/10.
01:58And so that means that each one of these minor lines is 10 cm apart.
02:05I have set the Subdivision lines to be a different color than the Grid lines to make that clear.
02:11So that's how I know that my world is built at one-to-one scale, because if a
02:17centimeter are my working units and the grid is setup to display in decimeter
02:22scale here, decimeter is 1/10 of a meter.
02:26I can tell just by looking at a glance that my bathtub is a little bit more than 150 cm wide.
02:34Next let's look at our animation preferences. The first thing we need to make
02:38sure is that our timeline is playing back at the correct speed, and this is a
02:43universal consideration for all dynamics.
02:46You get go down to your timeline and right-click on it and go to playback speed.
02:50You'll see there are three options.
02:53The option that you never want to chose is a Real-time.
02:57The Real-time mode will actually skip frames in a heavy scene, so if you've got a
03:01calculation intensive scene and you choose Real-time then what will happen is
03:06your dynamic simulation will break, because Maya will skip frames in order to
03:12maintain an overall playback speed of approximately 24 frames a second.
03:18If the simulations skip frames then the simulation is corrupted.
03:22So you cannot have the Real-time option when working with dynamics, because Maya
03:26calculates dynamics in the history-dependent fashion, meaning that what happened
03:30on frame 50 depends directly upon what happened on frame 49.
03:34And if we skipped frame 49 in order to maintain an overall average playback speed,
03:39then we will have dirty data on frame 50 and the simulation will blow up
03:43so we don't want that to happen.
03:44We have got other options here, the default option is Play Every Frame, Free
03:50and what that means is it will not skip frames and it will playback as fast or as low as it needs to.
03:57But that means that in a lightweight scene it might exceed your time base of in
04:02this case 24 frames a second.
04:05And if the Viewports are running too fast you are going to get a false idea false
04:09idea what your animation looks like.
04:11So you don't want to have a Free Playback speed.
04:14The only option that works for dynamics is Play Every Frame, Max Real-time
04:19and that again is universal for all Maya dynamics.
04:23Meaning, that it will not skip frames in a heavy scene, but it will also
04:27never exceed your current time base of 24 frames a second or whatever frame rate you've chosen.
04:33Okay, so your playback speed has to be Play Every Frame, Max Real-time.
04:39And then finally, one other thing that's not essential, but is helpful, is to
04:43make sure that we are seeing playback in all of the viewports. To do that
04:47I'll go back into my Preferences, there is an easy shortcut to that if I just go
04:52down into the lower right-hand corner that Animation Preferences.
04:55It opens the Preferences dialog but it takes me directly to the Time slider settings here.
05:00I just would change the Update View to All.
05:03And that means that when I playback my simulation, I will see it play in all the
05:08viewports not just the active one, very good.
05:12So that's our setup for preferences to build the scene from Maya dynamics.
Collapse this transcript
Creating a pond
00:01Let's create a Maya Pond.
00:04Just so that I can see what I'm doing a little bit better, I'm going to the
00:08Display layers here and hide a few of these scene elements like the ducky, we
00:12won't need him just yet, so I'll toggle his visibility off, as well as the room
00:16surrounding the bathtub. I'll just toggle it's visibility as well, so that I can
00:19actually tumble around and analyze my scene more clearly.
00:23Okay, now maximize the Perspective view by clicking in it and then tapping the
00:26spacebar and I'll create the pond.
00:29The Maya Pond is a variation on the fluid shape node, so you will find it in the
00:35Dynamics menu set, so make sure you have chosen Dynamics, and then you can go to
00:40Fluid Effects menu and go to Pond>Create Pond, and it's created at the origin with default attributes.
00:49And you note by the way, that I just built my scene so that the tub is in the
00:53right place for the pond at the origin.
00:57So let's go into those Pond attributes with that pond selected.
01:02I'll hold down Ctrl+A to open the Attribute Editor in Maya and you'll see that
01:06I've got the Attribute Editor in a separate window. That just gives me a little bit more screen real estate.
01:11Just up here you'll see the basic attributes. The most important ones are the Size attributes right now.
01:18You don't want to actually scale the pond, you could scale it uniformly if you
01:24had to, if you change this scale to be equal in XYZ, that's okay, but if you had
01:29stretched it so that were non-uniformly scaled like that, then you'd have major issues with your simulation.
01:36So you cannot stretch a fluid container in that manner.
01:40So again you can have a scale that isn't one, you can scale it up or down,
01:45but it has to be uniform in all axes.
01:47If you want a rectangular pond then you need to change the Size attributes here
01:52in the Fluid Shape node.
01:54I'll give my pond a length of 150 centimeters and a width of 75 centimeters and
02:03a depth of 45 centimeters.
02:07Now if I tumble around we can see the effects of that Depth parameter, it was at 3,
02:13and that might be okay if I was just rendering a surface. If I wanted to
02:17render a thick volume then it would definitely need to be a deeper pond.
02:23Okay, we have got our pond created and sized up, and next we'll look at the
02:27basic fluid attributes for Maya Pond.
Collapse this transcript
Understanding fluid node attributes
00:01The Maya Pond is a fluid shape, but not all of the fluid shape attributes are relevant to a Maya Pond.
00:08Let's take a look at the relevant attributes.
00:11I'll select that pond and open up the Attribute Editor with Ctrl+A if it's not
00:14already open. The most important thing to look at in fact is the Base
00:19Resolution and that is the density of the mesh, the surface of the pond.
00:25In order to see that we really want to be in a Wireframe mode.
00:29I'll give focus to the main window and press the 4 key so we can see wires.
00:34As I increase or decrease the Base Resolution you will see we get more or fewer polygons.
00:42Sometimes you might not see that happen in real time depending upon your
00:45graphics hardware and if you're not seeing a change then if you just rewind in
00:50your timeline it should update.
00:53This of course is the quality of the simulation and a higher Base Resolution is
00:57going to give you better detail on the surface of your pond.
01:01You'll notice that it maxes out at a value of 200, and that's a safe value for most systems.
01:08If you increase that Base Resolution past the value of 200 then you'll see a
01:14marked increase in the usage of memory.
01:18In other words, it's very RAM hungry.
01:21As you increase this Base Resolution, it's going to eat more and more on your system.
01:26I recommend that if you have only 4 GB of memory on your system that you
01:29don't even bother trying to take it up past 200, because the simulation is going to run so poorly.
01:35If you do have more than 4 GB of memory then you can increase the Base
01:39Resolution beyond 200 by simply typing it in, just be aware that you may
01:44experience performance issues. Don't go crazy in cranking up past 500, that's
01:49the ultimate max I would ever go for.
01:52Right now when I'm just setting it up I'll turn it back down to a 100.
01:56I can always turn that up or down nondestructively later to increase or decrease
02:00the quality of the simulation.
02:02Scrolling down a little bit, we can open up the Dynamic Simulation section.
02:06I just want to point out to you the Solver type is set to Spring Mesh and that
02:12only applies to a Maya Pond.
02:14The Maya Pond is a 2D height field.
02:19In other words, on each one of these vertices here it can have a Height value,
02:24so it can move up or down and it's connected to all of its neighbors with springs.
02:30We can't change this value if we want our pond to work, it has to be a spring mesh.
02:35Also, if you work with other types of fluids, for example, if you want fluid
02:40smoke or fluid fire, whatever, then you will probably want to increase the
02:45Substeps and the Solver Quality, etcetera.
02:48These values do apply to volumetric fluids, but they do not apply to a pond, which is a 2D surface.
02:55In other words, leave these values where they are and don't change them.
02:59There is another section I want to point out to you just so you understand what it is.
03:04If I open up this Liquids section here you'll see that there's the switch that
03:08says Enable Liquid Simulation.
03:11You might be tempted to turn this on, but in fact you should not, because this
03:16is using a completely different solver type. We'll cover that in another
03:20course in which we'll actually do a true 3D volumetric liquid.
03:26But the pond, once again, is a 2D simulation and we don't want, nor can we enable
03:33liquid simulation for a pond, so that needs to remain off.
03:37And then finally just to make it easier to see in the viewports, you note that if
03:41I deselect the pond it's going to be hard for me to see because it's the same
03:46wireframe color as everything else.
03:48So I just want to change that wireframe color really quickly.
03:50Select the pond, go back into Shape Node Attributes and go to the Object Display section.
03:57Scrolling down you'll see there's a Drawing Override section. I'll turn on
04:01Enable Overrides and then I can choose a different color for the wireframe, and
04:05that's this color slider here. I'll scroll this over to a light blue and
04:11then when I deselect the pond, you'll notice that it's in a different color and
04:15that will make it easier for me to see against the other objects wireframes.
Collapse this transcript
Adding a pond wake
00:01Our Pond has basic attributes of resolution and size, but without any forces
00:06acting upon it we'll not see any ripples in the pond.
00:09If I press Play, you'll notice that the timeline updates but we see no motion in the viewport.
00:16Press Stop and rewind back to frame 1.
00:20Let's add a fluid emitter and that will create density, which will allow the
00:25pond to create ripples, and this particular type of fluid emitter is known as a Pond Wake.
00:31I'll select the pond and go to the Dynamics menu set and in the Fluid Effects
00:37menu choose Pond>Create Wake.
00:43And now what you'll see is at the origin we have a spherical object and that
00:47is the wake fluid emitter, and if it's selected you'll notice that the pond
00:53itself is highlighted in magenta indicating that there's a connection between those two.
00:59Let's switch to a shaded view so we can see this a little bit better.
01:02Press the 5 key and then press Play. We don't see any motion right now.
01:09That's because the Wake Emitter is smaller than the polygons of the pond currently.
01:16So in order to see any ripples, the Wake Emitter will need to be scaled up.
01:21So I'll rewind back to frame 1, grab the Scale tool and scale that sphere up.
01:28Rewind and play that back and you'll see, ah, there we go, we've got some ripples.
01:32You will notice a couple things about this.
01:35First of all, that the emitter causes the pond to push upward and that's just
01:43the default behavior for a fluid emitter.
01:47If I have that object selected and go to its Attribute Editor then under Fluid
01:52Attributes you'll see Density/Voxel/Second, and that's just how much force is
01:58being exerted upon the pond.
02:01With a positive value it's going to push the pond vertices up.
02:04If I give it a negative value it will push it down, so give that -5 then rewind,
02:11playback and you'll see, that's going to behave much more like what you would
02:16expect if you had an object floating in the pond.
02:20Additionally, if the Wake Emitter is above or below the water line, it will not affect the pond.
02:28So if I grab the Move tool and pull this up and then play it back, since it's
02:33not intersecting with the pond, we will see no effect.
02:37So it needs to be sitting on the water line or with a Y value in this case of 0.
02:44We have got a Pond Wake added and next we'll actually add some turbulence, so we
02:48can create some ripples that will automatically generate from the emitter.
Collapse this transcript
Adding emission turbulence
00:01Our Fluid wake emitter is creating ripples in the bathtub, but only at the beginning of the simulation.
00:08If I press play you'll see that we get an initial kind of burst of density and
00:12then things sort of settle down and those ripples kind of die out.
00:17If we want those ripples to continue onward as if they were an object floating
00:21there then we can add turbulence to the emission.
00:24In order to see it more clearly, I want to extend the range of my timeline here.
00:28We've got 200 frames in the playback range, but I just want to click here and
00:32drag this out to extend that playback range to the full animation range of 480
00:36frames or 20 seconds. I'll rewind.
00:40Again, play back and you'll see that it will die out eventually.
00:43Those ripples will eventually kind of reach equilibrium and the water will sort of settle down.
00:50We want to add some turbulence to that emitter. Rewind.
00:54I want to select the emitter.
00:55Sometimes it's a little bit difficult to select that in emitter in the viewport.
00:59You might need to use the Outliner.
01:01Window Outliner, select the Emitter, and open up the Attribute Editor with
01:06Ctrl+A if you haven't already done that.
01:09You'll be looking for, in the Fluid Attribute section,
01:12there is a subsection here that says Fluid Emission Turbulence.
01:16You got the strength of the Turbulence here, you have got the Speed, which is
01:22how fast the Turbulence is going to oscillate, and then you have got the
01:26Turbulence Frequency, which is the size of the noise.
01:30I will set my Turbulence amount to a value up of 2 and then play the Simulation
01:36and see what happens.
01:39So it doesn't look that much different than what we saw a moment ago with no
01:42turbulence. The reason is that the Speed is very slow and the frequency is pretty high actually.
01:52Stop that and rewind it. I'll set the Turbulence Speed to a value of let's say 0.5 and then play that.
02:01What you will see here if you get in really close and look, you'll see that
02:06within the volume of the Emitter that we are getting this chaotic movement of
02:12the vertices of the pond's spring mesh, and that's the turbulence in effect.
02:18You'll see a speed here 0.5 is causing it to ripple at a certain speed.
02:24Let's play also with the Turbulence Frequency. A lower frequency is going to give me larger waves.
02:32So I will set that Frequency down to let's say.1 in all axes, X, Y, and Z.
02:37Rewind the simulation and play it back.
02:43Now I have got a fairly high Turbulence Amount of 2.
02:47I have got Turbulence Speed of 0.5 and the Frequency of 0.1, and this is
02:53basically producing constant ripples throughout the animation.
02:58If I had a higher speed, then the ripples will be closer together.
03:01If I had a higher frequency, then the ripples would be more chaotic.
03:08I'll increases Speed up to let's say 1, play that.
03:13What should you see here is now we're getting twice as many ripples in the
03:17same amount of time. Then the frequency is the amount of chaos, essentially.
03:23If I set that Turbulence Frequency back up to 1 in all axes, this going to be an extremely turbulent bathtub.
03:32So not only are we getting more ripples, but the ripples themselves are not as uniformly shaped.
03:39They're more chaotic.
03:43Those are some very extreme settings.
03:44I am actually going to take this down to something that's more workable for the
03:48scene I am going to build with rubber ducky.
03:51So I'll set my Turbulence down to 0.2, a Turbulence Speed also 0.2, and then the
03:58Frequency I am going to set that way down to .01 in all axes.
04:03That's going to be a very subtle effect that we might not see too much on this right now.
04:08But once we actually get some animation in this scene, it's actually going to
04:12kind of enhance that animation a little bit by just adding of a slight amount of chaos to it.
04:18That's the Fluid emission turbulence.
Collapse this transcript
Adjusting fluid shader attributes
00:01We have options on how we want to render the pond.
00:04Eventually, we will end up converting it into polygons so we can see how to
00:08create a truly refractive material that closely emulates the look of water.
00:13First, however, let's take a look at the attributes available to us in the fluid shape node itself.
00:19In order to see the shading better I need to have some ripples on the Pond.
00:23So go ahead and press Play and just let that play through for a moment and then
00:27press Stop so that then we'll have some ripples.
00:29I'll go ahead and render this with the default shading attributes.
00:33Go ahead and click Render the current frame.
00:35You'll notice that this is going to render in mental ray. I have chosen mental ray for a reason.
00:43That's because I can use the interactive production renderer and it's much faster.
00:48Let's look at the shading attribute.
00:49So I will select that Pond and hit Ctrl+A to open up the Attribute Editor.
00:55I've got that fluidShape node open.
00:57We want to look at the Shading sections.
00:59So go down here to Shading and open that up and let's do interactive production rendering
01:04so that as we make adjustments here we will see update in the Render view.
01:09I will click on IPR and then just drag a rectangle around a representative area of the pond.
01:15Now we can start playing around with these things.
01:20First and foremost is the Transparency.
01:22I want to increase the Transparency to nearly white so that eventually, I'll be able to see through the water.
01:30Well, you will notice that as I increase that Transparency suddenly it became
01:33very, very bright and almost overlit. That's because of the properties in the Surface section here.
01:40Let me open that up.
01:42You'll see Environment and you'll also see Specular color here. Those are
01:50what are resulting in this overly bright surface here.
01:53I am going to reduce the Specular color actually all the way down to 0 and IPR updates.
02:01With the specular color turned off we can start get a better handle
02:05on the Transparency and other attributes of the Shading for this fluid node.
02:09We've also got the Environment section here. This is the color of the reflections that you see here.
02:15I'm actually going to delete all of these color swatches except for 1 and set it to White
02:23and now we'll just basic white highlights.
02:27Now scrolling back down into the Shading section we've got the incandescence.
02:32This is also making it look overlit and I'm just going to once again delete
02:36all of these color flags until I've only got one and then just make sure that's set the black.
02:42So there it is black. No incandescence.
02:47Then finally the color itself you will notice that it's got a gradient and you
02:52will notice that it's got an input here.
02:54I am going to change that input to Density and what that means is that the color
03:00will be different depending upon the height of the pond.
03:03Then I will just adjust this Gradient here.
03:07Maybe I only need two color flags here.
03:09I'll delete green one in the center and I'll set this one on the far left to black
03:16and the one in the far right is already at white.
03:20I can move those around to change the Contrast.
03:25Then finally, yes, I can change the Transparency, maybe make it even more transparent.
03:32So with a little bit of playing around here we can get pretty decent looking water.
03:36However, we will not ever get any true refraction.
03:39You will notice that there is a refractive index value here, that only changes
03:44the behavior of the reflections.
03:47With the Shading attributes built into the fluidShape node we're not able to get truly refractive surfaces.
03:54So will do a full render on that and that's the result that we get after
04:00adjusting some of the fluidShape note shader attribute.
Collapse this transcript
Matching a wake emitter to an object
00:01We have got our pond built and an emitter and some basic fluid shape attributes adjusted
00:05and now we are ready to start integrating animation in this pond simulation.
00:11The first step to that is matching the emitter to the shape and size of the object that we want to animate.
00:19I have got my rubber ducky over here on the Display layer, so I will just
00:22turn that display layer visibility back on and dial in a little bit with alt right
00:27and tumble around with alt left and what we want to do is just scale that emitter.
00:33I want to select it.
00:35It's kind of difficult to select sometimes in the viewport, so you want to
00:39make sure that you actually have the emitter selected.
00:41I will go to Window Outliner and select that emitter. Okay.
00:47Now I will grab the Scale tool and then just shrink that emitter down.
00:51It's totally fine and okay for me to scale the emitter non-uniformly; unlike with the
00:58pond itself, I can't scale the pond to non-uniformly, but I can scale the emitter anyway I need it to be.
01:07So that's no problem.
01:08Let's go to the four viewport layouts, we can see that a little bit more clearly.
01:12I will tap the spacebar and the emitter is currently selected, so I can just go ahead and press the F key.
01:18but if I hold down Shift+F, I can zoom in all the viewports.
01:22My side view is currently a shader view, so I can focus to that side view and
01:28then press the 4 key, so we can see better.
01:31Okay, so I am just scaling that emitter so that it fits the ducky and maybe move
01:36it a little bit if I need to, so that it kind of fits his body.
01:41Then finally I just need to link it to the ducky.
01:45Ducky is being controlled by this NURBS curve here, so that's the parent of the entire ducky model.
01:51I just want to link the emitter to that Ducky control object, once again,
01:57I will go to the Outliner, here's the emitter. I just want to middle mouse drag that
02:03and drop it onto ducky control and that will parent it to the control object.
02:07If I open up the control object's hierarchy, we can see that it's got lots of
02:12children here including now, the PondWakeEmitter.
02:14Now if I select the ducky control and use the Move tool, I should be able to
02:20move the duck and the emitter all in one go.
02:26All right, that's all there is to that. We've got our emitter sized and shaped,
02:30and also linked so that it will follow the model.
Collapse this transcript
Testing with Interactive Playback
00:01Now the real fun begins. We can actually move the duck through the water
00:06and watch the ripples in Real-time. This will allow us to test our simulation
00:11before we've even created any animation.
00:13This is done through method called interactive playback.
00:17In order to see what we're doing we're actually going to need to reduce the
00:21transparency on the fluid shape just so that will be able to see a surface.
00:26I'll go ahead and select that fluid, and go to it's Attributes, Ctrl+A and just in
00:31the Shading section turn the Transparency all the way down while we are testing.
00:35When we finish we can turn it back if we want.
00:38Okay, I'll select the ducky control object and maximize the perspective view.
00:48So with ducky control selected and the view maximized, I've got 20 seconds of
00:53animation available in my timeline. I want to grab the move tool and go into
00:58the Dynamics menu Set and choose Solvers>Interactive Playback. Now I can
01:07actually move the duck around and cause it to affect the simulation.
01:13You can see here that it is working, but we just got way too much going on with our wake.
01:21So I just having done that it tells me that I need to reduce the amount of
01:26overall density being emitted from that wake.
01:28I rewind the timeline and I want to select the Emitter, go in the Outliner to do that.
01:34Open of Ducky Control and select that Emitter, go to the Attributes, Ctrl+A.
01:39We still want to set the density down, we are getting too much negative density.
01:46I'll give the Negative Density of let's say -1, close this windows, rewind the Simulation,
01:55select the ducky control object once again, and again if you have
01:59difficulty with that you can use the Outliner.
02:02So make sure you got ducky_control selected, and go back to Solvers>Interactive Playback.
02:09Now we're getting a much more realistic result; we just had too much density being emitted.
02:14Once we have done that we can see that we could probably use some fine tuning.
02:21In the next movie we will control the simulation quality.
Collapse this transcript
Controlling dynamic simulation quality
00:00We got a basic setup and our emitter is working, but our quality for the
00:05simulation isn't as good as it could be.
00:08If I select the ducky_control object with the Move tool, I can go back to
00:12Interactive Playback and illustrate that. It's looking a little bit rough around the edges.
00:18We're getting very fast performance, but our simulation isn't of the greatest quality.
00:22You can see that most specifically if you get in close.
00:28Because of the low definition of the pond shape, there aren't very many vertices nearby.
00:34We're seeing this kind of interesting look here, where it's not really conforming well to the shape of the emitter.
00:43What we need to do is simply increase the overall resolution of the pond.
00:49I'll select that Pond, go to the Attributes, Ctrl+A, and we've got the Base Resolution.
00:54We can turn that up, let's turn it up all the way to 200; I have got a pretty
00:59fast computer here and so it should be okay.
01:01Go ahead and close these Windows here, minimize the outliner, we need that again, back out a bit.
01:10Rewind the timeline and go back to Solvers>Interactive Playback and give that a go.
01:15You'll see with the value of 200 it's looking quite a lot better.
01:21Getting close there once again you'll see that the pond is not really conforming
01:26very well to the shape of the duck.
01:29We need an even higher resolution to the pond.
01:33I just want to warn you again, in your own scenes, on your own computer,
01:37you may not be able to push it up pass 200.
01:40The performance may not be good enough, and in that case what I would recommend
01:44is you can actually scale the emitter down slightly, so it's little bit smaller than the object.
01:50And that will help to try to prevent some of those issues, okay.
01:53But I have got a fast computer here in this case, and so I have no problem with
01:57just selecting the pond and increasing the base resolution.
02:01You know by the way, that some of the most basic attributes are here in the
02:04channel box, so I don't even really need to open the Attribute Editor.
02:07Base Resolution, I'll set up to 300 and back out, rewind, grab the ducky_control object, grab the
02:19Move tool once again, Solvers>Interactive Playback and you'll notice now that it's playing more slowly.
02:26We're not getting real-time performance anymore, but we are getting a much better result near the emitter.
02:33We should probably check in to see what our playback speed is.
02:36I'll go to the Display menu and choose Heads Up Display>Frame Rate.
02:44That way if I'm playing or if I'm in interactive playback, I'll be able to read out the speed
02:50of the current simulation, so it's not quite running in real time.
02:54I am getting something averaging around 15 or 20 frames per second.
02:59It's important that I know that I'm not playing in real time, because if I
03:05thought I was playing in real time, I might do things like change the simulation rate
03:09in order to speed it up and that would be wrong, because it's actually
03:13playing at the correct speed in the simulation. It's just that we're not seeing
03:18it update in the timeline in real time.
03:20In other words, it's working fine. It's working just perfectly.
03:25I might scale that emitter down just a little bit to try to hide that seam,
03:31so I'll just scale it down ever so slightly to be a little bit smaller than the duck.
03:36Then back to my ducky_control object, back to frame 1 with the Move tool,
03:40and do one final test on this and see.
03:47I think we're pretty good to go; our dynamic simulation is essentially doing
03:51what we needed to do at this point.
Collapse this transcript
Making collisions
00:01For more realistic simulation we'll want the ponds to collide with the tub,
00:07so that the ripples will actually bounce off the sides of the tub.
00:11If I just play the simulation now it's a pretty close approximation to that
00:16because the pond is actually not that much larger than the tub itself, but we
00:21can make that lot better.
00:23In order to make it more clear what's happening I'm going to increase the emission turbulence.
00:27I want to select the emitter that's in the outliner under
00:31the ducky_control hierarchy, select the emitter and go to its Attributes, Ctrl+A,
00:36and in the Fluid Emission Turbulence, I'm going to set the Turbulence amount to 5
00:40and increase the speed to 1. That way we will be able to see this much more clearly.
00:47Playback the simulation, and here with no collisions you'll see that there is a
00:52kind of delay between when the ripple hits the tub wall and when it bounces off,
00:59because it's actually not colliding with the tub just now.
01:02But to make it collide is quite simple.
01:04All we need to do is select the pond and then select the object that we want to collide with.
01:09Before I do that I want to point it out by the way that we've got a frame rate
01:14of about 20 frames a second currently with no collisions, okay.
01:17So I'll select the pond and I'll also select the tub geometry so I can hold
01:22down Ctrl and select both of those, so I've got the pond selected and the
01:27geometry selected, and go into the Fluid Effects menu and choose Make Collide
01:34that's all there is to that.
01:35Now if I playback my simulation, you'll see that I'm getting about 15 frames a second now,
01:42we're getting a better results in terms of the ripples but we're
01:45also seeing a little bit of kind of weirdness around the edges and does not
01:50really desirable, you can see how that kind of looks kind of strange, we get in
01:54really close on that stop the simulation and getting close.
01:57And you can see that it's colliding but we're having some sort of boundary
02:01condition issues here and additionally again my frames per second have gone down.
02:06Well, there is a solution to both of these problems, which is don't collide with
02:11the object that you want to render. Create a proxy object or some sort of simple
02:16geometry that has a lower polygon count and that is not quite the same size as
02:23the rendered collision object. I'm going to delete the collision ability, okay.
02:29So there's no menu item in here to delete collisions. If you look in your
02:35Fluid Effects menu we can make collide but we can't remove collide.
02:38To do that we have to select the object that we've made collisions with, select
02:43the tub and you need to go in to the hyper graph Window>Hypergraph: Connections,
02:48open that up and the collisions are created by this node here call the GeoConnector node.
02:56To remove collisions you just have to delete this GeoConnector node, so select
02:59the node in the Hypergraph and press the Delete key on the keyboard, now we have no more collisions.
03:07To get a better result with this and also a faster result we'll use a proxy object.
03:12I created that here, you'll see in the outliner>tubProxy and if I press the 4 key we can see it.
03:19I've created this proxy object that has a lower polygon count and its surface
03:24only exists in the area where it's possible for those collisions to take place.
03:29In other words, I don't need any geometry up here because the pond can't
03:33possibly collide with it there, okay.
03:36So I've got my proxy object selected and I'll also select the pond Ctrl+Click on that
03:41and Fluid Effects>Make Collide, go back to a shaded view press the 5 key
03:49rewind get in a little bit closer here, so we can see that better.
03:55Beacause the proxy object is a little bit larger,
03:58the collisions are kind of happening behind the renderable tub surface.
04:05I can actually change that up, I can actually scale the proxy object
04:11or I can also use a transform component tool and that'll actually move all the polygons out.
04:16The Transform Component tool is probably the best thing to use in this case.
04:20I'll go back to a Wireframe View with the 4 key and so I'll go to the Polygons
04:25menu set and choose Edit Mesh>Transform Component. What this will allow me
04:33to do is to move all the polygons towards or away from the surface, so I'll need
04:38to find a manipulator; so it's going to be kind of hiding down here, there's a manipulator here.
04:44And I just want to move it in the local z axis.
04:48So you see what that Transform Component tool is doing is it's moving the
04:52entire surface towards or away. t's different from scaling of course,
04:57because it's going to maintain a more consistent distance in an envelope around
05:02the object. I want to go up to the top view, maybe we can see that even more clearly in the top view.
05:10So if I extend this proxy object out a little bit more we can hide that funky
05:15edge that we saw on our pond, so that we won't get that weird result.
05:21How much this needs to go out we're not really sure but we know that it needs to
05:25be in a larger than one pond polygon, something like that is probably fine.
05:32I can exit out of the Transform Component tool just by using any other tool like
05:36the Move tool or whatever. Looks like I've been dropped into component mode
05:40here, so I can go back to object mode by right-clicking on one of these vertices
05:44and choosing Object mode, okay.
05:48Back to shaded view with the 5 key, rewind, playback, and see about our collisions.
05:56Much nicer, you can see we don't have so much of those weird issues and if we
06:01smooth this surface we would actually even get a cleaner result.
06:06So that's one of the tricks of the trade here, using a proxy object to clean up the edge
06:12and also to improve playback performance.
Collapse this transcript
Setting an initial state
00:01Currently our water is completely placid on frame one and there are no ripples
00:07at the first frame of the animation.
00:09In fact that's what I'm going to end up doing for my final version of this,
00:14but we also need to look at how we can set it up so that the fluid will actually
00:18be in motion on frame 1 and that's done by setting the initial state.
00:24I'll play this simulation through a little bit with a high turbulence on it, so
00:28we can get lots of nice ripples.
00:29I'll just let that play through for several hundred frames until it kind of
00:34propagates waves through the entire tub.
00:37So I have let it play through a little bit and I'll stop it before it reaches the en.d
00:41At this stage now I can set the initial state for the pond, meaning
00:47that what I see currently will be the new state at frame 1. I want to select the pond.
00:54Make sure that it is selected, you know, you may not get selection highlighting
00:58unless you're in a wireframe view, so you can switch out to wireframe with the 4 key,
01:02if you're not sure if your pond is selected, go back to shaded view with the 5 key
01:06and we want to go into the Dynamics menu set and choose Fluid Effects>Set Initial State.
01:16Now when I rewind back to frame 1 we see no change, because what we saw at
01:22frame 447 is now the state on frame 1.
01:28I also want to point out that there is another menu item that's very similar.
01:32If you look under Solvers you'll see initial state, this only works for rigid
01:37bodies and soft bodies. So if you tried to set initial state for a fluid using
01:42this menu it would do nothing so you need to go through the Fluid Effects menu.
01:46All right very good.
01:48Now if I press Play here we're still getting a lot of emission turbulence.
01:52Iwant to turn that back down again, let the ripples sort of settle down and then
01:56set the initial state again, go back to my outliner, Window>Outliner.
02:03I want to select the emitter, it's a child of the ducky control object, so I'll select
02:07that emitter, go back to the Attributes, Ctrl+A, and turn the Turbulence Values
02:13back down, turbulence amount of .2 and a speed of .2 and just play the
02:20simulation through for a few seconds until it settles down a bit and that looks pretty good.
02:26I will just make sure that I have the pond selected and I can set the
02:30initial state once again; Fluid Effects>Set Initial State.
02:36That will be the new state on frame 1.
02:40Now if necessary, we can remove the initial state as well, just select the pond
02:45fluid and go back into the Fluid Effects menu and choose Clear Initial State.
02:50I'm not going to do at this time, I want to leave this in this state currently,
02:54so that if we open up the finished version of this file, we'll actually be in
02:58this condition. I'm actually going to save this now as a finished version,
03:05initial state, finished.
Collapse this transcript
Keyframing emission
00:01Setting the initial state is necessary if you want your pond to be rippling on
00:06frame 1 of the animation, in this case what I want actually is a perfectly flat
00:12and placid water surface at the first frame of my animation.
00:17Now you'll note that even if you have a low turbulence value that when you
00:22press Play you'll still get a burst of emission at the very beginning of the
00:27simulation. Now you could let this play out and you know get to sort of
00:33equilibrium state and then set the initial state, so that the water would be almost completely flat.
00:38But there's a trick to this that we can use to kind of bypass the initial state entirely.
00:45We can keyframe the emission rate; rewind back to frame 1 and I want to select that emitter.
00:54I can go into the Channel box or the Attribute Editor. What I'm looking for
00:58is the density emission rate, scrolling down and here it is Fluid Density
01:05Emission. Remember we set that to a value of -1. I'm going to key that, so it'll
01:11slowly increase over a period of about three seconds, four seconds, and that will eliminate those ripples.
01:18On frame 1 of my animation I'll set the Fluid Density Emission to value of 0 and
01:24press Enter or Return than I want to key that. I'll select the name of the
01:28Attribute and go to the Channel menu and choose Channels>Key Selected.
01:34Its important that I'm only keying this one attribute, I don't want to key any of
01:37this other stuff, so don't use the S key.
01:40All right, so I can play that through and you'll see nothing happens, there is no
01:45emission. I'll just go up to about frame 100, it's make it exactly frame 100
01:52and set the Emission rate to what I wait to be for the final animation and that
01:56was a value of -1, press Return or Enter, select the name and choose Channels>Key Selected.
02:05Now that emission rate is going to decrease from a value of 0 at frame 1 to
02:10value of -1 at frame 100. I'll rewind, playback the simulation and because it's
02:17slowly increasing in emission we don't actually get a ripple coming out.
02:23Now I could just actually start my animation at frame 100 or frame 101 and
02:28I have no need to set the initial state at all.
Collapse this transcript
Keyframing an object in a pond
00:01Later in the course we will see how to make our objects float.
00:04That's a cool technique where we can have the position and rotation of an object
00:10to be partially determined by the ripples in the pond or an ocean.
00:17In this case we want to start small.
00:19I just want to create standard ordinary traditional keyframes on my ducky and
00:23cause the wake to be generated from the position of the emitter.
00:27Now to make that happen, I am going to want to disable evaluation on the fluid shape,
00:33because to make keyframes we need to scrub through the timeline, but if
00:38I scrub to the timeline here, my fluid is going to go haywire, just going to go crazy.
00:43This is just an example of the fact that you cannot scrub in the timeline
00:48with maya dynamics because they are history dependent meaning that, what happens on the
00:53current frame depends upon what happened on the last frame.
00:57If you skip around then the simulation is not going to work right.
01:00Okay, so I am going to rewind back to Frame 1 and I am going to disable evaluation for the fluid.
01:07Now we can do that in two ways.
01:09We can select the fluid and then go to its attributes, Ctrl+A, and we can turn
01:15Disable Evaluation on; and that will be just local for this one shape, so now if
01:22I scrub through here nothing happens.
01:26Okay, let me show you the other way that you can do this.
01:29So I will turn Disable Evaluation off, so that it's reenabled and if you got
01:34more than one fluid in your scene you might want to use the Evaluate menu.
01:39Go into the Modify menu and go to Evaluate Nodes and we can globally disable
01:47different dynamics and IK and so on.
01:49I want to warn you at this time that sometimes the state of these little
01:54checkboxes does not correctly indicate the state of evaluation in the scene.
02:00So just forewarned its forearmed, sometimes this checkbox might be off and yet
02:06evaluation is still working and if that happens to you can just go up here to
02:11Evaluate All, to turn everything back on again and come back into the menu and
02:16turn everything off or turn off the things that you need to.
02:19All right, now turn Fluids off and now I can scrub through here, no problem.
02:23I want my animation to start on Frame 101, remember we'd made a run-up.
02:29Instead of setting the initial state in this version of the scene, I have got
02:33animation on the density emission.
02:36So it's ramping down from a value of 0 at frame 1, to a value of negative 1 at frame 100.
02:44So my animation proper is going to start on frame 101.
02:46I will select a ducky control object and I only need to keyframe some of its transforms.
02:54I'm not going to keyframe the elevation or the Y position.
02:59I am going to leave that just constant.
03:02As far as rotations, really I only need to keyframes the Y rotation, which is its
03:08sort of direction of travel and the Z rotation, which is tilt up or tilt down.
03:14In summary the only channels I only need to keyframe are, Translate X, Translate Z,
03:21Rotate Y and Rotate Z. So I held down the Ctrl key and clicked on those four
03:28channels and the ducky control transform node.
03:31I will go the Channels menu and choose Channels key selected.
03:37All of those highlight in red indicating that there is an incoming animation
03:41curve and you see I have a keyframe here at frame 101.
03:45Now I want to create some tilt here, so I will get in a little closer, grab the
03:50Rotate tool and just tilt the ducky up a little bit and maybe actually position
03:55it up a little bit to while I am at it.
03:58And go ahead into Channels key selected.
04:02Now from now on, if I want to make more keyframes, I can just turn on Auto key,
04:06which is down here in the lower right hand corner of the Maya Interface, click
04:09on that little skeleton key icon and now any of these channels that have already
04:15been keyed will have new keys placed on them just automatically.
04:19Very good, so I scroll down to some point later in time, let's say frame 220 or so
04:27and I will just move the object forward.
04:32And when I release the mouse, a keyframe is created automatically.
04:37Let's see what that looks like.
04:38So I rewind back to Frame 1, I go back up to the Modify menu and chose Evaluate
04:43nodes, Evaluate All and then play the simulation.
04:48Lets give focus to the Camera view here, so right-click in the Camera View and
04:53tap the spacebar to maximize that.
04:57And the first 100 frames are of course our run up and then the animation starts on frame 100.
05:02All right, very good.
05:10Now we could probably improve that. We could collide the fluid with the ducky so
05:14that we will get ripples coming off the ducky.
05:16I will leave that as an exercise for you.
05:19Additionally we could do better job of animating this, we can cause him to turn and move around.
05:25Again you play around with that and have fun with that, but this is just the
05:29essential technique here of creating keyframes for the wake emitter.
Collapse this transcript
Rendering raytraced water
00:01Our next step in the quest for realism is to add a refractive raytraced material
00:06to our water surface.
00:08But before we do that I want to correct one small issue with the simulation,
00:13it has to do with the animation.
00:15If I press Play here you'll see we reach frame 100 the ducky starts moving,
00:21but our emission is too great here.
00:24If I continue playing that you'll
00:28see that it's, it's just kind of too great of the negative density emission.
00:33So we can go ahead and change that keyframe. I want to select the Emitter, and
00:40if you've trouble selecting the Emitter of course use the Outliner.
00:46I just want to adjust the keyframes.
00:49I can do that from the graph editors probably easiest; Window>Animation Editor>
00:53Graph Editor and press the F key to frame that and we've got a value of -1 here at frame 100.
01:02Let me select that keyframe and appear in the value field, I'll give a value of
01:07instead of -1, I'll make it -.5, reduce the Intensity of that emission.
01:13Let's see what that looks like, Rewind, play it back.
01:20Additionally one thing I can also do, is I can change the run up so that the
01:24run up is happening while the ducky is starting his motion, in other words,
01:30basically the Emitter is already at full strength by frame 100, but I can opt to
01:36make the Emitter run up to full strength during the first few frames of the
01:41animation proper. It's kind of a clever thing that we can do.
01:46Let's do that I want to turn off the Evaluation for a moment here evaluate nodes,
01:51let's turn fluids off so we can scrub through here and not see any issues.
01:57Basically, I want the run up to happen during the first few frames of motion here,
02:03and probably the best way to do that is again from the Graph Editor.
02:09I'll say, let's say this last frames here, that keyframe, I'll set that to let
02:15say frame 120 and then the first one we'll have Start at frame 100.
02:23So in fact now in this condition it's going to increase in negative density over a period of about 1 second.
02:31Now that I've changed those keyframes, I'll re-enable a valuation, Evalue All,
02:36and then play the simulation.
02:39Now off course my run up of a 100 frames is even really strictly necessary,
02:42because I have change the behavior of the wake, there I think I've got a better result.
02:52Very good, so if we are happy with that simulation then now we can move on to playing with Shaders.
02:58In order to see this better, we need to have some state to the fluid. In other words,
03:03it can't be perfectly flat and or we won't be able see the result of our materials.
03:08So I have parked my animation at a representative frame here, and in order to
03:14assign a new material to the Fluid, I'll need to convert it to polygons.
03:19I want to selected it; let's go into Wireframe, I'll press 4 key,
03:24make sure I have selected that Pond.
03:27And go once again to the Modify menu and this time we want to go to Convert>Fluid to Polygons.
03:34Now be aware that this is a one-way process, once you do this you can't go back.
03:40So you probably need to save your scene before you do this and then save it to
03:44a new version immediately afterwards; Convert>Fluid to Polygons. All right!
03:50And now the only thing we will see here now is that the object looks slightly
03:55more dense than it did before. Now we'll see it's as polySurface 1 here,
03:59let's go to the Outliner, investigate that. What have we got?
04:03We've got our Pond, which is the actual shape node and then we got polySurface,
04:09which is the Pond to Polygons. I really want to rename that.
04:12Okay I'll call this Pond, Polygons or pondPolySurface 1 is good enough. That way I know what I am dealing with.
04:22Once it's been converted to polygons now I can assign whatever material I want to it.
04:26Of course I don't want to delete the construction history, because if
04:29I did that then you would freeze the polygons in their current state, all right.
04:36So with focus on the main window here, I'll press the 5 five key so I can see shading.
04:41I want to assign a material. With that pondPolySurface selected
04:47I'll right-click and choose Assign New Material.
04:52Since I am using mental ray I could use MIA Material X and use the Glass preset,
04:57but I want a little bit more control over this someone.
05:00I want to have some amount of ability to sort of fine tune it, and it's easier
05:04to do that if I use of the Blinn material. We'll click on Blinn, I want to rename that.
05:10I want to call it waterBlinn.
05:15So I have got the Color here of course, change that to blue or whatever,
05:20but you'll see that it's kind of hard to tell what I'm doing, because I've got the objects selected.
05:27What I want to do is actually just in the Attribute Editor copy this tab off,
05:31and then I can deselect the object.
05:32I can play around with the attributes here.
05:36So for water we actually want the color to be black it's not going to have any
05:39Diffuse reflections or we turn the Diffuse amount down all the way, either would achieve the same result.
05:47For the Specular amount and reflectivity, we can kind a play around with that.
05:51Specular Color, Eccentricity, Specular Roll Off that's all that affect the highlights.
05:58So with a High Roll Off and the Low Eccentricity we're going to get really kind
06:02of sharp, shiny highlights it's kind of focused Highlights.
06:08Reflectivity is set to .5 by default, which means it's going to be uniformly reflected throughout.
06:13Let's do a test render of this, so go ahead and click Render and it's going to
06:20render in mental ray, which is Draft Quality Settings.
06:23So currently we're getting reflections but we're not getting any refractions.
06:27Let's go ahead and store that image by clicking keep image, back in my Material
06:32I want to scroll down and I want to enable refractions.
06:37I'll go to Raytrace Options and turn on Refractions.
06:41Now you will need to make sure that either you've got mental ray as your renderer
06:46or if you're using the Maya software renderer then you've gone into the
06:49Render Settings and enabled raytracing.
06:52The Refractive index here I want to be the same as water, which has a IOR index
06:57of refraction of 1.333. Go ahead and do another rendering of that.
07:03Now we're still seeing this black and that's because we need to have a greater transparency.
07:09So I'll increase the Transparency up to almost Fully Transparent and render.
07:17Now we're actually getting refractions.
07:18If we want to see that a little bit more clearly you know what I can do, is in
07:22my Display menu here, and Display layers I can turn the tub off and turn the room on,
07:27and the room actually has a tiled texture on it.
07:31So we can see those refractions a bit more clearly when we've got a tiled texture.
07:35All right!
07:36We can see here now with Raytraced refractions that we can actually see the ripples a lot more clearly.
07:44Now this is a very simple raytrace effect. If you want to do a more
07:48sophisticated version of this, then you want to build your own water shader .
07:53We're not going to cover that in this course, because it sort of off topic.
07:57But I get cover in another course, which is called Creating Shared Networks in Maya and Mental Ray.
08:03It goes into the process of creating what's called Dielectric Shader,
08:07which is not uniformly reflective and not uniformly opaque.
08:13If you want to learn how to do a more interesting baroque version of this,
08:17then go look at that other course here on the lynda.com online training library.
Collapse this transcript
Caching a fluid
00:01Before you can render a dynamic simulation in Maya you'll need to bake or cache that simulation.
00:08What that does is it calculates all the dynamics and then stores it on disk, and
00:14that way when it's rendered it will behave the same way each time a frame is
00:19called up on a batch render.
00:22If you don't cache your simulation, then when you do a batch render you may get
00:27unexpected results and they could be quite unpleasant.
00:30Your fluid may explode or do something completely different than what you saw in the viewport.
00:36Therefore caching is not optional, so before you render you need to cache your fluid.
00:42In this case I have already converted the fluid to polygons. You can cache the
00:45fluid before or after converting or you can catch a fluid without converting at all, of course.
00:51What I'll do is, I'll select that Pond and go in the Dynamics menu set and
00:57choose Fluid nCache>Create New Cache, and I want window into the Options.
01:04Now what you'll see here's the Cache directory, this is where the files will
01:08be stored in the current projects data folder. It will create a folder just
01:15using the name of the current scene file.
01:18You know what I am going to do, is I'm actually going to think ahead and I am
01:23going to put the word Finished here, because once I'm done with this I'm
01:28actually going to save it out again in that Finished State, and when I add this
01:33scene here that way at least the Cache directory name will match my file name,
01:38just thinking ahead a little bit.
01:41Additionally, you've got the time range here and the default is the time slider,
01:45but in this case you know I have a run up of 100 frames and I am never going to
01:51render that, and just to save time I am not going to bother cashing in either.
01:55I've set the Start time to frame 100 and the end time to frame 300,
02:00because I have got 200 frames of animation.
02:02And I am caching all these properties; really density and velocity are the
02:06only things that matter, but we will go ahead and leave all those on anyway.
02:10Go ahead and click Create and you'll see it starts from frame 100 and its just
02:14running at normal speed here. The reason why it's so slow is, because I've
02:19converted to Polygons. Be aware that once you converted to polygons your
02:24simulation times is going to be much, much, longer. We'll go ahead and let that calculate.
02:31Okay, our simulation has finished Caching and it's stored to disk and that means
02:35now that I can skip around in the timeline if I need to, and Maya is not
02:41actually calculated the simulation. Every time I go to a different frame it's
02:45simply loading that frame off of disk.
02:48Now loading the frame itself takes some time so it's not actually going to
02:51run in real-time even after it's been cached, but certainly it running faster than it did.
02:57Let's take a look at the Cache files themselves.
03:00I'll minimize Maya and go to my Project and look at the data folder, open that
03:05up and you'll see in the folder this says caching a fluid finished we've got a
03:11whole bunch of files. Each one of those files represents one frame, and
03:17because of the Density of my pond, these are fairly large in size; each one is
03:22one half of a megabyte.
03:23So that's going to be about 100 MB of data right there, let's find out.
03:27We'll right-click and go to Properties so 103 MB worth of data for that cache.
03:34Now this shot is actually ready to batch render and it will render predictably
03:38and we'll not have any problems.
03:41If I go back into Maya, I just want to mention that once we've cached we cannot change the simulation.
03:47In other words, for example altered my animation, or change the dynamic
03:52properties of the pond, that would not be reflected in the playback, because all
03:57of that information in the Pond has now been stored to disc.
04:01If I need to make changes to my animation or simulation I'll need to remove the cache.
04:06We'll just go back up in that menu and delete the Cache.
04:10I am not going to do at this time, because we have what we want.
Collapse this transcript
Smoothing pond polygons
00:01If you converted your pond to polygons, then you do have the option of smoothing
00:05those polygons and that will give you a softer more fluid look without
00:11increasing the base resolution of the fluid.
00:15Let's render this now with no smoothing for comparison. So in my perspective view,
00:20I've zoomed in really close so we can see the difference and I'll go-ahead do a render of that.
00:25Here is a rendering with no smoothing, and you can see that we got a little bit
00:30of jaggies in here; it's not too bad, but we can actually improve that without
00:35increasing the Mash Density on the original pond.
00:39I'll store that and I'll go ahead and just select the pondPolygons.
00:47I can use various methods to smooth it. Since I'm rendering in mental ray, I can
00:52actually just use Smooth Mesh Preview and that's simply pressing the 3 key on the keyboard.
00:58Now I do get this question that asks me, do you really want to do this, because
01:02you have got a high detail mesh already.
01:05Yes, I do want to continue with smooth meshed preview, so click Yes.
01:11You see here that it's kind of changed, it may not be better however, and
01:16the reason is that it's all built out triangles currently.
01:19Let's see what that looks like with the smoothing turned on.
01:22While that's rendering I'll go ahead and mention that if you are rendering in
01:29Maya software, then you won't be able to use the smooth mesh preview, the 3 key will not render.
01:35In that case you would use in mesh smooth node, you would just go to Polygons
01:39menu set and choose mesh smooth. But here in mental ray we can use a smooth mesh preview.
01:44All right! So that's what it looks like after it's been smoothed. Okay, so that's no
01:50smoothing and that's yes smoothing.
01:54So you could say that's better but we can actually even improve that more.
01:59What I'll do is all store that image so that somebody compar it to.
02:03With the object selected, I'll press 1 key and now we're just looking at raw polygons.
02:09Now what I'll do is all quadrangulate this polygon mesh, I'll go to the Polygons
02:16menu set and choose Mesh>Quadrangulate.
02:24The subdivision surface algorithm used by smooth mesh preview works better on quads.
02:29So you are just going to get better results if it's been converted to quadrilaterals
02:32or as close to quadrilaterals as we can get.
02:36You'll see there is poly quad node in there now.
02:39Okay, so let's do a render.
02:43So now this is what it looks like when it's quadrangulted, this is what it
02:49looks like when it's smoothed, and this is what looks like with nothing.
02:56Okay, so I'll go back to this version that has been quadrangulted and I'll store it,
03:01and then finally I'll the smoothing back on in my Pond, with it selectable
03:08press the 3 key, once again I get the Query are you sure you want to do this.
03:13Yes and now we'll do one more rendering.
03:18So for comparison this is quadrangulated and smoothed that's quadrangulated only
03:23that smoothed only, and that's with nothing, no effect applied.
03:30So let's skip over this, so this is with no effect, and that's after it's been
03:35quadranguled and smoothed.
03:37What it's done here is it's kind of amplified the ripples and made them better,
03:41so it's actually a better result.
03:44So once again here it is with no quadrangulation and no smoothing, and here it
03:49is after it's been quadrangulated and smoothed.
03:53On a final note once again as I was saying, if you need to render in Maya
03:58software then instead of hitting the 3 key for smooth mashed preview, you would
04:02drop a mesh smooth node on the object after it's been quadrangulated.
04:06Now since I'm rendering in mental ray in this case, I will need to do that.
04:11Here's the result after it's been rendered in mental ray with the
04:15quadrangulation and the smoothing, and it's also got a dielectric shader on it.
04:22That's how you work with Maya Ponds. It's a whole workflow for Ponds.
04:27There are some more features that we will apply to ponds such as making objects float.
04:31We will cover those in the next chapter having to do with ocean, because those
04:36features are common to both ponds and oceans.
Collapse this transcript
2. Open Ocean Effects
Creating an ocean
00:00In this chapter we will be looking at the Maya Ocean, which is a great tool for open water effects.
00:06So if you have got ships out at sea then the Maya ocean is a great tool.
00:11However it's not capable of reproducing crashing waves or surf.
00:16So if you've got a shot that includes a shoreline, then it's going to can be
00:20difficult or impossible for you to use the Maya Ocean in that case.
00:24So that means that you'll have to use other techniques, but you have got an
00:27open water effect then the Maya Ocean is an excellent choice and it's quite easy to use.
00:31In this exercise we're going to take the extra step of connecting the ocean to a camera.
00:37This will make it seem like the ocean is actually at the size of a real ocean.
00:42If the ocean is not connected to a camera, then it will actually have a boundary;
00:45you can actually move that camera so that you can sort of look over the edge of the Earth.
00:50If you connect it to a camera, then it'll always be scaled and rotated correctly
00:54to give the illusion of an ocean that extends all the way to the horizon.
00:59We can start by creating a camera; Create>Cameras and I'll use a Camera and Aim.
01:04It doesn't matter what type of camera you use,
01:07I just prefer the Camera and Aim, because I will not get a canted angle or a Dutch tilt
01:12accidentally with a Camera and Aim.
01:14So I'll use a Camera and Aim and it's created and there it is at the origin,
01:19here is the Camera and here's the aim point, tap the spacebar.
01:23I want to load that camera into a panel. I'm not using my side view here so will go
01:28Panels>Perspective>camera 1 and now I can use the Alt+left, Alt+right,
01:33and Alt+middle mouse buttons to sort of frame my shot.
01:36Additionally, if I want to I can also turn on the resolution gates, so I'll know
01:40where the borders of the frames are and I have currently got the panel toolbar hidden.
01:45Ctrl+Shift and we will hide or unhide the panel toolbar and here I can turn on the Resolution Gate.
01:52So we can see where the borders of the frame are, very good.
01:56I'll that panel toolbar back off again with Ctrl+Shift+M. Now I am ready to
02:01create the Ocean and in a perfect world what you would do is, you would select
02:06the camera viewport or maybe even maximize that view.
02:09When you create the ocean, Maya should connect the ocean to the camera.
02:14However what I've seen is that sometimes there was an issue with Maya attaching
02:18the ocean to your perspective view, and if that happens then we'll just have to
02:23make some minor modifications to an expression to connect it to the camera.
02:27Again in a perfect world you would just maximize that camera view and then go
02:31into the Dynamics menu set and choose Fluid Effects>Ocean>Create Ocean and go
02:38into the Options. You'll see there are two options here, Attached to Camera and Create Preview Plane.
02:42We can do those both at the same time actually.
02:47I will go ahead and click Create Ocean.
02:48Now to test to see if it's properly connected to the camera, what you do is
02:52you just navigate in the View. What you should see is the ocean sort of
02:56stays static in the view.
02:58Currently, I look at this and I know that this is not correct,
03:01so I'll need to make some adjustments.
03:03What we will do is, is will select the ocean itself, and that's this big nurbs
03:07circle here. With that selected in the Channel box, you'll see that some of
03:13those channels are highlighted in purple and that's indicator there's an expression there.
03:17I'll just select any one of those and go to the Edit menu here and choose
03:21Expressions, but we're not going to go deeply into the Expression Editor here,
03:25but what we can see is the perspective camera is being invoked in the first three lines of those.
03:30So I am just going to change that to camera 1 and that will fix the issue. If I
03:35want to see this is a little more clearly, I can just zoom in on the text a
03:39little bit by holding down the Ctrl key and using the mouse wheel.
03:43Okay, so everywhere says persp I just want to change that to camera1.
03:48So it's got to be camera1 no spaces all lower case.
03:59Okay, and then click Edit to update that, and now you'll see that if I move the
04:04camera around, let's say move left or right, or up and down, the Ocean plane
04:09sort of stays constant in the shot, and that way it'll feel like the ocean is
04:15actually almost infinitely large.
04:17Okay, let's do a quick renderer of that and there is the Maya Ocean with default parameters.
Collapse this transcript
Working with a preview plane
00:00The Maya ocean is actually in motion when you first create it. It's got waves
00:05that are actually flowing and if you rendered it right now you would see those waves moving.
00:09However, if you press Play in the viewport you can't see a motion on the ocean itself.
00:15But when I created the ocean I also created a preview plane and that's
00:19what this is here. Let's find it and you get it near the origin here, looking
00:25for the preview plane, so it's a very small little patch of ocean at the origin.
00:30That little plane there is the preview plane and it's not called a preview
00:33plane unfortunately it's called transform 1. I'm actually going to rename
00:37that because transform 1 is not a very helpful name. I'm going to call it preview or oceanPreview.
00:45If we get in close on that, if I press the F key and then press the 5 key to see shading,
00:51then when I press Play you can see there's some movement there.
00:55I have only got 24 frames in my timeline here, so let me extend that out. I'll set the
01:00end of the playback range to let's call it 20 seconds or 480 frames.
01:05Okay, so that is the preview plane and it is playing back at 24 frames a second, currently.
01:11If you're getting a difference playback speed, you want to verify that you've got
01:16the correct speed in your timeline, so you can right-click and choose Playback Speed
01:20and make sure that you've got a set to Play Every Frame, Max Real-time.
01:24Additionally and optionally, you can turn on the frame rate, Display>Heads Up
01:29Display>Frame Rate, so you see here we're getting some waves.
01:33Now if you want to change the size of the preview plane than we want to scale it.
01:38You'll see here in the Attributes in the Channel Box, Scale X and Scale Z
01:44are available for us to adjust. Scale Y is not and that's important, because you
01:50wouldn't want to scale the height of the preview plane; that would make it as if
01:54your waves were taller, so we only want to scale in X and Z.
02:00So if I need a larger preview plane I can select this and give this a value let
02:04say 50 and 50 then I can dolly back a little bit and I can see a larger patch of the ocean.
02:13Additionally, I can move it if I need to. I can just use the Move tool in that case.
02:18You'll see that Translate Y is grayed out meaning it's locked,
02:23so I cannot move the plane up or down, but I can move it X and Z.
02:27Additionally, we can change the quality of the preview. Since I've made it larger
02:31we're getting a sort of rougher approximation, because I've not changed the
02:36actual detail of the preview plane.
02:38If I go back to a wireframe view with a 4 key, you'll see that it's a very
02:42limited level of detail. I want to go into the preview plane attributes, Ctrl+A.
02:47You'll see here at the top, Resolution. That's the number of
02:53polygons on a side here and turn that up to let's say 70 or something like that.
03:00Now when I play this you'll see a much better approximation, it may start to run more slowly however.
03:06If I turn it all the way up to a 100, press Play, my frame rate is dropped down
03:11from 24 down to 20 frames a second, but that's a good trade because now we're
03:16getting a good idea of what this ocean is going to look like from the preview plane.
03:21Press the 5 key so we can see shading once again.
03:25Now we have got stage set, we can actually start adjusting the detail of the
03:31ocean share. We'll do a little quick render first just to see what it looks like.
Collapse this transcript
Customizing the Ocean shader
00:00The Maya Ocean is controlled by a custom material shader that only works with
00:06NURBS surfaces that are oriented so that they are flat relative to the world.
00:11In other words, they need to be planes that lie in the ZX plane of the world
00:18or the ground plane of the world.
00:20The ocean itself is a very large NURBS plane that's been stretched into a
00:24circular shape and it's got the ocean shader applied to it automatically.
00:29In fact, you could apply the ocean shader to any NURBS surface that's laying flat to the ground.
00:35Okay, let's play around with the Ocean Shader Attributes. But just so we get a
00:39little bit better realism, I'm going to just put a blue color in the background of my camera here.
00:45So with Camera 1 viewport active, I'll go to View>Select Camera and open up the
00:51attribute with Ctrl+A. Just go down into the Environment section and change the
00:55background color here. I'll do kind of periwinkle blue there, and let's
01:00render that and see what it looks like.
01:02Now I'm rendering this is in Maya software. I want to mention in passing that
01:05you can render it in mental ray, but it will look different, you need to decide
01:09in advance which render you want to use before you start to adjust the rendering
01:13attributes of this shader.
01:14This is what it looks like in Maya software. I'll save that image, switch over
01:18to mental ray and do another render so we can compare.
01:23It's much brighter and much more reflective in general.
01:27I actually prefer the look of the Maya software rendering that's what I'll be using in this lesson.
01:32So now we'll start playing around with the Ocean Shader itself. I want to select
01:37the Ocean in the viewport and then open up the Attributes, Ctrl+A if it's not
01:42already open. You want to find the Ocean Shader Node, so go to that tab and
01:46let's do an interactive production render while we adjust these attributes, so
01:50that they'll update in real time.
01:52In the Render View I'll click IPR. Maya will render the entire frame and then
01:59once it finished, select a region to begin tuning. I'll just drag a tall skinny
02:04rectangle that's representative of the ocean so we can see it at all distances.
02:10Back in the Attribute Editor let's start playing around with stuff.
02:13Well the most obvious thing is the Scale. As I increase the scale you'll see
02:17that it gets smaller, and as I reduce the scale you'll see that the texture on the Ocean gets larger.
02:25Set it back to Scale of 1.
02:28You've got the wave speed;
02:29we won't be able to see that if I change this.
02:32I mean, it'll change, but we won't be able to see the effect of the motion.
02:36So that's something you would need to test with an actual animated batch render, set that back to 1.
02:40Next, you'll see the number of frequencies, and this has to do with the detail
02:45and if I set the number of frequencies to a lower value, we will have less detail
02:50and it'll look like the ocean is smaller basically and if I set the
02:54number of frequencies down to 1, it's almost like a placid lake.
02:58If I increase the number of frequencies up to let's say 5, then I'm going to get
03:01more detail, set it back to the default of 3.
03:06Scrolling down a little bit more, we've got the Wave Height and so on, so this
03:10is a graph here that I can change.
03:12As I move this point on the graph, you will see that the waves become more extreme.
03:17You can bring that up or down to change the overall height of the waves.
03:20What I really want to do is change the shape of the waves and that's
03:25controlled through this Wave Peaking graph.
03:28If I bring this second point up higher, then we're going to get a sharper transition,
03:36this is going to cause the waves to be kind of sharper and stand up taller.
03:40I can actually add more points on this if I want.
03:42I can just click and then move that around and I'm trying to achieve the effect
03:49of a very sharp peaking wave.
03:52Let's do a full render of that.
03:54So now you can see my waves are peaking a lot more than they were.
03:59All right, what else have we got?
04:01We've got foam. Okay, we'll go back to IPR, let that render.
04:10Again, draw a rectangle and increase the Foam Emission, and as I bring that up
04:17you'll start to see little flecks of foam appear at the peaks of those waves.
04:23I can play around with all this stuff and have so much fun. I'll give you a
04:26chance to do that on your own. There are few things though I do want to point out.
04:30You've got the Refractive Index here and that's going to deal with how
04:35reflective it's going to be, the default is 1.3, scrolling down a little bit
04:40more you've got the Translucence.
04:42This is very helpful, because as you increase the translucence, it's going to
04:45make the ocean kind of glow from within.
04:50You've also got Specularity, so those are shiny highlights.
04:54It's easier to see those if you've got lighting in your scene. I currently don't have any
04:58lighting in my scene, but that's just the shiny highlights.
05:03And then finally down here you'll see Environment and this is fake reflections.
05:08Now the Maya Ocean can produce ray traced reflections, in other words, when I
05:14put a boat in here, it'll reflect the boat in the ocean, but it's not able to
05:18reflect for example, this background here.
05:20So what we see here are Environment colors and as I change these, you'll see we
05:25get different effects here to the reflectivity.
05:30So if I wanted those to be really white, shiny highlights then maybe I would set
05:35my Environment color to white here.
05:41Those are just a few of the fun attributes you can play with in the Maya Ocean Shader.
Collapse this transcript
Controlling render tessellation
00:00Sometimes when you render a Maya Ocean, especially if the camera is up close to
00:04the ocean surface, you will see the polygon structure of the ocean.
00:08You'll see a lot of straight lines and lack of detail.
00:11I'm going to show you how to improve that.
00:13Let's do a render of this Maya Ocean with just the default properties.
00:17You can see here that it's looking kind of flat and the closer you get in, the more obvious it is,
00:23say I dolly in right close here, do a render, you can see
00:28here, especially when we're up close, it doesn't look so nice.
00:31You're seeing straight lines and things like that, and that's because the NURB
00:35surface that makes up this ocean is being tessellated into polygonal triangles.
00:40That's happening behind the scenes, so we don't see that.
00:43But when it renders, we do see the end result of it, we see these little
00:47pyramids and little structures up here that don't look liquid at all.
00:50What we want to do is increase the render tessellation values in order to
00:54selectively displace this more intelligently.
00:58I'll store this image and minimize the Render View, and I want to select the ocean,
01:02not the preview plane, but the ocean itself and go to its Attributes, Ctrl+A,
01:06and you want to go to the nurbsSurface node here, so the oceanPlaneShape tab.
01:12You'll see there is a section that says Tessellation; that's just breaking
01:15the NURBS surface up into tiles, into triangles.
01:19Here are the default properties here, you'll see mode is set to Per Span
01:23number of Isoparms with a value of 10, that means for each one of these
01:28Isoparms, which are these green lines, it's going subdivide it 10 times in U
01:33and 10 times in V. That's not really very much, especially when we get up close on that.
01:38But we do have an ace in the hole here, there is a wonderful attribute down here
01:41called Use Min Screen; we turn that on.
01:45Now what this does is it makes sure that no polygon can be any larger than this value,
01:50which is a percentage of the screen width.
01:54Currently no polygon in the tessellated NURBS surface is allowed to be any
01:59larger than 14% of the screen width.
02:02I'm going to take this all the way down to its minimum value of 1% and
02:07that means that no polygon will be able to be larger than 1% of the screen width.
02:12Okay, we'll do another render of that.
02:16So here it is with min screen turned on and that's min screen turned off.
02:21Already we're starting to see an improvement. So that's with it off and on.
02:26We're seeing much more detail here, I'll store that image.
02:29Finally, if we want to really go all the way with this, what we could do is go
02:32back into our Tessellation settings and turn on Feature Displacement.
02:37I want to warn you that this could result in extremely long render times.
02:40Now what this is going to do is it's going to test the curvature of the surface
02:45and subdivide it smaller in the areas of higher curvature and I'll turn that on.
02:50There are two important attributes here, the Initial Sample Rate and the Extra Sample Rate.
02:56The Initial Sample Rate is how many times it's going to subdivide just by default.
03:00Extra Sample Rate is another layer of subdivision beyond the initial one.
03:06So if this divided six times, then this is going to divide another five times six or 30 times.
03:12This Extra Sample Rate is what causes the extremely long render times.
03:17I would recommend turning it down to 0 at first and then maybe creeping it up
03:21ever so slowly if necessary. Okay. So now what I have got?
03:24I've got min screen on with the Min Screen Value of 1, Feature Displacement on,
03:30and Extra Sample Rate turned down to 0.
03:34Go ahead and render that and even with an Extra Sample Rate of 0, it's going to
03:38take a while for that to render, so we'll have to give it a wait for a moment.
03:42So that's the result after we've enabled Feature Displacement; we don't see
03:45any straight lines anymore, and we're seeing nice smooth curves swells.
03:50I will go ahead and store that and then we can compare it to the other versions.
03:54This is the one with Feature Displacement and Min Screen,
03:59and this is the one with Min Screen Only and this is the one with Default Settings.
04:04So as you can see there's a huge difference between this one and this one.
04:08That's a very useful and helpful technique, especially if you need to do a close-up shot of the Maya Ocean.
Collapse this transcript
Floating objects
00:00The Maya Ocean renders as a displaced surface as we've seen, however, it's
00:05also dynamic and that means that we can float objects on the surface of the ocean,
00:10and the position and optionally rotation of the objects will be driven by the shape of the waves.
00:18Here I've got a scene with a Maya Ocean with default shader parameters.
00:23If I press play you can see we've got some moving waves here.
00:26I'm going to import an object that I can then float on the surface of the ocean.
00:31Go to the File menu and choose Import and scroll down a bit, you're looking for 02_05_jetski,
00:39select that, and then over in the Import options you might want
00:43to check the Namespace Option section, and make sure that Use namespace is on
00:48and the option down here labeled Merge is selected. That just means that Maya
00:53is going to import the file nodes and not change their names, go ahead and click Import.
01:00Now I've got a jetski in my scene, but it's very large relative to the ocean.
01:04If we go out to the top view, tap the spacebar, dolly back in the top view.
01:09You'll see that the jetski is actually larger than the entire ocean plane currently.
01:14Let's scale it down so it is at 1/100 scale. Select it and go over to Channel box,
01:20drag your mouse across the X, Y and Z scale values and type in .01m.
01:26Now it's at approximately the correct scale for the Ocean.
01:30Back to the Camera view, I'll tap the spacebar,
01:32press the 5 key, so we can see shading.
01:35Currently it's not dynamic. If I press Play
01:38we don't see any motion on the jetski itself.
01:40I'll select it and just move it up a little bit and then go into the menus and make it float.
01:46With the object selected, go into the Dynamics menu set and choose
01:49Fluid Effects>Ocean>Float Selected Objects, and then rewind and play back and you'll see that
01:58in fact it is floating on that surface dynamically.
02:02You'll note that a locator has been created, so the locator is a dummy object or a null.
02:08With that locator selected you can see in the Channel box that translate Y is in purple,
02:14that means it's got an incoming expression. That's what's driving the vertical position here.
02:19The other channels are all open and free for us to animate, so for example if I
02:23needed to move it forward I could select translate Z and middle mouse drag in
02:27the viewport here, just pull that forward closer to me.
02:30Translate X as well, I can move it but I can't move it in Y, because that's
02:34being controlled by the expression, play that through.
02:40If your object is too high or too low relative to the ocean, then you can move it relative to the locator.
02:47My object is simply just parented to that locator
02:50The locator is what's actually moving according to this expression.
02:53I can select the object itself and move it relative to the locator to move it up or down.
03:00So now it's not going to go below the ocean surface as much.
03:03Okay, so that's how you can make an object float and you can animate the position
03:08and rotation of the floating locator here.
03:11So I can select to Rotate tool and turn it in any direction I need it to be.
03:16This is the technique you'd want to use if in fact you are going to animate the
03:20rotations by hand with traditional key framing.
03:24Let's also look at how we can make an object float and have its rotations driven by the Ocean shader.
03:32Okay, so I'm going to delete these, I'll just select that locator and press delete
03:35and re-import my jetski; File>Import, select the file, import it, select it,
03:42set its scale down to 1/100th, .01.
03:49This time instead of using Float Selected Objects, I'm going to use Make Boats,
03:54with the object selected back in the Fluid Effects menu, Ocean>Make Boats.
04:02We also get a locator once again, but you'll notice that the Rotate X and
04:07Rotate Z Channels also have expressions in them now.
04:10I'll move it forward a little bit, translate Z, so we can see a little bit more clearly.
04:17Press Play, and now it's bobbing around according to the shape of the waves.
04:23I can still animate it in position X and position Z and I can still animate it
04:29in rotate Y to steer the boat in different directions.
Collapse this transcript
Adjusting attributes of a floating object
00:00Once you've made an object float or created a boat, you want to adjust the
00:04extra attributes of the locator in order to control its Scale, Buoyancy and other dynamic properties.
00:11If I press Play here now, you'll see that it bobs around quite a lot and feels
00:15as if it's almost a miniature jetski instead of a full size one.
00:19I'll select the locator and go to the Attribute Editor, Ctrl+A.
00:23In that locatorShape node open up the Extra Attribute section and here are all the
00:28goodies that will let you control the behavior of your boat.
00:31For example the Start Y value, if I rewind back to frame one, my boat is up in the air
00:37and it will just drop to the surface and rewind again, but if I set my
00:41Start Y to zero it'll already be floating on the surface on frame one.
00:48Also importantly, we've got the Scene Scale and a larger value will cause it
00:53to behave as if it were larger. I'll set the Scene Scale up at 10, and then play it.
01:00And you will see that it's moving more slowly.
01:02But for best result you should also set the Scene Scale for the Ocean Shader itself.
01:07Tou'll see the Ocean Shader tab is available here on the Attribute Editor.
01:11You can go there and set the Scale value to match that of your boat,
01:16set that to 10 as well, and that's going to make all of the waves larger in the scene.
01:22Now it's behaving more like an actual jetski on the surface of a full scale ocean.
01:28We can go back to our locator parameters and those Extra Attributes also include things like the Buoyancy.
01:34We can see this more clearly if we're actually playing in the scene
01:39or if we're using Interactive Playback. I can go to Solvers, Interactive Playback and
01:44then adjust the Buoyancy, in order to see what it does; so with a high Buoyancy
01:48its actually floating above the surface of the water and if I bring that
01:52Buoyancy down its about to sink.
01:54Value of .5 is default and that's usually accurate.
01:58You'll also see there are other things here like Start Rotation values, you'll
02:02see the Roll and Pitch attributes here as well, these control the amount of
02:06rotation that the ocean will impart to the floating boat.
02:10So that's how we can fine tune the behavior of a floating object.
Collapse this transcript
Creating motorboats
00:00If you create a boat on an ocean, then you can animate the position of the boat wherever you want it to go.
00:08But there's another way that you can drive the boat interactively, by creating a
00:13motor boat and that will be completely dynamic and it will also obey the laws of physics
00:18where it will turn and bank according to the shape of the waves.
00:23I'll select the boat and go into the Fluid Effects menu and choose, Ocean>Make Motor Boats.
00:35When I do that I get a locator just as before you can see it here.
00:40With that locator selected you can see in a channel box that all of the
00:44position and rotation channels are bring driven by expressions.
00:48I can't animate a motor boat in the traditional way by keying position and rotation
00:53channels here, but I can go in to the extra attributes and turn on the Throttle
00:58and Rudder and actually drive it through the scene.
01:02Go to Ctrl+A, Attributes, and that locatorShape node, in the Extra Attributes section
01:08down at the bottom you'll see Throttle and Rudder.
01:13All right, so we can drive our boat. Let's go into Interactive Playback mode,
01:18Solvers>Interactive Playback and increase the Throttle. There you go, we're
01:24driving our boat and I can turn the Rudder and make it go in different directions.
01:28We can see that in the top view here.
01:32So now it's actually driving in a circle. I can play around with that Rudder
01:38and make it turn in different directions.
01:46It goes straight. Additionally, I'll stop the playback.
01:51Additionally, we have Throttle Pitch and Turn Roll and this has to do it how much it's going to tilt.
01:58If the Throttle Pitch is up very high, then when the boat moves forward it's going to tilt upward.
02:07We'll need to actually play the simulation to see that happen, so with a
02:10Throttle Pitch of zero here in the side view and I set the Rudder value to zero as well.
02:18With no Throttle Pitch, when I press Play it just moves forward and it doesn't do anything special.
02:25Okay I go back to frame one a get a little bit more screen real estate here so you can see that.
02:31So just going straight forward, but if I increase the Throttle Pitch let's say
02:36turn it up all the way, then it's actually going to tilt upward as it drives forward,
02:43that's with a maximum Throttle Pitch.
02:47Likewise if you're turning, then you can increase the Turn Roll and that'll
02:53make the boat actually tilt as it goes around corners. We can see that in
02:58the front view here, if we actually give it a little bit of Rudder.
03:04I'll give it a little bit of a Rudder amount here with the Turn Roll turned up all
03:09the way and you'll see that it actually is turning according to the direction that it's moving.
03:26All right, so that's how we can control motor boats. Pretty exciting, pretty cool.
03:31If we want to actually animate this and create renderable animation from it,
03:36we would probably want to keyframe these values on appropriate frames.
03:40That's how motorboats work with Maya Oceans.
Collapse this transcript
Adding an ocean wake
00:00A boat moving on the water needs to generate a wake for it to be believable.
00:05To illustrate that, if I just play my simulation for a few seconds, I can render the camera view.
00:10Select the Camera View, click Render and you see that without a wake it doesn't
00:14even look like it's in the water.
00:17However, it's very easy to add the wake, you don't even need to select anything,
00:20just go to the Fluid Effects menu and choose Ocean>Create Wake,
00:24but you do need to go into the Options.
00:27The reason is the default value for Foam creation is 0, and if that value is 0,
00:31then no foam will be created, and you will not be able to add it later.
00:36That means, if you want Foam, which you basically always do, then you're going
00:40to need to increase this Foam creation value to some non-zero value.
00:44Let's give it a value about 5 and that's fine.
00:46Go ahead and click Create Ocean Wake, and what you get here is a Emitter.
00:50If we play the simulation, it's emitting density into a Maya Pond, and that's
00:54exactly what's going on here, it's a Maya Pond.
00:58Let's look at the Outliner, Window>Outliner. Now what you'll see here
01:02is three new nodes; of course, we've got the Emitter and then we've got a two FluidTexture nodes.
01:08A FluidTexture Node is basically a stripped down version of the fluidShape node,
01:12in which only some of the most relevant attributes are activated.
01:16The first one here is the Maya Pond and the second one is the Wake,
01:23so that's the white color we're seeing here.
01:25We should rename these, okay, so I'm going to double-click and call this one wakeFluid
01:30and the other one of double-click and I'll call that foamFluid, that way I will know what's what.
01:38Okay, so if I select that and go to the Attributes, Ctrl+A, then you'll see that
01:42it has all the familiar attributes that we saw from the Maya Pond.
01:46In order to see this more clearly, if we want to change for example, the resolution or the size,
01:51we probably want to go down into the Display section and boundary draw set to full.
01:56Now we can actually see the polygons of the pond itself.
02:00If we want to change the resolution, we need to keep the voxel's square,
02:04we want these to be perfect squares.
02:06So turn Keep Voxel Square on, and now you'll see if I change this and rewind
02:10back to frame1, we can see the effect of changing the base resolution. All right.
02:17Let's leave it at a 100 for now. Then of course you've got the size, and what
02:21you want to do really is have it be the optimal size for the area in which you
02:26need the wake to be created. Increase it just a little bit to like 30x30.
02:32I also want to move it back.
02:34But let's move both the wake and the foam together, so I have selected them both,
02:39and we just move them both back, so they're taking up basically the full frame.
02:46All right. Then the foamFluid also I want to increase its size, too.
02:52So I will set that to 30 and 30 as well, so it matches.
02:56Okay, since this is a Maya Pond, the techniques we learned in the last chapter will directly apply.
03:02What I want to do is just select that Emitter and then conform it to the shape of the boat.
03:07I'll move it over there, get in closer and scale it so it's a little bit smaller than the boat itself.
03:13And in the front view I'll scale it in Y, maybe position it up a little bit,
03:20scale it so that it's just a little bit smaller than that jetski, and then link it to a locator.
03:27So I'll select that Emitter, and then Shift+Select the Locator, and press P to create the parent link.
03:34Now that we've got our basic parameters, we don't really need to see the Pond Polygons again.
03:40We can go back in the Outliner, go to that wakeFluid, go back to
03:44its attributes and we can turn the boundary draw back to outline, that way we
03:50won't be distracted by that. Okay. So let's see what we get.
03:54Rewind and playback, and we've got a little bit of a wake happening.
03:59We can improve that in later movies.
04:02But at this point we've got our wake. We'll click render.
04:06We don't see much foam there. There is a little bit of foam there, but we're
04:10going to improve that look in a subsequent movie.
Collapse this transcript
Improving realism with Emit from Object
00:00For greater realism for an ocean or pond wake, we can emit from an object
00:05instead of the standard volume emitter that we see here.
00:09I'm going to select that volume emitter, maybe do that in the Outliner.
00:15It's a child of the Locator currently, but I am going to select that Wake Emitter and delete it.
00:20Now I'm actually going to make the jetski model create density and foam.
00:25To do that, I want to select the model and select the fluid, Ctrl+Click on that.
00:32I'll go up to Fluid Effects, and then choose Add Edit Contents>Emit From Object.
00:38Now the jetski model is actually going to be generating density into the pond.
00:45We can increase that, we can select the emitter now.
00:48There's a FluidEmitter that's now generating density, it's a child of the Mesh.
00:53Go to the Attributes and we can play around with a Density; if we give this a
00:57greater negative Density, then we'll see more effect to the wake.
01:01See what that looks like. So now I've got Density being emitted into the pond
01:08from the jetski model itself.
01:10Likewise we want to do that with the foam, too.
01:12I want to select the jetski model and the foamFluid container and once again go up to
01:18Fluid Effects>Add Edit Contents>Emit From Object.
01:22That's created a second emitter here. We could actually do this with
01:26one emitter, but it's just easier to do it with two in terms of using the menu structure in Maya.
01:31Here for this second emitter, we want to generate heat and that is what's going
01:35to create the foam; go to Ctrl+A, Attributes, and the Heat per Voxel per second value
01:40will need to be increased, so let's give that a value about 5.
01:45Now if play this back, we probably still won't see much in terms of foam.
01:50We're getting a little bit of foam, just a little bit; and if I render this,
01:54you might see a little bit of white foam there.
01:56What we need to do is just decrease the dissipation in the foamFluid shape node.
02:01It is creating foam, it's just fading out really quickly.
02:04I want to select the foamFluid and we need to go into
02:10Contents Details>Temperature. Open that up and what you'll see here is Dissipation and
02:18that's what causing the foam to fade out so quickly.
02:21I'm actually just going to turn the Dissipation completely off.
02:24Dissipation is the tendency of a property of the fluid, in this case the
02:28temperature to fade out over time.
02:32Diffusion is the tendency of that property to spread out over space.
02:37We want some amount of Diffusion, we do want to spread somewhat, but we don't
02:41need it to fade out, so no Dissipation.
02:43All right, rewind, close all the windows and play it back so we can see if we
02:48are getting foam now. There we go, so we're seeing a preview here in the
02:52viewport of what our foam might look like.
02:54Let's do a full render of that.
02:56We're seeing a little bit more foam, but I think if we just go back into the Emitter,
03:01we can increase that up.
03:03So go back to that second fluidEmitter, go to its Attributes, and just increase
03:09the Heat amount to let's say 10, and then playback the simulation.
03:17Now we're getting enough heat that the foam effect is visible in the rendering.
Collapse this transcript
Fine-tuning the look
00:00We have got the basics of our simulation working, but we need to spend a lot
00:04of time adjusting all the various attributes on different nodes in order to get a good result.
00:09For example, right now, when I just play that simulation and do a quick
00:13rendering, we got some issues here.
00:15First of all our wake is not very well defined. It's hardly even awake, and you
00:20know, we really need to have better results there.
00:22Also the foam isn't working the way we wanted to, the foam is actually swirling
00:27around and its sort of inheriting the velocity of the Emitter.
00:30We don't want that either; we need that foam to stay put on the surface of the
00:35water just like it would on a real ocean.
00:37Okay, so let's fix all those things up.
00:39The first thing we want to do is go into the locator and go to its attributes.
00:44In my tests, I discovered that the boat was kind of penetrating through the water a bit too much.
00:50And so I increased the Buoyancy to value of .8, and also brought the object
00:56height up a little bit that's just going to sort of bias the object up a little bit,
01:00so will set that to 1.2.
01:05And scrolling down little bit we also need to adjust the scene scale, that's a
01:10really important one. Because if we go to the Ocean Shader, you'll see that it's
01:15got a scale of 10; and the locator shape scale here should match that, so we will
01:21set that to a value of 10 as well.
01:23Now if I play this back we won't see a lot of change here now. What's really
01:27going to be most dramatic is when we increase the Resolution on the pond.
01:32All right. So we'll go back to the Outliner. We want to find the wakeFluid, that's the
01:39pond, and then we just we want to increased that base resolution.
01:42Now I am going to turn it up to 300. You may experience performance issues on
01:47your machine, if you have got a modest hardware; 300 is kind of a high-value here,
01:52but I need that in order to get the effect I want.
01:55Rewind and play that back and you'll see that my performance has gone down.
02:00The playback of the viewport is slower, but you can see that the wake appears to
02:05have a much better definition to it. o Do a quick render of that, you can see how
02:10much better that wake is now.
02:12We also want to adjust the Emission Density. Go back to my Outliner, and a child
02:17of the locator is that jetski object, and then it has children as well, these two Emitters.
02:24The first one here is actually the Pond wake emitter. I want to rename these, okay.
02:28So I am going to rename this one wakeEmitter and the second one here is the foam.
02:36I want to rename that, too, so I know which one is which.
02:42Okay, so the wakeEmitter controls, obviously, how much density is being admitted into that pond.
02:49Currently I have got a value of -5. I am going to reduce
02:53that negative value down to about -3, because I think these waves are bit too strident.
03:01Do a test render of that.
03:04So that's much better I think.
03:05Additionally we need to make some adjustments to the foamEmitter.
03:09Select that foamEmitter, go its attributes, and I need to increase the amount of heat
03:14being generated, because it's just not enough. Currently it's only a value of 10,
03:18so I am going to crank that up to 30, and that's going to produce a lot more foam.
03:23However that foam is kind of drifting and it's not staying put, its inheriting
03:28the velocity of the Emitter, and that's not very realistic at all. We need that
03:33foam to stay put on the surface of the water.
03:36To make that happen, we will go to the foamFuild attributes. In the Dynamic
03:42Simulation section here, there's a Damp factor. Damping in Dynamics is
03:47basically a chill out factor; it's a reduction in inheritance of velocity from the previous frame.
03:54If we have a positive Damp value, that's going to cause in this case the foam
03:58to stay put more on the surface of the water. We'll give that a Damp value of about 0.6.
04:06Rewind that and play that back and what we hope to see here is the foam kind of
04:10sticks to the surface and doesn't drift as much.
04:13Now we want to go down a little bit farther into the Contents Detail section.
04:19Under Temperature, previously we set the Dissipation down to 0, which means that
04:25it's not going to fade out over time.
04:28We got a very low Diffusion value of .08 and that is the default, but we do want
04:34some amount of diffusion. Let's do a render with the current settings.
04:38Keep that image and then I want to increase the Diffusion Amounts to let's say .5,
04:44and then replay the Simulation until it gets to approximately the same frame
04:54and then do another rendering with the Diffusion of 0.5.
05:00So that's the diffusion of 0.5 and that's the diffusion of almost 0,
05:05so that was .08, and that's .5.
05:07We're almost finished with our fine tuning. We just want to play around with the
05:12actual Texture properties here and make that look a bit more realistic.
05:16In the fluidShape node here and that fluidTexture node, we can keep scrolling down
05:20until we see the texture section. Here is where we can control the
05:26quality and the properties of that texture itself.
05:30Scroll down a little bit. The main one I want to adjust right away is the
05:34frequency, that's the scale of the texture.
05:36The higher frequencies would be smaller texture.
05:40So if I reduce the frequency I'll increase the size of the texture. Set that
05:45Frequency to 5. We want to store this image and then do another rendering.
05:50That's a texture frequency of 5, and that's a texture frequency of 10.
05:54So with the value 5, I have basically made the foam larger.
05:59Finally I want to increase the contrast here.
06:02I want that texture to have more influence over, in this case, the Opacity.
06:07Scrolling back up a little bit here you see Opacity texture gain is set to a low value here of .3.
06:14That means the texture is not having that much influence over the Opacity of the foam.
06:19We're going to increase that Opacity texture gain to 0.6, store the previous
06:25image into another rendering and there you go. We've got a much clearer foam texture here.
06:30That's the Opacity texture gain of .3 and that's Opacity texture gain of .6.
06:37Now we have got all of our fine tuning adjustments made and we can go ahead and cache the fluid before rendering it.
06:43Let me close some of these windows and I want to set my timeline here. Currently
06:48I have got 2000 frames to set my timeline to 240 frames or 10 seconds. Rewind,
06:55play that back and make sure that I've got what I want.
07:09All right. So I think we're good to go here. I have got about 10 seconds of simulation there.
07:13You want to re-render a couple of test renders in order to make sure that everything is working.
07:18But now we are ready to create our cache. We can select the wakeFluid and the
07:23foamFluid and we can go into fluid and cache create New Cache>Options.
07:29You'll need to reset the settings, because you may have some settings in there from before.
07:34Okay, so we've got a folder name and a Cache name and we're just going to render the time slider.
07:41I'll change my Cache name here to -- or the folder name rather -- to Finished, so I'll know that's the finished version of this exercise.
07:52Go ahead and click Create, and Simulation will play through once, and once that
07:57Cache is finished, you can go ahead and render it.
07:59Here is the rendered version of our ocean with a wake and as you can see,
08:04it looks pretty good. That concludes our chapter on open ocean effects.
Collapse this transcript
3. Rendering Underwater Scenes
Laying out the scene
00:01In our final chapter on creating fluid effects in Maya, we're going to look at underwater scenes.
00:07Here in this scene I've got a lot of scene elements. I've got a sky dome and
00:12clouds above the water. I've got the surface of the water. Below the water we
00:16have a fluid container to create a fog effect, and there are some paint effects for the kelp here.
00:23In the chapter we're only going to focus in on the fluid aspects of this scene.
00:29Let's take a look at the scene in Maya.
00:33Here I've created a whole bunch of scene elements, everything except for the water.
00:38There's a sky dome here, which is a large sphere. This is box is a 3D
00:43container which includes some clouds, and then I've got some paint effects kelp here as well.
00:50I won't be covering any of those techniques in this course.
00:54I covered them in a different course, which is Maya 2011: Creating Natural Environments.
01:00Here we're just going to focus in on the Maya fluids. Let's go ahead and create an ocean.
01:07In the Dynamics menu set, I'll go to Fluid Effects>Ocean>Create Ocean>Options.
01:16This time I'm not worried about attaching to the camera. I'm going to leave that off,
01:20but I'm going to make sure that Create preview plane is on.
01:24I know that is going to need to be a little bit larger, so I'll just go
01:28ahead and do that now, increase that Preview plane size to a value of 30.
01:32Go ahead and Create the Ocean. As you can see here in the perspective view,
01:37the ocean is just about the right size for the sky dome, in this case.
01:42If you look at our camera view, the preview plane is about the right size,
01:46so that we can get an idea of what our ripples are going to look like.
01:50We can play this, but it's going to be very, very slow to update because of these paint effects.
01:55So I'll just turn off the paint effects layer for a moment, just hide its
01:59visibility on this paint effects polygons layer, and then press play, and we can
02:03see that we're getting some ripples here on the ocean.
02:06All right, very good, it'll turn my paint effects back on again, and that's the basic layout of our scene.
Collapse this transcript
Building a shader network
00:01When rendering an underwater scene, we have to work a little bit harder on the
00:04ocean shader to make it look right.
00:07Water looks very different when you're inside it than it does when you're outside it.
00:12Let's take a look at just a rendering with the default parameters.
00:17I have already got one here in the Render view.
00:20So if we render this scene just as it is now, it looks like we're above the surface of the water,
00:25but the camera is turned upside down.
00:28We will make a lot of adjustments here and we're going to build a dielectric shader,
00:32which will be partially reflective.
00:36I'll go a head and select the oceanPlane and open of the Attribute Editor with Ctrl+A,
00:43go that oceanShader node and we're going to make a lot of adjustments here.
00:47First of all it's going to have no Diffuse color. I'll turn the Water Color and the Foam Color down,
00:53and all the color in the final rendering will come from reflections, and from transparency.
01:00Okay, so Water and Foam Color I have turned all the way down.
01:03Let's go download a little bit here you'll see Trough Shadowing.
01:07That's darkness in between the waves. I am going to turn that off as well, set that 0.
01:13Also Translucence, normally you want to increase the Translucence if you're
01:18above the surface of the water. Here once again because we're below the surface
01:22we've special consideration. So I want to set the Translucence to 0 in this case.
01:27Now we have got Specular Shading section here, that's the intensity and size of the Specular Highlights.
01:35What I want here is a slightly more specular effect. I'll set the Specularity amount to .9.
01:42I want to spread out a little bit, too, so the Eccentricity I'll increase to a value of 0.1.
01:47So now I am getting a little bit stronger and little bit larger specular highlight.
01:53Okay, now if we render this now it still won't look like much, because we don't
01:57really have any reflections and we don't really have opacity.
02:01So if we render it now it will be mostly black except for a few specular highlights.
02:06Okay, that's what it looks like with just those parameters changed.
02:10Basically, it's black. We're getting a little bit of reflection here that we can see.
02:14Let me go ahead and store that image so we can compare it to our next rendering.
02:19Let's build a Dielectric Shader. If you want to learn more about this
02:23I covered it also in more depth in another course, which is Creating Shader Networks in Maya in Mental Ray.
02:31Here we're just kind do a really kind of fast, accelerated version of that Dielectric Shader.
02:37Let's go into the Hypershade window, Window>Rendering Editors>Hypershade.
02:44Here in the Hypershade you'll see we actually have two oceanShaders;
02:48oceanShader 1 actually came with the scene file; that one is completed, and so if you want to
02:52take a look at that and compare it, you can do that.
02:56oceanShader 2 is the one that we're concerned with now, that's the one that we need to work on.
03:01I am going to go ahead and middle mouse, drag it over into the work area.
03:06What we want to do here to create a Dielectric Shader is we want the object to be
03:11more highly reflective on the edges, and more transparent in the center,
03:17or in the area that's pointed towards the camera. To do that we will create a couple of utility nodes.
03:23Over here in the Create section of the Hypershade let's go to Utilities and we
03:28want to create a sampler info node. That's going to find the facing ratio
03:35or whether a polygon is facing towards the camera or not.
03:39Let's find Sampler Info, go ahead and click that to create it.
03:43We also want to create a Utility node called Remap Value and here it is,
03:49Remap Value, click on that, and now I have created these.
03:54I want to take facing ratio of samplerInfo and connect it to the input value of remapValue.
03:59Right-click on the lower right-hand corner of the samplerInfo node and choose facingRatio,
04:07then left-click on the lower left-hand corner of the
04:10remapValue node and choose inputValue, and now that connection has been made.
04:15If I select the Remap Value node and have the Attribute Editor open
04:19you can see we've got two sections here, in each one of these is an output.
04:23The Value output is a single value and the Color output is a triple value;
04:28it's got a red, green, and blue, component. We want to connect the Value here to the
04:35reflectivity of the oceanShader.
04:38We want to connect the Color here to the Transparency of the oceanShader.
04:43I'll select the oceanShader and I want to find those two attributes.
04:48Here's reflectivity, okay and we also want to find the Transparency and that's going to be up here.
04:55All right. Maya is smart and it will know when you middle mouse drag and drop, it'll know
05:02whether to connect the single output or the triple output.
05:06Because transparency is a triple input, it will connect the triple output automatically.
05:12So I'll middle mouse drag and drop onto Transparency and I can hover my mouse
05:16over here and it says remap value out color is connected to oceanShader to Transparency.
05:21Now we can see we're getting a variable transparency here.
05:26Scroll down, we also want to middle mouse drag onto the Reflectivity.
05:31Now when we hover our mouse over this connection, you'll see there are two connections;
05:35remapValue2outcolor is connected to Transparency, and outValue is connected to Reflectivity.
05:42All right. Now we want to make some adjustments to the remapValue curves.
05:47I'll select that remapValue node and in the Attribute Editor I want to make some changes here.
05:52It's going to move these graph points around here.
05:56What we want is, is we wanted to be very highly reflective on the edges,
06:00and partially reflective in the faces that are pointed towards the camera,
06:05so that graph is going to look something like this.
06:08Now we have also got the Transparency and we want to be more opaque on the edges
06:13and more transparent in the center and that's what we're getting here now
06:17but I get want to make it more extreme by dragging these two points closer to one another.
06:24Okay, so let's do a render of that see what we get.
06:29All right. After this is finished rendering I want to keep the image in order to compare it to the other versions.
06:35Now as you can see here we're getting some transparency. I can see the sky and the clouds through the water.
06:42However, our reflections aren't quite working out just yet,
06:46but we will adjust that and fix it up in the following movie.
Collapse this transcript
Setting Refractive Index
00:01We created a dielectric shader and let's just take a look at that once again,
00:05open up the Render View, and the issue here is that the reflections are not strong enough.
00:12You can actually play around with trying to increase the reflection amount, but it won't actually do anything.
00:18What we need to do here is kind of tricky and unexpected.
00:21We need to adjust the Refractive Index in order to get our reflections here more strong.
00:28So I want to select the oceanShader. Go to its attributes, Ctrl+A. We want to
00:34scroll up here, we're looking for in the Common Material Attributes, the Refractive Index.
00:40It's set to approximately the correct value for water;
00:44that is, if we were above the water not below it.
00:48In this case, we want to actually change this Refractive Index to a fractional value.
00:54This is something you would do to get a metal look and it would also work in
00:58this case to give us a stronger reflection here.
01:02Okay, so with the Refractive Index of about 0.3, we'll go ahead and do another rendering.
01:10Okay, with a Fractional Refractive Index now we are getting a much better result to our reflections.
01:16We can also still see the clouds in the sky above the water.
01:20I'll go ahead and store that image.
01:24Now if we were to critique this now we would say that the reflections are too strong.
01:29Part of that is because of the lighting in the scene.
01:33I basically over-lit the seen in advance, because I know that once I add a fluid
01:38underwater to create fog, that's going to dim my lighting down quite a lot.
01:43The other reason why this is a bit too bright is because of the Environment settings.
01:49We're going to take a look at the environment color for the oceanShader in the next movie.
Collapse this transcript
Adjusting the environment color ramp
00:00We are nearly finished with our ocean shader for the underwater scene.
00:05Let's take a look at where we are so far. If I open up the Render View, here we
00:10have got some nice strong reflections, but they might be a bit too strong.
00:15What we can do is we can adjust the environment color ramp in the ocean shader to control the color
00:22of those specular highlights in those reflections.
00:26I'll select the ocean plane and go back to its attributes, Ctrl+A, and scroll down
00:33and just below the Specular Shading section you'll see Environment.
00:38This is the actual color that's reflected on the surface of the water.
00:44To see this most clearly, let's do an IPR rendering.
00:47Mental Ray is my current renderer, I am going to click on IPR and then just
00:52drag a rectangle around an area here, wait for that to render.
00:59So this red color is reflection from the oil drum underneath the water and the
01:06rest of all of this is from the environment color here.
01:11So if we change these, then that's going to change the look of the shot as you can see.
01:20Okay. What I want to do here is I want to actually set this flag here to a bright white color.
01:28This is going to produce a very extreme reflection, but that's
01:32actually what I want and I can go back into my Remap Value node that I created
01:38earlier and adjust the reflections.
01:41But let's just move these flags around a little bit here, too.
01:44Maybe I will make this more of a Cyan Hue, click on that, take that a little bit more towards Cyan.
01:52This blue here, maybe I will just bring that over a bit, so we can see a bit more of that.
02:00Let's do a different area of the rendering so just drag a rectangle here.
02:06Click IPR and we will drag the rectangle, just clear that one out.
02:09We'll start to see these little blue spots come up here.
02:14Okay, so now we can go back to our remapValue node, Window>Rendering Editors>Hypershade.
02:21Here is our oceanShader. We want to right-click and graph
02:28that network and here is the remapValue node. With it selected, and the attribute editor open,
02:35and IPR still enabled, we can move these flags around and see the results.
02:42As I reduce that point on the value graph, what's happening is that we are
02:48getting less reflection here in this area. We just kind of experiment and
02:55move this around until we get the result that we want.
03:01Perhaps that's too bright. We can kind of reduce the reflection amount.
03:05Of course we have also got the opacity here.
03:09As I change that, we will see the Opacity change.
03:14If I bring this flag all the way over to the right, that means we are going to have a lot less transparency.
03:20In other words, we will see more of the reflection and less of the sky above the water.
03:29This is just one of these things that you want to season to taste and
03:32experiment with until you get the look that you are going for.
03:39Let's try a full render of that.
03:42Okay, so that's how my rendering looks like. I will go ahead and store that
03:46image once again to compare it to the others.
03:48What we have done here is we have kind of evened out the reflection, so
03:52it's kind of more consistent, simply by moving these points around in the remap value node.
03:59Again, you want to experiment with this and use IPR in order to fine tune the look that you are going for.
Collapse this transcript
Creating a fluid for underwater fog
00:00Our rendering won't be very realistic if we don't add any fog to the underwater shot.
00:06Let's take a look at the rendering that made. As you see here that's not terribly believable.
00:11We need to add some fog here to make that feel like you know there's
00:16some murk and the objects in the distance will be darker and maybe bluer.
00:22Okay, to do that we will use a fluid container. We will go to the Dynamics
00:26menu set in Fluid Effects>Create 3D Container. It's built here at the origin and we need to size it up.
00:34So let's go to the Attribute Editor, Ctrl+A. I'll set the X size to 600 units,
00:40so it's just as wide as the SkyDome here.
00:45The Y size, which is the height, I'll set to 100 units and the Z size 600 as well.
00:52Now currently it's actually above and below the oceanPlane, as you can see here.
00:57We'll just need to move it down. Since this is a 100 units tall we can move it
01:02down to a Y-value of -50 and now it's ust right below that oceanPlane.
01:10Okay, so all of the work on this is actually shader work, because it's not in
01:15fact dynamic at all. There is not going to be any density or any other dynamic
01:20properties flowing through this fluid container, its just purely to be filled up with fog.
01:27That means, I can set these contents methods all off, so there is not going to be any dynamics.
01:32Scrolling down we want to open up the Shading Section, and you'll see you've got
01:38Transparency, Color and Incandescence.
01:41Okay, well for the Color we want that to be kind of deep blue, not a completely
01:46saturated blue but a little bit desaturated maybe the little bit less value.
01:53For the Incandescence we don't want to be Incandescent and currently it isn't really,
01:57because its input is temperature and there is no temperature, but just so
02:01I don't have these other colors here confusing me, I am just going to delete those.
02:06Really the Opacity is the most important attribute here, and currently its input
02:11is density, but there is no density, because it's not dynamic.
02:14What we want here is a Y gradient. It'll be thicker at the bottom and thinner at
02:21the top, as you can kind of see here. Basically we need to adjust these
02:26values in order to make it look right.
02:28But it's kind of hard to see that in the Camera View, we really need to do an
02:32interactive production render to make that clear.
02:35So I will go ahead and click on IPR and its rendered the wrong view, so I want to
02:40make sure I give focus to the Camera View and click IPR.
02:44Select the region to be in tuning, I'll select the representative area here that
02:49includes my little oil drum, wait for that to render.
02:55So you can see here, although it doesn't look quite we've very much density
02:59here and there in the viewport, in the render you can see that it's extremely dense.
03:05Okay, so I want to back to that fluid container, so I'm going too select it and
03:11then in the Attribute Editor start playing around with some these values.
03:14Most importantly is the Transparency. need to make that a lot more transparent
03:18like almost completely transparent in this case.
03:21So that's a really Transparent Fluid, too transparent, but we can also play
03:26around with this Opacity curve here. I can bring this point on the left
03:32upward so it'll be more opaque, cool.
03:37So that's starting look okay, we just want to make sure we eliminate this line here
03:41and that's kind of going away now, that line represents the boundary of the
03:47ocean itself and we just want to make sure we obscure that, cool.
03:50So we just play around with these 2 points on here to control the Gradient or
03:56how it transitions from a more dense area at the bottom to a less dense area up at the top.
04:03All right, maybe a little bit more Transparency we just want to just find the sweet spot
04:09here until it looks good.
04:10I think that's almost there we are very, very close, maybe I will just move
04:14this Opacity point up a little bit here, because remember we want to obscure
04:19that line so we don't see it.
04:21Okay, so I think I'm pretty good here actually to do a full rendering, go ahead and click Render.
04:29Okay, with those settings we still don't quite have what we need here, so I just
04:33what to give it a little bit more adjustment here. We will go back to IPR mode,
04:40drag a rectangle around that, and play around once again with the Transparency.
04:45We want it to be a little bit less transparent, more opaque.
04:49We can also change the color itself, too.
04:53Change that Color many make it darker, cool. All right. I think we're in a good place here now.
05:06Those settings are very sensitive and changing any one of those fluidShape
05:12Shading attributes just a little bit, may have a very profound effect on your rendering.
05:18So you will need to spend quite bit of time experimenting with those,
05:22especially with IPR, so that you can get the exact look that you are going for.
05:27There we go, we have got some fluidFog, now it doesn't look quite the same as
05:31the image that we saw the beginning of this chapter, but that's because as I
05:36said all these settings are very, very sensitive.
05:38And so you really need to devote more time than we have here in order to tweak
05:42it out and make it look exactly perfect.
05:45But I'll include the scene file of the other version so that you can analyze it.
05:50That then concludes our chapter on rendering underwater scenes and that also
05:55closes out our course in Creating Fluid Effects in Maya.
Collapse this transcript
Conclusion
Next steps
00:00As we've seen, Maya's Pond and Ocean are powerful tools for simulating the surfaces of liquids.
00:07The visual effects techniques I have demonstrated here have been employed in countless productions.
00:12To further your skill-set in Maya I invite you to browse the other training courses hosted here at lynda.com.
00:18I hope you've enjoyed this course, covering the Maya Ocean and Pond tools.
00:22Thanks and goodbye.
Collapse this transcript


Suggested courses to watch next:

Creating Simulations in Maya Dynamics (2h 11m)
Aaron F. Ross

Maya Essentials 5: Animation Tools (1h 20m)
George Maestri


Liquid Simulation in Maya (2h 31m)
Aaron F. Ross


Are you sure you want to delete this bookmark?

cancel

Bookmark this Tutorial

Name

Description

{0} characters left

Tags

Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading
cancel

bookmark this course

{0} characters left Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading

Error:

go to playlists »

Create new playlist

name:
description:
save cancel

You must be a lynda.com member to watch this video.

Every course in the lynda.com library contains free videos that let you assess the quality of our tutorials before you subscribe—just click on the blue links to watch them. Become a member to access all 104,069 instructional videos.

get started learn more

If you are already an active lynda.com member, please log in to access the lynda.com library.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Access to lynda.com videos

Your organization has a limited access membership to the lynda.com library that allows access to only a specific, limited selection of courses.

You don't have access to this video.

You're logged in as an account administrator, but your membership is not active.

Contact a Training Solutions Advisor at 1 (888) 335-9632.

How to access this video.

If this course is one of your five classes, then your class currently isn't in session.

If you want to watch this video and it is not part of your class, upgrade your membership for unlimited access to the full library of 2,025 courses anytime, anywhere.

learn more upgrade

You can always watch the free content included in every course.

Questions? Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com.

You don't have access to this video.

You're logged in as an account administrator, but your membership is no longer active. You can still access reports and account information.

To reactivate your account, contact a Training Solutions Advisor at 1 1 (888) 335-9632.

Need help accessing this video?

You can't access this video from your master administrator account.

Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com for help accessing this video.

preview image of new course page

Try our new course pages

Explore our redesigned course pages, and tell us about your experience.

If you want to switch back to the old view, change your site preferences from the my account menu.

Try the new pages No, thanks

site feedback

Thanks for signing up.

We’ll send you a confirmation email shortly.


By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked