Mandelbrot zoom (Composition by psonice)

Author: psonice
License: (unknown)
Date: 2009.12.15
Compatibility: 10.5, 10.6
Categories:
Required plugins:
(none)

It's been a while, so I had a quick tinker. Result: One traditional, coder-colour-cycling mandelbrot.

It's done in GLSL, so it's pretty quick (more or less realtime on my radeon 2400 here, zooming in until it hits the buffers). Control it with the mouse - point at where you want to go, then left button zooms in, right button zooms out. There's a control for visual quality (speed = blocky 2x2 pixel mode, quality = full res + 2x AA) and a control for the palette scaling (higher = stripier).

I'll apologise for the colours right now :) Other than that, there's plenty of room for optimisation. If anyone wants to try, I have some suggestions:

  1. A segmented renderer (not sure what the correct term is). Render it at maybe 1/8th scale, then look for areas where the pixel colour varies. Render at higher res, but only render these 'interesting' areas. Continue until at 1x1... this way, you can render only the areas of the image that contain anything interesting. Very tricky to do in a shader though I think ;)

  2. Render every x frames, but scale the image in between. This is what a lot of fractal apps do - you scale the last image smoothly so you have smooth zoom, and render a new actual frame in the background, adding it when it's done. QC isn't exactly geared towards 'background' rendering, but it IS possible (I know, because I've had different sections rendering at different speeds before now, which is a bad thing when one depends on the other ;) Unfortunately, I've no idea how to actually do that on purpose ;(

PreviewAttachmentSize
Mandelbrot.qtz20.61 KB

gtoledo3's picture
Re: Mandelbrot zoom (Composition by psonice)

Really cool. More useful than the mandelbrot plugin, imo.

toneburst's picture
Re: Mandelbrot zoom (Composition by psonice)

Nice. I notice if you zoom in far enough it turns to big chunky pixels though. I guess that's down to float precision issues though.

Nice work!

a|x

psonice's picture
Re: Mandelbrot zoom (Composition by psonice)

Yeah, that's the limit of float precision. Not a huge amount I can do about it without switching to a distance estimator, which involves difficult looking maths :(

toneburst's picture
Re: Mandelbrot zoom (Composition by psonice)

The distance-estimation route is probably the way to go ultimately, though. There are probably other cool things that can be done if you take that route, too.

a|x

robbietherobot's picture
Zoom Math

Been trying to get an image on a Sprite to zoom in and out around the mouse pointer just like your demo here. I can't seem to get my head around the math and then found your example here. Is there an easy way to translate what you have done here to Scale a sprite and translate the X and Y appropriately?

Any help much appreciated!

Great work. Thanks.

cybero's picture
Re: Zoom Math

Firstly, this isn't zooming in and out of a sprite.

It's zooming into a GLSL Grid.

Doesn't mean that what you seem to be thinking of doing cannot be done of course. Just thought I'd better clarify a little for you.

That said you can hook up the outputs affecting zoom and size in the shader to a Sprite, it will work.

I think it would need some additional tweaking, to more easily and smoothly zoom in and out.