Planetside Software Forums

General => Terragen Discussion => Topic started by: Nala1977 on May 22, 2021, 12:51:38 PM

Title: displacement weirdness
Post by: Nala1977 on May 22, 2021, 12:51:38 PM
maybe im doing wrong, as usual but.. i created two simple shapes and shifted one a bit on the right side so they intersect, then i used merge to subtract one from the other so i could create a half moon shape, and then displace it

problem is the terrain is displacing upwards whre i want, but displacing downwards where i do not want. I dont understand how Terragen interprets the colors. Black should be No displacement, while white should be displacement.

So why in the black part (inside the halfmoon) the terrain is pushed downward?
Title: Re: displacement weirdness
Post by: WAS on May 22, 2021, 01:00:27 PM
I think you want to simply mask the first by the second.. subtraction is going to subtract into negative values. Which is still legal displacement.
Title: Re: displacement weirdness
Post by: WAS on May 22, 2021, 01:05:23 PM
Here is an example.
Title: Re: displacement weirdness
Post by: Nala1977 on May 22, 2021, 01:51:46 PM
thanks WAS, so you telling me there is no way to have the same result using a merge shader node?
Title: Re: displacement weirdness
Post by: WAS on May 22, 2021, 02:18:00 PM
I don't believe so. What you want is a masked result and the merge shader is blending. There is no mask mode, though maybe that would solve the needing to use a heavy Surface Shader just to mask. Lots of variables being reference that aren't doing a thing. Waste of resources imo. Despite how little. It all adds up.

Still want just a Mask Shader.
Title: Re: displacement weirdness
Post by: KlausK on May 22, 2021, 06:06:31 PM
Something like this, perhaps?

CHeers, Klaus
Title: Re: displacement weirdness
Post by: WAS on May 22, 2021, 06:18:09 PM
Oh cool. Why does that even work though? The setup of mix to A at 1 with subtraction, with an absolute colour as mixer makes no sense to me.
Title: Re: displacement weirdness
Post by: KlausK on May 22, 2021, 06:42:23 PM
The "Mix to A" setting has no influence on the result here. Can be 0, 1 or any other value.
Only the subtraction is important. I cannot explain how and why it works really.
The idea was that the "Absolut Colour" clamps the blacks from going into negative values.
I use this always together with simple shapes.
Also, using a "Absolute Scalar" instead does the same.

CHeers, Klaus
Title: Re: displacement weirdness
Post by: WAS on May 22, 2021, 07:26:42 PM
Ahh that makes sense now. If mixer doesn't allow negatives then yeah. Probably only a clamp 0 scalar is needed in that case, to not possibly interfere with peaks.
Title: Re: displacement weirdness
Post by: Dune on May 23, 2021, 02:06:32 AM
I would simply do it like this, cheaper too.
Title: Re: displacement weirdness
Post by: Nala1977 on May 23, 2021, 02:39:13 AM
thanks everyone, lots of possibilities, whish this was a little bit more straightforward with a dedicated mask node with all operations like Was said, its a bit weird what you gotta do to achieve this simple thing :)
Title: Re: displacement weirdness
Post by: Dune on May 23, 2021, 08:06:11 AM
I thought it was pretty simple and straightforward ;)