Planetside Software Forums

General => File Sharing => Shaders, Materials => Topic started by: Volker Harun on September 08, 2009, 06:19:49 pm

Title: Julia-Set
Post by: Volker Harun on September 08, 2009, 06:19:49 pm
 ;D

Hi,

I was asked to share some nodes for a Julia-Set ...

I simplified it for 2 iterations ... once you get the point, feel free to add more ... to your needs and the power of your machine ,-)


Have fun,

Volker Harun
Title: Re: Julia-Set
Post by: old_blaggard on September 08, 2009, 06:36:24 pm
Wow, thanks Volker!

For those who don't know what a Julia set is: http://en.wikipedia.org/wiki/Julia_set

The possibilities are endless! The node implementation is very clean as well. Awesome!
Title: Re: Julia-Set
Post by: cyphyr on September 08, 2009, 06:41:43 pm
Hi Volker
Huge thanks for this :)
There's a huge stack of learning in here.
;D
Richard
Title: Re: Julia-Set
Post by: matrix2003 on September 08, 2009, 06:46:21 pm
  ---  and I plug this where?   And yes I am fully aware that I just left that wide open if you want to take that shot!   ;D
Title: Re: Julia-Set
Post by: CCC on September 08, 2009, 07:15:00 pm
This is way over my head and i can't see this for creating canyon networks but it would make good for artificial or alien terrain structures.
Title: Re: Julia-Set
Post by: pfrancke on September 08, 2009, 07:15:25 pm
Thank you Volker!!

And compliments to matrix2003 on your new avatar!!  I like it lots - which I wouldn't have been able to say before.   ;D
Title: Re: Julia-Set
Post by: matrix2003 on September 08, 2009, 07:26:25 pm
Fractals for me were old DOS programs. But at that moment in time,  I thought this was so much cooler than anything I had done on my TRS 80  or commodore 64 !
Fractint, Ultra Fractal, Fractal Explorer, and there was another one I can't remember.
Title: Re: Julia-Set
Post by: matrix2003 on September 08, 2009, 08:40:19 pm
Quote from: pfrancke on September 08, 2009, 07:15:25 pm
which I wouldn't have been able to say before.   ;D


Oh.  Believe me you can say anything in here.
Title: Re: Julia-Set
Post by: mogn on September 09, 2009, 12:49:33 am
Thanks, So just duplicate this to get 100 iterations.

My idea for this: pack 1 iterations inside a 'Buildvector' node using "dandelO's device"
pack 10 nodes of this inside another 'Buildvector node' still using "dandelO's" device
Finally pack 10 of these in a final 'Buildvector node'
Of cource you have to use the beta version.
dandelO's device: connecting assigning an input tab of a node to the output of an internal node.

Title: Re: Julia-Set
Post by: Volker Harun on September 09, 2009, 05:00:57 am
You might want to try the following:
Delete that multiply and dot-nodes at the bottom. Instead you use first a build vector (feeding only x and z) followed by a length to scalar.

This is more typical.

Volker
Title: Re: Julia-Set
Post by: Henry Blewer on September 09, 2009, 08:26:50 am
ChoasPro. I still use it.
Title: Re: Julia-Set
Post by: rcallicotte on September 09, 2009, 08:53:23 am
Giminy Cricket!!  Thanks Volker!
Title: Re: Julia-Set
Post by: cyphyr on September 09, 2009, 09:42:04 am
First image, 9 iterations took 2h30m with detail set to 1 and aa at 11
Yep this is gona get slow :)
Richard
Title: Re: Julia-Set
Post by: j meyer on September 09, 2009, 10:04:30 am
Cool,thanks!
Now go for some mandelbrot. ;)
Title: Re: Julia-Set
Post by: Volker Harun on September 09, 2009, 10:20:06 am
Cyphyr, this going very good!

I was too lazy yet, to get rid off those outer boundaries ... should be possible with a conditional scalar.

@J meyer: Just replace the scalar 'Real' with 'X to Scalar' and the 'Imag' with 'Y to scalar' on every iteration ;)

Volker
Title: Re: Julia-Set
Post by: j meyer on September 09, 2009, 10:24:38 am
Thank you very much! ;D
Title: Re: Julia-Set
Post by: dandelO on September 09, 2009, 04:27:38 pm
:)

I think, Mogn, if you go even further back than me, you'll find that it is, in fact, "Volkers" own device. :)
This is a trick I learned from reading his posts here on powerfractals a couple of years ago now, I think.

I believe Planetside invented it, though. New planets and object nodes etc. all do this by default. ;)
Title: Re: Julia-Set
Post by: mogn on September 10, 2009, 12:17:10 am
Quote from: mogn on September 09, 2009, 12:49:33 am
Thanks, So just duplicate this to get 100 iterations.

My idea for this: pack 1 iterations inside a 'Buildvector' node using "dandelO's device"
pack 10 nodes of this inside another 'Buildvector node' still using "dandelO's" device
Finally pack 10 of these in a final 'Buildvector node'
Of cource you have to use the beta version.
dandelO's device: connecting assigning an input tab of a node to the output of an internal node.




This isnt working. Tg2 is grinding to a halt when I get above 10 ┬┤julian nodes'. (in my version about 200 nodes)
I think that time for testing for circular connections grows exponentally.
Title: Re: Julia-Set
Post by: Volker Harun on September 10, 2009, 03:28:39 am
@mogn: It is a bit faster, when assigning the nodes within the shader ... drawing the lines kills mine, too (my machine is killing me with 130 nodes) ;)
Title: Re: Julia-Set
Post by: mogn on September 13, 2009, 12:10:19 am
Quote from: Volker Harun on September 08, 2009, 06:19:49 pm
;D

Hi,

I was asked to share some nodes for a Julia-Set ...

I simplified it for 2 iterations ... once you get the point, feel free to add more ... to your needs and the power of your machine ,-)


Have fun,

Volker Harun


I think that you should clamp the input x,z too the range -1..1
If you use many iterations you risk overflow, this might slow down the cpu,fpu

It might be faster to use "Get position in geometry" since y is not used in your network.
Title: Re: Julia-Set
Post by: Volker Harun on September 13, 2009, 04:40:21 am
Hello mogn,

the clamping makes sense, preferable is the smooth step scalar, as it does the same without any sudden breakup. :)

About the 'Get position in geometry' ... it has one main disadvantage, you will no longer be able to scale and translate the position using the transform shader. Of course it can be done by a multiplyingthe position with a aconstant vector for scaling and adding a vector for translation. I am too lazy for this ;)

Have you done speed-tests about that position-thingy?

Volker
Title: Re: Julia-Set
Post by: mogn on September 14, 2009, 12:14:04 am
No test on position yet. But as far as I can see 'Get position in geometry' is a global variable, i.e. you can implement
several copies without cost. This can clean up networks. I hope that TG2 is so clever that if 'Get position' does not
use the y coordinate, it is not calculated.
If the scaling is the same in all 3 coordinates you can make a vector division with a constant scalar.
I think that since 'build vector' and 'get x to scalar' are only addressing operations they are free.
In general I would like Matt to make a list of relative cost of the different nodes.
E.g a 'clamp 01' is much faster than a generel clamp.