Logo by DsyneGrafix - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. April 20, 2024, 10:17:03 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1] 2 3 ... 9   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Implementing MixPinski  (Read 20105 times)
0 Members and 1 Guest are viewing this topic.
mclarekin
Fractal Senior
******
Posts: 1739



« on: November 14, 2016, 01:44:39 AM »

first attempt at darkbeams mixPinski, which I now know is another cross menger  type (sierpinski-rotate-menger4D)


* mixPinski aaa2 800.jpg (206.37 KB, 800x800 - viewed 427 times.)
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #1 on: November 14, 2016, 06:05:58 AM »

Another way of looking at what is happening with the function is by graphing.  This image shows the five folds that are in some amazing surf UI,s graphed at default values (generally 1.0).

the horiz. axis is x entering the function ,and the vert. axis is the output value x, (the value it has been mapped to).  This graph is difficult  to read, but it shows the areas of similarity between these different folds.

The peaks and valleys in the graph are related to the fold/limit/offset/shift  value, in this case mostly happening at 1.0 and -1.0. What we can then do is insert  types of curves into the peaks and valley and make the  folding operation smooth ( i have yet to try  this).


* folds.jpg (48.52 KB, 791x691 - viewed 398 times.)
« Last Edit: November 14, 2016, 06:21:16 AM by mclarekin, Reason: more rambling » Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #2 on: November 14, 2016, 09:35:34 AM »

From what I remember I think MP is more symmetric  cheesy
Nice render though!  A Beer Cup thanks for implementing
Logged

No sweat, guardian of wisdom!
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #3 on: November 14, 2016, 10:37:53 AM »

mclarekin, thanks again! Not really sure, added foldings, strange construction  lips are sealed   grin 


* CM_Fold-1.bmp Files.zip (10.2 KB - downloaded 216 times.)
Logged

mclarekin
Fractal Senior
******
Posts: 1739



« Reply #4 on: November 14, 2016, 11:19:54 AM »

@crist, WOW , cool image.  A limitless world to explore when mixing all of of these linear type fractals.  Is the MixPinski in a .frag? if not  I can try and make one.

@DarkBeam

I quickly coded it (minus the rotation yet), and I have still to understand the menger and DE maths.

Anyhow first impressions is that is a brilliant tool for making  a very large infinity of shapes and patterns and then,  when I starting exploring, it just got better and better embarrass A Beer Cup afro

It is fast and hybridizable,  It finally gives me a second 4D linear to test the existing 4D transforms with and a reason to make some more.

So far, the analytical DE is better than I was expecting, and in some settings it is excellent.


* mixPinski aab2 550.jpg (222.33 KB, 550x550 - viewed 433 times.)
Logged
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #5 on: November 14, 2016, 11:47:42 AM »

@crist, WOW , cool image.  A limitless world to explore when mixing all of of these linear type fractals.  Is the MixPinski in a .frag? if not  I can try and make one.
Thank you!
I guess no. (Just googled now what is MixPinski  cheesy ) More .frags!  wink

upd.: another one render on Intel GPU. Classic DE-Raytracer.frag  smiley

« Last Edit: November 14, 2016, 02:09:13 PM by Crist-JRoger » Logged

mclarekin
Fractal Senior
******
Posts: 1739



« Reply #6 on: November 15, 2016, 07:42:11 AM »

@ crist.  This is an example of converting one of DarkBeams M3D.m3f.  I have still got a lot to do to finish coding it properly ( I have also lost some symmetry in c++ version),. This is a walk_through of  the steps I take when attempting to convert a .m3f to .fract

// DarkBeams MixPinski4.m3f


1) GET INFORMATION FROM FIRST SECTION
[OPTIONS]
.Version = 6
.DEscale = 0.2      DE step, fudge factor??
.ADEscale = 2      ??
.DEoption = 6      would be good to know what DE method this equates to in Fragmentarium
.RStop = 1024      bailout
.SIpower = 2      ??
.Double Scale = 2           make default settings.    uniform float scaleM; slider[0.0,2.0,20.]   
.Double CScale X = 1   make default settings.    uniform vec4;  slider[(-5.0,1.0,5.0),(-5.0,1.0,5.0),(-5.0,0.5,5.0),(-5.0,0.5,5.0)]
.Double CScale Y = 1
.Double CScale Z = 0.5
.Double CScale W = 0.5
.6SingleAngles Rotation = 0      4D six_angle rotation

558BEC53565789C38B75088B7E30DD41
08DD01DD02DD0390D9E0D8D1DFE0D0EC
7202D9C9D8D2DFE0D0EC7202D9CAD9E0
D9C9D9E0D8D2DFE0D0EC7202D9CAD9E0
D9C990D9E0D8D3DFE0D0EC7202D9CBD9
E0D9C9D9E0D8D3DFE0D0EC7202D9CBD9
E0D9C9D9CAD9E0D8D3DFE0D0EC7202D9
CBD9E0D9CA9083EF28D9C0D84FF4D9C2
D84FF0DEC1D9C3D84FECDEC1D9C4D84F
E8DEC1DD1BD9C0D84FE4D9C2D84FE0DE
C1D9C3D84FDCDEC1D9C4D84FD8DEC1DD
1AD9C0D84FD4D9C2D84FD0DEC1D9C3D8
4FCCDEC1D9C4D84FC8DEC1DD19D84FC4
D9C9D84FC0DEC1D9C9D84FBCDEC1D9C9
D84FB8DEC183C728DD47F0DCC9D9E8DE
E9DC4FD0DEE9DD5908DD01DD02DD03DD
47F0DD86E8000000D8C9DD9EE8000000
9090DCCADCC9D9C0D9E8DEE9D9C0D9C0
DC4FE8DEEDDC4FE0DEEBD8F1DC4FD8DC
ECD9CCD9E1DEECDECBDD1ADD1BDD1990
909089D85F5E5B5DC20800



2) THEN WE EVALUATE THE INFO IN DESCRIPTION (This can be very important)
Description:

NOTE: If the formula does not render correctly together with 3D formulas check "Disable analytical DE".

A strange but intriguing fractal, that mixes Sierpinski and Menger folds. The amazing thing is that in 3D it does not work so well!


3) SET UP INITIAL CONDITIONS
uniform float scaleM; slider[0.0,2.0,20.]   
uniform vec4 scaleC;  slider[(-5.0,1.0,5.0),(-5.0,1.0,5.0),(-5.0,0.5,5.0),(-5.0,0.5,5.0)]

// offset useful for testing purposes, but will also keep in final UI
uniform vec4 offsetM;  slider[(-5.0,0.0,5.0),(-5.0,0.0,5.0),(-5.0,0.0,5.0),(-5.0,0.0,5.0)]


// to give an intial w value
uniform float w; slider[0.0, 0.0, 5.0]

uniform int MI; slider[0.0, 10.0, 250.0] // maximum iterations

uniform float bailout; slider[0.0, 1024.0, 1024.0]

uniform float DE = 1.0; // not sure if you need this

uniform vec4 z  = (pos, w);  // not sure how to do this in Frag.(p.x,p.y, p.z, w)

//MixPinski4(x,y,z,w){
 //  r=x*x+y*y+z*z;

float DE(vec4 z)
{
    float  r = (z.x * z.x + z.y * z.y + z.z * z.z); //  for bailout. Mandelbulber includes "+ z.w * z.w); "
// but i suspect it may not be necessary


4) THEN THE ITERATION LOOP
4a)The Sierpinski part is a cut and paste. No editing required. smiley

   for(i=0;i<MI && r<bailout;i++){

      if(z.x+z.y<0.0) z.xy = -z.yx;
      if(z.x+z.z<0.0) z.xz = -z.zx;
      if(z.y+z.z<0.0) z.zy = -z.yz;
      if(z.x+z.w<0.0) z.xw = -z.wx;
      if(z.y+z.w<0.0) z.yw = -z.wy;
      if(z.z+z.w<0.0) z.zw = -z.wz;

4b)  z += offsetM; //  I  add in offset for testing


      //rotate4D(x,y,z,w); 4D rotation TODO, could try using a 3D rot for now

4c) 4D Menger Sponge part, I did a Find and Replace

      z.x= scaleM *z.x-scaleC.x*( scaleM -1);
      z.y= scaleM *z.y-scaleC.y*( scaleM -1);
      z.w= scaleM *z.w-scaleC.w*( scaleM -1);
      z.z-=0.5*scaleC.z*( scaleM -1)/ scaleM ;
      z.z=-abs(-z.z);
      z.z+=0.5*scaleC.z*( scaleM -1)/ scaleM ;
      z.z= scaleM *z.z;
    
    // original code
     /* x=scale*x-CX*(scale-1);
      y=scale*y-CY*(scale-1);
      w=scale*w-CW*(scale-1);
      z-=0.5*CZ*(scale-1)/scale;
      z=-abs(-z);
      z+=0.5*CZ*(scale-1)/scale;
      z=scale*z;*/
      
      //r=x*x+y*y+z*z;
   r = (z.x * z.x + z.y * z.y + z.z * z.z);

   DE *= scaleM; // I  added this because i do not understand the original DE, but I will eventually add the original  DE to the Mandelbulber DE section and test it out
   }


5) I GET CONFUSED WITH DE
   //return sqrt(x*x+y*y+z*z)*scale^(-i); // original code, completely new to me
   return (r - 2.0) / DE); // I used this, but I could try "return r/DE;" and maybe a generic "return (r - offsetD)/DE.
I// have a lot to learn about DE calculation.

I cannot guarantee this will make a workable .fract, but hopefully it may be OK.
« Last Edit: November 15, 2016, 09:52:02 AM by mclarekin » Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #7 on: November 15, 2016, 08:08:52 AM »

Please note that mb3d auto handles de so idk smiley
 A Beer Cup
Logged

No sweat, guardian of wisdom!
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #8 on: November 15, 2016, 09:39:20 AM »

 @ DarkBeam.  I am now working my way though the code, and have some questions for you.

a) does w come into the loop as a default of 0.0?

b)  line:  z=-abs(-z);
    abs of neg z,  is this different to abs of pos z in programming language?

c) With the use of Cscale. 
I am guessing the terms (scale-1) and (scale-1)/scale  is from how the maths is constructed.

But I am thinking that when implementing the code:

      x=scale*x-CX*(scale-1);
      y=scale*y-CY*(scale-1);
      w=scale*w-CW*(scale-1);
      z-=0.5*CZ*(scale-1)/scale;
      z=-abs(-z);
      z+=0.5*CZ*(scale-1)/scale;
      z=scale*z;

could ithet be removed and shortened to this:
(i.e  the user input CX value can be considered to include the result of the "scale" maths  (unless I missed something))

      x=scale*x-CX;
      y=scale*y-CY;
      w=scale*w-CW;
      z-= CZ;
      z=-abs(-z);
      z+=CZ;
      z=scale*z;


d) DELETED.  I  have looked at the DE maths:


   return sqrt(x*x+y*y+z*z)*scale^(-i);

and I figured out that  it looks like the linear  "return distance = r/DE" sort of thing, because DE is a function of scale and iterations. With this sort of DE I visualize  a graph of DE value over iteration_count, and in that respect this equation would appear to make sense.  I will check it out  once I have implemented the 4D rotation, but it would be interestingly cool if the  "scale^(-i)"  maths produced some difference.
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #9 on: November 15, 2016, 11:12:02 AM »

Symmetry issue resolved, my first image was not aligned to a symmetric axis, there are all sorts of 45 degree  rotations you can view it from.  It is a strange but intriguing fractal before you even start changing  parameters. A Beer Cup

These images are at default parameters.


* mixPinski4_axis.jpg (213.28 KB, 900x559 - viewed 415 times.)
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #10 on: November 15, 2016, 03:37:56 PM »

Yes to all questions except you should not touch the cx scaling because it is derived from the holy Knighty formulas that I will never understand ... but  are untouchable afro
Lastly I think your latest renders are okay but I am used to see it from the unrotated view. And I was amazed too from the very 1st render of the formula that I made only for fun I did not expect to discover a real fractal!
« Last Edit: November 15, 2016, 03:44:03 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #11 on: November 15, 2016, 05:59:38 PM »

don't works  undecided  end no errors  huh? Where return function need to be?

Code:
#include "DE-Raytracer.frag"

uniform float scaleM; slider[0,.2,.2]
uniform vec4 scaleC; slider[(-5,-5,-5,-5),(1.,1.,.5,.5),(5.,5.,5.,5.)]
uniform vec4 offsetM; slider[(-5,-5,-5,-5),(0.,0.,0.,0.),(5.,5.,5.,5.)]
uniform float w; slider[0,0,5.]
uniform int MI; slider[0,10,250]
//uniform float bailout; slider[0,1024,1024]

float DE(vec3 p)
{
vec4 z=vec4(p,w);
float r=0.;
//float r=(z.x*z.x+z.y*z.y+z.z*z.z);
//float r=z.x*z.x+z.y*z.y+z.z*z.z+z.w*z.w;
//for(int i=0; i<MI && r<bailout; i++){
for(int i=0; i<MI; i++){
if(z.x+z.y<0.0) z.xy = -z.yx;
    if(z.x+z.z<0.0) z.xz = -z.zx;
    if(z.y+z.z<0.0) z.zy = -z.yz;
    if(z.x+z.w<0.0) z.xw = -z.wx;
    if(z.y+z.w<0.0) z.yw = -z.wy;
    if(z.z+z.w<0.0) z.zw = -z.wz;

z+=offsetM;

z.x= scaleM *z.x-scaleC.x*( scaleM -1);
    z.y= scaleM *z.y-scaleC.y*( scaleM -1);
    z.w= scaleM *z.w-scaleC.w*( scaleM -1);
    z.z-=0.5*scaleC.z*( scaleM -1)/ scaleM ;
    z.z=-abs(-z.z);
    z.z+=0.5*scaleC.z*( scaleM -1)/ scaleM ;
    z.z= scaleM *z.z;

r=z.x*z.x+z.y*z.y+z.z*z.z+z.w*z.w;
return r;
}
//return r;
}

Logged

DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #12 on: November 15, 2016, 06:44:40 PM »


Code:
#include "DE-Raytracer.frag"

uniform float scaleM; slider[0,.2,.2]
uniform vec4 scaleC; slider[(-5,-5,-5,-5),(1.,1.,.5,.5),(5.,5.,5.,5.)]
uniform vec4 offsetM; slider[(-5,-5,-5,-5),(0.,0.,0.,0.),(5.,5.,5.,5.)]
uniform float w; slider[0,0,5.]
uniform int MI; slider[0,10,250]
//uniform float bailout; slider[0,1024,1024]

float DE(vec3 p)
{
vec4 z=vec4(p,w);
float r=0.; //float sk=1.;
//float r=(z.x*z.x+z.y*z.y+z.z*z.z);
//float r=z.x*z.x+z.y*z.y+z.z*z.z+z.w*z.w;
//for(int i=0; i<MI && r<bailout; i++){
for(int i=0; i<MI; i++){
if(z.x+z.y<0.0) z.xy = -z.yx;
        if(z.x+z.z<0.0) z.xz = -z.zx;
        if(z.y+z.z<0.0) z.zy = -z.yz;
        if(z.x+z.w<0.0) z.xw = -z.wx;
        if(z.y+z.w<0.0) z.yw = -z.wy;
        if(z.z+z.w<0.0) z.zw = -z.wz;

z+=offsetM;
        // why no rotate here? :(
        // sk *= scale;
z.x= scaleM *z.x-scaleC.x*( scaleM -1);
    z.y= scaleM *z.y-scaleC.y*( scaleM -1);
    z.w= scaleM *z.w-scaleC.w*( scaleM -1);
    z.z-=0.5*scaleC.z*( scaleM -1)/ scaleM ;
    z.z=-abs(-z.z);
    z.z+=0.5*scaleC.z*( scaleM -1)/ scaleM ;
    z.z= scaleM *z.z;
// You are returning on 1st iter! no ;)
r=z.x*z.x+z.y*z.y+z.z*z.z+z.w*z.w;
if (r>bailout) break; // bailout do not remove... else you get overflows break exits from a cycle.
} // cycle ends
return sqrt(r)*pow(scale,-i); // returning a DE... exits from function. You must convert i to float btw
// or uncomment the sk related lines and use
// return sqrt(r)*sk;
}



That should work I think wink
« Last Edit: November 15, 2016, 11:35:53 PM by DarkBeam, Reason: Added sk » Logged

No sweat, guardian of wisdom!
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #13 on: November 15, 2016, 11:42:48 PM »

Thanks DarkBeam,  It looks good.

Crist, beware that converting DarkBeams formulas can become addictive grin
Logged
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #14 on: November 16, 2016, 05:01:32 AM »

DarkBeam, did you tried thos code?

fragment errors
Code:
return sqrt(r)*pow(scale,-i); 
Frag says
Undeclared identifier: scale
Undeclared identifier: i

what is scale? i declared just inside the cycle.

and what is sk?  undecided

mclarekin, I just began  wink
Logged

Pages: [1] 2 3 ... 9   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Help about implementing the perturbation theory Programming « 1 2 » CFJH 23 2323 Last post May 14, 2015, 06:40:57 PM
by therror
mixPinski 1600 Mandelbulber Gallery mclarekin 3 955 Last post November 19, 2016, 02:54:00 AM
by paigan0
mixPinski sphFold Mandelbulber Gallery mclarekin 0 1168 Last post November 19, 2016, 10:27:57 AM
by mclarekin
Implementing ABoxModKaliEiffie Amazing Box, Amazing Surf and variations « 1 2 3 » mclarekin 30 10685 Last post November 27, 2016, 11:52:55 AM
by Sabine
Implementing Menger Sponge 45 rot Sierpinski Gasket mclarekin 9 3557 Last post December 04, 2016, 10:49:35 PM
by DarkBeam

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.181 seconds with 25 queries. (Pretty URLs adds 0.014s, 2q)