Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => (new) Theories & Research => Topic started by: TruthSerum on May 28, 2015, 04:34:06 PM




Title: exact DE formulas and fractal types
Post by: TruthSerum on May 28, 2015, 04:34:06 PM
Right now I can see two main types of fractals for rendering: those that construct the DE directly by CSG operations, and those that implement a bailout condition and then attempt to approximate the DE function using some kind of vector derivative field.

Right now I am investigating fractals where the DE is described from scratch. The basic procedure here is as follows:

Code:
float DE(vec3 p) {
  float d = 10000.0; /* arbitrary constant that is larger than any possible distance */
  for (iterations) {
    p += f(p);
    d = min(d,object(p));
  }
  return d;
}

This has the effect of instancing many copies of object() (like those defined at iq's distance formula page (http://iquilezles.org/www/articles/distfunctions/distfunctions.htm)), where each one is translated along a vector described by f(), a function of the current point position (and possibly other parameters too, such as the normalized iteration count).

One problem with this construction is that I keep finding that the space created by the instances is very closed, meaning that to see the repetitions and to understand the structure of the fractal you have to make additional CSG operations to "carve out" some kind of inner space. An example of applying this technique and then carving out a space using an infinite cylinder can be found here (https://www.shadertoy.com/view/lt23WV), and who's screenshot follows.

(http://i.imgur.com/5FPS25M.png)

Maybe someone has a better technique for "exploding" the space created by this operation. The idea is to be able to fly around inside a fractal space, but without resorting to simple repetition of the space (by using mod() or fract() on the input point) which has too much symmetry.

Here is another example, where f() is defined to be the paxis function (described here (http://www.fractalforums.com/programming/branchless-maximumprinciple-axis/)) and object() is the signed-box function. As you can see, you cannot fly inside this one. It is necessary to carve out a space, for example a cylinder, so you can fly through it and see the internal structure.

(http://i.imgur.com/DQrXEZr.png)


Title: Re: exact DE formulas and fractal types
Post by: 3dickulus on May 29, 2015, 03:51:43 AM
can you turn it inside out?


Title: Re: exact DE formulas and fractal types
Post by: TruthSerum on May 29, 2015, 02:00:42 PM
I have tried to do this using the mapping p'=1/(1+p) with little success.

I am still enjoying the technique though. Here is another shader implementation (https://www.shadertoy.com/view/4lB3W3) based on the same carving principle:

https://www.youtube.com/watch?v=NgopeP3a0wk

The f() function that I am using is below. The funtion also takes parameter, s, based on the iteration count.

Code:
vec3 func(vec3 p, float s) {
    vec3 off = paxis(p) * s * 1.5;
    p -= off;
    p -= sign(p) * s * 2.75;
    return p;
}


Title: Re: exact DE formulas and fractal types
Post by: eiffie on May 29, 2015, 04:56:07 PM
We are definitely thinking along the same lines...
https://www.shadertoy.com/view/XlSGDc (https://www.shadertoy.com/view/XlSGDc)
... I also had to cut one distance from another.

But in reality the difference between the two types of fractals comes down to the order of math operations. Any fractal done this way can be written as an escape time fractal. Although the reverse does seem challenging for say the mandelbrot set.


Title: Re: exact DE formulas and fractal types
Post by: TruthSerum on May 30, 2015, 12:07:54 AM
I enjoyed your shader too, I also observed many of those shapes while experimenting with the paxis routine. I don't know about you, but I think I prefer the sharp edges of the box as opposed to the cheaper sphere for instancing. Definitely produced more pleasing results in the MachineRoom shader.

I found that if you cut the scene with a plane, you get some very nice shapes at the intersection, which reminded me heavily of Kali's circuit board (https://www.shadertoy.com/view/XlX3Rj), one of my personal all time favorites :)


Title: Re: exact DE formulas and fractal types
Post by: TruthSerum on June 13, 2015, 01:28:37 AM
I made a new shader (https://www.shadertoy.com/view/MtsXRn) using this technique:

https://www.youtube.com/watch?v=wH2Pm_Jum1U