Clay Render

WARNING! This is archived content, you will be unlikely to get it working unless you use a DOS emulator capable ofemulating VESA video modes or you crank up an old Pentium 1 with a VESA graphics card.

I recommend using DOSBOX It'll run slowly as it's emulated but if you run it in native DOS mode, you'll get realtime framerates.

Click here to download the demo


I wrote this software rendering engine in around 1997, just as reasonably capable 3D hardware accelerators were beginning to hit the market in large numbers.

These were very transitional times. DirectX was a mess back then and OpenGL support was patchy. Most people didn't have a 3D accelerator so there was still a lot of scope for software rendering engines.

My aim for this engine was to get real-time framerates with multiple light sources, specular and environment mapped shading and transparency that handled specular highlights well.

      All of the inner loops were written in hand coded assembler for speed, as compilers weren't quite as bright back then. I quickly ran into permutation problems that today I'd overcome using some natty template meta programming or on the fly compilation of pixel shaders (an idea I toyed with at the time but dismissed as too much hard work!)

The engine worked fine and I used it in the then new version of ClayWorks, which was still a DOS based application but was written in C++ and used true colour modes.

  That version of ClayWorks was never released however as Direct3D was beginning to get better and I discovered that I could easily port all of my rendering code to Direct Draw with minimum of fuss.  I was very wary of releasing code dependent on the now defunct VESA graphics standard. The VESA standard was a set of bios functions that different graphics card manufacturers of the day used, way before DirectX came along.  There were some very loose interpretations of the standard, making life difficult for indy coders such as myself.

Getting applications to run on different hardware was a nightmare and I began to realise that I was spending more time working around inconsistent hardware than I was actually coding interesting work. 

Things are a lot better these days with DirectX and OpenGL. However, some manufactures still seem to play fast and loose with standards.  I've had many problems getting some Intel chipsets to do even simple rendering operations to standard. Unfortunately for us graphics coders, these cards seem to be ubiquitous as most consumers don't think much about the graphics card when buying machines.

Having experienced some very demanding customer support issues with the free version of ClayWorks under VGA in DOS (which was a far more robust standard), I quailed at dealing with the issues I knew would arise if I released that version of ClayWorks.

I learned early on how vitriolic people can be, even when they're getting the fruits of my labour for nothing! (oh the fun I had getting people to install mouse drivers)

I stopped working on this engine in 1998, having seen that the future was going to be in accelerated graphics, even if the quality of the rendering left a lot to be desired: early cards were designed just to chuck out as many textured polygons as possible, with little thought to interesting lighting models.  I re-implemented much of the engine in Java a few years later and released a number of web games using this version of the engine.

The following is a table listing some of the engine's features:

Rgb lighting 
True transparency 
Ambient, diffuse and specular materials 
4 internal texture formats 
Fast affine texture mapping, perspective correct mapping
Environment mapping 
Vertex colouring 
True colour polygons
Lens Flare
Loads mindformer files
Specular reflection lighting
Polygon Glow
6 plane clipping
Gouraud shading (with transparency and texturing)
16bit, 32bit and 24 bit colour rendering
VESA 2.0 compliant
sub pixel accuracy