Logo by Trifox - 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: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. January 10, 2026, 07:18:15 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] 4 5 ... 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 28364 times)
0 Members and 4 Guests are viewing this topic.
Sabine
Fractal Fertilizer
*****
Posts: 373



WWW
« Reply #30 on: November 16, 2016, 08:32:15 PM »

Great job, Crist-JRoger!  A Beer Cup Great solution of using MI and nice shapes possible!  A Beer Cup

@mclarekin As it looks now, I think maxiter at around 60-80 gives nice solid shapes with detail detail. Go higher 160+ and the whole thing dissolves :}
Here a preset to load into frag (see image below)

Code:
#preset 5
FOV = 0.3854626
Eye = -50,9.111111,-50
Target = -7.336343,1.918736,-1.467269
Up = 0.3304061,0.0735456,-0.3194292
EquiRectangular = false
AutoFocus = false
FocalPlane = 9.184845
Aperture = 0
Gamma = 1.501706
ToneMapping = 5
Exposure = 1
Brightness = 1
Contrast = 1
Saturation = 1
GaussianWeight = 1
AntiAliasScale = 2
DepthToAlpha = false
ShowDepth = false
DepthMagnitude = 0
Detail = -3
DetailAO = -0.5
FudgeFactor = 0.3
MaxDistance = 1000
MaxRaySteps = 739
Dither = 0.5
NormalBackStep = 1 NotLocked
AO = 0,0,0,0.1557093
Specular = 0.2233677
SpecularExp = 8.185054
SpecularMax = 10
SpotLight = 1,1,1,0.083632
SpotLightDir = 0.2816901,0.5
CamLight = 1,1,1,0.6372315
CamLightMin = 0.12121
Glow = 1,1,1,0.2305006
GlowMax = 41
Fog = 0
HardShadow = 0.5474795 NotLocked
ShadowSoft = 0.2588235
QualityShadows = true
Reflection = 0 NotLocked
DebugSun = false NotLocked
BaseColor = 0.3098039,0.3098039,0.3098039
OrbitStrength = 0.14286
X = 0.427451,0.09411765,1,1
Y = 0.345098,0.666667,0,0.02912
Z = 1,0.666667,0,1
R = 0.0784314,1,0.941176,-0.0194
BackgroundColor = 0.8196078,0.8666667,0.8117647
GradientBackground = 1.401925
CycleColors = false
Cycles = 4.04901
EnableFloor = false NotLocked
FloorNormal = 0,0,1
FloorHeight = 0
FloorColor = 1,1,1
scaleM = 1.029613
scaleC = -2.5728,3.737201,4.055745,1.211604
offsetM = -0.4753723,-1.357388,-1.013746,3.7629
w = 3.007726
MI = 73
bailout = 1024
#endpreset

As it is now, moving up to close dissolves the shape too...
And I think Crist-JRoger has a point about the DE, as I can only get good solids at DE<0,3




* 5.jpg (19.37 KB, 442x376 - viewed 285 times.)
Logged

sabine62.deviantart.com
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #31 on: November 16, 2016, 08:43:18 PM »

@ sabine62 Your image looks interesting,  


@ crist & sabine62,  if you like ,could you post your latest versions of the code & I will  add both DE methods to them.  It would be good to have us all evaluating them rather than just my opinions smiley

I have yet to learn  how to use fragmentarium so I can not test your .frags.  But I think we are getting close to getting it working.

another thought .......#include "DE-Raytracer.frag" I am not sure about the various options ,  it should be the one used for menger sponge and/or mandelbox.

Logged
Sabine
Fractal Fertilizer
*****
Posts: 373



WWW
« Reply #32 on: November 16, 2016, 08:52:39 PM »

The mandelbox uses DE-Raytracer, just checked.

If you unpack the zip, open fragmentarium and choose the 6.frag  grin

But if you prefer to stay away from Fragmentarium
Code:
// 
#include "DE-Raytracer.frag"

uniform float scaleM; slider[-2,0,2]
uniform vec4 scaleC; slider[(-5,-5,-5,-5),(0,0,0,0),(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,1,5]
uniform int MI; slider[0,10,250]
uniform float bailout; slider[0,16,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;

}
//return sqrt(r);
float Iter = MI;
return sqrt(r)*pow(scaleM,-Iter);
//return r;
}



* mixpinkitest.zip (25.67 KB - downloaded 77 times.)
Logged

sabine62.deviantart.com
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #33 on: November 16, 2016, 09:11:46 PM »

I have yet to learn  how to use fragmentarium so I can not test your .frags.  But I think we are getting close to getting it working.

another thought .......#include "DE-Raytracer.frag" I am not sure about the various options ,  it should be the one used for menger sponge and/or mandelbox.
Do not be afraid, he does not bite  cheesy
Open Fragmentarium -> Ctlr+N and paste my code to editor, press F5.
What could be easier?  roll eyes

DarkBeam, again, please return this topic to Frag section...  Now !!
Logged

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



« Reply #34 on: November 16, 2016, 09:16:20 PM »

@sabine62  You are missing the bailout termination code so it is running only on maxiter termination


Refer darkbeams post

Quote
z= scaleM *z.z;
   
   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;
}

float Iter = MI; This has to be Iter = i

    z.z= scaleM *z.z;
   DE *= scaleM; ................ add this in
   r=z.x*z.x+z.y*z.y+z.z*z.z;
   
   }
return sqrt(r)/ DE; // .............................alternative DE return function
}


I will be back later and have a proper look

Next time I am in Windows  OS I will download Fragmentarium
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #35 on: November 17, 2016, 04:51:34 AM »

Attached is my latest attempt at writing the frag, using Sabine62's code.

 I note I was using a step multiplier of 0.1 in MBulberV2 c++ (for this fractal.   I seldom go below that for fractals, but I have noticed that 0.1 is essential for  some difficult fractals)

Reviewing Sabine62 code, based on how my openCL code is behaving.
I have studied a lot of fractal code here at the forum, that is the extent of my programming knowledge. I would have to follow a tutorial to make  "hello world".
So I am limited to how much I can help.


Sabine62s Initial Conditions:

uniform float scaleM; slider[-2,0,2]
uniform vec4 scaleC; slider[(-5,-5,-5,-5),(0,0,0,0),(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,1,5]
uniform int MI; slider[0,10,250]
uniform float bailout; slider[0,16,1024]


ScaleM not sure if negative scale is usable.  BTW if using a negative scale, then  return sqrt(r)/ abs(DE) is required, I think.
ScaleM default should be 2.0, so I would  try (0.0, 2.0, 4.0)

vect4  -5 & 5 are guesses, for offsetM I was working with 0.1 and 0.2 size parameters when I tested it yesterday.

float w I have at default 0.0 , (-5, 0, 5) would be my initial guess forann initial range.
in this case w enter the loop as 0.0, then it gets given a non-zero value as it runs though the iterations. So to get the "default" image this must be set at 0.0.



MI  both in c++ and openCL is set  a default of 250 with no problems. This suggests that the fractal function is not terminating on Maxiter (this is normal for most std fractals). ( my guess at 50 was because I saw I had suggested 10 in my earlier frag post (standard menger sponges usually terminate in less than 10 iterations) and I thought i I better increase it just in case).  In fact I just had a look in MandelbulberV2 c++, and the first image I posted had an average of 4.8 and maximum of 8 iterations.

Bailout. I am running with 1024 in OpenCL (i hard code this value into openCL versions, but a slider would be nice, but MandelbulberV1.21 has only 15 empty parameter input boxes so I have to choose my parameters wisely.) BUT in MbulberV2 c++ i have a bailout set at only 10 and it is working OK. NOTE I still need to test out this formula for normal working ranges for the parameters.

I cannot quite remember but there might be a third criteria for stopping termination based on  z' - z < small number. So stops when when iterating is not significantly changing the value of z.

The first few pages of this try to explain how  bailout, maxiter and DE work in Mandelbulber:

http://cdn.mandelbulber.org/doc/Mandelbulber_Manual_v091.pdf  (translated from some form of archaic Polish language)


Added float Dd,  for the DE inside the loop as I have set this up with the common type of linear DE calc
Added in a float offsetD for manipulating the DE calc.  return  (r - offsetD)/ abs(DE).  Normally this should be set at 0.0 and increased to improve DE and will  lose detail. If the DE is already good then apply ing a small negative number can give more details it seems??).
The final part of the loop  I have changed to
   ................
  z.z= scaleM *z.z;
   Dd *= scaleM; // for DE calc   
   r2=z.x*z.x+z.y*z.y+z.z*z.z + z.w * z.w; // bailout criteia, and I added in the z.w part to see if it  necessary
   }

float r = sqrt(r2);


return (r - offsetD) / fabs(Dd); // offsetD has a default of 0.0 which is the std case. The offsetD results are similar or maybe the same as adjusting Detail Level( Quality)
// float Iter = i; // this DE works also in openCL so it might be something to with "i" in Fragmentarium
//return sqrt(r)*pow(scaleM,-Iter);


?? ooops I need to remove this from my frag
} urn sqrt(r)*pow(scaleM,-Iter);
//return r;
}




* mcl 6.frag (3.26 KB - downloaded 70 times.)
Logged
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #36 on: November 17, 2016, 05:53:36 AM »

Sabine, mclarekin try Subblue-Raytracer.frag. It looks much more better!  joy
#include "Subblue-Raytracer.frag"

* test.bmp Files.rar (4.96 KB - downloaded 78 times.)

* test.jpg (234.96 KB, 1050x900 - viewed 124 times.)
Logged

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



« Reply #37 on: November 17, 2016, 10:06:02 AM »

well down team. grin  It is cool that we have managed to almost properly convert the MixPinski4. 

Now I would add in separate start/stop iteration controls for the sierpinksi, offset, rotation and, possibly, menger4D transforms and explore different start/stop settings mixed with the other parameters. (as I have implemented in openCL)
A 3D rotation works good for now and is an integral part of the total formula, it maybe a while before i get back to finishing that

My latest guess about the missing symmetry is that it may be an orientation thingy between the Sierpinski  and Menger.  The sierpinski might have axis at 45 degrees to the menger sponge hmmm.  Otherwise I have created some typos.

Sequence  Sierp, rot(45,45,45), menger for the first iteration, then alternating sierp & meneger until termination, may produce a symmetrical fractal
Logged
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #38 on: November 17, 2016, 10:46:16 AM »

mclarekin, can you play with last .frag in Fragmentarium? To see what we got and maybe change something...
At least - set variable parameters to state when MixPinski looks as default shape
Logged

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



« Reply #39 on: November 17, 2016, 12:42:44 PM »

This is mandelbulberV2 dev version, looking straight down the y axis. scale default 2, offsets 0, menger scaleC 1, 1, 0.5, 0.5.
The image DE quality looks better then the statistics data displays. Rotate camera -45 degrees around z axis and the camera is looking at the main symmetry, i think.

About test.frag

float Dd = 1.0 must be outside the loop. It needs to come into the loop as value 1.0,  then be modified each iteration until termination conditions are met. This is how the DE is updated with every iteration 

Did you need to move it to get Subblues Raytracer to work?


* mixPinski boo4 DEFAULT 800.jpg (219.83 KB, 800x800 - viewed 130 times.)
Logged
Sabine
Fractal Fertilizer
*****
Posts: 373



WWW
« Reply #40 on: November 17, 2016, 01:59:26 PM »

Sorry, am lagging behind a bit...

@Crist-JRoger: Can't use Subblue's raytracer as it gives me strange errors, won't work cry
Update Had to define bool DepthFlag-uniform in raytracer, and all is well, great raytacer!!!  Yes !! Thanks for the tip!

@mclarekin: First of all, and I am really late with this: Thank you for taking all this trouble to code the Mixpinski!  A Beer Cup A Beer Cup A Beer Cup Without people like you who know what they are doing in fractal-land I'd be missing all the fun!

All those slider limits: They are arbitrary, I just used them this way to see how they work for this formula. There are fractals that can give nice results with negative scale (amazingboxes f.i.), and Menger really needs the scale=3 to get the perfect mengershape (at least, in mandelbulb3D). They can always be set to the best working ranges later when we know where fine steps are needed and where big ones wink
I got your own .frag to work also (Crist-JRoger doing the same work  grin) The missing bailout-break (Luca's) you mentioned: I don't really need to add it since it's in the condition of the loop already?

Had a look at Luca's .m3f and set the values in the .frag according, looks pretty standard to me?



* mixp7.zip (9.15 KB - downloaded 75 times.)
* mixp7.frag (3.34 KB - downloaded 77 times.)

* mixp7.jpg (77.94 KB, 800x600 - viewed 133 times.)
« Last Edit: November 17, 2016, 02:38:54 PM by Sabine62 » Logged

sabine62.deviantart.com
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #41 on: November 17, 2016, 03:24:09 PM »

Sabine, orbittrap coloring works too
Code:
uniform int ColorIterations; slider[0,10,250]
Code:
if (i<ColorIterations) orbitTrap = min(orbitTrap, abs(vec4(z.x,z.y,z.z,z.w)));

So there is intel mobile gpu with subblue-raytracer render (goodbye subframes!!!  grin ) 7200x4050  roll eyes

Logged

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


Fragments of the fractal -like the tip of it


« Reply #42 on: November 17, 2016, 04:10:38 PM »

Awesome works  cheesy congrats to everyone  A Beer Cup
mp goes well with the reciprocals so try some  smiley
Logged

No sweat, guardian of wisdom!
Sabine
Fractal Fertilizer
*****
Posts: 373



WWW
« Reply #43 on: November 17, 2016, 07:53:20 PM »

@Crist-JRoger ColorIterations up and running;) Thanks for that! Does not work wel in subblue-RT, but like a charm in DE_raytracer and DE-Kn2cr11!
And what do you mean by intel mobile gpu? :} What am I missing?! :}
Beautiful image of a beautiful formula!  Yes !!

@mclarekin Seems I was a bit off when coming to dimensions, zeroG-sh wink  The frag and image that I posted that look like the standard: it's upside down. Also I have checked and a maxiter of 16 is really better than 13, clearer forms and stable from there on. See attachment for the new and improved version;) Also I am not so sure about OffsetD (and that's very probably because I do not know what it is supposed to do!) : at low values its influence is negligible, at high values it leads to fuzz/discontinuities when walking in/out?

@dark-beam Don't you agree that mclarekin should have his own folder in the Examples by now, Luca?  Yes !!
Ohh and one question: Have not yet had time to really look at the reciprocals, but now I am braindead with flu the moment has come:} In the .m3f you write:
x' = sign(x)(1/Lim1 + 1/lim2 - 1/(abs(m1 * x)+ Lim ) - 1/(m2 * x*x+ Lim2 ) )
The third Lim... it should have been a Lim1?

 




* mixp8.frag (3.13 KB - downloaded 76 times.)
Logged

sabine62.deviantart.com
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #44 on: November 17, 2016, 08:13:30 PM »

Cool render!!! Bravo  shocked

So here 1st rotated version. I delete bailout, think it's no needs here. Pre-post rotations with start iteration position for more random  grin
Added some presets quickly.

intel mobile gpu - that's my only Frag-platform on my job  cheesy Enough for tests and simple renders.

* MixPinski.frag (8.74 KB - downloaded 82 times.)
Logged

Pages: 1 2 [3] 4 5 ... 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 3601 Last post May 14, 2015, 06:40:57 PM
by therror
mixPinski 1600 Mandelbulber Gallery mclarekin 3 1484 Last post November 19, 2016, 02:54:00 AM
by paigan0
mixPinski sphFold Mandelbulber Gallery mclarekin 0 1663 Last post November 19, 2016, 10:27:57 AM
by mclarekin
Implementing ABoxModKaliEiffie Amazing Box, Amazing Surf and variations « 1 2 3 » mclarekin 30 15069 Last post November 27, 2016, 11:52:55 AM
by Sabine
Implementing Menger Sponge 45 rot Sierpinski Gasket mclarekin 9 5195 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.338 seconds with 25 queries. (Pretty URLs adds 0.013s, 2q)