MAGAZINE

A Brief History of 3D

Edge Staff's picture

By Edge Staff

October 27, 2008

See also:

Related Articles:

Phong Shading




One problem with Gouraud shading is that it’s a screen space technique, which is to say that it’s calculated in terms of the display screen, not the 3D world the screen is attempting to represent. The disparity between the 3D world and the screen means that such processes cause interpolation errors. For instance, a Gouraud-shaded set of polygons that represent a sphere would betray the polygons that form it. Algorithms such as Phong shading fix this problem by computing the lighting value for each pixel as the polygon is rasterised. It works on a similar basis to Gouraud shading, though in the final stage of the process Phong shading is different because it can modulate the light reflectance value to simulate different surfaces – plastic, for instance – with strong specular highlights, such as Ulala’s shiny dress in Sega’s Space Channel 5.

Ray Casting




At the beginning of the 1990s, the PC had become powerful enough to allow developers to start thinking about rendering textured 3D worlds – providing they cut a few corners. Ray casting, a subset of the more complex ray tracing technique, renders a scene’s background using vertical rather than horizontal scan lines. A ray, or a straight line of sight, is traced from the centre of each scan line on the screen back into the 3D scene. The first object or wall it hits indicates its position and distance away from the camera, and if the world is made of walls or blocks of a uniform height, such as those in Wolfenstein 3D, they can therefore be textured in a similar way to Space Harrier’s sprites. Things get more complex if the environments aren’t of uniform height, but it’s simply a case of extending the ray intersection tests, which is exactly what John Carmack did with Doom, which was released in 1993.

Realtime Lighting




Realtime lighting actually comprises a complex series of different techniques, but in simplest terms can be represented by straightforward Gouraud or even flat shading. For gaming, however, this is clearly insufficient because, at the very minimum, we also want local point lights – light sources hanging in space that emit a specific colour, brightness and a rate at which the illumination dims as distance increases. This is achieved by extending lighting calculations (such as Phong) at the rasterisation stage to take multiple lighting directions and positions into account – though the final colour of each pixel is also affected by texturing and other surface effects, of course. Realtime lighting was used with spectacular results in id Software’s Quake, released in 1996. Its gloomily atmospheric dungeons sported local point lights in the guise of wall-mounted torches as well as dynamically located sources such as rockets.

Z-Buffering




One of the biggest problems with rendering 3D is calculating which polygons should appear in front of one another, and correctly displaying them. You could sort the polygons into depth order and render those farthest into the screen first, but what happens when two polygons intersect each other? This is where Z-buffering comes in. Here, the frame buffer not only stores the colour value for each pixel but also the depth of that pixel into the screen, a calculation that takes place as each polygon is rasterised. The Z-buffer starts off being set to the farthest depth from the screen. When rendered, every pixel’s depth is compared to that already stored in the buffer – if it’s closer to the screen then the new pixel depth values are stored. If not, the new values are thrown away because they are obscured behind the existing pixel in the rendered scene. While this technique had been in use for some years, it was the geometrical complexity of worlds such as those of Super Mario 64 that showed how Z-buffering could remove some of the compromises and restrictions to which games had been subject.

Frame Buffer: An area of memory that holds the image to be displayed on the screen. Typically this is divided into two – the frame being rendered and the one being displayed. The frame buffer normally holds more information than just the image: an alpha channel, stencil and depth (the Z-buffer) are normally all stored together.

Environment Mapping




Gran Turismo’s replays weren’t only notable for their dramatic framing of the race, or the fidelity with which its cars rode the track. It was also the shine of bodywork reflecting the environment around the vehicles and emphasising their form and movement. There are many ways to represent environment maps, but the most commonly used is that of a cube map. Imagine standing on the spot and taking six photos of the space around you: to the front, sides, back, top and bottom. An object can then be textured as if it were placed at the centre of this ‘cube’ by projecting rays out from its surface normals out into the ‘cube’ to gain a reflection of the virtual environment. The maths can be greatly simplified to allow static reflections to be computed cheaply, a deficiency that isn’t actually that noticeable, especially on a racetrack like that of Gran Turismo, where most of the reflection comprises road, crash barrier and sky.

Complex Filtering




One of the problems with texture mapping is aliasing, in which textures appear blocky when viewed close up, or swim and shimmer when reduced to less than their actual size. These effects are caused by the basic nature of ‘nearest neighbour’ filtering, which does not take into account the fact that it’s unlikely that the centre of any texel can be placed precisely on the point that the mathematics says it should. Better results are achieved with more complex filtering techniques, which take into account the positions of neighbouring texels. Bilinear filtering uses a square of four texels to interpolate the colours required for each pixel. Trilinear filtering adds MIP map levels into this computation, while anisotropic takes surface orientation into account to improve detail in textures on surfaces oriented at oblique angles to the view plane. The broad, low resolution (by modern standards) textured vistas of Flight Simulator 98 benefited strongly from such techniques, all performed with the invaluable help of the graphics card, whose wide availability was relatively new in 1997.

Tina_Russell's picture

Waaah! You forgot cel-shading! My fond memories of Jet Grind Radio are aching.

Great article! I’m really glad I know what all those fancy words mean now, seriously. It’s fascinating to learn the various tricks that devs use to make the games look real, when the way light really works would be too expensive even for today’s powerful processors.

Shifty Geezer's picture

A nice overview, but I was a little disappointed by the lack of 'future tech'. LittleBigPlanet showcases a new lighting technique that creates a very convincing realtime GI look. Alex Evans work is documented here :
http://ati.amd.com/developer/siggraph06/Evans-Fast_Approximations_for_Li...

He goes into more technical detail here, in a combination paper that links in with some other methods. Evans' GI solution is the last chapter. :
http://ati.amd.com/developer/techreports/2006/SIGGRAPH2006/Course_26_SIG...

The method isn't broadly applicable and only found its way into LBP due to LBP's 2.5D design, but it shows an alternative lighting model and how novel thinking can find striking solutions.

littlewilly91's picture

This is a brilliant article EDGE. I've just been on an animation course and i really needed the basis like this to understand what the hell i was doing. I didn't most of the time. So although i can use Maya quite well it feels pretty hollow.
This has been really helpful. I think they should put this sort of thing in as the first chapter in the textbooks, and have references to pages where each effect is explained in more detail, and pages which explain using it in Maya. You could have a checklist for your understanding of each technique. Then you could skim through in revision, reading this first article and easily revising more if you don't understand. We students are kind of desperate for this stuff. It's knowledge that teachers tend to assume we have. Teachers try to explain each deep and convoluted technique, but loads of students get left behind in a sea of unknown intensely technical talk that means nothing to them. The teachers tend to rely on all their own familiar terminology and like to give a focussed little speech that assumes we know all the background information, just so they can delve into a technique quickly, rounding it out for their own benefit. We really need a well ordered way of studying it ourselves, just to get a grounding. It needs to be in our own time, backtracking to what we need to know when necessary.

John_Ryan's picture

I was fascinating how much of this I actually understood just because I work with satellite imagery on occasion. Granted, I've HEARD and could basically explain all of it to someone dumber than me, but someone who did this stuff for a living would see right through me.