Project 6a: Effects and Compositing

Goal We are going to learn how to create dynamic effects using particles and fluids. The end result will be a fully composited and rendered animation of a burning log complete with roaring flames and sparking embers.

This project will be broken into three phases:


Phase I: Particles

Particles represent tiny objects such as snow, dust, or sparks. Since there can be sometimes hundreds or thousands of these particles, it is infeasible to animate them by hand. Instead you create a procedural animation for them by setting up some basic rules and behaviours and the particles animate themselves according to these constraints. This phase will walk you through setting up a simple particle system that simulates sparks. You will want to be in the nParticles Menu Set for this assignment.

  1. The first step in setting up a particle system is to create a particle emitter. In the nDynamics menu set go to nParticles → Create nParticles → Create Emitter (Options). We will need to adjust several of the emitter's attributes. This can be done before creation or afterward through the Attribute Editor.

    Call the new emitter sparksEmitter. Since we want our sparks to come from a log, set the Emitter type to Volume and the Volume shape to Cylinder. Rotate and scale the new volume emitter until it resembles a log. If you hit Play, you should see particles being emitted in all directions.

    Increase the frames in your Time Slider to 300. Going back to frame 0 will reset the particle simulation back to its initial state.

    By default Maya will try to play your effect in real-time. If it can not keep up with the computation required to simulate your effect, then it will cut some corners to make up time. This generally not what you want and can be especially problematic with fluids. To make sure Maya calculates every frame right click the timeline and go to Playback Speed → Play every frame, Max Real-time.

  2. Select the emitter and go to the Attribute Editor. Under Basic Emitter Attributes, change the Rate to 25. Under Basic Emission Speed Attributes, change Speed Random to 3.

  3. In the attributes of the nParticleShape, under Lifespan Attributes, change Lifespan Mode to Random range, Lifespan to 2, and Lifespan Random to 0.5. This means that every particle will last for anywhere from 1.5 to 2.5 sec.

  4. At the moment, the particles are emitted in all directions and travel in a straight line. We can affect the trajectory of a particle after it has been emitted by creating fields that are linked to the particles. Fields act as forces that affect the particles in a certain way, such as being pulled down by gravity..

    Fields can be linked to particles when they are created by selecting the particles before creating the field. With the particles selected (you can select the particles by clicking on the nParticle1 object in the Outliner) create an Air and a Turbulence field from the Fields menu and make sure they are linked to the particles. The default settings for the Air field should be sufficient, but change the Magnitude of the Turbulence field to 25.

  5. You may have noticed that the particles currently render as blue spheres. The first step to fixing that is to go to the attributes of the nParticleShape. Under Shading, change Particle Render Type to Tube (s/w).  Set Radius 0 and 1 to 0.03 and Tail Size to 2. This should make the particles look like below.

  6. To change the appearance of the nParticles, adjust the settings in the Opacity Scale, Color, and Incandescence sections as seen in the diagram below.  Remember to change the Input drop down menus to Age and the Input Max value to 2.5.  This input causes the shading to change with the particle’s age, with a maximum age of 2.5 seconds.  These shading settings simulate the spark cooling as it travels through the air, eventually turning to ash and disappearing.

  7. Now it's time to make the particles glow.  Go into the nParticle1's Material Attributes. You can access this by selecting the nParticle, right clicking on it on the main screen, and selecting "Material Attributes" from the menu - you will open a node called "npCloudBlinn". Navigate to the nParticleCloudSE node. Rename the shadingEngine named nParticleCloudSE to sparks_shader.  Doing this allows you to change how you shade different particles sets in the scene.  Now go into the npCloudVolume tab and change the Glow Intensity to 0.3.

  8. If you render your particles, they should look like those in the image below.

    As a finishing step, you will need to do a little Outliner cleanup. Group your fields and name the group "fields". Group your particles and name the group "particles". Group those groups together and name it "sparkFX".

  9. Save your file as [lastname]_[firstname]_effects_p1.ma

Phase II: Fluids

When you think of the word fluids, you probably imagine an effect that creates the splashing of water. In Maya Fluids refers to fluid dynamics, which deals with the interaction of fluids of similar density such as fire and air, smoke and air, or ink and water. Fluids can create very convincing effects, but as always, there is a performance tradeoff. Fluids are expensive to set up and expensive to render. In this phase we will walk you through creating a simple fire.

A large battle during a production, especially with effects, is finding ways to reduce your build time. We are going to use a little shortcut that will allow us to create a fire effect that would likely take several hours to build from scratch.

  1. In the same file from Phase I, using the Dynamics menu set, go to Fluid Effects → Get Fluid Example.... This will load the Maya Visor where we can select from a range of premade effects. These examples work well as a starting point to achieve some fairly complex effects. Choose Fire, select the TurbulentFlame.ma icon, Middle mouse click and drag the icon to your viewport.
  2. Unlike particles, fluids are contained in boxes (containers) which they cannot escape. The insides of these containers are divided into a set of "voxels" - points in space at which the various properties of the fluid are calculated. Increasing the resolution results in a higher fidelity image, but also takes longer to calculate and consumes more memory.

    The first step will create a fluid container (Flame) with a fluidEmitter attached to a nurbs torus. Don't worry about all this junk, we only want the emitter settings and the fluid container. This is where some trickery comes into the mix. We want to 'steal' the emitter settings from fluidEmitter and apply them to a new one we are about to create. In your Outliner, underneath the nurbsTorus, select the fluidEmitter and open the attribute editor. Select Presets → Save fluidEmitter preset.... Name it something like flame_preset.

  3. Now that we have our preset made, we can delete everything EXCEPT the fluid container (Flame) and your SparkFX group. Move and scale the fluid container so it snugly fits the sparksEmitter like the image below.
  4. Create a polygon cylinder and name it log. Rotate, move, and scale your log so it fits inside your sparksEmitter. Shape it like in the image below.

  5. Now we are going to create our own fire emitter. First select your log, THEN shift+select the fluid container. In the Dynamics menu set, go to Fluid Effects → Add/Edit Contents → Emit from object (options). Name the emitter logFlame_emitter and make sure the emitter type is set to surface. Click Apply and close. Select the emitter, and then in the attribute editor apply your created preset.

  6. At this point go ahead and hit 6, rewind and play the timeline. You should see Maya's attempt to preview what your fire is looking like. Find a spot that you like and take a quick render to see how we are doing. If all goes well you should have something that looks like the image below.

  7. You should now change the initial state of your sparks and your fire to make your fire is going strong from the beginning. For the fire go to the Dynamics menu set, then Fluid Effects →Set Initial State.  For the sparks go to the nDynamics menu set, then nSolver → Initial State → Set to Current.
  8. Apply a bark shader to your log. You can use this bark texture or find/create another one.

     

  9. Save your file as [lastname]_[firstname]_effects_p2.ma

Phase III: Compositing

A large part of creating successful effects is understanding the power and importance of setting your Maya file up in render layers so you can take advantage of layered compositing tricks in a post production program such as After Effects. In this phase we will prep your scene for layered rendering on the farm and finally import your renders into AfterEffects for final compositing and rendering.

  1. First, let's take a moment to clean up your Outliner again. Group your Flame container, log, and logFlame_emitter into a group named "fire". Name anything that you have overlooked and let’s get going. When preparing for final render it is often useful (especially for effects) to set up render layers in your scene. Open the Channel Box/Layer Editor. At the bottom of the panel are 3 tabs: Display, Render, and Anim. Click the render tab.

    The masterLayer contains all the elements of your scene. This is what renders by default. We want to split our scene up into 3 layers: A sparks layer, a log layer, and a fire layer.

  2. To begin, click the sparkFX group and your log in your outliner. With these, look at your render layers panel, click Layers → Create Layer from Selected. This will create a new render layer for our sparks. Name this render layer by double clicking on the name and type in sparks_RL. Next select everything under your fire group. (Layers → Create Layer from Selected) rename the layer to fire_RL. Now create a render layer just for your log and name it log_RL.

    Click through your newly created render layers and make sure that the correct objects are indeed on their proper render layer. Make sure your render layers are enabled (a little green check next to the name). Your Master Layer should be disabled (marked by a red x). Your render layer panel should look like the image below.

  3. You may have noticed that the log is in all of the render layers.  This is on purpose.  We want to make the log block out objects that are behind it without being visible in the final render.

    To do this we apply a "black hole" shader.  Right click on the log while you have the fire_RL selected and go to Assign New Material….  Select surface shader from the menu and press ok.  In the material attributes, set the Out Color to black and rename the shader black_hole.  Now assign the same material to the log while you have the sparks_RL selected.
  4. Time to Render! Double check your render settings: naming convention, quality settings, frame padding, file format, etc. Open the render settings and use the following settings:

    • Render Using: mental ray
    • File name prefix: shot_100
    • Image Format: PNG
    • Frame/Animation ext: name_#.ext
    • Frame padding: 4
    • Start frame: 1
    • End frame: 120
    • Renderable Camera: render_cam (You will have to set this up.)
    • Width: 640
    • Height: 360
    • Enable Default Light: Check
      NOTE: The default light needs to be on in order to see the log geometry during final render.
    • In the Render Setting window go to Presets → Load Preset → Production.

    You will also want to set up a project as the target location for your renders:

    1. Go to File → Project Window and hit New
    2. In Current Project: type renders.
    3. Under Location: Set the path to //ntdfs/cs/unix/projects/instr/capstone2/cse458_au14_student_files/[student_folder]/project_6
    4. Delete all the Primary Project Location fields except for Images (where your renders go) and Disk Cache (where all saved particle/fluid/cloth caches go).
    5. Hit Accept. Do make a new file for this in your student files called project_7.

    Once you have all of your render settings set up go to the Rendering menu on the top left. Then go to Render → Batch Render (options). Hit Batch render and close. In the bottom right of the Maya interface (where it tells you when you have errors), Maya will tell you what percentage of a current frame it has rendered. If you click to the right of this box, you will find the Script Editor. You can watch the Script Editor for any errors too. It will tell you which frame it's rendering, as well as the percentage.

    Do this for the three render layers you made. You do NOT need to render your master layer nor do you need to render more than one frame of the log. Once your render has begun you should be able to see folders created in your project directory, usually under images. These folders will have the same name as your render layers.

    Time to grab some coffee and wait for your renders to finish!

  5. Once your render is complete the next step is to import the resulting image sequences into After Effects CS6 for compositing. Remember to name your sequences so you know what you are working with!

    Click and drag one image sequence down to the "Create a new composition" button. Add in the remaining sequences, create a black solid (by going to Layer > New > Solid... and picking black from the color selection), and Layer your composition like the image below.

    You will also need to select your "fire" and "sparks" layer (really make sure to rename them! Always rename your image sequences, you will thank yourself for this later) and with those layers, right click on them, and go to Blending Mode > Add. This will blend out the black-holed log. You may see that your sparks are very faint at this point: feel free to go back in to your Maya file and tweak your settings to make them more visible, by changing color, size, or glow. If you re-render your sparks with the same settings, the new renders should overwrite your old ones, and you can right click your image sequence in After Effects and hit "Reload Footage" to see the new sparks.

  6. Change your composition settings to match your render settings.  The settings are located in Composition → Composition Settings.  Your settings should match those in the image below.

  7. In the project section of your AfterEffects project, right click on the fire images and go to Interpret Footage → Main.  In the dialog box set Alpha to Ignore and Frame Rate to 24 Frames per Second.  Repeat this step for the sparks images.

  8. In the composition section, right click on the fire images and go to Blending Mode → Screen. Repeat for the sparks images.
  9. At this point you can (if you want) start some final spit and polish such as color correction, added effects, layer blending etc. Fire up a render and you should have a nice animation of a roaring fire!

    Save your final "render layer ready" Maya file ([lastname]_[firstname]_effects_p3.ma), your AfterEffects file, and a .mov of your final fire animation.

Turn In You will be graded on the following: Turn the following into Collect-It on Catalyst: