distribution shader

Started by René, August 05, 2019, 03:59:42 am

Previous topic - Next topic

René

I'm pretty sure this has been dealt with before, but is there an (easy) way to limit slope distribution to the top only? In other words, I don't want any stones that stick to the underside of an overhang. Normally this is not such a problem because I always limit the maximum slope to 25 or 30, but now I use 70 and, well,...  ::)

Dune

August 05, 2019, 05:38:55 am #1 Last Edit: August 05, 2019, 05:51:03 am by Dune
When I add snow to branches of tree objects, I use Y, but I don't know if that works in normal displacement.

Maybe there's a way with get normal in texture, then +Y would be green (I don't know about -Y, though) and if so then clamp the -Y out?

René

Thanks. I'll give it a try. It comes down to telling the distributor which part of the terrain is facing up and which part is facing down, I guess.

Hetzen

If you use Get Normal in Texture, plug that in to a Y to Scaler, then Clamp 0 1, that will give you a greyscale range for surfaces facing up. You can then use an Adjust Colour to pull that range into the angle you're looking for, without getting into maths trying to figure out how to convert that greyscale into degrees of angles.

Dune

So my hunch was right  :)  Good to know about the color adjust.

Hetzen

Sorry Ulco, yes you are right. 8)

Dune

Just tried it, works like a dream. And X to scalar + a rotate vector gives you the sides at choice.

j meyer

Good one, thanks Jon and Ulco.

bobbystahr

Well now this was a worthy read, Thanks Jon & Ulco....
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

WAS

Not sure if it works as well as imagined. Take this simple smooth shape for example:

It doesn't seem to understand the terrains overhang, even with texture coordinates.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Hetzen

Couple of things. Is there a Compute Terrain re-calculating your shape? If there is, is the patch size small enough to accommodate the over hang?

Also. The clamp isn't necessary as I forgot the Colour Adjust has the clamp function built in.

If you want to mask faces looking down, then stick a Negate Scaler before the Colour Adjust...

WAS

Quote from: Hetzen on August 05, 2019, 03:27:43 pmCouple of things. Is there a Compute Terrain re-calculating your shape? If there is, is the patch size small enough to accommodate the over hang?

Also. The clamp isn't necessary as I forgot the Colour Adjust has the clamp function built in.

If you want to mask faces looking down, then stick a Negate Scaler before the Colour Adjust...



The patch size is most definitely likely not correct, being default 20 on a 10m shape. At least I'd think. That may be the reason, though I did use a texture coordinates after the lateral.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Matt

Quote from: René on August 05, 2019, 03:59:42 amI'm pretty sure this has been dealt with before, but is there an (easy) way to limit slope distribution to the top only? In other words, I don't want any stones that stick to the underside of an overhang. Normally this is not such a problem because I always limit the maximum slope to 25 or 30, but now I use 70 and, well,...  ::)

If you set the max to 90 that should limit it to upward-facing surfaces. What is the problem, exactly? Are you not getting enough coverage on the top?
Just because milk is white doesn't mean that clouds are made of milk.

Dune

QuoteIf you want to mask faces looking down, then stick a Negate Scaler before the Colour Adjust...

Or just inverse the color adjust.


Hetzen

Quote from: Dune on August 06, 2019, 01:49:28 am
Quote from: undefinedIf you want to mask faces looking down, then stick a Negate Scaler before the Colour Adjust...

Or just inverse the color adjust.


That would just colour all the non-up facing faces, ie everything except the top. The important bit is the negative values in Y which has been clamped out, so inverting the negative values put them into 0-1 range.