To convey a better sense of volume, we need to 'fill' the box's sides so it looks solid. Otherwise, you can't tell if which side is facing you. This is done by passing information about the order or the dots - usually called vertex (vertices if more than one). If they are drawn clockwise, that side faces outward and vice versa. This direction is called a 'normal'. The lines connecting the vertices are aptly called 'edges'. When all of them are put together, we'll either have a triangle (3 vertices and 3 edges) or polygon. A polygon can have more than 3 vertices and edges, but the greatest thing is that they can be easily be made using triangles. The computer will compare the normal of every object in 3D to where the camera (or you) is pointing at. If the object is in your perspective and the normals are facing in your general direction, the object (and the sides thats facing you) will be drawn. To avoid drawing the back of the object, the computer may choose to simply draw the back sides first and then the front. This is usually done by comparing the coordinates of the vertices (in relation to you and the camera)- which ones are further along the z axis.
Unfortunately, this process will draw every object in the world - even the ones not in view! This is of course not efficient - we want the computer to draw only the objects in our field of vision. Most of the time, this is done by defining a box or a plane representing our field of vision and the comparing the vertex coordinates to this plane. An object with vertex coordinates outside the plane will not be drawn. However, an object having both a vertex that's 'visible' and not will still be drawn. Of course, objects will all the vertices inside our field of vision will be drawn. This process is called clipping, since with it we 'clip' the 3D world as if we're looking at it through a hole in shape of a box - our field of vision. Normally, we define our field of vision as a 90 degree area, both up/down and left/right.
Distance also plays a role in clipping. For instance, if you have ever used a camera, you'll notice that objects beyond and below the focus will be blurred - out of focus. We need to have a near and far clipping plane to tell the computer not to draw objects that are too far or too near, because we only want to see objects in focus. This is again done by defining a value along the z axis where we want our clipping planes and the the computer will compare each vertices coordinates with these values.
In addition to this, there is a technique that will let the computer know not to draw the sides that are facing away. This is usually called back face culling. After clipping is done and before drawing the objects, back face culling helps the computer determine which sides of an object that's not in our view and stops them from being drawn.
Another exploit of distance we can find in 3D graphics is what's usually called Level of Detail (LOD). When using LOD, we make several versions of the same object, where we display the most detailed version when it's close and least version when it's far. This makes sense since in real life we hardly notice details of objects far from our focus. Using a less detailed version means we could save memory usage and processing time to use them on our most detailed version - where it really counts.
A Shady World
Up till now, you'll notice that our objects have the same color on all their sides. Needless to say, this is not natural phenomenon. In real life, lights and shadows are everywhere. They give us visual cues about an object, such as whether it is facing or away from us, how smooth the surface etc. Shadows present important information to our brain to 'see' where an object is and just how far it is from the ground.What most people seem to misunderstood is that we actually don't see light in terms of photons, but instead we see how they interact with objects all around us Light will interact through reflection, refraction, deflection, some are even absorbed. 3D graphics can't model light (at least its not practical with current hardware), so we settle for the next best thing - modeling how light interacts with objects. This way we could approximate how light behaves in relation to how we see it. So good lighting and shadows are important to 3D graphics.
The earliest form of shading - how light interacts with object - is based on the understanding that when light 'hits' an object, it will be reflected in all direction with the same intensity. Lambert shading laid the ground work for all 3D shading algorithms after it, by offering a simple calculation regarding the incidence of light (the angle of light relative to the object).
Gouraud shading takes it a step further. The problem with Lambert shading is that the resulting image doesn't give us a smooth transition between lit areas. This is because every triangle or polygon of an object are lit with different amounts of intensity. The solution is simple: interpolate the intensities between each vertex, resulting in smooth transition of intensity across the object.

Unfortunately, Gouraud shading has some drawbacks. For one, it can't offer specular highlights, since it only calculate diffuse light. Specular highlights occurs when an area of an object is directly reflecting light to our eyes. It also does not do a very good job of lighting a low polygon object since it needs lots of vertices to calculate the highlights. Phong shading solves all these problems by doing the calculation not per vertex, but per pixel. Like Gouraud shading, the angles can still be interpolated, but the per pixel calculation allows us to get specular highlights, even on a low polygon object. Phong shading is not without a drawback - the sheer number of calculation needed to be done per pixel. But if you have a fast hardware (or more than willing to wait), the resulting image is very pleasing and more acceptable to the eye than Gouraud shading.

Of course, 3D graphics doesn't stop there. In real life, surfaces of any objects are not perfectly smooth. Every surface has little microscopic fractures and holes, indents etc. They also have different behavior when interacting with light - some reflect more than others, some are even translucent or transmissive. Blinn shading incorporates all of this, providing us with the most complicated and more believable images than Phong shading.
What may surprise you is that all these algorithms are actually developed in the very early stages of computer history - in the 1970s. Up till the advent of affordable 3D graphics, they are only used for non-real time rendering. The first generation of consumer 3D graphics hardware mostly rely on Gouraud shading, since it offers a more affordable compromise between image quality and rendering performance. The latest hardware available are powerful enough to do Phong and even Blinn shading in real time, although some approximations and compromise may still be used.
[Previous Page]
[Go to top]
[Next Page]