fraktalized
- 11 Devlogs
- 70 Total hours
an ultra-smooth, cross-platform 2d/3d fractal engine featuring a decoupled Qt6/OpenGL pipeline, 64-bit precision, and an asynchronous micro-tile rendering matrix to render at 32k scale without exploding your gpu
an ultra-smooth, cross-platform 2d/3d fractal engine featuring a decoupled Qt6/OpenGL pipeline, 64-bit precision, and an asynchronous micro-tile rendering matrix to render at 32k scale without exploding your gpu
As a prize for your great work, look out for a bonus prize in the mail :)
extra ui tweaks and readme updates
added some images of 3d fractals to the readme, did some general ui tweaks, and some idiot proofing
now its time to ship!!! 
probably the final commit :o
most of this was spent idiot proofing, going through all my code and making sure that everything works well and actually makes sense
i also updated the tutorial to be a bit better
a major amount of time was spent figuring out how to get windows to actually compile
i swear windows is the bane of my entire existence
its not reflected in the devlog hours, but i did also make a demo video to show off some of the features
mystery link
other than that, it was mostly ui and readme updates :)
i set up a full tutorial system
the hard part was doing the whole thing where it darkens everywhere except the thing the tutorial is yapping about…
also, right now, the tutorial is really really easy to break, so i might have to implement some idiot proofing or something
to be honest, adding the whole darkening thing was really simple, but actually getting it to work was really annoying for some reason.
it essentially just gets the xy coord for each corner of the specified element, and then makes a dark block everywhere except inside those 4 corners.
also, i made it so the tutorial saves to the same json file as the preset manager, so that you only have to do the tutorial one time and it doesnt just get in your way every single time you open it.
aside from that, most of this time was spent trying to figure out how to get it to automatically build on github when i push a release.
i did this successfully for my other project, but the problem so far has been linking the qml for the binaries on the different platforms.
specifically, windows just really really doesnt want to behave, its starting to feel like getting a discord mod to eat anything other than gamersupps and pizza rolls
overall, maybe getting close to shipping? it honestly just depends on how much more features and idiot proofing i want to add 
if this sounds interesting, check out (and star
) the repo here
3d wasd controls (wowie zowie)

the math for this was super hard, especially because i want it to work alongside with the other classic orbit style controls lol
i ended up adding a toggle in the sidebar, which felt like the cleanest way to do it, but did mean doing more qml 
also, i pretty much had to guess when setting up all my vectors so i
spent like 15 presidential terms messing around with positives and
negatives and 1.0f / 0.0f everywhere until doing stuff in the right
directions actually did the right thing, which was hard
also had to implement auto horizon correction so things d
also added some live 3d settings, which took a while, but now theres a
live slider for both the mandelbulb power (exponent), and the brightness
(which was hard)
and, theres now a math section in the readme, which i spent a lot of
time pondering while making, but if you’re at all, check out the “mathy
information” section of the readme
https://github.com/swedishsplidney/fraktalized
(also star the repo
)
exploring the mandelbulb in wasd mode genuinely feels like exploring an alien planet in a spaceship, lowk super fun
3d is finally working!!!!!

i have been having an epic samurai battle against opengl and 3d fractal math for what feels like forever, but it finally works, and I have a working 3d mandelbulb explorer!!!
i have actually been working on getting 3d working for the past multiple devlogs, it just took me sooo incredibly long to actually figure it out that i never really mentioned it.
the longest step was figuring out the controls. when i first started working on the 3d mode, then it was literally just a cube, and i had to figure out a good way to be able to rotate it
the hard part wasn’t even trying to figure out how to do the math to rotate the vertices, the hard part was trying to figure out how the thing should actually rotate
what i figured out how to do is having an orbit style camera, where dragging side to side rotates the model along its own local yaw, and then dragging up and down changes the camera’s global pitch. this way the model’s roll never changes (because that makes the model look tilted or skewed).
i had to spend an embarassingly long amount of time trying to figure the logic of an orbital camera…
the camera is also slerped (like lerping but 3d) so it feels smooth
color mappping on the 3d was actually surprisingly easy, i just did it in a very similar way to the 2d escape time ones, except with an extra dimension (its not as hard as it sounds)
one other major change was when i added the ability to add and remove gradient stops. this way, instead of always having 4 gradient stops, you can have anywhere from 2 to 16 stops, for more customizeability.
also, the readme is updated, go check it out! (and star the repo
)
https://github.com/swedishsplidney/fraktalized
below: video demonstrating the 3d and camera system
added iterative function system fractals
basically, iterative function fractals are fractals that start at a set point, then repeatedly apply the same affine transformations (scaling, rotating, shifting), making an infinitely repeating, self-same fractal.
as far as actually getting this setup and working, i had to make a whole new compute shader that involves a lot of math and for loops to iterate forever
getting ifs fractals to render was a particular challenge, and i almost exploded my gpu and accidentally caused a vram cache overflow causing my display output to break. in the end, it turns out the trick was to not send 4,000,000 worker threads to the gpu all at once, and to do them 3-4 at a time
also finally got working on the whole 3d system, which will likely take forever, and completely does not work right now, but hopefully i will have figured out how in the world to get working 3d stuff by the next devlog 🙏
check out the github! -> https://github.com/swedishsplidney/fraktalized
image: barnsley fern, rendered in 4k
added support for trajectory based fractals
most people know the normal fractals (the ones ive covered so far), such as the mandelbrot and julia sets, that test wether or not a point escapes and maps how long it takes to escape
trajectory fractals look really cool, and the difference is that they map the trajectory that 𝑧 takes on its way out, while incrementing a counter for every pixel it steps on.
getting this to work was a lot of work, and required to write a whole new shader file from scratch, except instead of a .frag/.vert combo, it was a compute shader (.glsl).
instead of simply running a loop and writing color data to each independent pixel like with the escape-time fractals do,
the trajectory shader has to pick a random (x, y) starting coord, and then track its orbit across the complex plane, writing data to random pixels as it goes.
this required me to use atomics, because if 2 orbits cross, instead of one overwriting each other, you have to use imageAtomicAdd() to make sure that the brightness stacks up.
one other issue was that at first it was super grainy, which was fixed by assigning each gpu thread 50 random sampled to increase detail substantially.
i also nearly exploded my gpu because i accidentally had the render system run 50+ compute sequences at the same time, so i now have each compute wait for the one before it to finish
in other happenings, there is now a preset feature that writes your current color setup set, zoom, center, etc. to a JSON file to be loaded later
also added the newton set, but its a less interesting escape-time fractal, so not covered in as much detail
image: buddhabrot set, rendered at 4k
added the burning ship fractal, anti aliasing, and completely overhauled the color system to use a gradient input instead of one color.
burning ship fractal:
so the burning ship fractal is made when you take the mandelbrot equation, but you take the absolute value of the real and imaginary parts before squaring, basically destroying the symmetry:
𝑧ₙ₊₁ = (|𝑅𝑒(𝑍ₙ)| + 𝑖|𝐼𝑚(𝑍ₙ)|)² + 𝐶
this makes it look super duper cool (as seen in the image below)
gradient-based color mapping
so before, the color was just calculated using one color tint and boosting brightness quadratically near the edges.
now, it takes in a gradient (calculated between 4 color inputs), and does the same color mapping but essentially moves what color it uses as the iterations increase.
the hard part is figuring out how to get a good input system in qml with this, but I was able to do it using some colordialogues and a lot of trial and error.
the new color input system is kinda like creating a gradient in photoshop or illustrator, with 4 little handles that you can drag across and change their colors.
anti aliasing
also added anti aliasing, or more specifically, ssaa (super sampling anti aliasing), with a selector to choose between off, 2x, and 3x
so basically it renders the entire fractal at a higher resolution (2x or 3x) and then averages the color of every pixel block (2x2 or 3x3 respectively) and then displays that. this results in a much, much smoother image at the cost of much higher resource usage.
while i was screwing around with dynamic resolutions, i also added a resolution slider to change the rendered resolution to anywhere from 25 to 150% of the window resolution. turning it up past 100% basically just gives the ssaa architecture more information to work with, making it even smoother
my graphics card isnt very powerful and it basically stays pinned at 99% usage and 100% clock when i have anti aliasing turned on and the iterations above like 200.
image: burning ship fractal, rendered at 4k with 150% resolution scale and 3x ssaa
now has a render to file feature
basically you just import a custom resolution and it takes your current center and renders at that resolution with your current parameters. the hard part is that it uses a completely different framebuffer object from the regular viewport.
while testing i did almost explode my gpu when pushing the resolution to almost 32k, which is kinda unreasonable, but this was a good opportunity to add a tiled render system
basically it just splits up the image into 2000x2000 pixel sections and renders them, and then it does some math to position it
the weird thing is that opengl is kinda goofy and likes to mirror stuff for some reason (literally no idea why) so theres some math to render it in reverse (which means that its actually correct)
also increased the rendering to 64 bit, meaning it is now 536,870,912 times more accurate compared to the 32 bit one, and also means you can zoom in more than twice as far with better quality, but it is much more gpu intensive…
this image is one of the cooler ones i rendered out at 4k, it kinda looks like colliding galaxies or something
is now fully interactive and honestly feels super great, especially compared to my last devlog where it was static and unchanging entirely
added working real-time render parameters such as panning and zooming with mouse, and custom iteration setup and color setup on the sidebar.
lots and lots and lots of quality of life features, such as:
also added the julia set (which is what is in the image)
so basically, both the mandelbrot and julia sets are the same quadratic recurrence relation on the complex plane:
the main difference is that you start at the origin (𝑧₀ = 0) and change the constant 𝑐 for every single pixel on the screen based on its coordinates, but with the julia set the constant 𝑐 is the same everywhere, and the starting point 𝑧₀ changes based on the pixel’s coordinate, so you are testing how different starting points react to the same gravitational pull of 𝑐.
the nice thing is that you can change the constant 𝑐 in the julia set, and completely change how the fractal looks, so i added that as an input field too
looks really really cool lowk
working mandelbrot fractal rendering through opengl!!!!!
using qt/qml and raw opengl shaders together was a mistake
they really dont like working together and i had to spend 3 straight hours (its 5:42am at the time of this devlog) debugging an eternal tug of war between qt and opengl because qt kept overwriting what i wanted to happen
the worst part is that an opengl fragment shader cant really debug to the log so if something is on fire over there i just kinda have to guess to fix it
eventually i just gave up and switched to framebuffer objects, which i lowk should have done from the start
the funnest part was actually writing the equations for the mandelbrot set lol (it also looks super pretty):
so basically the Mandelbrot set is the set of all complex parameters 𝑐 ∈ ℂ for which the orbit of 𝑧₀ = 0 under quadratic recurrence remains bounded. in the shader, i just separate its multiplication into real and imaginary components:
also infinity is impossible so the iterations are capped at 100
sorry if this was too nerdy or long lmao