top | item 32846859

(no title)

Maelcum | 3 years ago

There's a lesser known optimization trick I haven't seen in a while, which is especially effective when a large portion of the Mandelbrot set is visible: there are no holes in it, i.e. it's a compact set.

From an optimization point of view, it means that if a rectangular area's edges contains only values reached the iteration limit without growing larger than the escape value, the entire area belongs to the Mandelbrot set.

discuss

order

hakuseki|3 years ago

The term you're looking for is "simply-connected set."

Simply-connected sets and compact sets are both sometimes informally described as "sets with no holes," but the definition of "holes" is different in both cases.

A compact set contains all of its limiting points (i.e. limits of convergent sequences of points within the set). Therefore it may not have any point-shaped holes. But it may still have a hole shaped like, e.g. an open disc.

To rule out such large holes, you want a simply-connected set, which is a connected set in which any closed path can be continuously shrunk to a point.

sliken|3 years ago

Not sure I'd say "no holes", but yes there are no islands, the entire mandelbrot set is connected. However that does not mean that parts of the display that's interesting doesn't cover part of the set, that's not visible in any individual pixel.

For those that want to fly around in the mandelbrot set, even a 2015 desktop can easily keep up, I suggest Xaos which I believe includes all the common mandelbrot optimizations at https://xaos-project.github.io/

There's even a web version at the above URL. It's in most linux repos I tried apt or yum. I couldn't find any docs for what optimizations Xaos uses, but it seems plenty fast for real time zooming, even on old hardware.

liftm|3 years ago

How do you best use this in practice? Quadtree-split the rendering area while checking edges?

Maelcum|3 years ago

I used a recursive way: split the image area, calculate the edges for all, checking edges, and then either fill it, or call the function with the sub-areas's region.

Or you can set up a grid and calculate the chunks.

When I was learning a new language in my collage days, my helloworld used to be implementing a Mandelbrot/Julia set on the given language. A few months ago I decided to look into Rust and started to work on my helloworld in Rust, using RayLib :-)

Here's an example output from my version: https://ibb.co/p4bFF7S