You are browsing as a guest. Sign up (or log in) to start making projects!

fraktalized

  • 6 Devlogs
  • 37 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                                                                      check out the github! -> https://github.com/swedishsplidney/fraktalized

Open comments for this post

7h 54m 52s logged

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

Replying to @swedishsplidney

0
3
Open comments for this post

6h 55m 22s logged

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

Replying to @swedishsplidney

0
5
Open comments for this post

5h 57m 21s logged

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

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

Replying to @swedishsplidney

0
6
Open comments for this post

4h 7m 59s logged

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

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

Replying to @swedishsplidney

0
6
Open comments for this post

6h 43m 35s logged

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:

  • the reset button for if you get lost
  • adjustable iteration slider min/max
  • direct text enter for iterations
  • hideable iteration min/max menu
  • camera smoothing
  • color clamping so it doesnt look deep fried

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

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:

  • the reset button for if you get lost
  • adjustable iteration slider min/max
  • direct text enter for iterations
  • hideable iteration min/max menu
  • camera smoothing
  • color clamping so it doesnt look deep fried

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

Replying to @swedishsplidney

0
5
Open comments for this post

5h 34m 51s logged

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:

  • Re(𝑧ₙ₊₁) = 𝑥² + 𝑦² + Re(𝑐)
  • Im(𝑧ₙ₊₁) = 2𝑥𝑦 + Im(𝑐)

also infinity is impossible so the iterations are capped at 100
 
sorry if this was too nerdy or long lmao

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:

  • Re(𝑧ₙ₊₁) = 𝑥² + 𝑦² + Re(𝑐)
  • Im(𝑧ₙ₊₁) = 2𝑥𝑦 + Im(𝑐)

also infinity is impossible so the iterations are capped at 100
 
sorry if this was too nerdy or long lmao

Replying to @swedishsplidney

0
6

Followers

Loading…