Raytracing in < 2KiB

December 31, 2011

Raytracing in 2KiB (Click to download)

A first prototype for the “4K Executable Graphics” competitions.
The executable is 1616 bytes using UPX (2178 bytes uncompressed)
including VESA RGB/BGR 24/32bit detection, automatic resolution selection and VGA fallback.

(64bit windows users will need to use dosbox to run the executable)

It’s a lot of fun to optimize for size rather than speed, making and reusing as many function calls as possible to reduce the code footprint, unrolling short loops and restructuring the code to produce as many repeating byte strings as possible for the compressor.

Leave a Reply

Your email address will not be published.