Sorry my bad I did copy it wrong. I have what I'm calling Input(loop) and Output (distance calc) modes/switches so I missed a bracket. Yeah the so called julia doesn't do much in that mode in another though with small values it has a flowering effect. Just rendering some images for you guys to check out I've come to realize its my DE engine. I've just started writing my own ray marcher the other day. (I have to admit hacked together by referring to marchers written by, Syntopia, IQ, Effie your global Illumination is the next thing I'm going to look at) but I have written every line and have implemented a few of my own ideas, mostly for coloring, and lighting. Once I get it a little further along I'll make a Fragmentarium version and post it in a new thread.
The original formula I got from an IQ post on ShaderToy called Apollonian. I then made 3 different iteration modes and 6 different output modes which includes the original. All this gave me an idea this morning to make a system for combining formulas together outside of the shader which I think will increase the shaders speed, but that is for a later date. I'll post the full formula and a few images:
float DE(in vec3 p )
{
float d = 0;
float fat = Fatness;
orbitTrap = vec4(1000.0);
if (InputMode == 0)
{
for( int i=0; i<Iterations;i++ )
{
p = -1.0 + 2.0*fract(0.5*p+0.5);
float r2 = dot(p,p);
if (i <= ColorIterations) orbitTrap = min( orbitTrap, vec4(abs(p)*12,r2) );
float k = max(Scale/r2,0.1);
p *= k;
fat *= k;
p *= Julia+1.0;
p += Offset;
p *= rot1;
}
}
else if (InputMode == 1)
{
for( int i=0; i<Iterations;i++ )
{
p = -1.0 + 2.0*fract(0.5*p+0.5);
if (p.x+p.y < 0.0) p.xy = -p.xy;
if (p.x+p.z < 0.0) p.xz = -p.xz;
if (p.y+p.z < 0.0) p.yz = -p.yz;
float r2 = dot(p,p);
if (i <= ColorIterations) orbitTrap = min( orbitTrap, vec4(abs(p)*12,r2) );
float k = max(Scale/r2,0.1);
p *= k;
fat *= k;
p *= Julia+1.0;
p += Offset;
p *= rot1;
}
}
else if (InputMode == 2)
{
for( int i=0; i<Iterations;i++ )
{
p = abs(p);
float r2 = dot(p,p);
if (i <= ColorIterations) orbitTrap = min( orbitTrap, vec4(abs(p)*12,r2) );
float k = max(Scale/r2,0.1);
p *= k;
fat *= k;
p *= Julia+1.0;
p += Offset;
p *= rot1;
}
}
else
{
for( int i=0; i<Iterations;i++ )
{
p = abs(Tile.xyz-mod(p,2.0*Tile.xyz));
float r2 = dot(p,p);
if (i <= ColorIterations) orbitTrap = min( orbitTrap, vec4(abs(p)*12,r2) );
float k = max(Scale/r2,0.1);
p *= k;
fat *= k;
p *= Julia+1.0;
p += Offset;
p *= rot1;
}
}
if (OutputMode == 0)
{
d = 0.25*length(p.xyz)/fat;
}
else if (OutputMode == 1)
{
d = 0.25*abs(p.y)/fat;///length(Offset);
}
else if (OutputMode == 2)
{
d = min(0.25*length(p.xyz),sdBox(normalize(p*CubeJulia+CubeOffset),CubeScale))/fat;
}
else if (OutputMode == 3)
{
d = min(0.25*abs(p.y),sdBox(normalize(p*CubeJulia+CubeOffset),CubeScale))/fat;
}
else if (OutputMode == 4)
{
d =max(0.25*length(p.xyz),sdBox(normalize(p*CubeJulia+CubeOffset),CubeScale))/fat;
}
else if (OutputMode == 5)
{
d = max(0.25*abs(p.y),sdBox(normalize(p*CubeJulia+CubeOffset),CubeScale))/fat;
}
orbitTrap = orbitTrap * ColorScale + ColorOffset;
return d;
}
The first one has the noise I was talking about as well as another on the next post.