Hiato
Forums Freshman
Posts: 14
|
|
« on: December 29, 2012, 02:02:19 AM » |
|
EDIT 2: I updated the code to reflect cKleinhuis' changes (there were always two parameters governing most of the transforms, now they are vec2's) and removed the unused circle and abs things that were probably just confusing people. EDIT: I realise this may not be the correct subforum for this post, and I apologise ahead of time if I have filed this incorrectly, it just seemed the most appropriate place at a cursorsy glance Hello all, I realise this is my second ever post here but I am rather excited to share my first original (in the sense that it arose from 'scratch' for me) creation, the Mandelex (yes, it can look a bit like an X sometimes). I'll let the pictures do the talking, but a quick formula can't hurt (see code for details): p -> nonLinearPull(boxWrap(circleInversion(s*rotation(linearPull(p)+c)))) where boxWrap is TGlad's I think, linearPull is just a special translation, nonLinearPull is nearly a coordinate modulus and the rest is fairly easy to see. Interestingly enough, by wrapping the whole thing up in another linearPull, we achieve almost an entire nesting of the pattern at each of the corners (hence the X). It contains a whole bunch of different patterns and shapes, but like some of these IFS thingies, it's a bit hard to tweak the escape time and iteration count to get a clean render (it seems, actually, that bailout can be arbitrarily large without much adverse effects, but iterations are tricky) - I cheated and squared the fraction of iterations survived so as to add some contrast to the renders. Anyway, I would be interested in extending this guy to 3D, any words of advice? --- Here is an overview of the whole thing without the extra linearpull, and at the risk of destroying folks' bandwidth, I've merely linked to some other renders https://www.dropbox.com/s/36ku46syduezp0h/mandelex_center.pnghttps://www.dropbox.com/s/dhpgkmcl2rza4lx/mandelex_upper_right.pnghttps://www.dropbox.com/s/z8vk61gjpw0zawp/mandelex_addlin_minilex.pnghttps://www.dropbox.com/s/q1kk27b6aazry5l/mandelex_additional_linear.png( if these don't work, you can try here instead) I would encourage all to explore this thing, and so I have here a Fragmentarium file for you to play around with Enjoy
|
|
« Last Edit: December 29, 2012, 04:56:45 PM by Hiato »
|
Logged
|
|
|
|
Kali
|
|
« Reply #1 on: December 29, 2012, 09:45:05 AM » |
|
Very nice... I didn't study the code yet, but I got really interesting patterns playing with it. 3D version could be also great, I'll see if I can help... This is from a Julia version of it: http://zoom.it/xn5t
|
|
« Last Edit: December 29, 2012, 10:46:08 AM by Kali »
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #2 on: December 29, 2012, 12:43:51 PM » |
|
Very interesting, 3d extension should be easy
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
cKleinhuis
|
|
« Reply #3 on: December 29, 2012, 12:46:05 PM » |
|
can you elaborate the formula parts with explicit code examples ? wohoo, a new formula!!!
|
|
|
Logged
|
---
divide and conquer - iterate and rule - chaos is No random!
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #4 on: December 29, 2012, 12:48:22 PM » |
|
can you elaborate the formula parts with explicit code examples ? wohoo, a new formula!!!
Here it is, I copypasted from his link // Tslil 'Hiato' Clingman, 2012 #include "2D.frag" #group mandelex
uniform float linear_a; slider[0.1,2,10]; uniform float linear_b; slider[0.1,2,10]; uniform float wrap; slider[0.1,0.5,10] uniform float radius; slider[0.1,0.5,10]; uniform float scale; slider[1,2,10]; uniform float angle; slider[0,180,360];
uniform int iters; slider[1,13,500]; uniform float bailout; slider[1,13,1000];
void wrapb(inout float a, in float w) { if (a>w) { a=2*w-a; } else if (a<-w) { a=-2*w-a; }; };
void wrapBox(inout vec2 a, float h, float w) { wrapb(a.x,w); wrapb(a.y,h); };
void wrapCirc(inout vec2 p, float r) { float l = length(p); vec2 u = p/l; if (l>r) p=2*r*u-p; };
void rotate(inout vec2 a, in float phi) { a = vec2(a.x*cos(phi)-a.y*sin(phi),a.x*sin(phi)+a.y*cos(phi)); };
void absv(inout vec2 a) { a.x = abs(a.x); a.y = abs(a.y); };
void circInvert(inout vec2 p, in float r) { float l = length(p); if (l<r) p*=r*r/(l*l); };
void linearPull(inout vec2 p, float h, float w) { if (abs(p.x)>w&&abs(p.y)>h) { h*=2; w*=2; if (p.x<0) p.x+=w; else p.x-=w; if (p.y<0) p.y+=h; else p.y-=h; } };
void nonlinearPull(inout vec2 p, float h, float w) { if (abs(p.x)>w&&abs(p.y)>h) { h*=2; w*=2; if (p.x>0) p.x-=w*floor(p.x/w); else p.x-=w*ceil(p.x/w); if (p.y>0) p.y-=h*floor(p.y/h); else p.y-=h*ceil(p.y/h); }; };
vec2 formula(in vec2 a, in vec2 p) { linearPull(a,linear_b,linear_b); if (abs(p.x)<linear_a&&abs(p.y)<linear_a) nonlinearPull(a,linear_a,linear_a); wrapBox(a,wrap,wrap); circInvert(a,radius); a*=scale; rotate(a,angle/180*3.1415926); a+=p; linearPull(a,linear_b,linear_b); return a; }
vec3 color(in vec2 p) { vec2 c = p; int k=-1; while (k<iters) { if (length(p)>bailout) break; p = formula(p,c); k+=1; }; float v = k/(iters+0.0); v*=v*v; return vec3(v,v,v); };
#preset default Center = 0,0 Zoom = 0.12359 AntiAliasScale = 1 AntiAlias = 3 linear_a = 2 linear_b = 2 wrap = 0.5 radius = 0.5 scale = 2 angle = 180 iters = 25 bailout = 500 #endpreset
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
cKleinhuis
|
|
« Reply #5 on: December 29, 2012, 01:48:38 PM » |
|
ah, just watched the pics, here is a fragmentarium file with parameters extended to vec2 and bigger range to allow negative scales, negative values work as well
|
|
|
Logged
|
---
divide and conquer - iterate and rule - chaos is No random!
|
|
|
Hiato
Forums Freshman
Posts: 14
|
|
« Reply #6 on: December 29, 2012, 05:02:24 PM » |
|
Thanks for the positive response all, much appreciated Kali: Wow, nice Julia find, what are the coordinates/params for that one? cKleinhuis: heh, the negative values of scale (around -2) make for some really interesting architecture, cool idea EDIT: Here's what I'm talking about (wrap=0.25, scale=-2, others are unchanged):
|
|
« Last Edit: December 29, 2012, 05:14:18 PM by Hiato »
|
Logged
|
|
|
|
matsoljare
|
|
« Reply #7 on: December 29, 2012, 10:28:46 PM » |
|
How about a height map?
|
|
|
Logged
|
|
|
|
cKleinhuis
|
|
« Reply #8 on: December 29, 2012, 11:00:55 PM » |
|
this is going to make an awesome 3d object, i am unsure how to fiddle the 3d rendering without de estimators, syntopia had somewhere a script for brute force raymarching, but it is not included in the examples of the program
|
|
|
Logged
|
---
divide and conquer - iterate and rule - chaos is No random!
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #9 on: December 30, 2012, 12:00:27 AM » |
|
critical question... If it has discontinuities, it gives trouble , So is it continue or not?
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
Hiato
Forums Freshman
Posts: 14
|
|
« Reply #10 on: December 30, 2012, 01:43:17 AM » |
|
DarkBeam: hmm, yeah, I thought about his a little and it doesn't seem to be continuous - linearpull essentially cuts space and shifts a chunk. Bleh, ah well.
cKleinhuis : I'll give that a stab on the morrow, I recall reading his blog post on the matter.
|
|
|
Logged
|
|
|
|
David Makin
|
|
« Reply #11 on: December 30, 2012, 03:03:58 AM » |
|
this is going to make an awesome 3d object, i am unsure how to fiddle the 3d rendering without de estimators, syntopia had somewhere a script for brute force raymarching, but it is not included in the examples of the program Buddhi's/my method of delta DE should work OK - if not just using the magnitudes then using the smooth iteration counts.
|
|
|
Logged
|
|
|
|
cKleinhuis
|
|
« Reply #12 on: December 30, 2012, 03:22:49 AM » |
|
is it included in the default examples or what would you suggest is the easiest method to get non de rendering working !??!
|
|
|
Logged
|
---
divide and conquer - iterate and rule - chaos is No random!
|
|
|
kram1032
|
|
« Reply #13 on: December 30, 2012, 10:13:23 AM » |
|
very beautiful cross-sections.
|
|
|
Logged
|
|
|
|
Hiato
Forums Freshman
Posts: 14
|
|
« Reply #14 on: December 30, 2012, 02:05:51 PM » |
|
Ladies and Gents, here is a quick preview of the first 3D render of this beast EDIT: Here is the script I used to get these renders (I have intentionally turned DOWN the ray count so that you don't get bombed by running it for the first time) http://hiato.uctleg.net/mandelex/mx3d.frag -- There are some serious issue with iteration counts, set it much above 15 and you get foam, perhaps a DE might solve this, I'm not sure. and a second (it's pretty tricky to do renders, the lines are an artefact of the image combination process, Syntopia?) There are still many things to work out though: rotations in 3D are not as simple as in 2D and so I'm not sure what 'good' paramaters are; i t would seem that half of the faces of the cube are fairly plain, while the others are not; the detail is not the same as the 2D version at all ... Anyway, I'll update with a script once it's stable (this was done using Syntopia's wonderful brute force raytracer )
|
|
« Last Edit: December 30, 2012, 02:38:02 PM by Hiato »
|
Logged
|
|
|
|
|