Gaming Beauty Is Only Pixel Deep
Thanks to NTSC-uk for its feature discussing what the new pixel and vertex shaders mean to this generation of videogames. The piece laments: "Looking back at the past few years, games have looked incredibly similar. And this is the main reason why: they all used the same tools", before going on to explain: "The hardware previously contained logic circuits to simply perform the operations needed by Gouraud and Flat shading, but now the fully Programmable Pipeline has introduced a whole new world of graphical effects for us all, limited only by the programmers' time and creativity", referencing "the water effects used in Super Mario Sunshine, cel shading effects used in Zelda, or the rippling water effects on Dead or Alive 3."
While I don't have any knowledge of the GC's GPU per se, what I do know is that the company that designed it, ArtX, was subsequently bought out by ATi and the same design was used as the base of their R3xx (Radeon 9x00) series of graphics cards, which do indeed use pixel and vertex shaders (versions 2.0). So it's certainly possible.
Work is punishment for failing to procrastinate effectively.
Hi all, I wrote this article, so I thought Id comment :)
The GameCube does in fact contain Pixel/Vertex shaders in the true sense of the word, rather than complicated GL extensions available. If you browse Gamasutra.com or elsewhere, there are considerable articles explaining how to use these.
If only someone would send me a full dev kit (I have the NR 'Cube) then I could test further :)
Good article? It's terrible:
...then they are split into triangles for simpler rendering (Due to the mathematics that states that any polygon can be formed by multiple triangles)."
"Most 3D objects are made from triangles. A triangle is given by three points in space. If they are modeled as polygons, by the time they are drawn on the screen (rasterised)..."
Rasterization is the process by which an aribtrary mathematical representation is converted into a raster image (an image composed of a grid of orthogonal display elements). Rasterization is not when something is drawn on the screen.
Complex representations of three dimentional objects are not split into triangles for simpler rendering, they are split into triangles because it allowed for faster rendering.
There is no statement in mathematics that claims any polygon can be formed by multiple triangles. Furthmore, this claim is false.
"The whole process of rendering takes each triangle in 3D world space, and projects them onto the screen as 2D triangles."
This claim is false. If you are projecting three space triangles onto a cartesian plane, they do not necessarily become triangles. Lines, points, and nothing at all are not triangles.
"The most basic method of lighting is simply giving each triangle a flat colour, and by no coincidence at all, this is called Flat Shading."
This is not lighting -- it is called shading. The process of selecting the actual colour of the polygon would be considered a rudamentary lighting model, not simply the assignment of a colour. Again, shading and lighting are independant.
"Cel shading techniques can make use of the fast rendering speed to save some processing power for the pencil outlines, so it's still a relevant shading method. I, Robot was one of the first games to take advantage of this technology."
As before, the ambiguity of the last statement is enjoyable -- "I, Robot" was one of the first games to use 3D polygonal representations. It was not one of the first games to use flat shading, nor cell shading (given that it does not use cell shading).
"The next shading technique, which was common in the later days of the PlayStation, is named Gouraud Shading:..."
Gouraud shading was first presented by Henri Gouraud in 1971 and has been common in games well before PlayStation.
"...by working out the colour at each vertex, and interpolating this colour between the vertices across the triangle whilst rendering, it will give an approximate idea of how the triangle should be shaded."
Gouraud shading takes the averaged surface normals at each vertex and performs a lighting computation (originally a Lambertian diffuse calculation) upon them. The resulting vertex colours are then interpolated along the edges of triangle, then the triangle is filled by interpolating between each set of edge pixels per a scanline.
"Unfortunately, because the colours are worked out at the corners and mixed across, shadows in the middle of the triangle will be completely missed."
The production of shadows has nothing to do with Gouraud shading, or shading at all.
"Also, when using large triangles, the effect can seem quite unnatural, and it's especially noticeable in Metroid Prime when moving around in Morph Ball mode."
The problem with Gouraud shading is that it restrict light sampling to vertices taken from the world geometry. The accuracy of the shading is then directly proportional to the vertex density of the world geometry. It also performs poorly at oblique junctions. Another issue is the Gouraud shading is not perspective correct.
"Games such as Silent Hill 2, however nice the shadow generation is, still only use this basic shading model, and it's very noticeable with the 'squares' since the light hits the vertices (corners) in turn, the light tends not to spread slowly across the triangles."
While the results are really good, Havok introduces dependencies into the development process that make it a non-trivial addition to any project that might use it.
Of course, that is true for almost any middleware (or in-house generated) technology.
"the water effects used in Super Mario Sunshine, cel shading effects used in Zelda, or the rippling water effects on Dead or Alive 3."
The gamecube doesn't have shader hardware, it uses a fixed function approach with many texture stages. Granted, the flexibility afforded by a dozen or so texture stages is similar to simple pixel shader hardware but there are still fundamental differences (particularly in the ability to do texture indirection) that make real shaders far more flexible. The first two games mentioned above don't use shaders at all... this guy should do a bit more research.
A minor point of interest (for true graphics geeks only): you write, "Another issue is the [sic] Gouraud shading is not perspective correct." In algorithmic terms, you're right, original Gouraud shading interpolates in screen space. However, when I was helping to revise the book "Real-Time Rendering" for its second edition, I asked NVIDIA about this (in 2001), whether they interpolated Gouraud in screen space or perspective space. Surprisingly enough, they now interpolate Gouraud shading using perspective correction, just as they do for textures, and so give a better result.
I agree that there were a number of missteps and questionable statements in the original article, unfortunately. It's too bad, as this area of graphics is exciting and much of it not all that hard to explain clearly. Graphics GPUs (and not the article's "VPUs", a term that hasn't caught on outside of ATI) now allow some seriously large programs (e.g. 1024 steps per pass) to operate on each pixel a triangle covers. The graphics hardware pipeline, by using multiple passes, is Turing-complete (and has been for some time), though I recommend against using it for making a spreadsheet program.