English translation by Rita Granda
from Toronto [ Thanks Rita ]
1. INTRODUCTION: DIFFERENCES IN ANIMATIONS
One of the first things that should be clarified is the difference between 3D animation and traditional animation, for example a classic animated Disney cartoon:
- ANIMATED DRAWINGS are just that: drawings that pass in front of our eyes at great speeds, specifically 24 images per second (24 fps/frames per second). In reality, any movie does exactly the same thing but with 24 photographs. Simplifying the process: a traditional animator has to DRAW each frame, one at a time. Drawing, inking, colouring… usually, this work is done on transparent materials that allow the more elaborate static backgrounds to be seen passing underneath.
- In a computer-generated 3D ANIMATION, there is no drawing. Instead, in three dimensions, you construct or model each element, character or scenery that appears in the scene. These forms are generated using computers and different tools (software) that can apply all sorts of surface characteristics to them, illuminate the scene they are in and move anything around, be it a character, light or camera. The big difference here compared to traditional animated drawings is that there is no need to create a different version of each object for each frame; once the object has been created, it can be seen from any point of view. Though the scenery and the characters are virtual, they are still three-dimensional.
This is a simple explanation of a process that is really very complicated. Let’s look at 3D animation in greater detail.
Once the script has been determined, and after planning every scene and doing dozens of sketches and pre-tests, the modeling process can begin. In the modeling stage, a three-dimensional structure is created for each element.
If we look around us and analyze the shapes of objects, we see that an enormous variety exists. The work of a modeller begins by analyzing each one of the basic forms that defines an object. A soccer ball is a sphere, a tin can is a cylinder and a die is a cube. These simple objects are constructed from basic forms, often referred to as “primitive”.
But many objects are made up of a variety of basic forms: a funnel is the intersection between a cone and a narrow cylinder, while a bookstore or building is made up of many rectangles (blocks) of varying thickness, width and height.
And finally, there are forms that are much more difficult to model: objects with lots of curves like a sports car or the famous Guggenheim in Bilbao; the organic forms of almost all living beings —trees, roses, cats, people— and generally, most objects from Nature around us, the mountains and geologic formations, water as it moves, the clouds. For these situations, software developers have had to create modeling systems that are generally very complex (nurb curves and meshes, particle systems, dynamic simulations, etc).
Initially, and in many of today’s modeling programs, computers represent structures using a system that is based on polygons. A cube has 6 faces, and each one of them is a square, a polygon; a pyramid, like the ones found in Egypt, is made up of four triangles and a square base. Round forms are also found among the polygons: the clearest example from real life is the soccer ball, which is made of 12 pentagons and 20 hexagons.
Surface curves are usually treated using triangles. Some programs can work with many-sided polygons but others cannot. The great ‘advantage” of a triangle is that its three vertices are always on the same plane; that’s why a 3-legged seat will not wobble. On the other hand, in a squared or upper-level polygon, the vertices can accidentally slip producing a form that is not flat. This can cause internal conflicts, which affect the rendering of the surface.
Today, other modeling systems exist in which the user does not work with polygons but with mathematically defined curved surfaces. Let’s imagine a circumference: it could be represented as a many-sided polygon, or as a mathematical function between two X and Y variables, the group of points on a plane that are equidistant from another.
Apparently, the user does not have to deal with complicated formulas. It is easy to trace perfect curves, not just circles and ellipses, in the same way as in a vector program like Illustrator or Freehand. Different types of tools, splines, NURBS, patches bezier, etc., are provided in a non-polygonal modeller for creating complex curved surfaces.
When you work with polygons, you need to economize; it is impractical to use a lot of polygons to define a curved surface like a simple sphere, if the sphere is going to be seen from a distance. Games creators make optimal use of the number of polygons in an object so that this data can be moved in real time. Don’t forget that the computer must maintain complete control as to where each vertex of a polygon is found at any given moment, and the number of points in space can easily climb into the millions.
The advantage of splines, or mathematical curves, is that they always define the surface perfectly no matter how close the observer gets. Nevertheless, they are much harder to manage and in some situations, resolving problems with splines can be quite tricky.
3. SURFACE PROPERTIES
If we look around us again, in addition to the structure of things, we see a great variety of surface finishes. They all have to be imitated on the computer.
Once the model has been figured out, each part or piece should be assigned different properties:
- Colour: This is probably what people perceive the clearest. Nevertheless, it’s not always that simple: what colour is a mirror? a glass? our skin? Usually, colour is defined by more than one variable. For example, diffusion controls the quantity and colour of the light dispersed by an object, and ambient colour controls the sensitivity of the material to the ambient light. Basically, we control the quantity of light present in the shadows of an object, since they hardly ever appear as black.
- Specularity: Controls the shine or sparkle that light produces on an object. An object is very shiny if it has high specularity and matt if the specularity is low.
- Reflectivity: Control the reflections on the object’s surface that come from its surroundings. Often, when we look at an object we aren’t really looking at the colour of its material but the colour of what it reflects; a mirror is the most extreme example of this. The surface of a new car is reflective, denim isn’t. Usually, if an object is highly reflective it is also very shiny or specular.
- Transparency: A windowpane allows us to see what is on the other side, if it is clean. The glass wouldn’t even be visible if there were no intervening factors. But sometimes the glass is stained, and it can almost always be distinguished by the reflections that it emits, the sparkles of light or the distortions produced by looking through it.
- Refraction: These distortions in glass are the result of the refraction process. The lens of a magnifying glass distorts what is beneath it, making it appear larger through the process of refraction. For the same reason, a stick placed in water seems to bend.
Other properties exist (luminance, caustics, anisotropy, etc.) but those mentioned above are the most important. Different 3D applications allow us to control these parameters; a material’s realism depends on their proper adjustment. Even a well-modeled object can lose all of its credibility if the colour is too saturated or if the surfaces are too shiny and reflective; these defects are very common in the work of many beginners.
4. TEXTURE MAPPING
This could have been a subheading under “Surface Characteristics” but it will be looked at separately because of its importance.
Many objects cannot define themselves with only one surface colour. The floor’s terrazzo, the wood in furniture, or the pattern on a shirt; they are made up of different colours with a distribution that is sometimes geometric or, at other times, completely haphazard. That’s why we turn to textures.
If we scan a piece of marble and save the image using a specific format, it can later be applied as a surface finish to any object. And it doesn’t need to be something flat: it can be applied to a cylinder, a sphere or to whatever we want, with the image completely covering the entire surface, or in such a way that it is repeated continuously.
This type of texture, known as bitmap texture, usually comes from a real image or one created in an imaging program such as Photoshop. As in any other bitmap image, like a photograph, it is very important to control the resolution, adapting it to one’s needs. If not, when you get too close to the object, the pixels will reveal themselves.
To avoid this problem, since gigantic textures do have to be created sometimes, other texture mapping systems have been developed called procedurals or shaders. These deal with internal algorithms that the 3D program creates, usually based on fractal structures that provide different benefits:
- Resolution is always optimal; pixels never show.
- Because of its fractal nature, the program is quite adept at imitating nature’s chaotic surfaces, such as the bark of a tree, the veining in marble, or the flames in fire.
- We never see repetition. Repetition is most unpleasant but, unfortunately, it is often used; when a small bitmap texture is repeated in all directions, it clearly reveals the artificial nature of the image.
- Usually, the calculations that a computer makes are faster than applying a large bitmap. Nevertheless, some shaders can be very complex and therefore, not very fast.
Four mapping techniques exist for applying texture:
- Plane: Used to apply a marble texture to a floor, for example. When this system is applied to an object, the texture is perfectly defined, but only where it is placed; on adjacent faces, it seems to project longitudinally.
- Cubic: This system is used to avoid the previous problem. For example, to texture map a cupboard, a cubic application can be used that projects the texture in the different directions of the cube’s six faces.
- Cylinder: A cylindrical projection is used to put a label on a bottle of wine.
- Sphere: This is the ideal process for applying texture to the oceans and continents on the terrestrial globe.
Obviously, there are many objects that are shaped differently and don’t clearly fall into any of these texture mapping systems, for example, a giraffe. And that’s where ingenuity comes in: sometimes, an object can be broken down into different, very basic areas; at other times, the texture can be mapped before applying a distortion to it. When procedural shaders are used, many of them can be applied in all directions to cover the whole surface perfectly, another great advantage to this type of texture mapping.
In any case, other more complicated mapping techniques exist. UV mapping, for example, applies texture that adapts to the shape like a glove; it knows how an object was generated during the modeling phase by following the generating co-ordinates.
Though all aspects of computer-generated art influence its quality, texture mapping may be the most important. A good texture can save a mediocre model; in fact, the quality of video games is based more on texture mapping than on modeling.
This is one of the most difficult subjects in computer graphics; in the real world, light displays complex behaviour that is not easy to imitate with computers. The main difficulty derives from the fact that light is emitted from a specific point, be it the sun, a light bulb, the flame of a candle. When light collides with bodies, it illuminates them but is also reflected in them, thus illuminating other points that at first would not seem to be affected by the light.
In any 3D program, there are different types of lights for illuminating a scene. In general, there are four classes of light; others exist but they aren’t as important:
- Radial: Light that proceeds from a concrete point placed in the scene, and emits its rays in all directions. It is the ideal light for a hanging light bulb or a flame…
- Spot or Focus: Lights that can be directed in a specific direction; they are typically used in theater or performances. We can control the size of the opening of the cone of light as well as its diffusion (sharp or soft reduction) and other factors.
- Parallel: This is the ideal light for simulating the sun. Radial light can be used to represent the sun since it is a star that is located at a concrete point and that emits light in all directions. However, in relation to us, the sun is located far, far away. So much so that, to position a luminous point thousands of kilometres away is not practical. That’s why parallel light is used: it is called parallel because the rays emitted are parallel, virtually like the rays of the sun when they reach the Earth. The rays remain parallel even when placed close to the scene.
- Ambient lights: A type of light that does not come from one concrete point; it comes from all directions. As we have said, light comes from a specific point and arrives at an object from one direction, illuminating it from a certain angle. But light also ricochets. In a room with white or light walls, light entering through a window, from a specific direction, ricochets off the walls and objects that are found in its path, softly illuminating a sofa in an area that should be in the shadows. Keep in mind that in a room, we almost never find 100% black darkness. Another phenomenon occurs in the open air with the dispersion of light as it crosses the atmosphere, like clouds or pollution.
To simulate this type of effect, ambient light was created. At any rate, certain types of systems exist that take into account light’s reflective phenomena (radiosity), although they are incredibly slow because of the large amount of calculations that the computer must process.
Of course, an infinite number of parameters can be controlled in any type of light: intensity, colour, contraction at a distance (‘drop-off’), rays, halos (‘glows’), lens flares, etc.
Directly related to lighting are the shadows that fall from objects. In the real world, each light that we analyze projects a shadow when it comes into contact with an obstacle, even reflected lights. On the other hand, in order to save on calculations in a 3D program, light can be controlled so that it does not project shadows. We should think of computer graphics as a constant trompe l’oeil; any trick is valid whenever it saves time on calculations, as long as the quality of the image does not suffer substantially.
If you think about it, this process is similar to film or photography: the scenes are constructed, artistically painted, and properly lit; now, all you need to do is hire good actors and photograph or film the action. Is that all?!
In some animations, movement is limited to a series of “flights” in or around a scene. The most obvious example is architectural computer graphics. In a 3D program, a camera is one more object that can be added to a scene, giving it certain characteristics like image format, focus opening, etc., in order to capture the environment from a virtual point of view. Usually, any number of cameras can be added and moved to suit our perspective, with the added advantage that we do not have to deal with the weight of real cameras.
It begins to get complicated if you want to move other objects around. Rarely is it as simple as moving or turning one element; most of the time, pieces are moved and rotated in relation to other pieces and, in more complex cases, people move, walk, run, laugh, yell or cry. So, now we are talking about an incredibly complex discipline. The ants in “A Bug’s Life” or the toys in “Toy Story”, the dinosaurs in “Jurassic Park” and the characters in “The Phantom Menace” represent the highest level of perfection that has been reached in this field. This perfection is arrived through the efforts of many highly specialized people, working with the best machines and programs, for long periods of time.
This is just an outline, and a highly simplified one at that: once a character has been modeled and texture mapped, an internal skeleton of virtual bones is created, in order to animate it. We can think of the bones in our bodies because they are a good visual image, but they don’t have to be physical bones.
The different pieces of this skeleton are united by ‘links’ that generate a series of hierarchies: the shoulder is the parent of the humerus, which is the parent of the cubit (and the radial, but we don’t have to use two bones; remember this is a simulation), the cubit is the parent of the hand, which is the parent of each of the first phalanges of the fingers. Each phalange has a child, a grandchild … and so on to the end.
Once the internal structure and all of its hierarchical relationships have been established, the limits of movement, the indices of friction, viscosity, etc. can be defined. In other words, the possibility for movement that each piece can have in relation to other pieces is assigned. Finally, we define how the different parts of the internal structure affect the external “skin”, the mesh polygons or the NURBS, so that when an arm is bent, a fold is produced here and a muscle bulges over there.
With the structure perfectly organized, we can now begin to animate, making each element move with the appropriate rhythm, controlling the velocity curves in such a way that the character acquires a specific personality. Easy, right?
These refinements are found in high-level programs; a strong competition exists between them to supply the most potent, agile and intuitive tools to work with. Maya and Softimage are the indisputable leaders in the field.
Up to now, we’ve been doing the work. Now it is the machine’s turn. As stated at the beginning, in one second of film we have 24 frames (there are 25 fps in the PAL video system and 30 fps in the American NTSC format) and the computer must calculate each of these images. This process is called rendering.
Various rendering systems, or algorithms, exist but the most important are:
- Wireframe: usually used to test movement, to see how things are going and avoid a surprise later. It is the quickest, as it shows just a few lines to define the polygons of each element. There is no recognizable texture, just the structure of the objects as in modeling, but it is very useful for testing the quality of movements in an animation before moving on to slower systems. Usually, both the front (visible) and back (invisible) of a structure can be seen. A variation called “Hidden Line” hides the back of objects, or elements that pass behind the others.
- Phong: this is a fairly clumsy algorithm in many programs. It can’t even represent a cast shadow, not to mention a number of other physical phenomena. In these cases, it is only used for testing animation. But, because of its great speed in calculating, some programs have converted it into their highest level rendering motor, debugging it and installing features to supply what is lacking. In fact, despite its many limitations, it is used the most in big productions where rendering time is critical.
- Raytracing: here, reflections, projected shadows or refractions are calculated according to parameters assimilated to the real world, giving a result that is pretty close to reality. The bad part is that it is much slower than Phong; it is usually used more in still images than in animations. In this system each visual ray that comes out of the camera reaches the object and, according to rates of reflection, transparency or refraction, passes on to other objects or lights from there. Each little visual ray that comes out of our camera will be a pixel (minimum unit of visual information) for our image.
- Radiosity: is the most perfect of all the rendering systems, but it is also the slowest, with a difference: it also calculates interactions between the light and the colour of objects that are in close proximity. For example, if a red ball is hung near a white wall, an area of the wall closest to the ball will appear to be tinted red. Another example: if we illuminate a wall, it reflects part of this light and provides a fainter light for objects that are found close by. This is the perfect system for realistic simulations in the field of architecture, especially interiors, since it illustrates very well how light behaves in these conditions. It is also used a lot to add realism to scenes for 3D video games (the scenes have already been calculated and saved on a disk, otherwise it would be impossible to play in real time).
Once a sequence is rendered, it can be dumped or recorded directly on to video. Usually, the file is passed to a post-production program first to retouch a few things before dumping it to video or film, once and for all.
Sometimes, it can be interesting to adjust the characteristics of an image or animation once it has been rendered: simple things like saturating the colour, adjusting the lights, or focusing/ blurring the image a bit; or, more complicated things like matching different parts of an animation, where the foreground is on one side and the background on the other so that they can be worked on separately, or integrating a computer graphics element into a real scene. Whether it’s a still image or an animation, many programs exist that help with these functions, the best known are Photoshop and After Effects.
Usually, this is what the process is called for passing information from a computer to a professional (Betacam) or domestic (VHS) video system, or to film using specialized equipment. In the case of a still image, it has to be output, either by printing it on paper, filming negatives or moving the image to a transparency. The animation or the illustration can also remain in a database for future publication on the Internet or CD-ROM.