Planetside Software Forums

General => Terragen Discussion => Topic started by: shadowphile on November 01, 2009, 04:25:54 PM

Title: keeping it simple using functions - turbulence (node clip included)
Post by: shadowphile on November 01, 2009, 04:25:54 PM
I'm finally getting the hang of functions, although if anybody has any major crits or suggestions, let me know.
The attached clip is a 'turbulence' function.  Wherever you might need to use a 'get position', you can use this instead.
It works very simply.
1) Get position (a set of coordinates, returned as a vector)
2) break out each component of the vector (x, y and z axes)
3) create some perlin noise  (this is where the turbulence is adjusted, btw)
4) offset each axis with the noise (by adding)
5) recombine the three scalar components back to a vector so that it can simulate a position value

No inputs, only one output, the perturbed position.

In these examples I used the 'Voronoi 3D diff scalar' function, which requires some kind of position information at its input.

Normal get-position input: (color only)
[attach=2]

With turbulated position as the input: (color only)
[attach=1]

With turbulated position as the input: (as a displacement in a surface layer, constrained to mostly vertical surfaces)
[attach=4]


Title: Re: keeping it simple using functions - turbulence (node clip included)
Post by: pfrancke on November 01, 2009, 04:43:34 PM
functions beat me into the ground.  I've always wondered how to add controlled randomness - I have downloaded and will study.  Thank you so much!!
Title: Re: keeping it simple using functions - turbulence (node clip included)
Post by: shadowphile on November 01, 2009, 06:23:38 PM
Keep in mind that I'm not trying to put up full solutions, but rather isolate and demonstrate with images.

Most of the meat of the terrain generation is not in the clip.
Title: Re: keeping it simple using functions - turbulence (node clip included)
Post by: mogn on November 01, 2009, 11:45:11 PM
Good. But you can save some nodes. This can be done (exactly the same output) with 6 nodes, instead of your 11 nodes.
Title: Re: keeping it simple using functions - turbulence (node clip included)
Post by: shadowphile on November 02, 2009, 12:58:43 AM
mogn: how?   I'm guessing it involves passing vectors instead of scalars. ???
thanks
Title: Re: keeping it simple using functions - turbulence (node clip included)
Post by: mogn on November 02, 2009, 01:09:35 AM
Yes:
Title: Re: keeping it simple using functions - turbulence (node clip included)
Post by: shadowphile on November 02, 2009, 02:23:33 AM
grrr!  guess I thought the PF nodes needed an input, otherwise, yes, this makes sense
thanks!