Ray Tracing On A Modern TI Graphing Calculator

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

    1. 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.

    1. 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.

      1. 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.

  1. 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.

  2. 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…

  3. 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. πŸ™‚πŸ‘

  4. 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.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.