← All ideas
  • Published 28 Apr 2019

Fractals in Blender

Hello. In the last couple of Months, I experimented with Fractals in Blender. I'm just impressed by some of the Pictures that are around the web. I'm also kind of curious about the math behind it. Until now, I haven't been able to come up with a new Idea but mostly tried to adapt what I found with someone would maybe say crazy node connections. This produced sometimes interesting patterns on different kind of meshes. Because the texture is projected from 3D to a surface and changes always when the shape scales or translates. Then I off course tried to use the texture as density input on the Volumetric Shaders like the Emission, Absorption and Scatter Shader. After trying around I found that since the Fractals often use a distance function, where values close to zero are standing for the actual surface of the fractal, I just have to use a math node set to less than to define which parts of volume have to be solid and which have to be transparent. It took me not so long to realize that it is crucial to have a very small step size and a lot of steps but not necessarily a lot of samples to produce a well-defined fractal. Also, I found that the use of an Emission and an Absorption Shader added together renders far more quickly and with no banding compared to the scatter shader. Off course the fractal looks far more interesting with light and shadow to give it depth and occlusion so that one can understand the geometry. And it also gives the fractal this sence of a structure in a big space. So I researched more to understand what they are doing to add shadows, reflections and occlusion and also found different examples of how to colorize a fractal which is also an important part of it. I will add some resulting pictures I created. The Resources I used are from:

  1. Fragmentarium - github.com/Syntopia/Fragmentarium/blob/master/Fragmentarium-Source/Examples/Include/DE-Raytracer.frag
  2. Mandelbulb 3D (The Koch Cube by Luca) / Mandelbulber
  3. Inigo Quilez iquilezles.org/www/articles/rmshadows/rmshadows.htm
  4. Fractal Lab - Interactive Fractal Explorer hirnsohle.de/test/fractalLab/
  5. The Golden Mandelbox and the compleat Mandelbox on Shadertoy shadertoy.com/view/MtlXR4
  6. Boxplorer sourceforge.net/projects/boxplorer/
  7. Some Ideas from Youtube Videos about the Mandelbrot and Julia Sets made in Blender. And the City at Dusk youtube.com/watch
  8. Java Mandelbox digitalfreepen.com/mandelbox370/

So I have a question now. It seams possible to do this with the cycles engine but there is mainly one problem. Cycles uses a constant step size to calculate the density of a volume. If the Fractal is rather big and has in the worst scenario a part that is transparent throughout the Mesh all the way to the Background. Then it calculates that part for ever and 3 days. But since I have a distance function I somehow would like to give this information to the renderer so that it can adjust the step size based on the found value on that step. I though about this. If the distance function is correct which is not always so trivial but can be done and if I define some boundaries with a maximum and minimum math function, the steps shoudn't overshoot the desired parts. I have no Idea how to program a node which would take this as an input value and passes it to the renderer. Maybe it's not possible at all. Because it needs a constant step size. But that's my question. Or Maybe someone can give me a direction where to search in the source code. I'm not a programmer but I understand some of the logic behind it. I'm aware that this is maybe very off topic for the Idea how and for what to use blender. But somehow I went in that direction. Maybe because I'm lazy and don't want to sculpt baroque Artwork like crazy :) I'm also aware that all the priorities at moment go to the completion of 2.8. But otherwise it could maybe also be useful to have this variable step size for other things like Clouds.

How can one upload a picture to the post?

KC MB 006.jpg

90%

Development Status: Open

Upvote 9 Downvote 1
zbindenmarc
28 Apr 2019

2 Comments

i personally find fractals quite useless

1
3dddan

* @dodododorian * same here, but it comes up once or twice every decade, and there's no out of the box solution to do them.

Had to work on huge fractal scenes for Guardians 2, it was pretty painful. I guess everything nodes would make this easier.

fxguide.com/featured/the-fractal-nature-of-guardians-of-the-galaxy-vol-2/

It's probably not the most pressing issue though I guess... :)

1