The Wind-Up Cow Tutorial
Introduction to computer animation using Maya

Part 5. Rendering

Lighting:

Before we actually render the cow animation we will need to add some lights to our scene.   Maya now adds a default light to a scene automatically when you render, but it is very basic and you will probably want more sophisticated lighting  for your final render.

There are Four types of lights in Maya, they are simply defined:

AMBIENT:
Shines everywhere uniformly, from all directions.   It can be positioned anywhere in a scene and it will look the same.

DIRECTIONAL:
Shines in one particular direction (indicated by the arrow icons which represent the light), much like sunlight.  While the direction the arrows are pointing are significant it does not matter where you place this light in the scene.  It has an all-over effect.

POINT:
Shines from a particular location out in all directions evenly (like a light bulb).

SPOT:
Shines from a particular location but only in a given direction.

(There are also AREA and VOLUME lights which we will discuss in class)

All you really need in this project is enough illumination to see your scene.   You may opt to use the 3 spotlight set up we discussed in class, or experiment with other lights but for this tutorial are going to use only an ambient and a directional light.

Switch to the Rendering Menu.

Press (Lights> Create Ambient Light)

In a 2-view layout open a perpective view on one window and the render view in the other.  to get this set up first, in any view hold the left mouse over Panel and select Layout> 2 side by side.  You should have only 2 windows now, in the left one under Panel select perspective> persp.  In the other it should be Panel > panel> Render View.  In the perspective window, be sure you are in smooth mode, (3) have textures displayed, (6) and are showing only surfaces and lights. Also in the perspective window, under Lighting select "Use All Lights".  this will give you somewhat of a preview of the lighting you are working on.  Arrange a good view of you cow scene in the perspective window and then, in the Render View window press (IPR> IPR Render> Current(persp).  When the first render is complete, draw a box on the region you want to update with each change you make. (You may remember we did IPR renders when we textured the cow.)

Locate the small red star-shaped icon which represents the ambiant light in your scene (it should be at the origin) and select it.  Open the attribute editor for the ambient light (cntrl a) or press (window> attribute editor). You should modify only the intensity and color, and the changes can be viewed in the IPR view window.  You can add a subtle color to a light for a nice effect.  Clicking in the color sample square opens the color chooser just like in the multilister.  This actually is enough light for a render, but it has a rather flat look since the light is exactly the same all over.  Next add a directional light (Lights> Create Directional Light). The icon for this light is a little bunch of arrows.  Select the directional light and using the rotate tool change the arrow direction.  In the attribute editor for the directional light, you can also modify the intensity and color.  since a directional light is going to give you some shadows your character will seem to have more depth.  If the shadows are too dark, you can lighten them with the slider next to shadow color.  Manipulate these atrributes for your two lights, keeping an eye on the IPR render until you are happy with the results.   The light should stay constant throughout your animation since the location of both directional and ambient lights make no difference.

Render Globals:

Now let's set up the render.   Press (Winow> Render Globals) enter the following attributes:

*NOTE: you need to set up your render globals this way in order to have files which you will be able to playback using Fcheck, and eventually output to videotape, whch is the preferred industry standard for demo reels. To Render a Qucktime movie to play on a computer and to turn in on a CD as your final projects see the last part of this tutorial.


Render Globals

Under the "Common" tab:

Image file output>


File Name Prefix: each frame of you animation is a separate image file.  Fill in a name here which will be the first part of the name of each frame.
Frame/animation ext: name.#.ext Please use exactly this format for your renders - it means the first part of each frame image is name, then the frame number, then the format type extension.
Start/EndFrame:  start at frame 1 and end at frame 300
By Frame:  1 here means you will render every frame
Frame Padding: set to 4 digits (this will give you a file name like: name.0001.tif) PLEASE AVOID USING 3 DIGITS.  Use only 1 or 4
Image Format: use Targa or Tif
Channels:  The RGB channel is the color channel, you must render this to see your scene, the Alpha channel will create a mask around your geometry which allows  you to composite the animation later, if you want.

Resolution>

Presets: CCIR601/Quantel NTSC 720X486 (refers to number of pixels) for a much better resolution than we have been using for test renders in class. This format is considered "broadcast quality"
Device Aspect Ratio: 1.33 and Pixel Aspect Ration: .898 - both part of the NTSC preset and should appear when you have it chosen

Under the "Maya Software" tab:
Antialiasing Quality: Presets> Production Quality and Edge Antialiasing > Highest Quality

You are now ready to render.

*NOTE You can render in one of two ways with Maya, using the Maya interface (called batch rendering) or using a DOS command line. While batch rendering works fine and is easy to navigate, I would encourage you to learn and use the command line rendering method. Command line rendering is much more versatile and provides a more detailed feedback as you render. It is also faster than batch rendering. It also allows you to render to the local drives without having to relocate you entire project.

****You should complete this class with two versions of your animation. A version on videotape, and one on CD (actually two on CDs since you will be turning one in to me!)*****

Maya Batch Rendering:

So that you may see what is happening during a render, open the script editor.  (Window> General Editor> Script Editor).  In the script editor window, press edit> clear history to give you a cleared viewing area.

Now press (Render> Save Batch Render).  Maya creates a new .mb file for a batch render so type in a new name.  Press the Save/Render button and the render information should shortly begin to appear in the script editor.  The script editor will indicate the progress of the render, frame by frame.  As soon as a few frames are completed, you may take a peek.  Press (Render> Show Batch Render) and an image should appear.  This actually just snatches whatever frame is in progress and shows it to you as is.  Do not be alarmed if it does not seem complete.  Close the image view window.  Once the render is complete the script editor should indicate Maya rendering completed. Your rendered images are stored in the images folder of your current project.

You can cancel a render at any time by pressing (Render> Cancel Batch Render).

Command Line Rendering:

Using the same Render Global set up as in batch rendering you can opt to use a DOS command line format to perform the actual render

To open a cammand window in Windows (Windows 200 or XP) click "Start" on you Windows menu and "Run". Type "cmd" in the space and click OK. This window should appear:

This is the DOS command window. We are going to enter the render information through this window. First you will need to navigate to the folder where your project is located. It should be on the Z drive for CADA students in my classes. To change drives simply type Z: and hit enter. The two command you will need to navigate to the scenes directory of your projects are "cd" for change directory, and "dir" to show the files in the directory. Using these commands navigate to the the scenes directory of the project where your cow animation is located. For instance, if my project were called "WindupCow" and it was at Z:staaffe I would go to the Z directory and type

cd staaffe/maya/projects/WindupCow/scenes

Once there I would type "dir" to make certain that the Maya scene file (the .mb file) I need is there.

There are a few commands (flags) for rendering which you will need to know.

Render = render

-s = start at frame #

-e = end at frame #

-cam = camera name (I usually include this flag to be certain that I render the correct camera, although I probably indictaed the camera already in Render Globals, this ensures that the right camera renders. Maya will render the perspective window by default if no camera is selected in Render Globals)

-rd =remote directory - For CADA students, Since your Maya projects are on the Z drive, which is the network for the whole department you will want to direct you renders to one of the local drives on you computer. Each work station should have two local drives available (ususally D and E). You should create a folder on one of these drives. The -rd flag will direct Maya to store the renders in that folder rather than the images folder of your project.

So lets say I have created a folder on E called TaaffeCows, and I have navigated to Z:staaffe/maya/projects/WinupCow/scenes in the DOS window. I would type the following command line to render my FinalCow.mb file:

Render -s 1 -e 300 -cam camera1 -rd E:TaaffeCows FinalCow.mb

Thus I am rendering the scene Final Cow.mb from frame 1 to frame 300 using camera 1. The images will be directed to the folder TaafffeCows on my local E drive

(There are many many more flags which you can take a look at by typing Render -h)

Viewing The Rendered Animation:

Well that is it - you should now have a fully rendered animation, and I suppose you must want to see it.   What you have actually created is a large number of individual image files numbered sequentially.  Maya has a utility called "Fcheck" which is used to view series of images as animation.  

There should be a shortcut to Fcheck on your desktop.

(If there is not one there you can create one by locating the fcheck.exe file on your system (should be at C:/AliasWavefront/Maya5/bin), right clicking on it and choosing "create shortcut".)

Start Fcheck. You can view a simgle frame by clicking "open image" and selecting a frame. You can view the entire animation by clicking "open animation" and selecting the first frame. (imagename.0001.tif).  It will display the entire sequence.  (It goes through it the first time slowly as it retrieves the frames, then it should play more smoothly.) You may find that your animation will not play back in real time using Fcheck. The resolution of 720x486 may be too large for your processors to play efficiently. When you "open animation" you can choose a shrink factor of 2 to view a half size version which will be more likely to play back in real time.

NOTE: If you want to save you animation onto videotape, bring a blank tape to class and a lab aid can assist you in copying you animation to tape. (animations which will be copied to tape should have the 720x486 resolution discussed above)

QUICKTIME MOVIES

You will also need to create a Quicktime version of your animation. This is a lower resolution single .avi file which can be played on you computer. This is also the version which you will burn onto a CD and turn in to me as your final project.

To render the quicktime version you need to change some details in the Render Globals. First you will change the image format to AVI, which will automatically change the Frame/Animation Ext to name.ext (Single Frame). You also need to change the resolution to 320x240. This resolution is typical of Quicktime movies playable fron CDs or on a computer.

Now you can render the Quicktime in either Maya batch mode or as a command line render. All of the commands remain the same as they were for the full resolution renders above.

NOTE: Do Not make a 720x486 quicktime. It will essentially be useless. It will be to heavy to play well on most computers and it is not a good format for transferring to videotape.

*****You should complete this class with two versions of your animation. A version on videotape, and one on CD (actually two on CDs since you will be turning one in to me!)*****

Ta Da !

You have successfully created your first 3D animated film! Congratulations!