Forming the mandelbrot set

Started by
15 comments, last by Monder 20 years, 6 months ago
Just use more iterations.
Advertisement
Using more iterations will solve it. You''ll know when you come to the limit, because the image will become ''pixelated''.

May I also suggest you add extra sampling to your program. ie for each pixel render 4 and take the average. The gain in quality is considerable, although it takes 4 times as long of course, so isn''t great if you want to do it in realtime. Having said that you can ignore most of the pixels in the picture for oversampling. Just do a check to see if the current pixel is in a block of colour.

If you are looking for nice realtime performance, you can always adopt a quadtree approach.

I''ve always gone for a more subtle colouring scheme, but that''s just me. How are you outputting the image? ie, What format? I know it''s in jpeg now, but I''d recommend a gif file, as that pic is unnecessarily large. It would be smaller with a run length encoded tga.
for color schemes, you can try things like the following :

c = (n*255)/iterations;
red = c * fabs(sin(zn.imaginary*0.1);
green = c* fabs(cos(zn.real*10.0);
blue = c;

it renders the set with nice "mach cone" patterns

[edited by - bucheron on September 25, 2003 5:45:26 AM]
quote:I've always gone for a more subtle colouring scheme, but that's just me. How are you outputting the image? ie, What format? I know it's in jpeg now, but I'd recommend a gif file, as that pic is unnecessarily large. It would be smaller with a run length encoded tga.


Well ATM the program is very rough seeing as I was only just playing around so for colouring I just use 16-bit and then set the pixel colour to i * (65535 / ITERATIONS) i being the amount of iterations it took the absolute value of Z to get above 2 and ITERATIONS being the max amount of iterations. As for outputting it it's just a plain BMP and I converted it to a jpg when I wanted to put an image of it here. Oh and could you explain the sampling a bit more? I think I understand what to do, but I'm not entirely sure.

If it's just the number of iterations being low that gives me the above result I think I'll just double the amount of iterations everytime I zoom in, though it'll start taking ages to render at high zoom levels.

Thanks bucheron, I'll try doing my colouring with that.

[edit]Well doubling the iterations every zoom level means the rendering times get slow rather quickly (predicibly) so I just add 10 to the max iterations every zoom and I've got a way to add more of them if you want them.

[edited by - Monder on September 25, 2003 1:12:35 PM]
Lately I have been studying fractals quite a bit, and I have become even more interested in them then before. (I decided to to my research paper for my college writing class on chaos theory).

Right before I came here I was surfing the web for good fractal sites. (I was trying to find an online Julia/Mandelbrot Set generator to mess with). Anyway I found a lot of neat stuff, like this site on quaternion julia sets http://www.evl.uic.edu/hypercomplex/



[edited by - Platinum314 on September 25, 2003 1:57:49 PM]
The sentence below is true.The sentence above is false.And by the way, this sentence only exists when you are reading it.
Monder, you should consider reading Fracting source code. It's old DOS code but mathematically very robust and optimized (though hard to follow due to coding style and the math tricks), could for sure be boosted with SSE or new instructions sets.

Platinum, check this :

http://astronomy.swin.edu.au/~pbourke/fractals/quaternionjulia/
http://home.hia.no/%7Efgill/quatern.html

Some code and applets :

http://dake.calodox.org:8080/tuts/
http://equinox.planet-d.net/java/fractals/


[edited by - bucheron on September 25, 2003 3:09:37 PM]
quote:Monder, you should consider reading Fracting source code. It''s old DOS code but mathematically very robust and optimized (though hard to follow due to coding style and the math tricks), could for sure be boosted with SSE or new instructions sets.


That''s probably a good idea seeing as my code runs horribly slowly

This topic is closed to new replies.

Advertisement