DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« on: October 27, 2015, 08:14:50 PM » |
|
Can someone transcript this in a frag script? Have been asked but I have no time ... procedure MengerIFSsmooth(var x, y, z, w: Double; PIteration3D: TPIteration3D); var t: Double; sc, sc1, sc2: Double; Cx, Cy, Cz: Double; s: Double;
begin sc := 3.0; sc1 := sc-1.0; sc2 := sc1/sc; Cx := 1.0; Cy := 1.0; Cz := 0.5; t := 9999999.0; s := 0.005;
x := sqrt(x*x+s); y := sqrt(y*y+s); z := sqrt(z*z+s);
t:=x-y; t:= 0.5*(t-sqrt(t*t+s)); x:=x-t; y:= y+t;
t:=x-z; t:= 0.5*(t-sqrt(t*t+s)); x:=x-t; z:= z+t;
t:=y-z; t:= 0.5*(t-sqrt(t*t+s)); y:=y-t; z:= z+t;
z := z - Cz*sc2; z := - sqrt(z*z+s); z := z + Cz*sc2;
x := sc*x-Cx*sc1; y := sc*y-Cy*sc1; z := sc*z; w := sc*w; // w is the de scale starts as 1 end;
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
Patryk Kizny
|
|
« Reply #1 on: October 27, 2015, 10:06:22 PM » |
|
It's a single procedure so it's hard to do anything with that w/out context.
|
|
|
Logged
|
Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
|
|
|
M Benesi
|
|
« Reply #2 on: October 27, 2015, 10:25:34 PM » |
|
|
|
« Last Edit: October 27, 2015, 11:30:15 PM by M Benesi »
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #3 on: October 27, 2015, 10:52:21 PM » |
|
Lol I think it is at least a base
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
M Benesi
|
|
« Reply #4 on: October 27, 2015, 11:29:26 PM » |
|
Ok. I did 2 formulas. Non DE, and DE. Made s a variable, so that you can change it... also added Sphere checkbox, so you can make MengerBalls...
|
|
« Last Edit: October 27, 2015, 11:56:37 PM by M Benesi »
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #5 on: October 28, 2015, 08:22:51 AM » |
|
Thanks Matt it is not for me btw it will be used for sure
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
Crist-JRoger
|
|
« Reply #6 on: October 29, 2015, 09:12:53 PM » |
|
DarkBeam, M Benesi, thank you guys! Nice script I used it in hybrid pseudo-kleinian. For water used terrain with small amplitude and frequency
|
|
|
Logged
|
|
|
|
M Benesi
|
|
« Reply #7 on: October 29, 2015, 09:50:30 PM » |
|
Beautiful water effect! I'll probably ask for a few tips later...
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #8 on: October 30, 2015, 02:30:33 AM » |
|
@Crist-JRoger, I've wanted a nice water effect for a while but just haven't had the time to play with it, at least now I have an idea of where to start @M Benesi, I did have a little time to hybridize a Benesi-Bulb thingy and hope to play around with that this weekend. Can I include this with the next patch update? it's a great program but doesn't amount to much without some good frag scripts. Definately thank you guys (DarkBeam too) keep the formulas flowing
|
|
|
Logged
|
|
|
|
M Benesi
|
|
« Reply #9 on: October 30, 2015, 04:15:49 AM » |
|
@3dickulus- you got it. My frags are a mess. Let me see if I can salvage something for you to work off of... working on it. Doy.. you made one. haha.. I already started cleaning up my frags.. anyway.
Have at it.
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #10 on: October 30, 2015, 04:18:11 AM » |
|
here's what I came up with, fold only, but somehow I don't think it's right
|
|
|
Logged
|
|
|
|
M Benesi
|
|
« Reply #11 on: October 30, 2015, 05:15:25 AM » |
|
Hmm.. dunno. Looks cool. I've seen similar... hahah... Well, check out my no-DE version, attached. Pine 1 cleaned no mag. The other one is another DE, but it has lots of options which slow it down... it has the old "mag" formula instead of the quicker Transform 1 formula- and it is messy, and NOT optimized. The mag is wayyyyy slower. For the Pine 1 Cleaned no Mag... I included a rotation option, to rotate after a specific iteration. It is cool. If you do it from iteration 1 on, it does the whole fractal (well, unless I set it up wrong??!@ might have to remove the -1 part!!). If you do it from iteration 2 on.. .it rotates smaller sections. Likewise with iteration 3 on (it rotates the next size smaller bulbs and down). It will allow you to do cool things... I suppose all fractals are like that, but it really popped out at me for this one. Now, I should build on Pine 1, to allow other transforms to be thrown into the mix. I might do that (separate out the mandy portion, and do separate calls like I did in this extremely complicated script I wrote, which needs to be completely re-written!!). Anyway, try this out. Keep in mind the "actual clean a bit" frag is cleaned a bit... and it's a mess. Updated version in message below. I'll eventually put the other frag up again...
|
|
« Last Edit: October 30, 2015, 06:28:53 AM by M Benesi »
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #12 on: October 30, 2015, 05:42:56 AM » |
|
nice and fast too, I don't have Brute-RaytracerExp.frag so using Brute-Raytracer.frag
|
|
|
Logged
|
|
|
|
M Benesi
|
|
« Reply #13 on: October 30, 2015, 06:23:41 AM » |
|
nice and fast too, I don't have Brute-RaytracerExp.frag so using Brute-Raytracer.frag Ohh.. exp is mine. Whhhooops... I put in some options to rotate around the camera- actually screwed up the math, but it worked good enough for me, although it didn't work the way I wanted. And.. here is an update. Includes transforms 3,4,5b as options. I don't get a lot of mileage out of my ancient 8+ year old GPU (8600m... mobile.. and not the faster one)... ahh, you know what. I don't know how to color either... I wrote a few scripts.. but.. meh... Anyway.. this has options to do the other transforms (and you can see how I set it up from within the code).. runs slower, but it has options. If you remove a few of the if statements from the main loop, it will run faster. I'd do that for rendering animations.
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #14 on: October 30, 2015, 07:14:21 AM » |
|
this is how I used (modified) your fold function... uniform vec3 bscale; slider[(-2,-2,-2),(0.5,0.5,0.5),(2,2,2)] uniform vec3 boffset; slider[(-2,-2,-2),(0.5,0.5,0.5),(2,2,2)]
float Cx = 0.816496580927726; float Cy = 0.5773502691896258; float Cz = 0.7071067811865475;
void BenesiFold(inout vec3 b) { // STEP1: "Benesi fold 1" float tx=(b.x*Cx-b.z*Cy)*Cz; b.z=abs(b.x*Cy + b.z*Cx); b.x=abs(tx-b.y*Cz); b.y=abs(tx+b.y*Cz);
tx=b.x*Cz+b.y*Cz; b.y=-b.x*Cz+b.y*Cz; b.x=tx*Cx+b.z*Cy; b.z=-tx*Cy+b.z*Cx;
b.x=bscale.x*b.x-boffset.x; //scale =2 offset=2 b.y=bscale.y*b.y-boffset.y; b.z=bscale.z*b.z-boffset.z; }
...called once before entering the while loop in DE function, I don't have the math skills to fix things but when parameters are just right it makes some really interesting bulb variations, I haven't figured out what to do with the Step 2 part yet. did the same sort of thing with that... void BenesiPine(inout vec3 b) { // STEP2: "Benesi pinetree" float xt = b.x*b.x; float yt = b.y*b.y; float zt = b.z*b.z; float t = 2.0*b.x/sqrt(yt+zt); b.x = xt-yt-zt+Cx; b.z = t*(yt-zt)+Cy; b.y = 2.0*t*b.y*b.z+Cz; }
I will add a Benensi folder to the Examples collection for these frags if that's ok with you (apologies to DarkBeam for hijacking this thread )
|
|
« Last Edit: October 30, 2015, 07:27:00 AM by 3dickulus, Reason: ap »
|
Logged
|
|
|
|
|