Software 3D Engine

Final year project at university was a pure software 3D engine written in Modula 2 and then ported to C++.

PDF version of the dissertation can be downloaded by clicking this link

Its features included:

Brief history

The basic engine started out in Modula 2 which was the #1 language at the University at the time. It ran at a decenent 60 FPS framerate in DOS talking direct to the graphics hardware using Mode 13h (320 x 200 + colour palette).
It then got ported to C++, so it could run at a higer resolution with 24 bit colour on Windows using DirectShow.

With more colours and more resolution all the shading / environment mapping started to be added. The results were good, but still suffered from lots of aliasing ( jaggies ). To fix this the engine rendered everything 3 x larger than the display, then sampled it down ( Super Sampling). The results looked good, but involved huge amounts of RAM for time! Also the frame rate dropped from 60 Frames per second to 2 Frames per minute :-)


Animation competition

In effort to kill two birds with one stone, the engine was also used to create an animation for the Reading University Computer Graphics competition ( part of a graphics module).

The competition is based on trying to create a short Pixar style animation, but instead of using an off the shelf package like Maya or 3D-Studio Max you have to write your own graphics engine to generate the animation. The generated frames were saved as .ras (Sun Raster) files on to multiple cd-roms that were then copied on to an SGI Indigio for playing out in realtime.

The team consisted of Nigel Drew, Mike Roberts, Joe Rutledge and myself.

We tried to go for a car driving through a futuristic landscape. Unfortunately I didn't have time to add a camera to the engine, so everything was done by moving objects around. Also at the time it didn't have the ability to manipulte child 3d objects in relation to their parent. So the wheels on the car had to be 'detached' as a separate model and moved / rotated separately to the body of the car :-) There were some incredible magic numbers to tie it all together.

Depsite tough competetion the animation won first place, which was the first time a non-ray tracer based engine had won. I remember at the time a few people couldn't understand how you could generate a 3D model that looks smooth and shiny, but is only made of triangles.

low resolution mpeg of the entire video with audio

With graphics programming you never have bugs, just effects

One scene in the animation featured the car driving through video. The Video Wall was an attempt to replicate a video wall from blade runner. Unfornately I messed up with the bilinear filtering so it was sampling 3 pixels from the video texture and 1 from a skyscaper texture. However it made the video wall look like it was made of blocks of LEDs. Note for some reason the color of these stills is wrong (bug in PaintShopPro's ras file loader).

Drawing in Mode 13h with Modula 2

Who needs to DirectX and OpenGL, when you can talk direct to the hardware, perfectly in sync with the display

PROCEDURE WaitRetrace();
VAR data:BYTE;
    UNTIL  (3 IN BITSET(data));
  UNTIL NOT (3 IN BITSET(data));

END WaitRetrace;



END DrawMph;

     FOR i:=X TO N DO

END SpanLine;



END PutPixel;

Modula 2 recording from dosbox -> gif ( a lot smoother on an original 486)