Something being impractical isn’t any reason not to do it, which is why just about anything with a CPU in it can run Doom by now. For the same reason there obviously is a way to do ray tracing of 3D scenes on a modern-day TI-84 Plus CE graphical calculator. This is excellent news for anyone who has one of these calculators, along with a lot of time, perhaps during boring classes, to spare.
As [TheScienceElf] demonstrates in a video, also embedded after the break, it’s not quite the real-time experience one would expect from an NVidia RTX 30-series GPU. Although the eZ80-based CPU in the calculator is significantly more efficient than a Z80 as found in many 1980s home computers, the demo scene at standard resolution takes about 12 minutes to render, as also noted on the GitHub project page.
Perhaps the most interesting part about this project is its use of the Clang-based C & C++ toolchain for the TI-84 Plus CE which gives easy access to the calculator’s hardware and related, including graphics, file I/O, fonts, keypad input and more. Even if using a TI-84 Plus CE to render the next Pixar-level movie isn’t the most productive use imaginable for these devices, this project and the CE toolchain make it all too easy to tinker with these $150 devices.
It would also offer a nice change of pace from writing Snake in TiBASIC, a BASIC dialect in which [TheScienceElf] incidentally has also written a ray tracer.
(Thanks to [poiuyt] for the tip)
16 thoughts on “Ray Tracing On A Modern TI Graphing Calculator”
$150? I’m assuming you’re paying primarily for the software running on it (& branding), rather than the hardware these days
Software being what makes the value:
That’s been the case for a long time. Your iPhone’s parts also don’t cost nearly as much as the retail price.
Hardware not being what makes the value:
A well-designed calculator costing more than the thing your local bank gives out as freebies is also not a new thing! So, no, hardware design does certainly play a role here.
Sure, there’s a strong capturing effect: educators have to settle on *one*, maybe a class of devices. TI and Casio pretty much own that market.
The argument for these rather than smartphone apps is by the way “distraction free” (TI’s term) due to no bluetooth, or internet connectivity, and therefore also non-cheatability. As little as I like that – it makes sense in a classroom setting. Otherwise, “here’s the Android & iOS app that the school district paid for (or that is free), in case anyone forgot their phone, we have three lenders” would solve this in practically all markets where pupils have graphing calculators.
Those calculators are phenomenal… Not to be undervalued especially for math and science fields and their worth every penny
Wish there was a C compiler for my HP 50g.
But… there is? Correct me, the HP 50g is based on an ARM, which in turn runs an emulator for the HP 4-bit “Saturn” CPU. (Which, honestly, is an incredible design choice. I’m not sure whether in a good or a bad way.)
So, while the HP software you interact with might be partially written for a strange 4-bit HP CPU from the 1980s, you can directly target the (also already old) ARM9; and I believe a lot of the software on it is actually natively ARM; makes little sense to add an RS232 port to the hardware, then write an interface to your emulator for that, then write a driver for the 4-bit CPU emulated, then put all that in the small address space within the emulator, instead of writing everything from scratch for the ARM and just having parts of the UI / math be strange for legacy/UI compat reasons.
There is allegedly a C compiler for the Saturn processor: http://hp48xgcc.sourceforge.net/
One day I’m planning to try and get my own language’s compiler working on the HP48. I’d need to port it to produce the completely crazy Saturn machine code, and then figure out how to run the compiler itself on the calculator! Plus lots of work making everything work with 4-bit addresses.
The Saturn instruction set is possibly the most bizarre I’ve ever seen, and I used to program for the ShBoom.
The z80 is about 1.16 MIPS at 8MHz.
You can get 3.52 teraflops on a second hand tesla K20 for similar money, but admittedly, it won’t run on alkaline batteries for as long.
is that the original Z80 or the eZ80?
original. It seems the eZ80 when clocked at 50MHz runs at 80 mips. Maybe someone could design a GPU with multiple eZ80 cores!
Is anyone going to setup a render farm of TI-84+ CE calculators to make a video? 320×240 resolution, 16 bit color. 12 minutes per frame. It would take 288 calculators to render the equivalent of 24 frames per second. Ie, start them rendering at 1/24 second intervals so that 24 frames per second could be pulled off and stacked in order to make the video in real time.
But then there’s the possible issue of variable rendering time. Frames that take less than 12 minutes wouldn’t be a problem, just take them off to a buffer to wait their turn. Frames that take longer than 12 minutes would be a problem. Time for some pre-calculation on more complex scenes, or do it the brute force way. Render the most complex frames then increase the number of calculators in the render farm to be enough as though every frame render is the worst case.
With that, for most of the video the output could be faster than real time.
More like 17280 calculators. 24x60x12.
Heck, I got bored in class in high school and programmed my TI-83+ to raytrace a sphere! I can’t hardly think of a slower way to draw a black circle on the screen, and of course I didn’t bother to do any lighting calculations either, but it worked! I also had it plot the classic Mandelbrot as well. Somewhere I hopefully still have pictures of the calculator screen from this madness…
That’s cool! I for one would be interested to see a photo of your calculator and the screen ! 🙂
12 minutes? My DOS PC (80286,12MHz, VGA) doesn’t have such a long raytracing time in 320×200 @256c.. Or 640×480 @256c, even. Anyway, I’m just a bit disappointed about the eZ80. I expected more. Even the Z80/Z80A had certain 16-Bit instructions. Still, all in all I’m impressed that the calculator is able to do that, at all. 🙂👍
I used to make all kinds of games and animations with TI basic on my good ol’ z80 based ti 73 and 84. It was a really great way to pass the time in class. Also terrific for making programs when I didn’t want to remember equations for physics or chem classes and to put small notes in for my calculus classes
At one point there was a full gameboy emulator where you had to pan and scan because the screen resolution was just a little bit less than the original GB. It even had sound if you wanted to slow down the game to a crawl and were willing to hack together a 2.5 mm phone jack adapter.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)