Show HN: CUDA Fractal Renderer
16 comments
·July 26, 2025neomantra
azath92
The electric sheep always intrigued me so much! but was a bit before my time, and also felt so impenetrable. I appreciate you drawing the link between them and something like this which is so finite and understandable.
and to OP for making something so finite and understandable ofc.
neomantra
Porting the ElectricSheep AfterEffects Plugin from Windows to OSX was my true first open source contribution (1999?). And that only happened because my friend was friends with its author and it came up when he was showing off some fractals movies. Then I said, “Oh I can help you with that.”
That OSS plugin itself was riding on the OSS ElectricSheep. All collaboration and distribution was via tarballs, although is on GitHub now. It was a trip seeing some code I wrangled make its way into commercial media, just organically.
The ElectricSheep project weaves so many cool tech threads together. Only thing is was missing compared to modernity is decentralized genome propagation.
Scott Draves, its author, has some great artist content too. He also spearheaded Polyglot notebooks, early on in that kind of interface.
azath92
I think the depth (in time, and community involvement) is one of the things that has drawn me to this project. It has the excellent vibe of a dedicated and yet accessible, IMO because of the beautiful and widely available visual output, internet community.
Thanks for sharing some of this rich history!
monster_truck
Electric Sheep still works great to this day. The lifetime membership is worth it if you want nice enough sheep with 0 effort, but there are countless HD packs on archiveorg and elsewhere
azath92
cool to hear that the actual electric sheep project is still something you can interact with!
For those super new to it (like me), check out https://electricsheep.org/ og video we came across it with https://www.youtube.com/watch?v=O5RdMvgk8b0 (this was just the first I found when looking there are many on youtube) and the algorithm behind it https://flam3.com/ This is all AFAICT as someone who's only just skimmed the surface, but i find it amazing.
sestep
Thank you for providing a uv.lock file! I spent a good chunk of last month trying to get graphics research projects working that only provided requirements.txt (or not even that, e.g. the original Gaussian splatting paper), and it was hell to figure out how to undo all the bitrot.
dcanelhas
Thanks for sharing. I don't see why there is an atomic add in the kernel there. It doesn't look like two separate threads should be able to modify the same pixel, based on the block/thread indices?
tripplyons
Each block is for a different image, but each thread within the same block has a small chance of modifying the same pixel.
porphyra
Writing CUDA in Python is so nice and elegant now. What a time to be alive! I love how wonderfully short the code is.
bsenftner
Have you tried fractal volumes yet? A calculation worthy of cuda... Or even fractal animation? Fun awaits!
neomantra
I have been very interested in fractal volumes using mesh shading to sample the isosurfaces. Some of the first mesh shader demos included Mandelbulbs, but AFAIK there's been no OSS tools/demos 7 years later?
Please comment if you know of one! Checking now, there appears to be recent (~3 years) graduate research papers on this topic , so a new reading list for me.
tripplyons
I've experimented with fractals in higher dimensions, but not in CUDA yet. Seems like a good next step!
almostgotcaught
tangential question: does anyone know a way to call/use CUDA from graphics code? like directx or opengl (or whatever). as opposed to this code which is named "renderer" but doesn't draw to the screen...
corysama
There are DX/GL interop functions in the CUDA API. But, they are a bit tricky. Unless you really have a strong, specific need for something only available in CUDA, you are better off using compute shaders.
Ono-Sendai
compute shaders?
OP, great work on this. While I can't run it, I appreciate that it's pretty bite-sized and easy to inspect.
Dealing with volumes is a big change, but interpolation of the affine transforms is not far off. Expose the matrix to the CLI and then one can wrap it with an interpolation script; or you can build that interpolation in. Maybe note the generation time in your README?
I spent many weekends in the mid-00's doing GPGPU for ElectricSheep-style Iterated Function systems, instead of the distributed ElectricSheep network [1]. That was C++ and CUDA. Your implementation is much easier to make sense of, albeit it smaller scope.
[1] https://electricsheep.org