Title: Cross Menger!? Can anyone do this? Post by: DarkBeam on June 11, 2016, 09:45:02 AM Looks very amazing!
http://paulbourke.net/fractals/crossmenger/ Can you do this fractal for Fragmentarium too? Using a KIFS routine ofc! Must be interesting as it mixes geometries Title: Re: Cross Menger!? Can anyone do this? Post by: Max Sinister on June 13, 2016, 07:24:29 PM It's not exactly the same, but I programmed the half Menger sponge as a 3D printable file, here:
https://www.shapeways.com/shops/fractals-procgen Title: Re: Cross Menger!? Can anyone do this? Post by: knighty on June 22, 2016, 01:45:12 AM Hi,
Not eazy :/ Code: #info CrossMenger Title: Re: Cross Menger!? Can anyone do this? Post by: DarkBeam on June 22, 2016, 12:43:03 PM hehe you never fail to amaze us! :cantor_dance: :cantor_dance:
Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on June 22, 2016, 07:18:24 PM Thank you very much! :) Rotated looks good :D
(http://img03.deviantart.net/e7c3/i/2016/174/4/5/crossmenger_rot_by_crist_jroger-da7c8s8.jpg) (http://orig15.deviantart.net/d7a3/f/2016/174/4/1/crossmenger_rot_by_crist_jroger-da7c8s8.jpg) Code: #define providesInit Title: Re: Cross Menger!? Can anyone do this? Post by: DarkBeam on June 22, 2016, 10:09:46 PM Heyyy can you post a render of the kifs version? plzzz
Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on June 23, 2016, 12:12:00 AM It is a cool maths, and I am still far from understanding it and getting it coded.
It will be interesting to see the hybrids that can be made with it. One question for now, what is "s" that is being brought into the baseshape? Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on June 23, 2016, 12:47:01 AM Heyyy can you post a render of the kifs version? plzzz :D KIFS rotated, fullscreen super resolution mode, 3000 subframes, palette by M Benesi :) (http://pre01.deviantart.net/a574/th/pre/f/2016/174/3/a/cross_menger_kifs_by_crist_jroger-da7dk0b.jpg) (http://orig06.deviantart.net/0be7/f/2016/174/3/a/cross_menger_kifs_by_crist_jroger-da7dk0b.jpg) (http://pre06.deviantart.net/6903/th/pre/f/2016/174/2/1/cross_menger_kifs_2_by_crist_jroger-da7dlow.jpg) (http://orig11.deviantart.net/44a0/f/2016/174/2/1/cross_menger_kifs_2_by_crist_jroger-da7dlow.jpg) Code: float CrossMengerKIFS(vec3 p){//Pure KIFS... almost correctTitle: Re: Cross Menger!? Can anyone do this? Post by: M Benesi on June 23, 2016, 06:27:29 AM Sweet. :D
Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on June 23, 2016, 12:02:16 PM It will be interesting to see the hybrids that can be made with it. Pseudo-Kleinian hybrid looks awesome :dink:intel gpu quick render (http://orig12.deviantart.net/bddb/f/2016/175/a/6/pkleinian_cm_test_by_crist_jroger-da7fn9j.jpg) Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on June 23, 2016, 12:41:41 PM Wow! that is beautiful. O0
Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on June 23, 2016, 02:11:30 PM Thanks Knighty, I have only coded the basic shape so far, and now I am sidetracked into testing it out on various formulas. O0
Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on June 23, 2016, 03:56:54 PM mclarekin, nice shapes )
so, just little fun: (http://orig15.deviantart.net/dc01/f/2016/175/8/9/pkleinian_cm_test2_by_crist_jroger-da7g54e.jpg) Title: Re: Cross Menger!? Can anyone do this? Post by: knighty on June 24, 2016, 02:14:34 AM Wow! those are awesome and really unexpected results.
FYI, The base sape is not really necessary if you use a lot of iterations. It is there only for low iteration. One can replace it with a sphere as usual. The s parameter is there only to give the gaps and get a picture that looks like those of the OP. (just experiement with the Gap slider to see what I mean :D ) Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on June 24, 2016, 04:33:41 AM Quote Wow! Yes that's what I have been thinking , from the time I first saw the post.Quote FYI, The baseshape is not really necessary if you use a lot of iterations. It is there only for low iteration. One can replace it with a sphere as usual. So it is a pre-transform necessary for low iteration formulas. I did a bit of this in Mandelbulber V1.21OpenCL but we have yet to set up an "Initial Conditions" feature to easily implement pre_transforms in MandelbulberV2Thanks for info. Quote just experiment with the Gap slider I still havent coded it yet, LOL, (I am slow and easily distracted),as the baseshape is too interesting. I have being mixing it successfully with various Abox/Mbox & menger type fractals with generally good analytic DE results.But here a two questions. 1) Has the baseshape got a name (prism??) because I will add it as a Transform as well as using it in a Formula UI?? :embarrass: I know the answer I just forgot LOL, :embarrass: Cheers BTW This is a draft c++ version of the baseshape with some multiplications removed and constants added. Code: void CrossMengerIteration(CVector3 &z, CVector3 &c, int i, const cFractal *fractal, sExtendedAux &aux) Title: Re: Cross Menger!? Can anyone do this? Post by: knighty on June 25, 2016, 02:24:55 AM Well... no. The base shape (which is indeed a prism with an equilateral triangular base) have nothing to do with pre-transform. It is just a convex hull of the fractal. IMHO, you don't need to implement the base shape as an iteration.
You are right, there is a lot of room for optimization. for example: Code: float t = 2. * max(0., dot(p.xy, vec2(-sqrt(3.) * 0.5, 0.5)) ); Code: float t = max(0., dot(p.xy, vec2(-sqrt(3.)*0.5 , 0.5)) ); It seems you forgot a 2 factor in : Code: double dot = z.x * -sqr305 + z.y * 0.5; Code: double dot = z.x * -sqr3 + z.y; Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on June 25, 2016, 06:39:00 AM Probably in Mandelbulber V2.09 we will have it set up to make it easier to do maths outside the iteration loop. But currently I have to use a single iteration at the beginning inside the loop. (.ie . if( i < 1). (but is currently set up for testing, so I temporary itr start and itr stop parameters).
"It is just a convex hull of the fractal", that is a good definition. This is my optimisation path, and I still seem to end up with the same line double dot = z.x * -sqr305 + z.y * 0.5;h.mmm??? I can not see a mistake (but that is a common thing for me, ie. 10minutes to code it "perfectly" , then several hours to find and fix the imperfections ;D) original float t = 2. * max(0., dot(p.xy, vec2(-sqrt(3.) * 0.5, 0.5)) ); p.xy -= t*vec2(-sqrt(3.),1.)*0.5; optimised float t = max(0., dot(p.xy, vec2(-sqrt(3.) * 0.5, 0.5)) ); p.xy -= t*vec2(-sqrt(3.),1.); // same as Knighty's example where dot part = ( p.x * -sqrt(3.) * 0.5) + (p.y * 0.5) code to c++ dot1 = (z.x * -sqr305) + (z.y * 0.5); // sqr305 = constant sqr3 * 0.5 t = max( 0.0 , dot1); z.x -= t * -sqr3; z.y -= t; // or z.y = z.y - t //............................................. //Next line is //z.y = fabs(z.y) // // optimise with previous line // becomes z.y = fabs(z.y - t). //......................................................... c++ dot1 = (z.x * -sqr305) + (z.y * 0.5); // sqr305 = sqr3 * 0.5 t = max( 0.0 , dot1); z.x -= t * -sqr3; z.y = fabs(z.y – t); and these lines are also used in CrossMengerTrick and CrossMengerKIFS which I am finally starting to look at Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on June 26, 2016, 02:56:03 AM I have a better understanding of how this .frag works now, ;D, (I was lacking some real basic programming knowledge.) So I feel embarrassed for a minute, then move on, LOL.
This is the first time I have seen and understood how a base shape can be used O0, A whole new area of formulas that I have yet to explore. Will there ever be an end to this infinity of possibilities?? Title: Re: Cross Menger!? Can anyone do this? Post by: knighty on June 26, 2016, 02:58:15 AM No! ;D
(the N in No stans for No) ;) BTW, you can get the KIFS version without coding in mandelbulber. Code: # Mandelbulber settings file Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on June 26, 2016, 03:16:05 AM Thanks I will try that.
This formula/concept is so cool. Just testing the base shape for the few days has been a lot of fun, it works so well with many linear type formulas creating all sorts of new shapes for me. Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on July 02, 2016, 02:53:22 AM Latest c++ version of the prism shape transform. I have made one UI where the set up has transforms :- PrismShape, Benesi T1, Benesi T1 Mod, Menger Sponge (all have start/stop iterations controls.)
The prism shape has now got four internal parameters, when mixed with the other transform internal parameters, the possibilities appear to approximate infinity :dink:. Code: /** Title: Re: Cross Menger!? Can anyone do this? Post by: Buddhi on July 04, 2016, 09:01:06 PM No! ;D (the N in No stans for No) ;) BTW, you can get the KIFS version without coding in mandelbulber. Code: # Mandelbulber settings file You are GENIUS! I have never mastered how to define all vectors intentionally. It is always mostly experimenting. I can write the software, but don't know how to use it :headbatting: Title: Re: Cross Menger!? Can anyone do this? Post by: Buddhi on July 04, 2016, 10:05:44 PM By the way, it's very nice starting point to get interesting shapes:
Code: # Mandelbulber settings file Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on July 05, 2016, 06:11:16 AM @ buddhi, I was impressed too!!!
The prism shape is a lot of fun and has introduced another fast shape into the mix. I am thinking we could add this (and probably others to the presets on the kifs UI.) Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on July 05, 2016, 06:32:19 PM The prism shape is a lot of fun and has introduced another fast shape into the mix. I am thinking we could add this (and probably others to the presets on the kifs UI.) Can you show on GLSL how you doing this? :embarrass:Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on July 05, 2016, 08:43:08 PM Here is an attempt :)
It is essentially the first part of Knighty's code with the differences in yellow and used generally as a pre transform. The simplest example is place it before a menger sponge and test out the gap and dotscale parameters. For the above image I placed it before the existing KIFS version that Knighty showed was already possible in Mandelbulber. Code: #info CrossMenger #include "DE-Raytracer.frag" #group CrossMenger // Number of fractal iterations. uniform int Iterations; slider[0,3,100] uniform vec3 Gap; slider[-1.,0.,1.] uniform float dotscale; slider[0.,1.,5.] uniform float Dot KIFS; checkbox[false] float baseshape(vec3 p, float gap) { p.yz=abs(p.yz); float t = 2.* max(0., dotscale * dot(p.xy, vec2(-sqrt(3.) * 0.5, 0.5)) ); p.xy -= t*vec2(-sqrt(3.),1.)*0.5; p.y=abs(p.y); if(p.y>p.z) p.yz=p.zy; p-=gap *vec3(0.5*sqrt(3.),1.5,1.5); if(p.z>p.x){p.xz=p.zx;} if(p.x<0.) return p.x; p.yz=max(vec2(0.),p.yz); return (p ); } oops yellow hard to read Code: Code: Title: Re: Cross Menger!? Can anyone do this? Post by: Max Sinister on July 05, 2016, 11:15:36 PM Very nice. I may have to get this software one day.
Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on July 06, 2016, 06:05:39 AM Quote Can you show on GLSL how you doing this? embarrass This is what the default settings should give you if you run Prism Shape for one iteration, followed by a standard Menger Sponge for the remaining iterations. The dotscale simply flattens the shape i.e a house with roof shape. With the Gap x,y,z controls you get some cool shapes with symmetric gap vect3 like (0.5, -0.5, 0.0) In Mandelbulber I have iteration controls so I can place the Prism Shape Transform at "say" iteration number 2 , or iterations 2 & 3. If you can get this to work I can do some more GLSL-ish code for the other transforms that work well together with the prism base shape. Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on July 06, 2016, 06:46:54 AM This is what gap vect3 (0.5, -0.5, 0.0) should look like :)
Title: Re: Cross Menger!? Can anyone do this? Post by: knighty on July 12, 2016, 12:12:47 AM It is not that difficult to do KIFS. It requires some work though and a lot of sketches (and maybe a 3D CAD software). It is better to begin with 2D objects. The first one I did was a 2D Sierpinski triangle :)
One have to: - Identify scale center and value. - Identify the folding lines/planes and their order: These are visible as the object is symmetric. Here is the settings for the KIFS version of the crossMenger with 3 iterations (can be changed). The second KIFS formula is for the prism: Code: # Mandelbulber settings file And this one with a "reduced" prism. I have just scaled down (in the second KIFS) the "vector offset" and the "dist" of the #3 folding vector: Code: # Mandelbulber settings file Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on July 13, 2016, 12:15:50 PM Thanks Knighty for the settings.
DarkBeam sidetracked me away from this, with a single line transform _inv_cylindrical. Instead of it being a quick diversion, it turned into yet another journey of discovery :) O0 I have been thinking about kifs and linear type folds in general, and now can visualize the mega UI that I will probably never build. When I was still using MandelbulberV1.21 openCL, I did a little bit of drawing up and it makes it easier to visualize. This reminded me to have another look at that code :) Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on August 18, 2016, 02:48:36 PM I have got "some sort" of pseudo kleinian code working with the prism shape and menger sponge in dev V2.09. Early days yet. :)
Title: Re: Cross Menger!? Can anyone do this? Post by: M Benesi on August 19, 2016, 02:50:02 AM lol :D
Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on August 31, 2016, 06:30:06 AM (http://pre12.deviantart.net/4ec2/th/pre/f/2016/243/5/7/glass_bunch_by_crist_jroger-dag1w5z.jpg) (http://orig11.deviantart.net/7f81/f/2016/243/5/7/glass_bunch_by_crist_jroger-dag1w5z.jpg)
Title: Re: Cross Menger!? Can anyone do this? Post by: 3dickulus on August 31, 2016, 06:32:19 AM Spring thaw, very nice, refreshing and crispy :)
Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on August 31, 2016, 09:08:14 AM Thank you very much :dink: Originally it was this (http://crist-jroger.deviantart.com/art/Water-sphere-631542194), then moved camera top and looked at water only ) and change sphere to fractal
Title: Re: Cross Menger!? Can anyone do this? Post by: DarkBeam on September 09, 2016, 10:44:54 AM I added the pure kifs version in mb3d 8D
Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on September 15, 2016, 12:58:56 PM A modification thing.
Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on September 15, 2016, 01:12:20 PM shared .frag? :embarrass: :dink:
Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on September 16, 2016, 06:51:42 AM This is an attempt at the formula part of a .frag. (I don't know enough yet about programming for fragmentarium)
If you can get it to work, please post back the corrected .frag so i can see my mistakes. I have been using it to make hybrids with aSurf, pseudoKlienianMod, and MengerMods This image is with gap.y set at 1.99, the rest of parameters at default. Code: #info CrossMengerMod1 Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on September 17, 2016, 08:59:06 PM Thank you! I tried to make this code working... so here some strange :o it shows little different geometry ) but it runs :embarrass:
Code: #info CrossMengerMod1 Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on September 18, 2016, 02:06:38 AM Thanks, I now have a better understanding of .frag.
I will code it up in Mandelbulber V1.21 OpenCL and see what I get and report back. The important bit is the first half , which gives you control over the prism shape, you can replace the crossmengertrick with iterations of other linear types Title: Re: Cross Menger!? Can anyone do this? Post by: Tim Emit on September 19, 2016, 10:36:20 AM @crist.. that code runs ok as far as shapes but it doesn't seem to iterate or make much interesting forms...or is that just me !
Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on September 19, 2016, 06:15:59 PM The important bit is the first half , which gives you control over the prism shape, you can replace the crossmengertrick with iterations of other linear types Unfortunately I can't. Not yet I think ;D because all GLSL-guru escaped :-\ and maybe soon I will be able to understand this interesting process: imagine - create a mathematical model - implement the code :)Tim my code is wrong (but runs without errors) Somebody (Knighty, where are you???? ;D ) can help. Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on September 20, 2016, 09:40:58 AM The formula can make the attached image, (but there is an extra bit on the far end :o I have lost the symmetry). More work required!
Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on September 26, 2016, 09:34:16 AM A finally coded the KIFS version ;D
Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on September 28, 2016, 04:09:31 PM Looks like robot or constructor :)
CrossMenger in PseudoKleinian: (http://pre10.deviantart.net/272a/th/pre/f/2016/272/1/a/to_the_sun_by_crist_jroger-daj9s5z.jpg) (http://orig11.deviantart.net/ddec/f/2016/272/1/a/to_the_sun_by_crist_jroger-daj9s5z.jpg) Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on October 05, 2016, 03:53:01 PM Shared PseudoKleinian-CrossMenger hybrid (http://crist-jroger.deviantart.com/art/PseudoKleinian-CrossMenger-for-Fragmentarium-638363685)
Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin 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 Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on October 07, 2016, 09:04:11 AM ... in the PrismShapeOption.frag i posted yesterday Where? :)Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on October 07, 2016, 11:06:12 AM I hid it here ;D
http://www.fractalforums.com/images-showcase-(rate-my-fractal)/spires-t24633/msg96518/#new (http://www.fractalforums.com/images-showcase-(rate-my-fractal)/spires-t24633/msg96518/#new) It 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 Code: //PreAdd and Knighty MengerSponge and // bailout termination if (r > 10.0f) //bailout { dist = r / fabs(DE); out.colourIndex = colourMin * 10.0f; break; } Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin 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 Code: if (crossMengerTrickEnabled Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin 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.
Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin 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) Code: CVector3 tempZ = z; Title: Re: Cross Menger!? Can anyone do this? Post by: DarkBeam 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. :D Or try to use my reciprocalx3 it is a rational polynomial that never goes to infinity. Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin 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. Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 03, 2016, 02:06:23 AM Well Reciprocal3 has got me sidetracked :D 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. Title: Re: Cross Menger!? Can anyone do this? Post by: DarkBeam on November 03, 2016, 08:07:38 AM Woow it looks nice :D 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... :D and usually it is alternated for every iter to get strange futuristic buildings.
Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on November 07, 2016, 09:33:47 AM Code: const float SQRT_3_4 = 0.86602540378443864676372317075294; 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? Title: Re: Cross Menger!? Can anyone do this? Post by: DarkBeam on November 07, 2016, 05:25:02 PM Just found ChebyMenger from an Eiffie shadertoy! Lool, fantastic ;D
Code: /// Chebymenger by eiffie Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 08, 2016, 02:40:54 AM @ Crist
quote]Tried another code from your latest posts, what is fabs? Did you used Fragmentarium?[/quote In openCL and C++ I have a fabs() which is abs() in most frags I have seen. Not sure if it a maths library thingy. And I have still haven’t learnt how to use fragmentarium:) Quote z = vec3({z.z, z.x, z.y); // reorientate Yep, I dont know how that got there. I should really transpose the axis in the formula so that the reorientation wouldn’t be necessary.Missing a z.y = abs(z.y); before the z.z = abs(z.z); also can add in a z.x = abs(z.x); option checkbox. BTW This is where I am up to this coding: a) I have written a fourth version of the PrismShape, it does all of what my first three attempts can do plus more. I will post this with an explanation of converting Mandelbulber code into .frag. b) The CrossMenger Trick i posted here on the 29th is my final version of that one. c) I have yet to do a final CrossMengerKIFS version PS you can replace if(z.z > z.x){temp =z.z; z.z = z.x; z.x = temp;} type code with if(z.z > z.x){z.xz = z.zx;} in Fragnmentarium (and in openCL) PPS looking at the zipped file. As well as the prismShape code , you can add a dotScale to the dot in both the CrossMengerTrick and CrossMengerKIFS. Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 08, 2016, 04:20:19 AM I have finished coding Darkbeams reciprocal3 x, y, and z. ( I have still got to get a SIGN() function code to work for optimising this code.)
Here is Darkbeams code Quote Description: Computes the reciprocal of x with a different (continuous) function: x' = sign(x)(1/Lim - 1/(abs(x)+ Lim )) The DE is almost untouched, it should work fine also with a Raystep 0.5 ! Just don't go too low with the limiter to avoid noise. In Mandelbulber I have it set up this way at present. I have the default parameters at 1.0 but 0.5 might be better in most cases. Hmmm Here is the z.x part. Start/stop iteration controls are also necessary. The transform can be run on all three axis until termination but using 1 or 2 axis for only a few iterations is generally best, starting at iteration 0 or iteration1. (It works well with the menger types but I suspect surf/box types is where this transform maybe at it's best). Covert from Mandelbulber to .frag: if (fractal->transformCommon.functionEnabledx) type code is a checkBox fractal->transformCommon.offset111.x) type code is a vec3 default(1,1,1) axis .x fabs is abs Code: if (fractal->transformCommon.functionEnabledx) Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 08, 2016, 04:48:51 AM @Darkbeam. I checked out chebyshev rotation on the net. O0
I have just starting on MixPinski :) :hmh: :hmh: :embarrass: :) ;D :hmh: In a day or two I will probably seek some clarification ;D Title: Re: Cross Menger!? Can anyone do this? Post by: DarkBeam on November 08, 2016, 10:52:40 AM hehe by the way I got an identical effect using a shorter formula (not three just one I think?). I called it ngon (and ngon2) but I don't remember how it works! :D lol
Maybe with a combo of "normal" atan2 and stuff... But now I am curious about MPinski ;) Sign(x) is normally a one line macro. Or sgn(x)=x/abs(x) horrible! :D Or you make some AND with sign mask then if it is 0 it is a positive number else a negative. Duh hackish stuff sorry :D There are premade cakes in Stackoverflow too; http://stackoverflow.com/questions/1903954/is-there-a-standard-sign-function-signum-sgn-in-c-c Btw I think you added too much stuff ... the mb3d counterpart is really a 1 line... :) Title: Re: Cross Menger!? Can anyone do this? Post by: claude on November 08, 2016, 12:20:37 PM my favourite version is: sign(x) = (x > 0) - (x < 0)
Title: Re: Cross Menger!? Can anyone do this? Post by: Sabine on November 08, 2016, 05:29:44 PM @Luca Is this THE _reciprocalX,...Y,... - ...Z3 you're all talking about??? And if yes... We can haz for Frag? :love:
Title: Re: Cross Menger!? Can anyone do this? Post by: DarkBeam on November 08, 2016, 05:35:01 PM Lol Sabi! Yes it is but what do you mean? You can code it as a one line transform then add it after a menger iter :) ... easy for a basic programmer like you!
:-* ;D Title: Re: Cross Menger!? Can anyone do this? Post by: Sabine on November 08, 2016, 08:02:21 PM I never touched anything even remotely 'fractalesque' with basic in the last 30 years, I think, and what I did then was only very basic fractal stuff.
Basic I used in my work and later VScript and JScript (now Those are really hi-tec, I know! rofl2) for simple eventlog readouts, replication-logs and other info for rapporting, WMI stuff, that kind thing, mostly r/w & string-modification-hell. And sometimes still write something small and handy or fun for at home. Ohh forgot: some LISP for Autocad in the jolly 90's, whahaha now that will come in handy :} So really, Luca, trust me now and forever, I'm a total nitwit when it comes to fractals AND programming, honestly!!! :'( But will try nonetheless :dink: :-* Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 09, 2016, 02:01:40 AM @sabine02
Reciprocal3 x' = sign(x)((1/Lim - 1/(abs(x)+ Lim) works best, including the linear slope + (abs(x) * slope) works well adding a two limit mode works OK in some cases, but can cause poor DE @darkbeam & claude template <typename T> inline int sign(T val) { return (T(0) < val) - (val < T(0)); } is what Buddhi has added for me,although I currently cannot get it to work :) With MixPinski "A strange but intriguing fractal", progress stopped at 4D rotation, :hmh:, is there any examples of how this is done?? Meanwhile, when looking at 4D rotation I came across the tesseract O0 https://en.wikipedia.org/wiki/Rotations_in_4-dimensional_Euclidean_space#/media/File:Tesseract.gif (https://en.wikipedia.org/wiki/Rotations_in_4-dimensional_Euclidean_space#/media/File:Tesseract.gif) and I start wondering if this structure translation has been used in making a fractal? Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 09, 2016, 05:02:45 AM CrossMengerTrick alternating with rotateForward_fold_rotateBack (rotatedAbs, rotatedFolding & "rotatedMBoxFolding")
Title: Re: Cross Menger!? Can anyone do this? Post by: Sabine on November 09, 2016, 09:04:50 AM @mclarekin Thanks a lot :)
Title: Re: Cross Menger!? Can anyone do this? Post by: DarkBeam on November 09, 2016, 09:56:07 AM Dear mclarekin you may look at this shader for a reference ;)
https://www.shadertoy.com/view/llSSzc It has xw yw and zw routines. I am sure MBulber already has a 3d rotation support ;) You just modify routines accordingly. (A copypaste should do the job :D ). The mixpinski itself is just a modded copypaste of Knighty Sierpinski fused with Menger but with one more dimension! Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 10, 2016, 03:05:07 AM PrismShape for 1 iteration to deform crossmenger trick.
This crude deformation is by replacing line in prismShape dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale; by dot1 = (z.y * -SQRT_3 + z.z) * fractal->transformCommon.scale; @darkbeam. Answering two questions with one link, well done. :) I recognise that 4D rotation from somewhere back then, it looks much simpler now. That tesseract is hypnotizing/fascinating to watch. Thanks again :) Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 12, 2016, 04:54:25 AM This is the UI setup for darkbeams rotateForward_Fold_rotateBack, that I have used to deform the CrossMengerTrick. The UI only covers some of the possibilities.
Seems to work well with mandelbulbs too! Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 12, 2016, 04:57:12 AM Here I have deformed the CrossMengerKIFS with Darkbeams tetra3D.
Title: Re: Cross Menger!? Can anyone do this? Post by: DarkBeam on November 12, 2016, 08:59:06 AM But isn't Tglad fold exactly the Mandelbox fold? Doh :D
Aldo rotate back should only ripristinate coords multiplying by the same rot matrix as before but translated (switch rows with columns). This is a nice framework for mostly every transformer imaginable though 🤓 Title: Re: Cross Menger!? Can anyone do this? Post by: 3dickulus on November 12, 2016, 06:18:12 PM @mclarekin me thinks FragM needs a mclarekin folder in the /Examples/ ;)
Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on November 12, 2016, 09:12:56 PM mclarekin, thank you for explanation! I found some time for fix .frag. Here rotated CM with prismshape and some modes for dotScale
(http://img13.deviantart.net/926b/i/2016/317/f/8/cm_prism_by_crist_jroger-daoa2an.jpg) (http://orig03.deviantart.net/9c85/f/2016/317/e/a/cm_prism_by_crist_jroger-daoa2an.jpg) (http://img09.deviantart.net/2d52/i/2016/317/b/e/cm_prism2_by_crist_jroger-daoa4en.jpg) (http://orig08.deviantart.net/d789/f/2016/317/9/9/cm_prism2_by_crist_jroger-daoa4en.jpg) Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 13, 2016, 01:06:15 AM @darkbeam
I am not really sure but I thought that Tglad fold was the same as Mbox at default setting and when the Mbox limit:value ratio was at 1:2. :hmh: But when straying from this ratio (when using the MboxFold in an Mbox formula) I think can cause nasty cuts therefore 99% of the time Tglads fold is the easiest one to use. I thought, "ripristinate! is that a typo?" but it is a real word . :) Yeah, i assumed that was the correct way the transform should work, and had only added in the second rotation controls as a checkBox option. Then I decided to delay figuring out if I could do a non-trig back rotation. When I have time I may test adding this fold (from M3D somewhere?), to the UI :- z = fold2 - fabs( fabs(z + fold) - fold2) - fabs(fold) Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 13, 2016, 02:12:46 AM I like these patterned surfaces that come out of mixing all these IFS foldings as per attached image (there are still areas of menger sponge inside as well.) So now that I have Folding Tetra3D, Octo, Menger and all this Cross Menger code, I can explore a lot more possibilities, and they are FAST to render. :) (and there is Knighty's KIFS UI in Mandelbulber that can do much more if you learn how to use it.)
One of FRagmentariums advantages is in being able to have all these in a .frag for exploring , and when you find a good place, just simply //comment out the transforms you have decided not to use. I currently have a UI setup in this order : - PrismShape Rotation CMT CMkifs Benesi T1 Benesi T1mod (a Tglad fold inside) FabsMulti Menger Sponge there is more rotations and other transforms to be added, but it already too big and clumsy . :sad1: Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 13, 2016, 02:27:27 AM Attached image show what the Benesi t1Mod and the Fabs Multi transforms on the UI.
Fabs Multi lets me explore various fabs() folds, but with the cost of the extra checkBoxes and maths. Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 13, 2016, 02:39:35 AM @crist. Cool, checking out the dot modes.
For prismShape2 I have added two more offset options. This allows me to replicate the variations I had between earlier versions. t = max(0.0, dot1); if (fractal->transformCommon.functionEnabledBxFalse) { z.x -= t * -SQRT_3 - (fractal->transformCommon.offset0); } else { z.x -= t * -SQRT_3; } z.y = fabs(z.y - t); if (z.y > z.z) { temp = z.y; z.y = z.z; z.z = temp; } if (fractal->transformCommon.functionEnabledByFalse) z.y -= fractal->transformCommon.offset105; z -= gap * CVector3(SQRT_3_4, 1.5, 1.5); Title: Re: Cross Menger!? Can anyone do this? Post by: Crist-JRoger on November 13, 2016, 02:44:13 PM mclarekin, i'm newbie in programming, more interested in fractal rendering ) So i really don't understand your code
This formula z = fold2 - fabs( fabs(z + fold) - fold2) - fabs(fold) What is fold and fold2? Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 14, 2016, 01:39:12 AM @crist
These questions should be directed to Darkbeam. :police: ;D ;D ;D But I will try to answer :) This function contains two folds. Fold & fold2 are user defined variable parameters, usually a double or vect3. This is the mapping or maths sequence where fold & fold2 can be pos or neg numbers x' = fold2 - fabs( fabs(x + fold) - fold2) - fabs(fold) broken into steps: result' = (x + fold); shift x by distance fold result' = fabs(result); fold the result, (fold the plane, all neg numbers are mapped over to positive) result' = ( result - fold2); shift the result by distance fold2 result' = fabs(result); again all negative numbers are folded to positive x' = fold2 - result - fabs(fold); final shifts. fold is the number used to "shift / offset / translate / add_additionConstant" before doing the "absolute function" So I was thinking of trialling this in between a rotate_forward and a rotate_back. I think I already have included it as an amazing_surf fold option (it could be added to Tim Emit's amazing surf frag set up.) Title: Re: Cross Menger!? Can anyone do this? Post by: Sabine on November 16, 2016, 11:36:26 AM Please ignore, answered the wrong thread, my bad! :embarrass: Seems the topic was split while I was typing :}
Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on November 30, 2016, 12:22:49 PM I have just tried this Iteration Weight Transform with the prismShapeCMT, and it works well, ( as it does with menger sponge,, and sometimes with other fractals, but I have :hmh:forgotten).
The function occasionally can improve the DE quality I generally put it as the last transform in a loop // iteration weight transform. // Influence fractal based on the weight of Z values at specified iterations // intA & intB are positive int, (0,0,99) // vec3 offsetIw1 & 2 slider (-5,0,5) // float scaleIw guessing slider (0,1,3) if (iterW) { vec3 zA, zB; if (i == intA) { zA = z; } if (i == intB) { zB = z; } z = (z * scaleIw) + (zA * offsetIw1) + (zB * offsetIw2); Dd *= scaleIw; //aux.r_dz *= scaleIw; } Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on December 21, 2016, 10:44:56 AM I have been testing the DotModes in the PrismShape. There is some good things hidden in the combinations. :)
Having the seperate bool abs functions allows for more combinations (not all prismshape). DE can get a bit bad with some. These are the six DotModes I have tested . My loop was PrismShape, Octo, SphereFold, Rotation, Menger Code: if(FabsXMode == 1) z.x = fabs(z.x); Title: Re: Cross Menger!? Can anyone do this? Post by: mclarekin on January 07, 2017, 09:33:51 AM Finally finished PrismShape2. Attached hybrid image is CMT (3 iters) Mbox (the rest)
Code: /** Title: Re: Cross Menger!? Can anyone do this? Post by: Sabine on January 07, 2017, 07:40:12 PM Congratulations, mclarekin! :beer: :beer: :beer:
Title: Re: Cross Menger!? Can anyone do this? Post by: Tim Emit on January 09, 2017, 07:41:44 PM excellent :)
Title: Re: Cross Menger!? Can anyone do this? Post by: Patryk Kizny on March 27, 2017, 11:54:08 AM I remember either in Mandelbulb or Mandelbulber there's an IFS mode that actaully allows you to introduce many planes of symmetry and even rotate them per iteration. Perhaps that would be a generalization of what you did here and could be brought here to tweak the code further? |