A fractal is a “curve or geometric figure, each part of which has the same statistical character as the whole” [1] that is represented by a complex equation. Because these equations are infinite and so complex, it would be impossible to represent them at a set of vertices. One technique that is used to circumvent this problem is ray marching using distance estimator formulas. Put simply, this technique works by calculating the distance from the current pixel to the boundary of the fractal set. [2]

"Classic raytracing shoots one (or more) rays per pixel and calculate where the rays intersect the geometry in the scene.” [3] Ray marching uses a similar technique, but because the geometry in the scene is not defined by a set of vertices, we must use a different technique to find intersections. We march along the ray, each time using a distance estimator function to see how far we are from the fractal set. Once we are within a specified distance of the set, we stop.

The distance estimator will be different for each fractal. Although it is important to understand these functions, we did not write these ourselves. To understand the concept of these distance estimators, it is important to understand that the fractals (or at least two of them) we used are what is called “escape-time” fractals. This means, “we iterate a function for each point in space, and follow the orbit to see whether the sequence of points diverge for a maximum number of iterations, or whether the sequence stays inside a fixed escape radius.” [3]

One fractal we chose to represent is not an escape-time fractal, but rather an iterated function system (IFS) . This complicated term basically means that “the fractal is made up of the union of several copies of itself, each copy being transformed by a function” [4]

The fractals we chose to represent are the Mandelbulb, Mandelbox, and Menger Sponge.

The Mandelbulb is “a three-dimensional analogue of the Mandelbrot set”. [6] In order to understand this complex object, we must first understand the Mandelbrot set. The Mandelbrot set is a 2D fractal represented by the points that do not diverge for the equation z_{n+1}=z_{n}^{2}+c and is pictured below. To arrive at the 3D version of this fractal, the equation is simply changed to z_{n+1}=z_{n}^{8}+c.[3]

The Mandelbox is similar to the Mandelbulb, but instead of an equation of the format z_{n+1}=z_{n}^{8}+c, it is represented using complex operations called folds. Put simply, the algorithm works by using a shape, such as a sphere or cube, and some planes of symmetry. If a point is inside of this sphere or cube, we reflect it across the planes.

As mentioned before, the Menger Sponge is an iterated function system (IFS). In the case of the Menger Sponge, we can construct the IFS using the following steps:

- Begin with a cube (first image).
- Divide every face of the cube into 9 squares, like a Rubik's Cube. This will sub-divide the cube into 27 smaller cubes.
- Remove the smaller cube in the middle of each face, and remove the smaller cube in the very center of the larger cube, leaving 20 smaller cubes (second image). This is a level-1 Menger sponge (resembling a Void Cube).
- Repeat steps 2 and 3 for each of the remaining smaller cubes, and continue to iterate ad infinitum.

We began our process by using the distance estimator to create a grayscale picture. We used the amount of steps taken in the ray marching to represent a grayscale value. The result:

The next step was to do lighting and shading. The results:

The biggest and most important step was implementing looking and walking around. The results:

After getting everything else finished, the last step was coloring. For coloring we used a technique called orbit traps, a technique which "keeps track of how close the orbit comes to a chosen geometric object." [3] The results:

Final product for Mandelbox

Final product for Menger Sponge:

- Marks-Tarlow, Terry. "Terms & Definitions." Complexity Space Consulting RSS. Complexity Space Consulting, n.d. Web. 11 June 2013.
- Quilez, Iñigo. "Iñigo Quilez - Fractals, Computer Graphics, Mathematics, Demoscene and More." Iñigo Quilez - Fractals, Computer Graphics, Mathematics, Demoscene and More. N.p., n.d. Web. 11 June 2013.
- Christensen, Mikael H. "Syntopia." Syntopia. N.p., 3 June 2011. Web. 11 June 2013.
- "Iterated Function Systems." Wikipedia. Wikimedia Foundation, 06 Oct. 2013. Web. 11 June 2013.
- "Menger Sponge." Wikipedia. Wikimedia Foundation, 15 May 2013. Web. 11 June 2013.
- "Mandelbulb." Wikipedia. Wikimedia Foundation, 22 May 2013. Web. 11 June 2013.