

XaoS.js - a real-time fractal zoomer - m_for_monkey
http://jblangston.com/xaos/

======
program
I've seen tons of different Mandelbrot implementations in Javascript and
Processing.js (it's a pretty popular example of the ImageData object) and I
can say that this particular one is indeed fast considering that is using 128
iterations on a relatively big canvas.

------
pronoiac
Would using WebGL could give smoother animation or use less CPU?

~~~
thristian
Probably not. The XaoS algorithm depends on nearest-neighbour scaling and
recalculating just the interpolated rows/columns. You could do that in a
texture then scale the texture to the screen with WebGL, but it probably
wouldn't be any more efficient than just doing it in a non-accellerated frame-
buffer.

If there was a way to offload the Mandelbrot calculations to the GPU, that
might make things faster, depending on how tedious it would be to composite
them back onto the framebuffer afterward.

Here's a Mandelbrot zoomer implemented entirely with WebGL:

<http://learningwebgl.com/lessons/example01/>

It doesn't use the XaoS algorithm, it recalculates the entire frame from
scratch on the GPU. On my machine at least, it's noticeably choppier than the
XaoS version, and at a smaller frame-size, too.

------
ninjo
Listen to this while zooming: <http://www.youtube.com/watch?v=MWqdO74iApc>

------
jayferd
awesome. Does get blurry after a while though :(

~~~
eridius
Yeah, I managed to hit the limit where it stopped being fractal. Damn these
limited-precision floating point numbers!

~~~
m_for_monkey
No, it's because the maximum number of iterations is too low for that zoom
level.

~~~
nkoren
That won't cause it to be "blurry" -- that just causes it to be black.
"Blurriness" is indeed due to floating-point errors in the coordinates system.

~~~
m_for_monkey
For me, in the browser, the edges just smooth out to a straight line, and seem
blurry only because of the color scheme. In the desktop version, however, I
see this when zoomed in maximally: <http://i.imgur.com/ryhai.png>.

~~~
artursapek
This is what I maxed out at. It did start to look blurry right before it
started lagging, and these staggered lines were revealed, but they look much
different from yours. <http://i.imgur.com/R5PbQ.jpg>

------
djtriptych
...i'm not sure these guys understand the difference between "fractal" and
"not a fractal"

~~~
nkoren
Er... did you mean to leave this comment on some other article? I've seen the
term "fractal" misused recently, but this is _very_ much a fractal.

~~~
djtriptych
OK I concede it meets a definition of fractal. I'm recalling having seen
Mandelbrot speak at my high school and identify a property of his eponymous
set in particular: that no matter how closely you zoom, no part of it ever
appears to be a straight line, unlike, for instance, a circle.

I just feel cheated.

But sure, it's a fractal capped at a disappointingly low number of iterations.

Kinda like how an equilateral triangle is a sierpinski's gasket at zero
iterations.

~~~
m_for_monkey
Try the desktop version, this is a very limited alpha. But no, not even the
desktop version offers _unlimited_ precision.

<http://wmi.math.u-szeged.hu/xaos/doku.php>

