Welcome to Fractal Forums

Fractal Software => 3D Fractal Generation => Topic started by: DarkBeam on January 06, 2017, 11:28:02 PM




Title: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 06, 2017, 11:28:02 PM
Hi all.
The algorithm by Jos is fantastic. The problem is that for some reason the spatial vars x y z during iters get more and more discontinue except y (?) ...
I do not understand a lot of operations that are in the code. So it is very hard to figure out modifications without ruining the good DE.

The easiest is Aexion's. Add something to z also instead only to y and x before inversion.
http://www.fractalforums.com/index.php?topic=24728.msg98467#msg98467
Gives cool results.
The problem is that the DE gets instantly broken (even for infinitesimal values).
Even the separation line seems to not work anymore.
Ideas on how to fix?


Title: Re: Little help needed for extending the Kleinian algo.
Post by: pupukuusikko on January 06, 2017, 11:52:52 PM
There is a line in the frag:
z = vec3(-b, a, 0.) - z;

In Aexion's version, I think it should be:
z = vec3(-b, a, -KleinJ) - z;

at least then it doesn't turn to dust so easily :)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 07, 2017, 12:24:13 AM
I will test this asap! Thanks so much my friend!


Title: Re: Little help needed for extending the Kleinian algo.
Post by: JosLeys on January 07, 2017, 11:41:25 AM
Wait, it is a bit more complicated than that.
Adding in the KleinJ parameter in the z-direction requires the 'separation line' to be rotated.
The 'line' is actually a plane perpendicular to the xy plane.
Just try it: put KleinI=0 and KleinJ=something and things go horribly wrong.

The equation for the separation line :  a * (0.5 +  f * 0.25 * sign(z.x + b * 0.5)* (1. - exp( - 3.2 * abs(z.x + b * 0.5))))) needs changing.
Let c=KleinJ.

Let d=(b*(z.x+b*0.5)-c*(z.z+c*0.5))/sqrt(b*b+c*c)

Then we need :  a * (0.5 +  f * 0.25 * sign(d)* (1. - exp( - 3.2 * abs(d)))))

I have not tried it out on the frag code, so beware of mistakes!
.   


Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 07, 2017, 12:36:41 PM
It REALLY works perfectly thanks so much guys!!!
:spgloomy: :drink:


Title: Re: Little help needed for extending the Kleinian algo.
Post by: JosLeys on January 07, 2017, 12:56:52 PM
Just one thing, with the changed equation for the separation line, things will fail if both KleinI and KleinJ are zero.
(division by zero)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: JosLeys on January 07, 2017, 02:35:28 PM
...and another thing.: I tried it out in my UF implementation and have some corrections.
I said:
Quote
Let c=KleinJ.
Let d=(b*(z.x+b*0.5)-c*(z.z+c*0.5))/sqrt(b*b+c*c)
Then we need :  a * (0.5 +  f * 0.25 * sign(d)* (1. - exp( - 3.2 * abs(d)))))

This should be:
first :
if c=0
  {float f=1,if b<0,f=-1}

if b=0
  {float f=1,if c<0,f=-1}

if abs(c)>0 && abs(b)>0,f=1

Then: Let d=(b*(z.x+b*0.5)+c*(z.z+c*0.5))/sqrt(b*b+c*c)
..and you could add
if (b=0 && c=0), d=z.x


Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 07, 2017, 11:00:03 PM
Jos ... can simply be
 f = sign (b*c)
?

I would also like to ask more complicated questions but I also asked to Knighty (I will wait)

Please people be patient a little the formula is under construction.
Meanwhile use positive b and Aexion...
;)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: JosLeys on January 07, 2017, 11:29:39 PM
Quote
Jos ... can simply be
 f = sign (b*c)
?

I find that f should be 1 when both b and c are nonzero. If you do sign(b*c) you will still get -1 if b and c have opposite signs...


Title: Re: Little help needed for extending the Kleinian algo.
Post by: Aexion on January 07, 2017, 11:31:09 PM
Please people be patient a little the formula is under construction.
Meanwhile use positive b and Aexion...
;)

While the formula is under construction, you can either use a Julia Set mix for replacing the spheres or
use your favorite Abs() function for a set of very interesting variations
 ;D
(http://www.rfractals.net/share/k1.png)(http://www.rfractals.net/share/k2.png)
(http://www.rfractals.net/share/k3.png)(http://www.rfractals.net/share/k4.png)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: Sabine on January 08, 2017, 11:55:41 AM
Aexion, such Beauties up here!  :beer:


Title: Re: Little help needed for extending the Kleinian algo.
Post by: KRAFTWERK on January 08, 2017, 02:40:33 PM
Please people be patient a little the formula is under construction.
Meanwhile use positive b and Aexion...
;)

Cant wait.... ;)
And Aexion... Beautiful renders!!!


Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 08, 2017, 05:17:59 PM
Since you already keep in mind signs of a, c in my opinion f should just be 1 (you multiply by b then divide by a modulus -> equals to sgn(b) if c=0 etc. ... ) ;D
, in my case 0.25 because I moves out some constants, so this should be the correct;
(sorry for the strange stuff all around but it just works into assembly! :evil1: )

Code:
	double x,y,z;
//vec3 lz=z+vec3(1.), llz=z+vec3(-1.);
double DF = load1();
x=loadX(); y=loadY(); z=loadZ();
double lzx = x+DF; double lzy = y+DF; double lzz = z+DF;
double llzx = x-DF; double llzy = y-DF; double llzz = z-DF;
double DE = loadNthDoubleCns(0,0);
double d2;
double oC = DE;
double a, b, AexJ;
//double bdiva = (fabs(b)>loadNthDoubleCns(1,0))?b/a:load1();
double bdiva, distJosfix;
double f; // f * 0.25
int Box_Iterations = loadNthIntVar(0,6*szof1dbl);
int Final_Iterations = loadNthIntVar(1,6*szof1dbl);
int MiscOps;
int SpI = (loadNthIntVar(2,6*szof1dbl))&4;
double bsx = loadNthDoubleVar(2,0);
double bsz = loadNthDoubleVar(3,0);
double bsx2 = bsx*loadNthDoubleCns(5,0);
double bsz2 = bsz*loadNthDoubleCns(5,0);
int i;

if (Box_Iterations>100) Box_Iterations = 100;
if (Final_Iterations>20) Final_Iterations = 20;

    //Box_Iterations = 30; Final_Iterations = 4;
    a = loadNthDoubleVar(0,0); b = loadNthDoubleVar(1,0);
    AexJ = loadNthDoubleVar(10,3*szof1int);
    bdiva = (b/a);
WORD oldcw=fegr_floor(); // wrap() works ok
// f = sig0p(b)*sig0p(AexJ)*loadNthDoubleCns(3,0); // f * 0.25
f = loadNthDoubleCns(3,0); // = 0.25
distJosfix = sqrt(b*b+AexJ*AexJ);
if (distJosfix>loadNthDoubleCns(1,0)) distJosfix = recip(distJosfix);

// vars:
// 0 = dbl a; 1 = dbl b; 2 = dbl box_size_x; 3 = dbl box_size_y;
// 4 = dbl clampY; 5 = dbl clampDF;
// 6+off(3int) = iCx 7+off(3int) = iCx 8+off(3int) = iCx
// 0+off(6dbl) = int Box_Iterations;
// 1+off(6dbl) = int Final_Iterations;
MiscOps = (loadNthIntVar(2,6*szof1dbl))&4;
    if (MiscOps) {
        //z=z-InvCenter;
        x = x - loadNthDoubleVar(6,3*szof1int);
        y = y - loadNthDoubleVar(7,3*szof1int);
        z = z - loadNthDoubleVar(8,3*szof1int);
double iR = loadNthDoubleVar(9,3*szof1int); iR *= iR;
d2 = length2(x,y,z);
iR = iR/d2;
x = x*iR + loadNthDoubleVar(6,3*szof1int);
        y = y*iR + loadNthDoubleVar(7,3*szof1int);
        z = z*iR + loadNthDoubleVar(8,3*szof1int);
    }
    
MiscOps = (loadNthIntVar(2,6*szof1dbl))&1;
for (i = 0; i < Box_Iterations ; i++)
{
//if(z.y<0. || z.y>a) break;

x += bdiva*y;
/*
if (FourGen)
z = wrap(z, vec3(2. * box_size_x, a, 2. * box_size_z), vec3(- box_size_x, 0., - box_size_z));
else
z.xz = wrap(z.xz, vec2(2. * box_size_x, 2. * box_size_z), vec2(- box_size_x, - box_size_z));
*/
if (MiscOps) {
wrap3D(&x,&y,&z,
bsx2,a, bsz2,
-bsx,loadzero(),-bsz);
} else {
wrap2D(&x,&z,
bsx2,bsz2,
-bsx,-bsz);
}
x -= bdiva*y;

//If above the separation line, rotate by 180° about (-b/2, a/2)
// if  (z.y >= a * (0.5 +  f * 0.25 * sign(z.x + b * 0.5)* (1. - exp( - 3.2 * abs(z.x + b * 0.5)))))
{
// Jos' rotated separation line for Aexion mod! THANKS JOS!
double x00 = (b * (x + b * loadNthDoubleCns(2,0))
-AexJ*(z + AexJ * loadNthDoubleCns(2,0))) * distJosfix;
// old separation line:
// double x00 = x + b * loadNthDoubleCns(2,0);
x00 = loadNthDoubleCns(2,0) +  f * sign(x00) *
(load1() - exp( loadNthDoubleCns(4,0) * fabs(x00) ) ) ;
if  (y >= a *x00 )
{
//z = vec3(-b, a, 0.) - z;
// x = -b - x; y = a - y; z = -z ;original
x = -b - x; y = a - y; z = AexJ-z; // Pupukuusikko mod THANKS
//z.xy = vec2(-b, a) - z.xy; // commented out in Jos orig src
}
}

//Apply transformation a (Orig)
// TransA(&x,&y,&z, &DF, a, b);
//Apply transformation a + add Aex to z
TransA_Aex(&x,&y,&z, &DF, a, b, AexJ);
/*
//For colouring
double oCn = fabs(fabs(y)-fabs(x)-fabs(z));
oC = min(oC, oCn);
*/


//If the iterated points enters a 2-cycle , bail out.
if ( length2(x-llzx,y-llzy,z-llzz) < loadNthDoubleCns(1,0) )
{
break;
}
//Store prévious iterates
llzx = lzx; llzy = lzy; llzz = lzz;
lzx = x; lzy = y; lzz = z;
}
bsx = loadNthDoubleVar(11,3*szof1int);
saveOTColor( (loadNthDoubleCns(6,0)-bsx)*lzy / ( bsx*sqrt((double)i)+loadNthDoubleCns(6,0)) );

bsx = loadNthDoubleVar(4,0); // clampy
bsz = loadNthDoubleVar(5,0); // clampdf
MiscOps = (loadNthIntVar(2,6*szof1dbl))&2;
MiscOps = (MiscOps != 0);
//WIP: Push the iterated point left or right depending on the sign of KleinI
i = 0;
// sorry for using GOTO but it just does its job perfectly here
do {
   if (MiscOps) donothing();
else y = min(y, a-y); // Show balls (Strongly reccomended! Really! :D )
DE=min(DE,min(y,bsx)/max(DF,bsz));
if (i>=Final_Iterations) break;
//Apply inv-transformation a (Orig)
// TransAInv(&x,&y,&z, &DF, a, b);
//Apply inv-transformation a + add Aex to z
TransAInv_Aex(&x,&y,&z, &DF, a, b, AexJ);
i++;
} while (1);

MiscOps = (loadNthIntVar(2,6*szof1dbl))&4;
    if (MiscOps) { // fixde finale sphereinv
        DE=DE*d2/(loadNthDoubleVar(9,3*szof1int)+sqrt(d2)*DE);
    }
    
fesetround(oldcw); // do this right before returning
saveDE (DE);
/*
cns; loadNthDoubleCns(n,0);

0 = 1e10
1 = 1e-5
2 = 0.5
3 = 0.25
4 = -3.2
5 = 2.
---------
*/

To Aexion post codeeeeeeeeeeee :pray2: :worm:


Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 09, 2017, 09:59:12 AM
In the meantime.
I wanted to reproduce something that rensembles those groups:

http://alessandrorosa.altervista.org/complex/listings/circles/display.php?f=experiments/maskit/experiments.maskit.01.02.txt


Title: Re: Little help needed for extending the Kleinian algo.
Post by: JosLeys on January 09, 2017, 10:40:22 AM
@Darkbeam. The new version works well!
A question though : option 3 does the normal thing, while option 4 does the sphere inversion, but what about option 0,1,2 ?


Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 09, 2017, 11:51:47 AM
Dear Jos mb3d has a very limited number of sliders.
I had to use a binary encoding of all your options in order of effect beauty  :angel1:
Option 1 enables your "Four generators".
Option 2 DISables "Show balls". (hmm... should be?)
4 for sphere inversion.
To enable several options sum the numbers: 3 enables 4 gen and show balls and zero disables all 88) :)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: Sabine on January 09, 2017, 12:28:19 PM
@Luca Can you add this text about the options to the description? It would be so helpful!


Title: Re: Little help needed for extending the Kleinian algo.
Post by: Aexion on January 09, 2017, 02:37:28 PM
To Sabine and KRAFTWERK:
Many Thanks!! :)

To Aexion post codeeeeeeeeeeee :pray2: :worm:

I forgot to post the .frag! my apologies!
Consider this .frag as a non canonical, mutant version of the original version. Its some experiments that I was trying to do.   ;D
It basically add a Julia set (and a multiplier) and two possible entry points for the abs() function.
All is under the Jul section, and you can see the examples (variations of the original examples) in the Jul presets.
One example is missing, the first picture, that was done by changing the Julia function by the burning ship formula, but I didn't wanted to burden the .frag with more conditionals!.

Anyways, I will try other functions!  :)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: bib on January 09, 2017, 05:10:19 PM
Dear Jos mb3d has a very limited number of sliders.
I had to use a binary encoding of all your options in order of effect beauty  :angel1:
Option 1 enables your "Four generators".
Option 2 DISables "Show balls". (hmm... should be?)
4 for sphere inversion.
To enable several options sum the numbers: 3 enables 4 gen and show balls and zero disables all 88) :)

It took me discussions on deviantart with some core protagonists to realize that the answer to my question "how to combine options 2 and 4?" was simply "option 6" :)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: Tim Emit on January 09, 2017, 07:11:41 PM
@ Aexion and all.. thanks for the fragment ..very nice .. keep up the good work :beer:


Title: Re: Little help needed for extending the Kleinian algo.
Post by: Sabine on January 10, 2017, 01:46:42 PM
@Aexion Thank you for adding the Julia and posting the .frag, so much fun to play with! Seems whatever you do to it, it throws up goodies:)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: pupukuusikko on January 10, 2017, 09:11:17 PM
Here's a possibly interesting mod, found after intensive frobbling ;)

I replaced the warping function with boxfold and removed the separation line thing.
Surprisingly, resulting fractal still has nice kleinian style spirals, although they are arranged unnecessarily
symmetrically, and shiny spheres are gone.

On a positive side, the thing does not seem to have cuts.  :happy:
Frag is attached below.

examples:

(http://i.imgur.com/5vLwH48.jpg)
(http://i.imgur.com/YSjzRUE.jpg)
(http://i.imgur.com/gaH0xnG.jpg)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 10, 2017, 10:46:49 PM
This is cruel, you know :'( :'( :'(


Title: Re: Little help needed for extending the Kleinian algo.
Post by: pupukuusikko on January 10, 2017, 10:58:22 PM
Take your time Luca, people wil be happy with the vanilla version for weeks  :yes:
(although it IS a great formula!)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: Sabine on January 11, 2017, 12:37:36 AM
 88) I Do need some sleep once in a while, you know?  :sleepy:

Thanks for posting the .frag, Pupukuusikko!  :dink:


Title: Re: Little help needed for extending the Kleinian algo.
Post by: JosLeys on January 11, 2017, 11:34:42 AM
Using a boxfold makes things go a little wild!
Two images below in the 'standard' view. The first is the normal situation, the second is with a boxfold in the three direction, no separation line, and so applying always the same transformation.


Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 11, 2017, 08:01:25 PM
yaaaaaaaay

I figured out how to show hexagon flakes instead of plain "squares", the result is stunning especially if coupled with aexionj:
(replace wrap with) (edit: storeint equals a FLOOR, not roundint)

Code:
		x += bdiva*y;
x -= -bsx; z -= -bsz;
int bop = (storeint(z/bsz2) );  // HEXAGON MOD
MiscOps = (loadNthIntVar(2,6*szof1dbl))&8; // HEXAGON MOD enabled? yes/no
if (MiscOps) {
if (bop&1) x-= bsz;   // HEXAGON MOD
}
x += -bsx-bsx2*storeint(x/bsx2);
z += -bsz-bsz2*bop;
MiscOps = (loadNthIntVar(2,6*szof1dbl))&1; // 3d mode
if (MiscOps) {
y += -a*(storeint(y/a));
}
x -= bdiva*y;

(http://orig10.deviantart.net/e2b6/f/2017/011/d/4/hexagon_mode_by_dark_beam-dav1ici.png)

edit; too bad the method is adding some cuts around  :'(


Title: Re: Little help needed for extending the Kleinian algo.
Post by: pupukuusikko on January 11, 2017, 08:20:30 PM
Using a boxfold makes things go a little wild!
Two images below in the 'standard' view. The first is the normal situation, the second is with a boxfold in the three direction, no separation line, and so applying always the same transformation.

I very much appreciate your interest, nice comparison, it is a little on the wild side ;)
However, the boxfold is not to blame, if you use boxfold with the separation line, it is almost identical to the original,
except for different symmetries. This combination also produces cuts  in the same way as the original formula.
In my script you get comparable results by setting fold multiplier = 1 instead of 0.5.

Below a comparison, left is the original wrapping and right is boxfold.

(http://i.imgur.com/FPCSCvT.jpg)



Title: Re: Little help needed for extending the Kleinian algo.
Post by: JosLeys on January 11, 2017, 08:32:31 PM
@pupukuusikko
I cannot run your frag file, it crashes my computer. I tried to replicate what you did in another frag file but probably made some mistakes.

I probably have an ancient version of Fragmentarium.
What version are you using and where can I find it?


Title: Re: Little help needed for extending the Kleinian algo.
Post by: pupukuusikko on January 11, 2017, 09:13:04 PM
@josLeys:

Sorry to hear that. I also use old version, 1.0.0, from http://syntopia.github.io/Fragmentarium/
You could try uncommenting the fast-raytracer.frag and commenting the DE-Kn2.frag to speed it up,
also set "Lock-to 1/2 window size' or lower. These could help with the gpu-related crashes, which I've experienced too.

That said, your results for boxfold+no separation look exactly like mine, so I'm sure your frag is good.


Title: Re: Little help needed for extending the Kleinian algo.
Post by: knighty on January 11, 2017, 10:29:34 PM
Cool variations!

I figured out how to show hexagon flakes instead of plain "squares"
(...)
edit; too bad the method is adding some cuts around  :'(

hexagonal tilings are not the only possible. Here is the (very slow) fragmentarium shader that generated this picture (http://www.fractalforums.com/index.php?action=gallery;sa=view;id=19902). Still some work to do in order to make it faster. It is slow because of the tests added in order to reduce the cuts.


Title: Re: Little help needed for extending the Kleinian algo.
Post by: Crist-JRoger on January 15, 2017, 08:10:03 AM
I forgot to post the .frag! my apologies!
Consider this .frag as a non canonical, mutant version of the original version. Its some experiments that I was trying to do.   ;D
It basically add a Julia set (and a multiplier) and two possible entry points for the abs() function.
All is under the Jul section, and you can see the examples (variations of the original examples) in the Jul presets.
One example is missing, the first picture, that was done by changing the Julia function by the burning ship formula, but I didn't wanted to burden the .frag with more conditionals!.

Anyways, I will try other functions!  :)

Thank you very much for frag! Played with this and finally i got what i wanted to do for a long time  ^-^

(http://pre09.deviantart.net/33b7/th/pre/f/2017/014/5/3/kleinian_cave_by_c_jr-davgovq.jpg) (http://orig04.deviantart.net/28a3/f/2017/014/5/3/kleinian_cave_by_c_jr-davgovq.jpg)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: mclarekin on January 16, 2017, 08:39:41 AM
Beautiful use of light , color and reflection O0 O0


Title: Re: Little help needed for extending the Kleinian algo.
Post by: Crist-JRoger on January 16, 2017, 11:19:51 AM
Thank you ) Turned off reflexions on fractal.
Little oftopic question to Knighty: Is possible to reflect godrays? Here on water the ray does't reflect
upd.: found the problem  (http://www.fractalforums.com/index.php?topic=20680.msg98929#msg98929)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: Aexion on January 17, 2017, 06:57:32 PM
Thank you very much for frag! Played with this and finally i got what i wanted to do for a long time  ^-^

(http://pre09.deviantart.net/33b7/th/pre/f/2017/014/5/3/kleinian_cave_by_c_jr-davgovq.jpg) (http://orig04.deviantart.net/28a3/f/2017/014/5/3/kleinian_cave_by_c_jr-davgovq.jpg)
It's a beautiful render!! Looks like a real nature photo..  :)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: 0Encrypted0 on January 18, 2017, 08:51:16 PM
@DarkBeam
Hexagonal mode for JosKn-KleinIFS (http://dark-beam.deviantart.com/journal/Hexagonal-mode-for-JosKn-KleinIFS-658189744)

Zoomed in on parameter from above link and saw some artifacts in Navi and rendered image (FYI).
See attached image.


Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 19, 2017, 09:13:24 AM
Thanks, I am aware that this fractal is based on cuts and approximated so it is not avoidable to have some troubles.


Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 20, 2017, 07:20:47 PM
I am currently trying to implement aexion and pupukuusikko 's suggestions. Some bad news;

1. Mb3D really dislikes when I take off separation line, the render is very slow and the shapes blow out. (Just I get small spheres scattering around).
2. Aexion abs options; Abs1 works even if the effect is somewhat strange but Abs2 just causes a bailout failure (all points become solid).
3. Boxfold works ok! But without sep line tweak... ?
4. Aexion Julia Mode looks interesting but deforms strongly.

 :sad1:


Title: Re: Little help needed for extending the Kleinian algo.
Post by: pupukuusikko on January 22, 2017, 02:15:47 PM
I am currently trying to implement aexion and pupukuusikko 's suggestions. Some bad news;

1. Mb3D really dislikes when I take off separation line, the render is very slow and the shapes blow out. (Just I get small spheres scattering around).
2. Aexion abs options; Abs1 works even if the effect is somewhat strange but Abs2 just causes a bailout failure (all points become solid).
3. Boxfold works ok! But without sep line tweak... ?
4. Aexion Julia Mode looks interesting but deforms strongly.

 :sad1:

Unfortunate. Do you mean that taking off separation line never works? No separation line and boxfold should
be just about the same as scale 1 box, so it should be straightforward :hmh: . I got maybe similar issues
when I had the z = vec3(-b,a,c)-z; outside the conditional, make sure you have it like below.


Code:
if (separation_line) {
if  (z.y >= a * (0.5+  f * 0.25*sign(z.x + b * 0.5)* (1. - exp( - 3.2 * abs(z.x + b * 0.5)))))
z = vec3(-b, a, c) - z; //<- check that this line is not performed if there is no separation line
}
}

Also the DE works a bit differently without separation line, clampY and clampDF have to be close to zero.
If you want to make behaviour more consistent, you can try to add a constant to DF like:
Code:
if (separation_line) {
....
}
else {
   DF+=0.5;
}

Also if you get this work, and want to allow combination of no separation line and  original wrapping, I think the box sizes should be halved.

Hope you get it working :)




Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 22, 2017, 03:06:54 PM
Actually I kinda got it to work keeping the separation line calculus, then breaking the loop if we are too far from it (when distance is > a/2 ). Else I just do no transform like in your frag.
This causes one side of kleinian to be just empty and the other to have "tall spirals" that in some cases get broken. :beer: Very close to that you made I think...
Removing it altogether causes too much trouble. 88) I think even some overflows happen ...


Title: Re: Little help needed for extending the Kleinian algo.
Post by: pupukuusikko on January 22, 2017, 04:00:51 PM

Cool :) Although if it is not continuous, then it might be kind of useless.  That is in my view the only positive aspect of my version compared to the original.
But, like you've said, people like symmetry. :)



Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 22, 2017, 04:26:00 PM
I am getting sliced spheres even in forced symmetry mode but sometimes the results are cool (see the strange spirals around);

(http://img02.deviantart.net/38bf/i/2017/022/b/2/colossus_by_dark_beam-dawbtan.jpg)


Title: Re: Little help needed for extending the Kleinian algo.
Post by: pupukuusikko on January 22, 2017, 05:46:08 PM
That's interesting :)

I think it might be better to approach no separation + boxfold from the box direction,
if you ever decide to get back to amazingIFS. Then it would also have better hybrid possibilities.


Title: Re: Little help needed for extending the Kleinian algo.
Post by: DarkBeam on January 22, 2017, 07:41:34 PM
I tried to rewrite the formula as did trafassel.
Now the formula stopped to work. I don't know how and when I will be able to recover it. :(
See that it is not easy to change those ...


Title: Re: Little help needed for extending the Kleinian algo.
Post by: pupukuusikko on January 23, 2017, 05:52:03 PM
I tried to rewrite the formula as did trafassel.
Now the formula stopped to work. I don't know how and when I will be able to recover it. :(
See that it is not easy to change those ...

sorry to hear that  :-\
If I ever use phrases like 'should be easy' or 'straightforward', you know I mean it in a special sense,
as in 'beyond impossible for everyone in the world except perhaps Luca if he is especially lucky'  ^-^