mclarekin
|
|
« Reply #45 on: September 26, 2016, 09:34:16 AM » |
|
A finally coded the KIFS version
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #46 on: September 28, 2016, 04:09:31 PM » |
|
Looks like robot or constructor CrossMenger in PseudoKleinian:
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #47 on: October 05, 2016, 03:53:01 PM » |
|
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #48 on: October 07, 2016, 01:45:14 AM » |
|
// This is the simplest version of Knighty prismshape that I have used as a pre-transform in several formula UI's // I forgot to add the Xcondition checkbox in the PrismShapeOption.frag i posted yesterday
const float SQRT_3_4 = 0.86602540378443864676372317075294; const float SQRT_3 = 1.73205080756887729352744634150587; uniform vec3 offsetScale; slider[(-1,-1,-1),(0,0,0),(1,1,1)] uniform float dotScale; slider[0.0,1.0,2.0] uniform bool PrismShape; checkbox[true] uniform bool Xcondition; checkbox[true]
if (PrismShape) { // a pre-transform, no DE required z = vec3({z.z, z.x, z.y); // reorientate
z.z = abs(z.z); float dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * dotScale; float t = max(0.0, dot1); z.x -= t * -SQRT_3; z.y = abs(z.y - t); if(z.y > z.z){ temp =z.y; z.y = z.z; z.z = temp;} z -= offsetScale * vec3{ SQRT_3_4, 1.5, 1.5}; if(z.z > z.x){temp =z.z; z.z = z.x; z.x = temp;}
if (Xcondition) { if(z.x >= 0.0){ z.y = max(0.0, z.y); z.z = max(0.0, z.z);} } }
// then iterate a menger sponge
// when dotScale = 2.0 , is standard house shape // when offset scale = (-0.5, 0, 0), is the prism shape (for this version) // X Condition. With some settings parts of the fractal become "extrusions", if this is not wanted then untick this checkBox
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #49 on: October 07, 2016, 09:04:11 AM » |
|
... in the PrismShapeOption.frag i posted yesterday
Where?
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #50 on: October 07, 2016, 11:06:12 AM » |
|
I hid it here http://www.fractalforums.com/images-showcase-(rate-my-fractal)/spires-t24633/msg96518/#newIt has just been inserted into 3dickulus's .frag, so probably need to zoom out at first I was re-learning this prism thing yesterday. This is the version that makes the house shape. You can add this to the Prism Shape pre-transform (openCL code) z *= postScale;// vect3 default (1,1,1) z = Matrix33MulFloat3(consts->fractal.mandelbox.mainRot, z); // rotations and this is the formula code inside the menger sponge iteration loop //PreAdd and Knighty MengerSponge z = fabs( z + preAdd ); // preadd default (0,0,0) if (z.x - z.y < 0.0f){temp = z.y; z.y = z.x; z.x = temp;} if (z.x - z.z < 0.0f){temp = z.z; z.z = z.x; z.x = temp;} if (z.y - z.z < 0.0f){temp = z.z; z.z = z.y; z.y = temp;} z *= mengerScale; // default 3 z.x -= 2.0f; z.y -= 2.0f; if (z.z > 1.0f) z.z -= 2.0f; DE *= mengerScale;
//postAddition z = z + postAdd; // postAdd default (0,0,0) // make it hollow z.x = fabs(z.x + tempA) + tempB; // defaults float 0 and 0, something like 1 and -1 will make the mengerSponge hollow
if (negY == 1) // turning on a tweak that works depending on other parameters are set to. {z.y = -z.y;
}
and // bailout termination if (r > 10.0f) //bailout { dist = r / fabs(DE); out.colourIndex = colourMin * 10.0f; break; }
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #51 on: October 29, 2016, 06:17:52 AM » |
|
Latest version of crossmenger trick Adding in the fabs(z.x) option provides another ... eh.. option. The derivative scale thingy is a beta thingy, that can work in some hybrid situations. Images below are with a dotscale of 0.2, and with and without fabs(z.x) #define SQRT_3_4 0.86602540378443864676372317075294 #define SQRT_3 1.73205080756887729352744634150587 if (crossMengerTrickEnabled && i >= startIterations && i < stopIterations)
{ // CrossMengerTrick. Tweaks on Knighty_Maths double dd = DE; z.y = fabs(z.y); z.z = fabs(z.z); if ( FabsZEnabled) { z.x = fabs(z.x); }
dot1 = ( z.x * -SQRT_3_4 + z.y * 0.5 ) * DotScale; double t = max(0.0, dot1); z.x -= t * -SQRT_3;
if (Mod1Enabled) { z.y = fabs(z.y) - t; } else { z.y = fabs(z.y - t); } z.x -= SQRT_3_4; double dy = 0.0; double dz = 0.0; if (z.y > 0.5 && z.z > 0.5) { dy = 1.5; dz = 1.5; } else if ((z.y - 1.5) * (z.y - 1.5) + z.z * z.z < z.y * z.y + (z.z - 1.5) * (z.z - 1.5)) { dy = 1.5; } else dz = 1.5;
z.y -= dy; z.z -= dz; z *= MengerScale; DE *= MengerScale; z.y += dy; z.z += dz; z.x += SQRT_3_4;
if (DerivativeScaleEnabled) { dd *= DerivativeScale; z *= dd; aux.DE *= dd; } DE *= DEtweak; }
|
|
« Last Edit: October 29, 2016, 10:29:57 AM by mclarekin, Reason: fixed conversion mistakes »
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #52 on: October 29, 2016, 08:38:37 AM » |
|
And the dotScale can even go negative in some situations. Bringing the parameter to -0.1 has made this shape hollow.
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #53 on: October 31, 2016, 12:43:52 AM » |
|
These images have an exp2 transform used for 2 or 3 iterations. In brief; This transform can be used with most standard type formulas (but can be a bit tricky to use.) we are modifying so that z = z + a_proportion _of exp2(z.x) Here is the beginning code, repeat for y and z. (even though there is no DE calc, I also insert a DE tweak at the end which can help) CVector3 tempZ = z;
if (fractal->transformCommon.functionEnabledx) // enable exp2(z.x) { if (fractal->transformCommon.functionEnabledAx) // enable fabs (z.x) { tempZ.x = fabs(z.x); if (fractal->transformCommon.functionEnabledAxFalse) // enable if you want to use the flatter negative part of the pow curve { tempZ.x = -tempZ.x; } tempZ.x = exp2(tempZ.x * fractal->transformCommon.constantMultiplier000.x) - 1.0; if (z.x > 0) z.x += tempZ.x; else z.x -= tempZ.x; } else z.x += exp2(tempZ.x * fractal->transformCommon.constantMultiplier000.x) - 1.0; }
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #54 on: October 31, 2016, 10:32:45 AM » |
|
Exp is too strong as deform and slows de You should use a polynome valid in range -1 to 1 then extend it with some linear expression. Or try to use my reciprocalx3 it is a rational polynomial that never goes to infinity.
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
mclarekin
|
|
« Reply #55 on: November 01, 2016, 02:36:05 AM » |
|
@darkbeam thanks, I will code up the reciprocalx3 type. "Deform" is the word I have been looking for , the parameter tweaking iteration_count stuff, that I have also been working on are "deformers". The main reason behind the exp2 transform is that apparently I once made the attached image out of a mandelbox with some exp2 working on one axis, and I want to recreate it to find out how it worked.
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #56 on: November 03, 2016, 02:06:23 AM » |
|
Well Reciprocal3 has got me sidetracked I even graphed it. And I am now getting a SIGN() function added to the Mandelbulbers maths Here it is for a single iteration to deform the cross menger trick, Image 001 running at iteration 0, and then image 002 at iteration 1 (after the first crossmenger trick iteration ) in the hybrid loop.
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #57 on: November 03, 2016, 08:07:38 AM » |
|
Woow it looks nice in mb3d sometimes it stretches fractals to the infinity. There are versions also for y and z that do very different things on kifs fractals (that do intense coord swapping) like Menger, Sierpinski SierpHilbert etc... and usually it is alternated for every iter to get strange futuristic buildings.
|
|
« Last Edit: November 03, 2016, 08:27:52 AM by DarkBeam »
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
Crist-JRoger
|
|
« Reply #58 on: November 07, 2016, 09:33:47 AM » |
|
const float SQRT_3_4 = 0.86602540378443864676372317075294; const float SQRT_3 = 1.73205080756887729352744634150587; uniform vec3 offsetScale; slider[(-1,-1,-1),(0,0,0),(1,1,1)] uniform float dotScale; slider[0.0,1.0,2.0] uniform bool PrismShape; checkbox[true] uniform bool Xcondition; checkbox[true]
if (PrismShape) { // a pre-transform, no DE required z = vec3({z.z, z.x, z.y); // reorientate
z.z = abs(z.z); float dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * dotScale; float t = max(0.0, dot1); z.x -= t * -SQRT_3; z.y = abs(z.y - t); if(z.y > z.z){ temp =z.y; z.y = z.z; z.z = temp;} z -= offsetScale * vec3{ SQRT_3_4, 1.5, 1.5}; if(z.z > z.x){temp =z.z; z.z = z.x; z.x = temp;}
if (Xcondition) { if(z.x >= 0.0){ z.y = max(0.0, z.y); z.z = max(0.0, z.z);} } } error? z = vec3( {z.z, z.x, z.y); // reorientate Can you see my .frag? What's wrong? Tried another code from your latest posts, what is fabs? Did you used Fragmentarium?
|
|
« Last Edit: November 07, 2016, 10:32:37 AM by Crist-JRoger »
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #59 on: November 07, 2016, 05:25:02 PM » |
|
Just found ChebyMenger from an Eiffie shadertoy! Lool, fantastic /// Chebymenger by eiffie
#define Pi 4.0 float Cos(float a){return clamp(abs(mod(a,2.0*Pi)-Pi)-Pi/2.0,-1.0,1.0);} float Sin(float a){return Cos(a-Pi/2.0);} vec2 CosSin(float a){return vec2(Cos(a),Sin(a));} float Length(vec2 p){return max(abs(p.x),abs(p.y));}//==(x^inf+y^inf)^(1/inf) float Length(vec3 p){return max(abs(p.x),max(abs(p.y),abs(p.z)));} float Atan(vec2 p){ if(p.y==0.0)return (p.x>0.0?0.0:4.0); float a=p.x/p.y; if(abs(a)<1.0){ if(p.y>0.0)return 2.0-a; else return 6.0-a; }else { a=p.y/p.x; if(p.x>0.0)return mod(a,8.0); else return 4.0+a; } } vec2 Rotate(vec2 p,float a){return CosSin(Atan(p)+a)*Length(p);}
const int iters=4; float psni=pow(3.0,-float(iters)),tym=iGlobalTime; float DE(in vec3 p){//menger with chebyshev rotation p.xy=Rotate(p.xy,tym); //p.xz=Rotate(p.xz,tym);//for more weirdness for (int n = 0; n < iters; n++) { p = abs(p); if (p.x<p.y)p.xy = p.yx; if (p.x<p.z)p.xz = p.zx; if (p.y<p.z)p.yz = p.zy; p = p*3.0 - 2.0; if(p.z<-1.0)p.z+=2.0; } return (Length(p)-1.0)*psni*0.707;//.707 compensates for the square rotation }
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
|