Part 5. Rendering
Lighting:
Before we actually render the bee 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 Five 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.
AREA: Light shines from a rectangular surface
All you really need in this project is enought illumination to see your character. We 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 character 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 bee.)
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.
For the purposes of this project that is really all you need. I will go over the other types of lights and their attributes more thoroughly in class and you may experiment with them if you want.
Render Globals:
Now let's set up the render. Press (Winow> Render Globals) and enter the following attributes:
*NOTE: YOU MUST SET UP YOUR RENDER GLOBALS AS BELOW IN ORDER TO HAVE FILES WHICH YOU WILL BE ABLE TO PLAYBACK USING FCHECK
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: Please use exactly this format for your
renders "name.#.ext" - it means the first part of each frame image is name, then
the frame number, then the format type extension.
Start Frame: you will likely
want to star at frame 1
End Frame: the number of the last frame of you
animation
By Frame: a 1 here
means you will render every frame
Frame Padding: set to 4
digits (this will give you a file name like: name.0001.sgi) PLEASE
AVOID USING 3 DIGITS. Use only 1 or 4
Image Format: use SGI
Channels: The RGB channel is the
color channel, you must render this to see your character, the Alpha channel
will create a mask around your character which allows you to composite the
animation later, if you want.
Resolution: We will use 720 x 486. (refers to number
of pixels) for a much better resolution than we have been using for test renders
in class.
Device
Aspect Ratio: 1.33
Pixel Aspect Ration: .898
Antialiasing Quality: Presets>
Production Quality and Edge Antialiasing > Highest
Quality
You are now ready to render.
*NOTE: Students in this class are permitted to render on only one machine at a time. You may render during class time, during lab time, or if you want to set up a render to happen over night you can set it up to begin at 11 pm. If your render is still going when people arrive at the machine the next morning you render will be killed, and you can pick up where you left off later.
Close your Render Globals Window.
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.
You can cancel a render at any time by pressing (Render> Cancel Batch Render).
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. To use Fcheck you need to minimize the entire Maya window and open a Unix shell (right click on the desktop and click shell just like when you log in). In the new shell which opens up you will need to navigate to the folder which contains your image files. If you recall when we created a New Project for the bee Maya set up a series of folders or directories within that project. Your bee models and the files you have been working with so far were all in the "scenes" folder. The render we just did was automatically directed to the "images" folder of your current project. In the shell determine what directory you are currently in by typing " pwd" (print working directory). It should probably be something like usr/disks/t52/yourID. You need to navigate to:
usr/disks/t52/yourID/maya/projects/yourProject/images
To navigate within the Unix shell here are some of the basic commands:
cd
change directory (type cd maya to
go from usr/disks/t52/yourID to usr/disks/t52/yourID
/maya)
cd .. go back one directory
(type cd .. while in usr/disks/t52/yourID
/maya to go back to usr/disks/t52/yourID)
ls
list the files in the directory
REMEMBER THAT UNIX IS CASE SENSITIVE
*If you have trouble navigating in Unix ask a lab aide for assistance.
Once you are in the images directory (type ls to be sure your rendered files are there). To view a single image in fcheck type the following command:
fcheck Yourfilename.0001.sgi and press enter - it should display the image by that name and number from your sequence.
To play an animation, you must indicate that you want to see a numbered sequence (-n ) and you must indicate the first frame, the last frame, and by how many steps you want to view it (1 means you want to see every frame- which we do in this case).
if you used 4 digits of padding, use a # as the wild card, one for each digit of padding. So the syntax would be: -n 1 400 1 yourfilename.####.sgi
f you did not use number padding when you rendered use @ as the wild card the syntax would be: fcheck -n 100 400 1 yourfilename.@.sgi
Press enter. It will display the entire sequence of images. (It goes through it the first time slowly as it retrieves the frames, then it should play more smoothly.
Ta Da !
If you want to
add sparks to the bee's tail continue to:
Part
6: Particles
ADDENDUM
*NOTE: As long as we are in a Unix Shell it should be noted that you can also render from the shell. While we will go over how to do this more thoroughly in class here are some instruction for those who may already be comfortable enough with Unix to give it a try.
To render in the
shell navigate to the
/usr/disks/t52/yourID/maya/projects/myproject/scenes/
and use
the following syntax (-s start frame,-e end frame, -b
by frames)
Render -s 100 -e 400 -b 1 yourprojectname.mb (note the capital "R" in render)
------------------------------------------------------------------------------
To render "at" a later time you create what is called an at job.
First type in date and hit enter to see what date and time the system is currently set to.
Navigate to the following directory -
cd (your home directory)/maya/projects/yourproject/scenes
/usr/sbin/Render yourproject.mb
(Note however that the Maya renderer could be installed
anywhere, not necessarily in /usr/sbin. Execute this
command to check on where the renderer is installed: which Render)
To create an at job, invoke "at" with a time or time-date as an argument:
> at
11:00pm
or
> at 11:00pm
Saturday
Terminate input by typing Ctrl-d on a line by itself. The at command will confirm that a job was created:
warning: commands will be executed using /bin/sh
job 955677600.a at Thu Apr 13 22:00:00 2000
To list your at jobs on the current machine with "at -l":
example:
> at -l
955677600.a Thu Apr 13 22:00:00
2000
Cancel at jobs with "at -r", using the id number from "at -l":
example
> at -r 955677600.a
Then you can navigate back to you scenes file and run the Render commands from above. ( Render -s 100 -e 400 -b 1 yourprojectname.mb
The render will begin at 11:00 PM
As with any
unattended render, users should run tests and ensure that adequate time and disk
space is available before launching a
render. Users who are
learning to use "at" should experiment while at the console. Do a
"date" to find out what time the machine
thinks it is, then set a
Render "at" job to run a couple of minutes later. Use "top" to
watch as the machine starts the render.