Infinite Fractal

Started by
2 comments, last by -XM- 8 years, 11 months ago

I've implemented the code here in my XNA project: http://blogs.msdn.com/b/shawnhar/archive/2006/12/12/technicolor-julias.aspx

I have a fractal drawing on the screen I can zoom in and out. However, when I zoom in to a certain amount the fractal ends and the pixels get distorted.

What I'm after is a fractal I can zoom into infinitely and it keeps giving me new patterns. Is this not possible to do in real time? If it's possible, can someone point me to good resources on how to do this in XNA4/HLSL? My google searches came up with nothing.

Thanks!

Advertisement

From the comments of that very article:

Hi
First off great work, I'm impressed, was going to try to draw a mandelbrot for my first XNA program but mine wouldn't have been anywhere near has good.
Any reason why after a certain amount of zoom, the image gets pixelated and unmovable? can't fractals zoom indefinitly? I changed the fx file so that iterations was a paramter instead of a constant, and that helped, but still I eventually get lots of blocks.
Anyway - great work.


I think it's running up against the limits of 32 bit floating point precision. Fractals can only zoom forever if you have an infinitely precise way of doing your calculations...

The obvious fix is to switch to higher precision at some zoom level, but that can be much slower and less well supported by graphics cards. To zoom infinitely deep would require arbitrary precision arithmetic, which is very slow to implement in any reasonable way on graphics cards (all those "super-deep" zooms you see on Youtube are made with CPU's and are not rendered in realtime). You could settle for some "nice" precision like, say, 256-bit arithmetic, and optimize the add/multiply operations on the graphics cards, you'll eventually reach a limit but it should still be realtime at that precision and you'll be able to zoom much further in.

There's also some advanced techniques to get more out of 32-bit floating-point precision, utilizing things like perturbation theory, but that can be tricky to implement (worth looking into). But at the end of the day if you truly want infinite precision you pretty much need to resign yourself to the fact that the further you zoom in, the more precision you need, and the slower it's going to be, so CPU's + offline rendering are king for really deep zooms.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

Thanks Bacterius, you pretty much confirmed my fear :P I'll look into the stuff you mentioned since I'm interested, but it looks like I won't be able to get the super deep zooms I was hoping for.

This topic is closed to new replies.

Advertisement