Ray Tracer ported to an x86 boot sector in only 483 bytes, run on Pentium Pro and faster CPUs

nanochess' Boot Sector Ray Tracer Demo
nanochess' Boot Sector Ray Tracer Demo (Image credit: nanochess on YouTube)

Do you think real-time ray tracing requires a modern GPU? It still does for practical applications, but YouTuber nanochess has a functioning ray tracing demo with ray-traced reflections working on machines as old as an original Intel Pentium Pro (1995), and in only  *483 bytes at that. Below, we've embedded the original video of this demo, titled Boot Sector Ray Tracer.

*Previously 506. Changed during the writing of this article!

Boot Sector Ray Tracer is a simple demo showcasing a camera coming across two reflective orbs floating in the air in the middle of a large, empty space surrounded by a colorful sky. The colors of the sky reflect off of both orbs realistically, as do the reflections of the orbs themselves, resulting in a hall-of-mirrors effect if one looks into the correct part of the reflection during the animation. It's also real-time animation, so the final speed will depend on your hardware.

The main ray tracing effect being shown is ray traced reflections. Non-ray traced graphics, or rasterized graphics usually, can only display reflections based on information already available onscreen. These limitations have workarounds like rendering additional character models in video games, but there's no room for "workarounds" in 483 bytes!

The full demo is available for free on GitHub and is recommended to those who have the old hardware lying around or don't mind setting up a virtual machine for something like this. The YouTube animation runs on a Macbook Air through a VirtualBox'd Windows XP, and seems to run perfectly smoothly despite the virtual machine ahead.

Other projects by Nanochess include an Intel 8080 emulator, various Chess programs, and even various homebrew games for retro consoles and PCs (Intellivision, MSX, Atari, etc).

Additionally, Boot Sector Ray Tracer is inspired by a similar 8-bit "RayTrace Movie" demo released for Atari, though that runs at frames-per-hour. The visual touching up that this (relatively) more modern Boot Sector RT demo makes it look more akin to something like the classic Amiga ball demo instead of the pure-pixel vaporwave aesthetic of the original Atari demo.

Christopher Harper
Contributing Writer

Christopher Harper has been a successful freelance tech writer specializing in PC hardware and gaming since 2015, and ghostwrote for various B2B clients in High School before that. Outside of work, Christopher is best known to friends and rivals as an active competitive player in various eSports (particularly fighting games and arena shooters) and a purveyor of music ranging from Jimi Hendrix to Killer Mike to the Sonic Adventure 2 soundtrack.

  • kyzarvs
    Ray tracing demos were all the rage on the indy scene for the Commodore Amiga in the late 80's / early 90's. As was VR in some arcades in the mid-90's which is why I'm underwhelmed by either after a 30 year wait...
    Reply
  • usertests
    Still one of my favorites.

    iw17c70uJes
    Reply
  • digitalgriffin
    Solution has been around over 13 years. I saw the code myself.
    Reply
  • bit_user
    Here's one of the best 4 kB intros I've seen:
    jB0vBmiTr6oView: https://www.youtube.com/watch?v=jB0vBmiTr6o
    Reply
  • bit_user
    usertests said:
    Still one of my favorites.

    iw17c70uJes
    Definitely a classic, but by no means small (for the time)! I seem to recall it wouldn't even fit on a single 1.44 MB floppy. I'm sure it was at least a MB!

    Some friends and I used to enjoy downloading the top demos from each new party, watching them, and then trying to figure out how they implemented all of the effects.

    According to the Wikipedia page, members of the Future Crew went on to do some of the following notable things:
    Futuremark (3DMark)
    Remedy (Death Rally, Max Payne, Alan Wake)
    Bugbear Entertainment (FlatOut, Glimmerati, Rally Trophy)
    Bitboys (a graphics hardware company)
    Recoil Games (Rochard)
    contributed graphics to the game Ken's Labyrinth published by Epic MegaGamesSkaven contributed music to Unreal Tournament 1999
    Reply
  • dalauder
    Why don't the orbs reflect the floor? A halfway reflected scene just seems really off.

    Vampire floor?
    Reply
  • BogdanH
    dalauder said:
    Why don't the orbs reflect the floor? A halfway reflected scene just seems really off.
    Hmm.. at least to me that video has nothing to do with ray tracing: what we see is two "chrome" circles (with static content) slowly growing, which gives the impression of coming closer (because floor is "moving" away from observer). In short: is just an optical illusion.
    Reply
  • usertests
    bit_user said:
    According to the Wikipedia page, members of the Future Crew went on to do some of the following notable things:
    You can clearly feel the demo vibes playing Death Rally.
    Reply
  • Xenophage
    kyzarvs said:
    Ray tracing demos were all the rage on the indy scene for the Commodore Amiga in the late 80's / early 90's. As was VR in some arcades in the mid-90's which is why I'm underwhelmed by either after a 30 year wait...
    I came to comment basically the same thing. I had a 3D ray-tracing demo on my Amiga 1000. That's a Motorola 68000 CPU, which was a 32-bit CPU introduced in 1979. Still one of the best CPU designs ever.
    Reply
  • bit_user
    Xenophage said:
    Motorola 68000 CPU, which was a 32-bit CPU introduced in 1979. Still one of the best CPU designs ever.
    I'm genuinely curious why think so. Care to enlighten us?

    For me, I basically stopped at the part where it's big endian.
    : P
    Reply