Planetside Software Forums

General => Terragen Discussion => Topic started by: N-drju on August 26, 2019, 04:57:13 AM

Title: Preferred input for fake stone shader "scale function"?
Post by: N-drju on August 26, 2019, 04:57:13 AM
As in the title.

But let me give you an idea of what I would like to see.

The idea is to have the stone layer differ in scale from place to place in a gentle (smooth) manner. So they are 100% nominal scale in one spot, while almost disappearing in another area.

PF could be used as a guiding mask to determine these regions... But not as a function alone as it terribly glitches out the stones. Even without displacement.

So how would you define a scale function to get this result?

EDIT: I believe the "constant colour" could be used in some way as any of its values would accordingly enlarge or shrink the stones. I'm just not sure how I could "randomize" its influence (because "constant colour" alone is a global effect of course.)
Title: Re: Preferred input for fake stone shader "scale function"?
Post by: Tangled-Universe on August 26, 2019, 08:04:41 AM
As far as I know you can't do this yet and the input only accepts numerical input, either through a constant colour constant scalar.

So for now the only way I see is the idea you proposed already, to mix the stone sizes by a mask.
Title: Re: Preferred input for fake stone shader "scale function"?
Post by: cyphyr on August 26, 2019, 08:45:36 AM
something like this?
Title: Re: Preferred input for fake stone shader "scale function"?
Post by: cyphyr on August 26, 2019, 08:56:00 AM
Quote from: N-drju on August 26, 2019, 04:57:13 AM...
But not as a function alone as it terribly glitches out the stones. Even without displacement.
...
Ahh do you mean the warping effect the PF has on the stines?
Yeah that's quite odd and I think it's inevitable because each "stone" covers an area that has different scale values in it. One side of the stone is effected by one value of the PF and the other side of the same stone is effected by a different value from the PF. Hence warped stone.
If you made very small stones and had a very large PF you might just not notice the warp ...
Title: Re: Preferred input for fake stone shader "scale function"?
Post by: N-drju on August 26, 2019, 09:39:27 AM
I see. Well, my idea was to randomly scale the stones, like you would scale objects... Each stone (area) having a slightly different size, calculated from their nominal value in the "stone scale" parameter.

It is a terrain feature though... so I understand it might not be possible, just like Tangled says it might.

Besides, I'd prefer the size to randomly vary instead of having to define size areas by hand with the use of SSS.
Title: Re: Preferred input for fake stone shader "scale function"?
Post by: Dune on August 26, 2019, 10:54:20 AM
So, what if you displace by PF with larger max size than the stone? It would displace stones by the patchiness of the stones, especially after a transform to world shader. You could also mask a surface shader by PF, thus creating random patches and use the offset function to displace the stones' offset, thus blowing them up by this pf.
I have (ages ago) enlarged stones this way by an altitude restriction.
Title: Re: Preferred input for fake stone shader "scale function"?
Post by: N-drju on August 28, 2019, 04:56:02 AM
Quote from: Dune on August 26, 2019, 10:54:20 AMSo, what if you displace by PF with larger max size than the stone? It would displace stones by the patchiness of the stones, especially after a transform to world shader. You could also mask a surface shader by PF, thus creating random patches and use the offset function to displace the stones' offset, thus blowing them up by this pf.
I have (ages ago) enlarged stones this way by an altitude restriction.

I'm afraid I don't quite follow the first idea... I have a screenshot attached. It looks terrible... Unless it is the "scale function" fault. Maybe I should use some other input?

example 1.png
Title: Re: Preferred input for fake stone shader "scale function"?
Post by: Tangled-Universe on August 28, 2019, 05:11:56 AM
Quote from: cyphyr on August 26, 2019, 08:45:36 AMsomething like this?
Intriguing.
I seem to recall from the release note discussion in the alpha forum that the input only accepted single value inputs.
Your example seems to show that the gradient from the simple shape shader decrease stone size towards the edge, suggesting you can drive this with a more complex input.

This should mean that a PF should work as well, but as you say in your reply below there may be issues with value transitions at fake stone seed positions (as fake stone shader is basically a single octave voronoi noise with seed input).
Title: Re: Preferred input for fake stone shader "scale function"?
Post by: Dune on August 28, 2019, 06:55:25 AM
I recall that the scale factor works by exponential values or something like that, so it's hard to control. I never use it.

What I meant in my post is not the scale factor but a normal displacement addition into the surface input, or after the stone shader. But it's a bit fickle, and I haven't used it for a while, so am not sure.
Title: Re: Preferred input for fake stone shader "scale function"?
Post by: N-drju on August 28, 2019, 07:54:46 AM
Quote from: Dune on August 28, 2019, 06:55:25 AMI recall that the scale factor works by exponential values or something like that, so it's hard to control. I never use it.

What I meant in my post is not the scale factor but a normal displacement addition into the surface input, or after the stone shader. But it's a bit fickle, and I haven't used it for a while, so am not sure.
Ok, I understand. Well, it does work as a proof of concept. Additional displacement does indeed inflate some stones making the same layer vary in size depending on whites / blacks but... as you can see it also creates a full-bloom of artifacts in the remaining areas. :(
Title: Re: Preferred input for fake stone shader "scale function"?
Post by: Dune on August 28, 2019, 08:31:10 AM
I told you, it's a bit fickle ::)
Title: Re: Preferred input for fake stone shader "scale function"?
Post by: AP on August 28, 2019, 05:43:51 PM
https://planetside.co.uk/forums/index.php/topic,24257.0.html

https://planetside.co.uk/forums/index.php/topic,4484.45.html