Planetside Software Forums

General => Terragen Discussion => Topic started by: TheBlackHole on September 26, 2010, 01:48:39 AM

Title: Twist function?
Post by: TheBlackHole on September 26, 2010, 01:48:39 AM
I'm trying to make a galaxy in TG2 and I need a way to twist the cloud fractal shader. As in, something like Photoshop's Twirl filter. Can anyone help with this?
Title: Re: Twist function?
Post by: Dune on September 27, 2010, 02:49:11 AM
You'd need a warp shader or (use a power fractal as clouds, with) warp checked, and experiment with that.
Title: Re: Twist function?
Post by: Volker Harun on September 27, 2010, 03:35:48 AM
A year ago I was searching google for functions to draw spirals ... but I cannot find it anymore. Nonetheless I was able to get them working in TG2, but have not saved it :(
You can use a cloud fractal, multiply with the spiral function.

If you find this function, you can tell me via PM, so we can build this together.

Cheers,
Volker
Title: Re: Twist function?
Post by: mogn on September 27, 2010, 09:14:21 AM
The secret: Rotate the x-axis according to the distance, and bandpass the x-axis.
Title: Re: Twist function?
Post by: Volker Harun on September 27, 2010, 12:03:09 PM
Quote from: mogn on September 27, 2010, 09:14:21 AM
The secret: Rotate the x-axis according to the distance, and bandpass the x-axis.
Can I be your Padawan???
Title: Re: Twist function?
Post by: Hetzen on September 27, 2010, 12:43:20 PM
Quote from: mogn on September 27, 2010, 09:14:21 AM
The secret: Rotate the x-axis according to the distance, and bandpass the x-axis.


Hi Mogn,

I've got to say that I've never learnt about vectors, so don't really understand trigonometry too well. But how would you get the radius of your spiral to expand exponentially out, rather than having a constant distance from the previous ring.
Title: Re: Twist function?
Post by: j meyer on September 27, 2010, 01:10:30 PM
Worth a look methinks.
http://forums.planetside.co.uk/index.php?topic=3227.0
Title: Re: Twist function?
Post by: Hetzen on September 27, 2010, 01:46:10 PM
It's a thread I've visited a few times, but the spiral has the same width between rings all the way. I was wondering how you could get the width between the rings to increase the further you get away from it's centre, rather than it being fixed, like a vortex or galaxy.
Title: Re: Twist function?
Post by: j meyer on September 27, 2010, 02:03:53 PM
Sorry Hetzen,thought there was something about that in this thread,too.
Let's wait for mogn then.
Title: Re: Twist function?
Post by: Volker Harun on September 27, 2010, 02:08:11 PM
@Hetzen, You could use a square scalar between the Divide Scalar and the trig functions.
Title: Re: Twist function?
Post by: dandelO on September 27, 2010, 02:39:14 PM
Mogn to the rescue, once again! I love to see your solutions, this is great!

QuoteYou could use a square scalar between the Divide Scalar and the trig functions.

And Volker, brilliant!

Slowly, oh so slowly, these little posts are all building up to become the first letter in the word 'understanding', for me!
Keep posting, you lot. Thanks! :P

Title: Re: Twist function?
Post by: TheBlackHole on September 27, 2010, 03:23:31 PM
Could I have a tgc of your spiral function, mogn?
Title: Re: Twist function?
Post by: Hetzen on September 27, 2010, 03:45:38 PM
Great stuff Volker and Mogn. I'm not sure how you can warp PFs with this function yet, just playing around with it now.

@Blackhole, Mogn's posted the node diagram above, you just need to put a Sqr Root funtion between the Divide and Cos/Sin nodes.

You can also stick a clamp scaler instead of the hard step nodes to get a thicker ring.
Title: Re: Twist function?
Post by: Volker Harun on September 27, 2010, 04:11:38 PM
Quote from: Hetzen on September 27, 2010, 03:45:38 PM
Great stuff Volker and Mogn. I'm not sure how you can warp PFs with this function yet, just playing around with it now.

You cannot quite drive a powerfractal with it, unless you have a height sensitive conditional scalar and a smooth step afterwards ...
For the question in this thread you will not need it, as the cloud layer already has this height range built in.
So, just multiply this function's output with the cloud fractal .... everything else is done with Matt's built in stuff ;)

Quote from: Hetzen on September 27, 2010, 03:45:38 PM
You can also stick a clamp scaler instead of the hard step nodes to get a thicker ring.
Or you might want to use a smooth step scalar to get ... something smooth!?!?

,-) Salam, Volker
Title: Re: Twist function?
Post by: Hetzen on September 27, 2010, 04:15:21 PM
Just doodling. Needs loads of work, but wanted to see what anyone could do with driving this function into a couple of perlins.
Title: Re: Twist function?
Post by: Hetzen on September 27, 2010, 04:17:31 PM
Quote from: Volker Harun on September 27, 2010, 04:11:38 PM

Or you might want to use a smooth step scalar to get ... something smooth!?!?

Good idea, I was thinkg on how to smooth off the edges.
Title: Re: Twist function?
Post by: FrankB on September 27, 2010, 05:11:43 PM
Quote from: Volker Harun on September 27, 2010, 12:03:09 PM
Quote from: mogn on September 27, 2010, 09:14:21 AM
The secret: Rotate the x-axis according to the distance, and bandpass the x-axis.
Can I be your Padawan???
;D ;D ;D that was the funniest thing I have read today! thank you :)
Title: Re: Twist function?
Post by: Volker Harun on September 27, 2010, 05:36:49 PM
Quote from: FrankB on September 27, 2010, 05:11:43 PM
Quote from: Volker Harun on September 27, 2010, 12:03:09 PM
Quote from: mogn on September 27, 2010, 09:14:21 AM
The secret: Rotate the x-axis according to the distance, and bandpass the x-axis.
Can I be your Padawan???
;D ;D ;D that was the funniest thing I have read today! thank you :)
Well, there are a lot of things, that I do not understand due to lack of knowledge ... all I do is intuition ...
Anyway, I am glad to cheer you up! :)