Part V

Part V: Conclusions


I covered the most important issues related to my implementation of a Fractals generator. It would be nice to add some features like:

Fractals Features:
-More options to customize domains and colors schemes.
-Shading algorithms selection without the need of a derived class.
-Support for parameters, so that a generator can expose a list of parameters that can be changed and the application offers the form to host them.
-More Fractals (i.e. The Fractal Flame Algorithm).

GUI Features:
-Fractals families grouping in the menu.
-Full history with not only the image, but also all the image informations (rendering time and so on) and the possibility to zoom on any of the cached image.
-Post processing filters.
-Rendering partial images while computing (so that you don't need to wait the end).

Performances:
-More speed.
-Better precision.

Architecture:
-Support for non thread-safe generators.
-A better generator interface wich supports more Fractal types.

Two final considerations concerning performances and precision.

Performances are embarassingly bad. My very old C++ Mandelbrot renderer has been compiled with Visual C++ 6.0 (who knows it understands what I'm talking about) and yet seems faster than my C# implementation. To be fair, I'm currently using GetPixel()/SetPixel() because they are easy to use but have an overhead which may explain (at least partially) these performances. A better implementation would use a float array to access directly pixels values. The whole pipeline would then use floating point values until the very last step (the Bitmap creation). This would also avoid most of those int/float/double conversions I'm actually doing.
Of course, C# is less friendly when it comes to low level optimizations such as SSE vectorialization and the like, but hey, you cannot have everything.

If you magnify the Fractals enough you will see that after a few steps there are far less details. Most probably this is due to the double type precision limits. There are C++ libraries that support higher precision arithmetic, and this would be nice because some of the most interesting images are generated with a magnification level impossible to reach with double precision. I suppose such libraries exist for C# as well, but I thought that using an external library would have made things too much complex for an introductory tutorial that does not aim to build a scientific tool. If I have some spare time I will consider giving it a try though.

That's all, folk! I hope you enjoyed reading these pages and that you found them interesting.

Useful links:

Wikipedia about Fractals

A very nice site about Fractals, with images and a tutorial

Another site about Fractals, with a quite extensive collection of Fractals with their explanation

Another great source of informations (but in french)

Wikipedia about Complex Numbers

One more site about Fractals

Fractal Explorer Software

FractInt Software

Xaos Software

Gallery:

The following pictures show the default rendering of all the Fractals currently implemented.