Planetside Software Forums

General => Terragen Discussion => Topic started by: terp on June 17, 2022, 04:21:10 PM

Title: Yes, I'll have a Slice'o'Voronoi!
Post by: terp on June 17, 2022, 04:21:10 PM
Hi all.

I'd like to make a 2D Voronoi pattern...one that doesn't change shape as y-value/altitude changes.
Is it possible to slice a 3D Voronoi at a certain y-value/altitude to get what we want?

The preview window for Voronoi shows a slice based on Y value...it must be possible!   :)

I see all of those tasty blue nodes out there, like get_position and get_altitude.
Can someone help me out with the combination of these nodes to get what I'm looking for?

Thanks!
Terp
Title: Re: Yes, I'll have a Slice'o'Voronoi!
Post by: Dune on June 18, 2022, 02:10:20 AM
One thing that you could do is stretch the voronoi on Y immensely, so there would be extremely little difference between altitudes. 
This is the basic setup from blues for voronoi, but you may already know that.
Title: Re: Yes, I'll have a Slice'o'Voronoi!
Post by: mhaze on June 19, 2022, 01:12:43 PM
You should note however, that you only get real stretching on near vertical surfaces.
Title: Re: Yes, I'll have a Slice'o'Voronoi!
Post by: Matt on June 19, 2022, 01:50:19 PM
I would use a Build Vector node: https://planetside.co.uk/wiki/index.php?title=Build_Vector

Build Vector can be used to modify an input vector, not just build a vector from scratch. You can use this to set the Y component of your position vector to any value you like (e.g. 0), while passing through the X and Z components, and that gives you your slice.

Get Position in Texture -> "Main input"
Constant Scalar -> "Y input"
Title: Re: Yes, I'll have a Slice'o'Voronoi!
Post by: terp on June 20, 2022, 12:41:40 AM
Thanks all.

Dune, Thanks for that, that setup is similar to what I'm using.
I get scared to use huge numbers with TG, as, in my mind, it means TG has to do more calculations.
I'm working on an iMacPro and am always looking to keep overhead as low as possible.


Quote from: Matt on June 19, 2022, 01:50:19 PMI would use a Build Vector node: https://planetside.co.uk/wiki/index.php?title=Build_Vector

Build Vector can be used to modify an input vector, not just build a vector from scratch. You can use this to set the Y component of your position vector to any value you like (e.g. 0), while passing through the X and Z components, and that gives you your slice.

Get Position in Texture -> "Main input"
Constant Scalar -> "Y input"
Hey Matt - below is the setup I've been using to generate Voronoi shapes, plus what I *think* you are saying, but I'm missing something.
When I replace the Voronoi data being passed to the Build Vector node with a Constant Scalar value, it isn't passing any Voronoi information anymore.  I've tried all kinds of node combinations, but I don't "think in blue nodes" very well.

How would I assemble the node tree to pass the Build Vector node the "Voronoi-value at Y" instead of just a blanket Y value?

Terp
Title: Re: Yes, I'll have a Slice'o'Voronoi!
Post by: Dune on June 20, 2022, 02:06:56 AM
I think you should link the smooth voronoi to the input of the build vector, and not another get position.
Title: Re: Yes, I'll have a Slice'o'Voronoi!
Post by: Matt on June 20, 2022, 09:12:22 AM
Get Position in Texture
     |
    v
Build Vector
     |
    v
Voronoi



Title: Re: Yes, I'll have a Slice'o'Voronoi!
Post by: Matt on June 20, 2022, 09:42:16 AM
using_BuildVector_to_set_Y_coordinate_sm.png
Title: Re: Yes, I'll have a Slice'o'Voronoi!
Post by: terp on June 20, 2022, 02:33:52 PM
I feel asleep ruminating on whether or not there was a way to affect the Y after the voronoi node...hahahaha.  Thanks guys.
The more I'm exposed to these ways of [blue node] thinking the easier it will become to manipulate shapes to what I need.

T