Hi, this is my most complex project so far. Enjoy! For a general overview read this file. For some cool renders view the ScreenShots folder. For a rendered video view this. For a user manual read MANUAL.md (highly recommended if you plan to have some fun with it). For a more in depth description of the inner workings read DOC.md
To put it simply fractals are mathematical shapes containing infinite detail. This detail can be achieved in many different ways. Some fractals are self similar. For example Sierpiński triangle. Some never repeat. Mandelbrot set is Quasi self similar. This means that after you zoom in far enough you will find copies of the original set, they will never be identical thought.
Mandelbrot set is a fractal that lives in the realm of complex numbers.
Each pixel on the screen is assigned a number based on its position.
Horizontal axis represents the real part while Vertical axis represents the imaginary part.
Once a pixel is assigned it's number
If the
In order for computers to calculate quickly some sacrifices had to be made. In most programming languages there are two options for calculating real numbers:
- float - 32 bit representation of a number
- double - 64 bit representation of a number
for most cases, this is more than enough. You can zoom in quite far before you run out of precision, but wether you use floats or doubles sooner or later you will run out of precision. This program uses a custom number representation: Each number is represented by a list of integers, Think of it like digits in our daily number representation, for example 1.256 would be represented by [1,2,4,6]. For this case numbers are centered around 1 so we can assume the dot is always after the first number. Typical long addition, subtraction and multiplication algorithms can be applied. Numbers of type int can be much larger than 10 so the numbers are not base 10, they are base 46300. Obviously this comes with a cost, GPUs are optimized to multiply numbers in float format, not this kind of format, This makes this kind of representation slower.
As you zoom in, the computation time required increases. For small zooms the frame can be generated in milliseconds, for extreme zooms the frame can be generated in hours. For this reasons, I ve taken some steps so that the experience of deep zooms is as smooth as possible.
Rendering and calculations is separated, therefore you can watch in real time how the image is created.
This means that even thought the whole frame can take a few seconds to render,
the program will always run smooth and never stutter.
When you decide to move the image, data about already generated pixels is preserved.
If you want to dive deep into the fractal rendering each image on the way in full resolution is time consuming.
Therefore the images can be rendered in lower resolution for a preview.
- Mandelbrot Set, Burning Ship, Mandelbrot 3rd and 4th power
- Julia Sets
- Infinite zoom (Not really because of the build times e-100 should be possible in current version)
- Various performance enhancements
- Rendering in Tiles
- Simple gui
- Antyaliasing
- Video Rendering
- Distance Estimation
- Normal Mapping with 1st derivative
- Texture mapping
This will probably be the last revision of the program. This are some futures that could be added:
- Other fractals
- Optimizing targeted at video generation
- Better gui
- Performance boost
- Color control via gui
- Animated Julia Sets
- Generating a fractal based on a provided shape
