I first saw video feedback fractal rendering in the early era 2000s music visualisers: They copied pixel colors from a previous frame, using texture coordinates that implemented the distorting, folding of a complex conformal maps.
This is fast and (comparatively) easy to code: You assign each pixel a coordinate z in the complex plane, apply your map like z'←z²+c, and then map back to screen coordinates. The texture coordinates can be cached, reducing each frame to a single texture pull, and giving good performance on limited hardware.
A few months ago, I was programming feedback fractals on an AtMega328P-based Arduino, and was wondering: Does this technique perform on retro 8-bit computers like the 1 Mhz Commodore64?
It seems the answer is... almost , or perhaps yes ? Take a look on YouTube .
On the Commodore 64, even a small 128×64 region using double-sized 2×2 pixels seems to render at at most 4-6 frames per second. I tried a few different approaches, and this is as fast as I can get it. Even this is a bit miraculous: 128×64 is 8,192 pixels. If I'm calculating this right, at 4 frames per second with a 1 MHz clock, we have only 30 CPU cycles to update each pixel (on average).
The code is here on Github, although its a bit of a mess.

No comments:
Post a Comment