Page 2 of 2

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

Posted: Mon Dec 06, 2021 2:59 pm
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.

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

Posted: Mon Dec 06, 2021 3:11 pm
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.

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

Posted: Tue Dec 07, 2021 12:52 pm
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

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

Posted: Fri Dec 10, 2021 9:10 pm
by Mr.L
I love this kind of stuff!
Works very well - thanks for sharing! :D

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

Posted: Sat Dec 11, 2021 12:07 am
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."

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

Posted: Sat Dec 11, 2021 2:24 am
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.

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

Posted: Sat Dec 11, 2021 4:15 am
by BarryG
Ah, I get it now. Thanks.

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

Posted: Mon Dec 23, 2024 8:31 pm
by skinkairewalker
Is anyone else having trouble running the shader?
It doesn't cause any errors, but everything in the OpenGL area goes black

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

Posted: Mon Dec 23, 2024 8:56 pm
by STARGÅTE
skinkairewalker wrote: Mon Dec 23, 2024 8:31 pm Is anyone else having trouble running the shader?
It doesn't cause any errors, but everything in the OpenGL area goes black
What PB Version do you use, which operating system and which graphic card do you use?

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

Posted: Mon Dec 23, 2024 11:13 pm
by skinkairewalker
STARGÅTE wrote: Mon Dec 23, 2024 8:56 pm What PB Version do you use
I tested it on PB versions: 6.10, 6.12 and 6.20
STARGÅTE wrote: Mon Dec 23, 2024 8:56 pm which operating system
Windows 11 Home Single Language - 23H2
STARGÅTE wrote: Mon Dec 23, 2024 8:56 pm and which graphic card do you use?
Intel UHD Graphics
Nvidia 3060 Laptop

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

Posted: Tue Dec 24, 2024 4:20 am
by threedslider
Me too is shown black

I have used PB 6.12 and my Nvidia 3080 laptop

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

Posted: Tue Dec 24, 2024 10:53 am
by macros
Here both versions work flawlessly (Stargates Original Code and mpz's version)
Kubuntu 24.04 + PB 6.12 and Radeon Phoenix1 GPU (an APU)

For the original code I just added

Code: Select all

CompilerIf #PB_Compiler_OS = #PB_OS_Linux
  ImportC "-lGL"
    wglGetProcAddress_(s.p-ascii) As "glXGetProcAddress"
  EndImport
CompilerEndIf 
to make it work under Linux.