Title: Speeding up Nebulabrot Post by: PurpleBlu3s on December 12, 2011, 09:59:00 AM Hi, after a break from fractal generating, I've gone back to my Buddhabrot/Nebulabrot program and am looking to speed it up. As far as I can see it is not possible to produce a sort of generic data set that produces Nebulabrot using different colouring - the idea being to do the long generation once, then apply different colours instead of having to generate the whole fractal every time I want to try a different colour scheme. If there is a way to do this I would greatly appreciate guidance!
Additionally, I would like to know whether it's worth porting my code to C, as it's currently written in Java, which isn't a fast language. I don't really know how to generate images in C though, so any pointers (forgive the pun) would be appreciated. Just as a benchmark, my Java program takes about 16 hours to produce a Nebulabrot with 8000 iterations, 1 billion orbits, 2400x2400 pixels - the image: http://dl.dropbox.com/u/16319566/8000it-1borbits-01c.png (http://dl.dropbox.com/u/16319566/8000it-1borbits-01c.png). Thanks in advance for any help. Title: Re: Speeding up Nebulabrot Post by: huminado on December 12, 2011, 07:07:20 PM if you are already using multithreading and still not happy with performance, porting to C is probably a good idea.
Title: Re: Speeding up Nebulabrot Post by: cKleinhuis on December 12, 2011, 09:57:40 PM you know, most improvements gain is sure by rendering on gpu, :D
and you could keep your java base ... Title: Re: Speeding up Nebulabrot Post by: PurpleBlu3s on December 13, 2011, 01:19:05 PM you know, most improvements gain is sure by rendering on gpu, :D and you could keep your java base ... I have no clue how to do that. Where do I start? Title: Re: Speeding up Nebulabrot Post by: cKleinhuis on December 13, 2011, 02:41:45 PM check out fragmentarium
http://syntopia.github.com/Fragmentarium/ he is a member on this forum too, you need a gpu enabled graphics card, but most of nowadays cards support it .... Title: Re: Speeding up Nebulabrot Post by: Syntopia on December 13, 2011, 08:03:01 PM Hi, I think there is a thread on this: http://www.fractalforums.com/programming/buddhabrot-on-gpu/
I'm don't think the approach used in Fragmentarium will help here: for something to run efficiently on a GPU you must be able to divide the job into many separate tasks (threads). For a GPU, the number of threads must be even larger than the number of computational cores, to hide the different kind of latencies. This means 1000+ of tasks on a modern GPU. In Fragmentarium each pixel is calculated in its own thread - which is the dream job for a GPU - roughly a million threads, which can be executed independently. THis is erfect for ray marched, distance estimated 3D fractals, but I don't think it is easy to frame the Buddabrot formula in this setting. Title: Re: Speeding up Nebulabrot Post by: ker2x on December 21, 2011, 01:35:01 AM Hi, after a break from fractal generating, I've gone back to my Buddhabrot/Nebulabrot program and am looking to speed it up. As far as I can see it is not possible to produce a sort of generic data set that produces Nebulabrot using different colouring - the idea being to do the long generation once, then apply different colours instead of having to generate the whole fractal every time I want to try a different colour scheme. If there is a way to do this I would greatly appreciate guidance! Additionally, I would like to know whether it's worth porting my code to C, as it's currently written in Java, which isn't a fast language. I don't really know how to generate images in C though, so any pointers (forgive the pun) would be appreciated. Just as a benchmark, my Java program takes about 16 hours to produce a Nebulabrot with 8000 iterations, 1 billion orbits, 2400x2400 pixels - the image: http://dl.dropbox.com/u/16319566/8000it-1borbits-01c.png (http://dl.dropbox.com/u/16319566/8000it-1borbits-01c.png). Thanks in advance for any help. Feel free to take a look at our (emmmile and me) code/work on buddha++ (and use the part of the code in your own software if you wish) : https://github.com/emmmile/buddha Title: Re: Speeding up Nebulabrot Post by: ker2x on December 21, 2011, 01:45:01 AM Hi, I think there is a thread on this: http://www.fractalforums.com/programming/buddhabrot-on-gpu/ I'm don't think the approach used in Fragmentarium will help here: for something to run efficiently on a GPU you must be able to divide the job into many separate tasks (threads). For a GPU, the number of threads must be even larger than the number of computational cores, to hide the different kind of latencies. This means 1000+ of tasks on a modern GPU. In Fragmentarium each pixel is calculated in its own thread - which is the dream job for a GPU - roughly a million threads, which can be executed independently. THis is erfect for ray marched, distance estimated 3D fractals, but I don't think it is easy to frame the Buddabrot formula in this setting. That's correct. Below is an openCL implementation of the buddhabrot. but this is inefficient. The memory latency of the GPU (and branching) is a huge bottleneck and there isn't anything you can do about it. The threads can write anywhere (and it's not predictible, of course) on the global memory, and the global memory latency kill the performances. Code: bool isInMSet( |