Shop Forum More Submit  Join Login
fast, accurate mandelbrot by lyc fast, accurate mandelbrot by lyc
rendered with 12*12 supersampling, double precision iteration to a maximum depth of 1024, floating point palette with 1024 entries (1:1 mapping with iteration count), sampled from (-2.25,-1) to (0.75,1) over the complex plane, 1800x1200 pixels.

rendering this takes 265 seconds on my 3ghz quadcore. i think that's reasonably fast, if you factor out how fast my quadcore is :giggle:
Add a Comment:
 
:iconmaschen:
maschen Featured By Owner Aug 10, 2016  Hobbyist General Artist
Who doesn't like the Mandelbrot set?! Must be in favourites!
Reply
:iconsinspunkt:
Sinspunkt Featured By Owner Aug 5, 2015  Professional Writer
Lovely to see this classic fractal, just like what I used to play with on the computer when I was small! Nostalgic!
Reply
:iconzigurdu:
zigurdu Featured By Owner Mar 20, 2008
Nice render there. I'm trying to do the same and similar things, but I'm more proficient at maths than C++ libraries. Did you use the pngwriter header? Or just libpng? Do you know about some site which explains how to install and use these things "for dummies"?
Reply
:iconlyc:
lyc Featured By Owner Mar 20, 2008
nope, i just save simple bmp files and then convert them to max-compressed (which libpng curiously does not support!) pngs via the excellent and free program irfanview.
Reply
:iconzigurdu:
zigurdu Featured By Owner Mar 21, 2008
Okay, thanks. I think I'll stick to Matlab a bit longer, though. =P
Reply
:iconchritter:
CHRiTTeR Featured By Owner Jan 8, 2008  Professional Interface Designer
remember how long it took on an amiga? :p
Reply
:iconlyc:
lyc Featured By Owner Jan 8, 2008
ah i never had an amiga :/ actually i started coding on a pentium 100mhz :(
Reply
:iconchritter:
CHRiTTeR Featured By Owner Jan 8, 2008  Professional Interface Designer
Well, I bet that would've taken a while to render this on that too :)
Reply
:iconlyc:
lyc Featured By Owner Jan 8, 2008
most definitely :nod:

after i've done my exams for this month i'm going to add some nice antialiasing to it, right now it's just a straight average :/
Reply
:iconchritter:
CHRiTTeR Featured By Owner Jan 8, 2008  Professional Interface Designer
Yeah, i noticed its a bit blurry compared to your other works but thought it was maybe a jpeg thing
Reply
:iconkram1032:
kram1032 Featured By Owner Jan 8, 2008
Wow, that's an amazingly fast Mandelbrot!
But didn't you write somewhere in the past, Mandelbrot is overdone? xD
Anyway, nice palette and incredible specs :)
I should have about the double time (if core counts linearly affect render time, as I've a 3Ghz Dcore)
Reply
:iconlyc:
lyc Featured By Owner Jan 8, 2008
it's actually pretty slow compared to applications that use tricks like checking for periodicity, guessing solid regions, things like that. however, as a brute force iteration, i think it's decent, as i've a very tight sse2 rendering loop that's really very minimal.
Reply
:iconkram1032:
kram1032 Featured By Owner Jan 9, 2008
I see...
I guess, such a guessing application is pretty hard to code?
Reply
:iconlyc:
lyc Featured By Owner Jan 9, 2008
dunno, never tried, nor do i intend to. i just want a reasonably fast inner loop for making some simple pix; and it will be handy to have a nice tile-based antialiasing system for linear rendering.

i can only code again after january though :cries:
Reply
:iconkram1032:
kram1032 Featured By Owner Jan 9, 2008
I see. :)

Why that? O.o what's now, in january?
Exams again?
Reply
:iconlyc:
lyc Featured By Owner Jan 9, 2008
yeah i deferred one exam and have two re-writes :|
Reply
:iconkram1032:
kram1032 Featured By Owner Jan 10, 2008
:S
Good luck
Reply
:iconawesty:
awesty Featured By Owner Jan 8, 2008
What language are you using to do this?
Reply
:iconlyc:
lyc Featured By Owner Jan 8, 2008
here's an executable: [link]
Reply
:iconlyc:
lyc Featured By Owner Jan 8, 2008
c++, using the sse2 extensions to iterate two points at once in double precision. it's nice and fast in 64bit mode on a 3ghz quadcore using all 4 threads, i plan to make some high quality animations with it, along the lines of what i have at [link] . btw, if you can tolerate the slowness you should check out my recent ray tracer demo: [link] (i recently sped the program up by like 2-3x because of a major oversight, but that specific scene's settings weren't saved so i left the linked application as is).
Reply
:iconawesty:
awesty Featured By Owner Jan 8, 2008
I doubt my laptop will be able to take it :D
Reply
:iconlyc:
lyc Featured By Owner Jan 8, 2008
the thing ran decently on a 2.4ghz p4, which is really slow. anyway it's not all that exciting, just interesting to see it render for a while.
Reply
:iconchaos5:
chaos5 Featured By Owner Jan 7, 2008
:clap:

LOL, nice color palette ;)
Reply
:iconlyc:
lyc Featured By Owner Jan 7, 2008
btw, i was hoping you'd provide some data on how long it takes you to render with the same settings, and whether or not you use double precision iteration for deeper zooms.
Reply
:iconchaos5:
chaos5 Featured By Owner Jan 7, 2008
BTW
My rendering gets distorted at a zoom of 50x10^12 and fails at 10x10^13
Reply
:iconlyc:
lyc Featured By Owner Jan 8, 2008
double precision is as accurate as i'm willing to go, anything more is way too slow and too much hassle. my double precision loop is really nice and optimised, so i'll see how far it gets me... i've never actually gone zooming in the mandelbrot set before, even though i knew it's possible in principle, so it'll be nice to do so with my own program first :)
Reply
:iconchaos5:
chaos5 Featured By Owner Jan 8, 2008
Oh, it's lots of fun!!
Reply
:iconchaos5:
chaos5 Featured By Owner Jan 7, 2008
I could run it much faster without all the GUI junk that slows it down a lot.

BTW, what was the line of code you used to take advantage of multi processors?
Reply
:iconlyc:
lyc Featured By Owner Jan 8, 2008
you'll probably get errors if you just use it without separating out your shared data, but for basic (coarse-grained!) loop parallelisation you just put "#pragma omp parallel for" in front of your loop.
Reply
:iconchaos5:
chaos5 Featured By Owner Jan 8, 2008
Cool, I'll search MSDN for more info too. I just needed a starting point :)
:thanks:
Reply
:iconlyc:
lyc Featured By Owner Jan 8, 2008
the spec is quite usable: [link]
Reply
:iconchaos5:
chaos5 Featured By Owner Jan 8, 2008
I may have some issues getting that to work with C# in a .net enviroment... :(
Reply
:iconlyc:
lyc Featured By Owner Jan 8, 2008
dunno, depends on what compiler you're using. i get the most feature complete versions of visual studio (currently 2008 team suite) via the ms academic alliance, a microsoft/university thing that gets me hooked on their software so i wind up using it in my professional career...
Reply
(1 Reply)
:iconchaos5:
chaos5 Featured By Owner Jan 7, 2008
I was about 75% done at 300s and quit.
I have not scrubbed the new code for speed, and I am only using one thread on a duel core.

As for double precision iterations, that’s not going to affect how deep you can zoom.

This is the hart and sole of my Mandelbrot class.
It is very fast, and as you can see the iterations only limit how many times you want to test a point before giving up. Even at the deepest zooms I seldom have an iteration value of more than a few thousand.

public int testPoint(double x, double y, int iterations)//a+bi
{
double az, bz;
double swapA, swapB;

int i;

az = x;
bz = y;

for (i = 0; i < (iterations); i++)
{
//test modulus
if (((az * az) + (bz * bz)) > 4.0)
{
return i;
}

// z^2 + originalZ
swapA = ((az * az) - (bz * bz)) + x;
swapB = (2 * az * bz) + y;

//swap
az = swapA;
bz = swapB;
}

return i;
}
Reply
:iconlyc:
lyc Featured By Owner Jan 8, 2008
btw, a "hart" is a male deer, and a "sole" is a type of fish!! :rofl:

wordweb ftw! ;P just control+click on a word and you get the spelling + definition.
Reply
:iconchaos5:
chaos5 Featured By Owner Jan 8, 2008
Heart and Soul!!! :P
Reply
:iconchaos5:
chaos5 Featured By Owner Jan 8, 2008
ROFL!
I quit life!!!!!!!!!!
Reply
Hidden by Owner
:iconlyc:
lyc Featured By Owner Jan 8, 2008
double precision most definitely affects how far you can zoom, try replacing your scalars with "float" instead of "double" and see how far that gets you!
Reply
:iconchaos5:
chaos5 Featured By Owner Jan 8, 2008
I think we just had a mix up in nomenclature.
Reply
:iconchaos5:
chaos5 Featured By Owner Jan 8, 2008
I agree you won’t get nearly as far with a float as a double. I don’t even bother with floats.
Reply
:iconlyc:
lyc Featured By Owner Jan 7, 2008
thanks ;) it works very nicely indeed with the mandelbrot set.
Reply
Add a Comment:
 
×



Details

Submitted on
January 7, 2008
Image Size
551 KB
Resolution
1800×1200
Thumb

Stats

Views
2,100 (1 today)
Favourites
6 (who?)
Comments
45
×