Welcome to Fractal Forums

Community => Meet & Greet => Topic started by: FractArno on August 04, 2011, 01:10:42 PM




Title: Hello Mandelbulbers
Post by: FractArno on August 04, 2011, 01:10:42 PM
Hello Mandelbulbers!

I’m new here. Being fascinated by the complexity and beauty of the Mandelbulb fractal, I’ve started some month ago to write a small program with the goal to render such 3D-Fractals.

Most things I’ve go so far can be found on http://fractal3d.1x.net/
On the main page I tried to summarize the algorithm and I would be happy to get feedback of what I did wrong or right – I’m sure there is potential to improve the images…

There is also a small gallery http://fractal3d.1x.net/galery1/galery1.html and some gif animations …these animations take while for loading

http://fractal3d.1x.net/julia-anim-power-2/anim/julia-anim-p2.gif
http://fractal3d.1x.net/julia-anim-power-6/anim/julia-n6-anim.gif
http://fractal3d.1x.net/julia-anim-power-8/anim/julia-anim-p8.gif
http://fractal3d.1x.net/morphing_the_power/anim/Nvar.gif

I did all the programming just for fun and I would be happy to get feedback and to learn from sophisticated comments.
 



Title: Re: Hello Mandelbulbers
Post by: bib on August 18, 2011, 09:47:15 PM
Hi, and welcome to the forums. You've got a nice gallery and great animated gifs here, congratulations for your program!


Title: Re: Hello Mandelbulbers
Post by: FractArno on August 19, 2011, 06:01:41 PM
Thanks a lot  :)
As soon as I'm going to find time, I want to learn to speed up the program. At the moment everyting is done on the CPU and I want to learn how to run the algorithm on the GPU. Since I'm a greenhorn on GPU programming, I'm sure I will find appropriate platforms here .. ?!


Title: Re: Hello Mandelbulbers
Post by: A Noniem on August 19, 2011, 10:40:00 PM
Thanks a lot  :)
As soon as I'm going to find time, I want to learn to speed up the program. At the moment everyting is done on the CPU and I want to learn how to run the algorithm on the GPU. Since I'm a greenhorn on GPU programming, I'm sure I will find appropriate platforms here .. ?!

There are a few people (including me) doing some gpu stuff indeed, so if you need any help we'd be glad to help you out.


Title: Re: Hello Mandelbulbers
Post by: FractArno on August 21, 2011, 10:34:40 AM
A Noniem , Thanks, I'll appreciate your help on GPU – programming!
Which programming language/libraries would you recommend (CUDA, GLSL, …)? 
---
P.S.: Unfortunately, my domain service deleted my gif animations :(
Hence I've put them on youtube: http://www.youtube.com/user/fractarno#p/u


Title: Re: Hello Mandelbulbers
Post by: cKleinhuis on August 21, 2011, 11:51:34 AM
hi there, and welcome to the forums ...

i just bought a new gpu ....  one by ati, in fact, i bought the 6870HD because it has in my eyes best price/value at the moment, and it has amazingly 2TFLOPS of calculating power

so, my advice for gpu programming is, DO NOT TOUCH ANY PROPRIETARY STUFF (NVIDIA:CUDA,PHYSX ATI:STREAM ) , because if you switch manufacturers, it might happen that your code doesnt run ... as i did it right now, the nvidia gpus suffer from gflops, the best and most expensive card of nvidia just manages to get 1,5tflops out ....

i would recomend you use OpenCL ( if you want calculating stuff ) or you use OpenGL ( GLSL ) for your code, this way you are independent of manufacturers, if you like you could
also use directx ( HLSL ) but this way you would yourself limit to only windows platform ...

and for the double precision ... my thought was ... i want to do REALTIME stuff, but as you know the fractals tend to get extraordinary complex when it goes down ( >250 iterations )
and when using double ... you would loose the realtime, at least with nowadays hardware, so, i choosed a single precision GPU but with massive GFLOPS available, so that realtime
zooming on single precision floating point will always be smooth :D ...


Title: Re: Hello Mandelbulbers
Post by: A Noniem on August 21, 2011, 02:30:02 PM
At the moment OpenCL is a bit hyped at the moment (in potential it is the best language, no doubt about that)
- OpenCL runs on both gpu/cpu, runs on both Amd/Nvidia, what can you expect more.
- Cuda is more mature than OpenCL, but is Nvidia only, so a major drawback.
- Shader languages are just nog suitable for general gpgpu things. I did some things with hlsl and shader model 3 and you reach the limitations very quickly. 3.0 is old ofcourse and a lot of restrictions have been lifted in SM 4 and 5. Most features however you find in shader languages are also available in OpenCL and Cuda.

Only benefit with shader languages is that they are also supported on older hardware, for OpenCL you need relatively new hardware (which normally isn't an issue in these parts of the internet). I know that Amd supports OpenCL 1.0 on their 4xxx series and onward and OpenCL 1.1 on the 5xxx series and onward. But well, if you really need that old hardware support you might as well run in on the cpu, so it's not that big of a drawback.

And about that HLSL/Windows thingie. Personally I use(d) linux a lot, running OpenCL in linux however with the amd sdk is a bit of a pain in the ass (and it works like a charm with Windows), but possible.


Title: Re: Hello Mandelbulbers
Post by: lycium on August 21, 2011, 03:52:57 PM
so, my advice for gpu programming is, DO NOT TOUCH ANY PROPRIETARY STUFF (NVIDIA:CUDA,PHYSX ATI:STREAM ) , because if you switch manufacturers, it might happen that your code doesnt run ... as i did it right now, the nvidia gpus suffer from gflops, the best and most expensive card of nvidia just manages to get 1,5tflops out ....
Oh man, you're really going advise one card over the other based on theoretical max FLOPS? I can buy some speakers for 2c which do "1000W", in theory... Some years ago, you could get a P4 with 4ghz versus an Athlon 64 with 2.4ghz, which you might expect to be faster in theory...

However, as anybody who ever tried coding GPGPU will agree, NVIDIA's architecture is superior in this regard - NVIDIA are actively chasing the market, whereas AMD are still aiming for gaming applications first and foremost. It's no coincidence that after many years of using their SIMD/VLIW architecture, they decided to switch (http://www.anandtech.com/show/4455/amds-graphics-core-next-preview-amd-architects-for-compute/3) to an architecture closer to NVIDIA's.


Title: Re: Hello Mandelbulbers
Post by: David Makin on August 21, 2011, 04:25:23 PM
"But well, if you really need that old hardware support you might as well run in on the cpu, so it's not that big of a drawback."

I beg to differ - unless you need double support then on older equipment (as long as it supports shader 2 or later) with equivalent generation CPU/FPU (e.g. up to core2duo) then using the GPU kicks the hell out of the CPU/FPU.
(That's without considering the mobile device factor)


Title: Re: Hello Mandelbulbers
Post by: A Noniem on August 21, 2011, 05:05:32 PM
"But well, if you really need that old hardware support you might as well run in on the cpu, so it's not that big of a drawback."

I beg to differ - unless you need double support then on older equipment (as long as it supports shader 2 or later) with equivalent generation CPU/FPU (e.g. up to core2duo) then using the GPU kicks the hell out of the CPU/FPU.
(That's without considering the mobile device factor)

I wrote a mandelbrot demo in hlsl a while ago using xna and shader model 3. The main problem is that shader model 3 (and it's problematic with 2) you're limited to the amount of instructions. (512 and 65536 instructions for SM 2 and 3 respectively) There must be a way to avoid this, since I've seen a couple of glsl programs out there which render 3d fractals just fine (and which require a lot more than 65536 instructions), but I don't know how.

Commenting on the Teraflop thingie. Amd indeed has more raw compute power than nVidia. When it comes to memory management however nVidia is ahead of Amd.  In the end it comes down to the programmer and what he wants to program. Memory intensive programs will faster on a nVidia card even though a comparable Amd card has more Gflops. Also nVidia is ahead of Amd when it comes to gpgpu computing (having a lot of experience with Cuda) so it won't surprise me if nVidia drivers and support are better compared to Amd.


Title: Re: Hello Mandelbulbers
Post by: lycium on August 21, 2011, 06:18:05 PM
So much GPU Kool Aid drinking in here  :-\

It's not like Intel's been wasting their time all these years; different tools for different problems.


Title: Re: Hello Mandelbulbers
Post by: FractArno on August 21, 2011, 08:29:52 PM
Thanks for so many comments & hints!!!

However, I need to get new (gpu-)hardware first (my private PC is pretty old …) and then I’ll decide about programming. Of course, I would be happy about recommendations…

Anyway, I like the idea of platform-independence– hence OpenCL or GLSL seem to be suitable choices?!


Title: Re: Hello Mandelbulbers
Post by: David Makin on September 25, 2011, 03:16:33 PM

I wrote a mandelbrot demo in hlsl a while ago using xna and shader model 3. The main problem is that shader model 3 (and it's problematic with 2) you're limited to the amount of instructions. (512 and 65536 instructions for SM 2 and 3 respectively) There must be a way to avoid this, since I've seen a couple of glsl programs out there which render 3d fractals just fine (and which require a lot more than 65536 instructions), but I don't know how.


I wrote this for iOS which is OpenGL ES2.0:

http://itunes.apple.com/us/app/i-candy/id397933343?mt=8 (http://itunes.apple.com/us/app/i-candy/id397933343?mt=8)

Writing shader source for a single fractal type (2D or 3D) with a single colouring method is no problem (up to a limit) even on ES2.0 but when you want a more generic app you need to have modifiable shader source to cope with all the possibilities.
Of course a really complicated polynomial Mandelbulb or complicated hybrids (bulb+box+kifs etc) will require more instructions than currently available in mobile shaders.