| Submitted by , posted on 16 May 2002 |

Image Description, by The images above shows our recently released Amiga 64k intro. It is available for download, incl. a divx video version, here: http://loonies.dk/demos/demos.asp?id=thecastle The target system is a MC68060/50mhz cpu, AGA (the 2nd generation Amiga graphics chipset) and 18 mb ram. The whole thing including music takes up 64 kb on disk. Think about the performance of recent PDAs...
The whole intro is running clean 25 fps, synchronized to the video beam, ie. a new image for every 2nd time the video beam sweeps the screen. This gives a quite smooth performance compared to ordinary "free running" 25 fps.
The 3D Engine
Portal like approach. Portals are placed manually and most of the time only in the doorways, connecting the individual rooms in a graph.
Each room is then sorted by its own BSP tree. These local BSP trees ensures minimum splitting of polygons.
Scanline based C-buffer (coverage buffer) to avoid any overdraw.
The walls etc. are rendered as convex polygons with perspective correct texturemapping. The division involved in the perspective correct mapping is done in floating point while mapping the next 16 pixels affine. During the remainder of the perspective mapping calculations themselves, the memory bus is utilized copying parts the last rendered frame to the slow graphics memory.
Dynamic objects are placed as single points in the BSP, and rendered completely at that point in the render process (the choice of point for an object is ofcourse quite important then). The dynamic objects includes some small particle systems, torches (as blended animated billboards) and ordinary affine texture mapped objects.
Interrupt driven queue-like n-buffer (instead of double or triple buffer) system to make the framerate more stable by allowing the render to render ahead of time to save up frames for the slower parts of the scenes. This effectivily turns our 25 fps requirement from a worst case to an average case requirement. This is ofcourse only possible because the system is not interactive.
The 64 kb consists of the following (after compression):

> - 30 kb code
> - 8 kb music, including player and softsynth for samples
> - 10 kb textures (see below)
> - 15 kb highly compressed 3d objects
> - 1 kb motion paths

All textures are built from the same 256 different 8x8 pixel tiles. This makes pretty dull and repetetive textures, so noise at different frequencies are added afterwards. Lightmaps are then calculated by interpolated raytracing incl. manually placed shadow objects (mainly to improve precalculation speed compared to shadows from everything). The lightmaps and the textures are finally combined so just a single texture has to be mapped to each polygon in the realtime part. This is ofcourse a bit expensive memory wise, but not as bad as usual, as the textures at this point are 8 bit only too.
The intro ended up 2nd in the amiga intro competition at Mekka-Symposium, the most important demoscene party worldwide. However, the competition rules allowed both 3D hardware (which also cuts away a good deal on the code size) and a PowerPC cpu 5 times faster than our 68060, and the winning intro used both.

[prev] | Image of the Day Gallery www.flipcode.com | [next]

Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
Please read our Terms, Conditions, and Privacy information.