Flatten displacements

Started by james adamson, August 13, 2020, 01:29:03 PM

Previous topic - Next topic

james adamson

I have put flatten into search and got nothing back.

Basically I have some small stones. (Asphalt stones) I have used a PF to create these for now but may use fake stones as I progress with setup but I guess the solution would be the same.
 And I want to flatten the tops of them so they catch the light relatively evenly like they have been worn down I guess.

Is this something min max/abs type thing would solve or would a colour adjust do it. 
Or..... non of the above.
Cheers.
James.

Hetzen

You can convert the displacement with a Displacement to Vector/Scalar, then clamp the Y/scalar to 'cut-off' the tops of the pattern, then feed back into a Vector/Displacement Shader depending on whether you're working with vector displacement from fake stones or regular displacement from a PF.

Personally, I'd use a PF to output colour and switch off displacement. Then use a Colour Adjust to 'clamp' the top curve of the pattern off, or take it into blue territory if I wanted to control the smoothness or do other things with it. Then feed that into a displacement shader.

james adamson

Cheers.
So using the colour adjust method would I essentially be reducing the roll off between white and black. 
Would I be looking for a flatish area of white with a hard edge then grading off to black?

Hetzen

If you pull the white level towards black, you are essentially clamping any values above that slider and making a black to white gradient to that slider.

With tarmac, I'd probably go with a PF set to perlin billows, set appropriate scales, possibly clamped multifractal, then feed that into a Colour Adjust. Pull the white slider to say 0.3. That will cut off any curve in the pattern above 0.3.

james adamson

Thanks Hetzen.
Will give it a go.
James.

Dune

If you use a smooth step instead of color adjust, the edges of the clamp are just a bit softer, btw. But that may hardly be visible in small asphalt stones.

WAS

Soft Clamp Maximum/Minimum are fantastic tools.

You can easily target an altitude of your terrain and flatten it out, or even do different stuff like US a PF for min-max zones of different plateau heights or softnesses.

Here are two examples

james adamson

Brilliant.
I have got some nice results just using the colour adjust on the PF but sounds great for larger areas.
Thanks.
James.

WAS

Awesome. Just remember noise-based PF displacement won't match what the PF creates on its own utilizing its more advanced internal displacement mechanics.

james adamson

You've lost me a bit on that one.  :o
Whats the difference between the two and how would I make use of one over the other?
I just use PF in either colour or displacement mode at the moment. And when I use as colour I either add a displace node or displace in surface layer.

WAS

It's really down to preference. If the colour of a PF is providing better results in a displacement shader, that could be the route to take. But if you were basing something off the internal displacement of a shader, the provided colour from that shader won't match it's internal displacement. Just good to keep in mind if you wanted to us it for like, masking certain features of it's own displacement for example, it won't coincide exactly. A "Displacement to Scalar" function will give you the exact "noise" of what a PF's displacement is producing. The Smoothing Function even still works on the displacement to scalar as well based on the downstream to the PF.

james adamson

Gotcha!
Yep thats how I have been using the node so far. Still working out the most efficient workflow.
Im a bit all over the place at the moment and I am trying to limit the amount of nodes I use.

sboerner

QuoteJust remember noise-based PF displacement won't match what the PF creates on its own utilizing its more advanced internal displacement mechanics.
Good to know, and thanks, WAS, for elaborating on this.

Dune

You also have to keep in mind that displacement directly from a noise has an amplitude down and up, whereas displacement from color only goes up, unless you also use a negative color (-black).