It turns out that ray tracing on a 42-year-old computer is actually possible, if you’re willing to wait 17 hours for each frame to load

ZX spectrum computer
(Image credit: / seeshooteatrepeat)

We hear the term ‘ray tracing’ thrown around more and more these days, being one of the features almost synonymous with modern, best-in-class visuals. It’s a rendering method that allows shadows and light to be portrayed in a more realistic, lifelike way, and is included as a graphics option in many current-generation games. Needless to say, it’s probably not the sort of technology that you’d imagine a 42-year-old computer could even dream of running. 

However, it turns out that the trusty ZX Spectrum, released by Sinclair Research back in 1982, was capable all along, at least with the brains of Google Zürich senior software engineer Gabriel Gambetta behind it. As spotted by Hackaday (via PC Gamer), Gambetta has shared how he managed to use the Spectrum’s in-built programming language, Sinclair BASIC, to get the computer to produce a shiny, ray-traced frame.

Before we get into it, it’s important to note that the ZX Spectrum has its limitations. As Gambetta notes, its processor is roughly 1,000 times slower than a modern-day computer, it has a whopping total of 48 KB of RAM, can display only 15 colors, and boasts a 256x176 resolution. Needless to say, if you’re expecting to see a beautiful, realistic screenshot from Cyberpunk 2077 come from it, that’s not going to happen, but what you can get is a still image of three colorful 3D objects with surprisingly detailed shadows. 

Gambetta went through the entire process in a detailed post on his website. But in short, after porting over a ray-tracing code into Sinclair BASIC, and a lot of testing at higher resolutions and optimizations, his final test was able to produce an image that had him staring “in disbelief for a good minute.”

This final result still suffers slightly from attribute clash - you can clearly see that some of the red in the image bleeds over into the yellow (the blue and green do too, but less so). On top of that, it took around 17 hours to render, which amounts to, erm, about 0.000016 frames per second. Not the speediest output, then. Regardless though, given the computer’s limitations, this is certainly impressive, and a truly fascinating experiment - I’d encourage anyone interested to take a look at the whole thing on Gambetta’s website

On the lookout for some new games to dive into? Be sure to check out our recommendations for the best PC games, as well as the best multiplayer PC games for some options to play with friends.

Catherine Lewis
News Writer, TechRadar Gaming

Catherine is a News Writer for TechRadar Gaming. Armed with a journalism degree from The University of Sheffield, she was sucked into the games media industry after spending far too much time on her university newspaper writing about Pokémon and cool indie games, and realising that was a very cool job, actually. She previously spent 19 months working at GAMINGbible as a full-time journalist. She loves all things Nintendo, and will never stop talking about Xenoblade Chronicles.