3D ACCEL, 1996

When hardware took over the triangle, the pipeline became something you configure rather than write. This era spells out the fixed-function path stage by stage: model, view and projection matrices, rasterisation, shading, texture mapping and the z-buffer.

Graphics track · 27 missions · boss mission, written exam and certificate · free, no signup. Everything below runs in the browser terminal on the SERVBG home page.

Open 3D ACCEL in the terminal

What you will do

  1. put the reference scene on screen as a textured quad ref

    Two triangles, four vertices, one texture. Every frame of every 3D game in 1996 was this operation repeated a few thousand times.

  2. list the 8 cube vertices in object space vertex list

    Object space is the model on its own terms. A cube of side 2 centred on the origin knows nothing about the camera yet.

  3. print the model matrix: object space to world space model rotate

    A 4x4 matrix holds rotation in its upper-left 3x3 and translation in its right column, which is the only reason 3D graphics uses 4 numbers for a 3D point.

  4. print the view matrix: world space to camera space view

    There is no camera in hardware. Moving the eye to +Z is identical to translating the whole world by -Z, so the view matrix is the inverse of the eye placement.

  5. print the projection matrix for a 60 degree field of view proj 60

    The -1 sitting in row 4 column 3 copies -z into w. The matrix does not divide anything; it loads the divisor that the perspective divide will use.

  6. combine all three and follow one vertex to a pixel mvp

    Object to clip to NDC to viewport. Until the GeForce 256 in October 1999 this multiply ran on the host CPU, per vertex, per frame.

  7. see the cube as 12 triangles with their winding tri

    Hardware rasterises triangles rather than quads because three points are always planar and always convex, which makes the span endpoints on every scanline just two edges.

  8. throw away the triangles facing away from the camera cull on

    The signed area of a projected triangle tells you which way it faces. On a closed solid that discards half the triangles before any pixel work, for the cost of one cross product.

  9. draw the edges only raster wire

    Wireframe is what a transform pipeline gives you before a rasteriser exists. Every CAD workstation of the 1980s looked like this.

  10. fill each triangle with a single colour raster flat

    A pixel is inside the triangle when all three edge functions agree on sign. Walk the bounding box, test the sign, write the pixel: that is a scanline fill.

  11. add a diffuse lambert term light on

    N dot L is the cosine of the angle between the surface normal and the light direction. Diffuse lighting is one dot product and a clamp, nothing more.

  12. compute lighting per vertex and interpolate it across the face raster gouraud

    Henri Gouraud published this interpolation in 1971. Three dot products per triangle instead of one, and the flat banding disappears.

  13. upload the reference image as a 64x64 texture texture ref

    A Voodoo Graphics board held 2 MB of texture memory on a bus separate from its 2 MB frame buffer, and no single texture could exceed 256x256.

  14. sample the texture per pixel raster textured

    u/w and v/w interpolate linearly across a span and are divided by the interpolated 1/w at each pixel. Skipping that divide is affine mapping, and it is why early textured floors appeared to swim.

  15. see what happens to intersecting geometry with no depth test zbuffer off

    Two triangles that pass through each other cannot be sorted. Neither one is behind the other, so any per-polygon ordering gets the intersection wrong.

  16. turn on the per-pixel depth test zbuffer on

    One depth value per pixel, compared and conditionally written. At 640x480 a 16-bit depth buffer is 614,400 bytes, about a third of the 2 MB frame buffer a Voodoo Graphics carried.

  17. build the 64/32/16/8 chain and pick a level per pixel mipmap on

    Lance Williams described the mip pyramid in 1983. It costs 33% more texture memory and removes the sparkle you get from point-sampling a texture below its own detail rate.

  18. sample one texel per pixel filter nearest

    One fetch per pixel is the cheapest thing a texture unit can do, and at two times magnification you see the texel grid directly.

  19. blend the four nearest texels filter bilinear

    Four fetches per pixel instead of one. Texture memory bandwidth, not arithmetic, was the resource 1996 boards ran out of first.

  20. blend distant pixels toward a fog colour fog on

    Linear fog reuses the 1/w the texture stage already interpolated, so it costs almost nothing, and it let a card stop drawing distant geometry without a visible pop.

  21. read the counters from the last frame stats

    Pixels shaded is the number that matters. Shading a pixel a nearer triangle later covers is overdraw, and the depth test only prevents it when the nearer triangle arrived first.

  22. compare this rasteriser with 1996 silicon bench

    Voodoo Graphics did roughly 50 million pixels per second, one per clock at 50 MHz, with bilinear filtering and the depth test inside that same clock.

  23. the four years that settled consumer 3D cards

    3dfx shipped Voodoo Graphics in October 1996; id Software released GLQuake in January 1997; the Riva TNT arrived in 1998; the GeForce 256 in October 1999.

  24. see what hardware transform and lighting actually moved tnl

    The GeForce 256 did not change the shape of the pipeline in October 1999. It moved the line between CPU and chip so that transform and lighting fell on the card side.

  25. compare Glide, OpenGL 1.1 and Direct3D 5/6 api

    Glide was a thin wrapper over one vendor's registers, OpenGL 1.1 a portable state machine, Direct3D 5 the version that replaced execute buffers with DrawPrimitive. All three drove the same fixed pipeline.

  26. animate the cube and run the whole pipeline every frame spin

    A 1996 game loop rebuilt this entire chain of stages every frame at 320x240 and treated 30 frames per second as a good result.

  27. Boss missionevery stage on at once - textured, gouraud lit, depth tested, culled, mipmapped, bilinear, spinning render

    Transform, cull, rasterise, depth test, sample, shade, fog. Each stage a fixed job with knobs you set and could not rewrite. Breaking that limit is what the shader era is for.

Certificate

This track is certifiable. Clear the boss mission in the terminal, then run EXAM ACCEL3D for the written paper: 20 server-graded questions drawn from our own bank, pass mark 14 of 20. The certificate is issued once both are done, and it carries a verification code.

Nearby eras

Previous
1992 · 3D SOFTWARE
Build a software 3D renderer by hand: DDA raycasting, textured walls, fixed-point maths, BSP sectors, projection and depth sorting.
Next
2001 · SHADERS
Write GLSL in a live fragment-shader sandbox: the programmable pipeline, varyings and uniforms, signed distance fields, lighting, errors.

All 25 eras in the Terminal Academy

Open 3D ACCEL in the terminal