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
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.