Logo by wmauzey - 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 us on facebook
 
*
Welcome, Guest. Please login or register. April 25, 2024, 09:15:05 PM


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 ... 8   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: Help?  (Read 2774 times)
0 Members and 1 Guest are viewing this topic.
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 ...
Code:
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
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« 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
Fractal Schemer
****
Posts: 1075



WWW
« Reply #2 on: October 27, 2015, 10:25:34 PM »

Also, what's the DE calculation?  How the do we test it without knowing how you calculate DE?  Figure it out ourselves?  Look in someone else's formula!!!  Why use w at all?  What is it for!$@!#$  What it isn't good for!@#$!


......    cheesy cheesy grin cheesy
« 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 wink
Logged

No sweat, guardian of wisdom!
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« 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... cheesy


* MengerSmooth.frag (4.7 KB - downloaded 34 times.)
* Menger smooth no DE.frag (5.43 KB - downloaded 28 times.)
« 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 cheesy
Logged

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



WWW
« Reply #6 on: October 29, 2015, 09:12:53 PM »

DarkBeam, M Benesi, thank you guys! Nice script love  wink
I used it in hybrid pseudo-kleinian. For water used terrain with small amplitude and frequency

Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #7 on: October 29, 2015, 09:50:30 PM »

Beautiful water effect!  I'll probably ask for a few tips later...
Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« 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  A Beer Cup
@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)
 A Beer Cup keep the formulas flowing
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« 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
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« 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 wink


* benesi-bulb-top.jpg (18.89 KB, 640x360 - viewed 31 times.)

* benesi-bulb-side.jpg (19.95 KB, 640x360 - viewed 25 times.)
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« 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.  cheesy


  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
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #12 on: October 30, 2015, 05:42:56 AM »

 afro nice and fast too, I don't have Brute-RaytracerExp.frag so using Brute-Raytracer.frag
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #13 on: October 30, 2015, 06:23:41 AM »

afro nice and fast too, I don't have Brute-RaytracerExp.frag so using Brute-Raytracer.frag

  Ohh.. exp is mine.  Whhhooops... cheesy  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...  wink  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.

* pine with options original Brute Raytracer.frag (7.34 KB - downloaded 20 times.)
Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #14 on: October 30, 2015, 07:14:21 AM »

this is how I used (modified) your fold function...
Code:
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...
Code:
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  cheesy

(apologies to DarkBeam for hijacking this thread  embarrass )


* benesi-bulb.jpg (142.22 KB, 811x714 - viewed 27 times.)
« Last Edit: October 30, 2015, 07:27:00 AM by 3dickulus, Reason: ap » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Pages: [1] 2 3 ... 8   Go Down
  Print  
 
Jump to:  


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.151 seconds with 24 queries. (Pretty URLs adds 0.009s, 2q)