Some demos, and my thoughts thereof.

This page contains a few demos made out of the various experiments and projects i've done over the last year or so. They are all written in C++. Some work on a wider range of systems than others, and the required graphics cards vary from demo to demo too. You will need the latest release of DirectX 9.0 and also the common components.

For instructions on how to run the demos, see the 'Common Components' section below. All the demos available are known to run with the December 2005 release of the DirectX SDK. You can email bugs, comments etc etc to I'm always interested to hear what graphics cards these run on.

Cell Shading (source)

This was something I programmed early 2005 and my first experiement with vertex and pixel shaders. I think the basic algorithm came from an article on, but i'm not sure anymore. This version uses the normalize() pixel shader 2.0 intrinsic instead of a normalizing cube map so requires shader model 2.0 hardware.

You can load your choice of X file in for it to render from the menu. Try tweaking the light map as well to create different lighting styles.

At some point, I want to add outlining to this experiment. One of the ShaderX chapters has a method I think is quite nice using edge information exported from the artist software.


Pre-Sampled Displacement Mapping

This is an experiment I programmed in 2005 with the then new presampled displacement mapping API. I've always liked terrain rendering and in the past programmed terrain renderers that interleave height data with a static 2D grid mesh. Pre-Sampled displacement mapping uses a special texture sampling stage connected to the vertex shader.

This is useful because it means you don't have to build height vertex buffers from height map images on the CPU, at the expense of some pre-processing. The conventional wisdom also states that texture data is much better optomised in general than vertex buffer data, after decades of 2D rendering.

This demo seems to have stopped working since I last looked at it. Debug shows the driver is complaining a lot, so something may have changed there. I need this code for my next demo, so I should have it fixed soon.


Galaxy Simulation (source)

This is a N-body spiral galaxy simulation, with a DirectX point sprite visualisation. The simulation is physically realistic and was used to investigate model parameters for spiral galaxy evolution. The physics involved is not sophisticated enough to completely reproduce spiral galaxy evolution, but it does produce transient spiral patterns and evolutionary behaviour changes in an explicable and consistent manner with changes in the parameters.

Aside from insights into the physics on spiral galaxies, I also learnt from this project that large point sprites tend to be fill rate limited before they are vertex processing limited!


Pirates: (un)Tactical Warfare (source)

This is a rolling demo I programmed in a hurry for a job application. I wasn't all that happy with the way it turned out, I ended up cutting out a lot of features because of the short deadline and I really don't think the finished product does justice to the engine underneath it at all. On top of that, its a bit flaky about which graphics cards it will run on.

I learnt two things from making this demo: Firstly, don't spend all your time on engine code and leave no time to make use of it. Secondly, don't try to do too much on short notice!

Normal Mapped Water (source)

I originally programmed normal mapped water for the pirates demo, but since it has quite a nice look (and I want to reuse it for my next demo) i've improved it and split it of into its own demo. This is based on another ShaderX chapter by ATI. Rather than use thier series expansion for sin and cos, I just used the Vertex Shader 2.0 intrinsics (which probably does the same thing, but anyway).

Current Project: FFT based Water

Fast Fourier Transforms of oceanographic statistics frequency distributions produce extremely realistic looking waves. They are expensive to compute, but have been used successfully in offline computer graphics for films such as Titanic. There is an ATI technical paper describing success in using the Render to Vertex Buffer (R2VB) extension to computer FFT's on a GPU for the water, resulting in similar performance to a heavily optomised CPU based FFT algorithm.

It looks like in the near future gaming machines may come equipped with extra 'physics' cards, at which point FFT based water may become common in games.

(image from the ATI tech paper)

Current Project: An as yet unnamed space odyssey

This is my next demo project. This time, I intend to fully leverage the abilities of the engine code I wrote for the Pirates demo! The demo will start with a cut scene as you see a enormous ship in orbit around a small planet. A small space craft accelerates out of the massive ship. As the small vessel clears its mothership, you are given the controls and can fly down through the planets atmosphere and across its surface.

This demo aims to use the flexible engine written for Pirates, the normal mapped water and also the result of the displacement mapping experiment above to allow the extreme scale of the demo through computationally unintensive LOD techniques.

(image is borrowed from EVE online)

Digital PnP

I also work on the Digital PnP project over at Ironwood Omnimedia. Its due for release sometime in July 2006, if your into role play games, go check it out! The Digital PnP software is written in managed C++, at the moment just by me.

Common Components

These are the Visual Studio 8 C run time dll's and the D3DX9_28 dll. These files are typically larger than the rest of the demo put together, so i've split them of. To run the demos, copy the common components into the unzipped demo directory and then just double click the demo's exe.

Source Code

The source code downloads contain code specific to each project, the underlying 'Nebula' framework/engine source and a VC8 project and user options file. They don't include the art for each project, which you can copy from the precompiled exe downloads. Where there is a Nebula file duplicated in the project source code files, use the project source code version first.