Mandelbrot set and Julia set using the OpenGLGadget and a fragment shader

Share your advanced PureBasic knowledge/code with the community.
User avatar
NicTheQuick
Addict
Addict
Posts: 1224
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Mandelbrot set and Julia set using the OpenGLGadget and a fragment shader

Post by NicTheQuick »

BarryG wrote: Mon Dec 06, 2021 1:00 pm Nice code, STARGÅTE. Fast, too. I thought I could keep zooming in forever but it does come to an eventual end.
On the one hand you can increase the iterations per step which will drastically lower your framerate.
But on the other hand there are limits with floating point values and at some point you will not be able to zoom any further.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Mandelbrot set and Julia set using the OpenGLGadget and a fragment shader

Post by STARGÅTE »

NicTheQuick wrote: Mon Dec 06, 2021 2:47 pm Works flawlessly an very snappy on Linux. very nice!

Well, 16384 iteration steps gave me a rendering time of about 1000 ms which in turn affects my whole system. Typical bad nvidia drivers on Linux I guess. :lol:
16k iterations is a lot, especially when you are looking into a "black region". Then I think 1s is fine for a normal GPU and 1600 x 800 px.
NicTheQuick wrote: Mon Dec 06, 2021 2:59 pm
BarryG wrote: Mon Dec 06, 2021 1:00 pm Nice code, STARGÅTE. Fast, too. I thought I could keep zooming in forever but it does come to an eventual end.
On the one hand you can increase the iterations per step which will drastically lower your framerate.
But on the other hand there are limits with floating point values and at some point you will not be able to zoom any further.
Right. Currently the calculation uses doubles (64bit), but I have also the option to implement fixed point arithmetic with 128bits, 256bits or more, but of course with reductions in the frame rate.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
macros
User
User
Posts: 80
Joined: Wed Mar 15, 2006 1:47 pm
Location: Munich

Re: Mandelbrot set and Julia set using the OpenGLGadget and a fragment shader

Post by macros »

mpz wrote: Sun Dec 05, 2021 9:33 pm
linux/Ubuntu error
0:1(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES
0:1(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES
Thank you very much for the Linux version, its rendering speed is incredible
and of course to you STARGÅTE for the original.

I ran into the same error as you, but then I remembered that the code runs only on my weak integrated graphics card.

A

Code: Select all

DRI_PRIME=1 ./Mandelbrot 
and in ran flawlessly on my discrete graphics with OpenGL 4.5
Mr.L
Enthusiast
Enthusiast
Posts: 104
Joined: Sun Oct 09, 2011 7:39 am

Re: Mandelbrot set and Julia set using the OpenGLGadget and a fragment shader

Post by Mr.L »

I love this kind of stuff!
Works very well - thanks for sharing! :D
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Mandelbrot set and Julia set using the OpenGLGadget and a fragment shader

Post by BarryG »

NicTheQuick wrote: Mon Dec 06, 2021 2:59 pmat some point you will not be able to zoom any further
I remember reading (or watching a documentary on TV?) years ago that zooming into Mandelbrots was unlimited because the maths involved was recursive?

[Edit] I just found this website -> https://sciencedemos.org.uk/mandelbrot.php

Which says: "The Mandelbrot set is one of the best known examples of a fractal. It is a structure with an infinite amount of fine detail: you can zoom in on the edge of the fractal forever, and it will continue to reveal ever-smaller details."
User avatar
Demivec
Addict
Addict
Posts: 4086
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Mandelbrot set and Julia set using the OpenGLGadget and a fragment shader

Post by Demivec »

BarryG wrote: Sat Dec 11, 2021 12:07 am
NicTheQuick wrote: Mon Dec 06, 2021 2:59 pmat some point you will not be able to zoom any further
I remember reading (or watching a documentary on TV?) years ago that zooming into Mandelbrots was unlimited because the maths involved was recursive?

[Edit] I just found this website -> https://sciencedemos.org.uk/mandelbrot.php

Which says: "The Mandelbrot set is one of the best known examples of a fractal. It is a structure with an infinite amount of fine detail: you can zoom in on the edge of the fractal forever, and it will continue to reveal ever-smaller details."
@BarryG: NicTheQuick most likely meant that you would not be able to zoom any further because of limitations with the representation used for a floating pointer number along with the math functions for it. For instance, the website you linked to can't zoom in beyond 7051 interations. To increase the ability to zoom in you would need a number format that could represent the increasingly small values with enough detail.
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Mandelbrot set and Julia set using the OpenGLGadget and a fragment shader

Post by BarryG »

Ah, I get it now. Thanks.
Post Reply