Fake stone woes

Started by sboerner, February 18, 2020, 11:28:36 PM

Previous topic - Next topic

sboerner

Is there a way to prevent a layer of fake stones from picking up underlying displacements? Before I continue to beat my head against this wall I thought I'd check to see if this is even achievable. 
 
I'd like the cracks to be limited to the underlying floor, with the fake stones overlaying them. Possible?

Right now the stones are on a lateral line that begins at the floor base (no displacements) then goes through a tex coords node, the fss, and hooks back into the main line as a child to the final surface layer.

bobbystahr

be helpful to see the .tgd
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

WAS

I've heard smoothing the surface helps, but I've never seen this for me...

The best I've seen is clever masking.

See example FS usage I whipped up for you for this sort of scenario. The issue with masking out disps down to the base surface is the buildup around FS being hard. You'll want a surface that is relatively flat. If there is high disp, you may try just the Displacement to Scalar with a colour adjustment to get some soft boundaries.

Tangled-Universe

Yes you'd need the smoothing function in the surface layer for that.

1) merge your multiple fake stones with a merge shader set to 0.5 and mode in "highest" (seems you did that already)
2) connect final merge to the child layer input port of a surface layer
3) this surface layer is after the compute terrain node
4) enable smoothing in the smoothing tab of the surface layer
5) additionally you can mask the surface layer with your surface crack functions and invert that to avoid having stones very close to the cracks
6) this surface layer now also controls your slope/altitude restrictions for all those fake stones, very handy!

Dune

That is indeed the 'standard' and best way, but I often don't like all previous fine displacements being smoothed. So masking the specific stone areas would help to limit the smoothing, or add finer ground displacements later (masking out the stones again). Fake stones and fine soil are difficult combinations. Also when not using a compute terrain.

cyphyr

#5
Unless I'm missing something in your question simplest way would be to take a mask from the FSS and apply it (inverted) to the cracks.
FSS_masked_Cracks.JPG
FSS_masked_Cracks.tgd
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Hannes

Cool, Richard! I'm not able to test your file at the moment, so just a little question: which functions do the color adjust shaders in your setup have? Is it for inverting?

cyphyr

#7
They are for inverting and removing the texture that is applied to the FSS so it can be used as a clean mask.
There is probably a better way of doing this but the coffee hasn't kicked in yet ...!

maybe this ...
FSS_masked_Cracks_2.JPG
FSS_masked_Cracks_2.tgd
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Dune

I do this by just using a color adjust and setting white point way down to eliminate all color hues. Rough, but simple.

Tangled-Universe

Quote from: Dune on February 19, 2020, 03:25:45 AMThat is indeed the 'standard' and best way, but I often don't like all previous fine displacements being smoothed. So masking the specific stone areas would help to limit the smoothing, or add finer ground displacements later (masking out the stones again). Fake stones and fine soil are difficult combinations. Also when not using a compute terrain.
You can reduce the smoothing value to retain some of the finer displacements, but it will probably also inherit the larger displacements as well as it's basically a mixing factor for smoothed and unsmoothed.
Therefore I usually set smoothing at 1 and then use the input ports for surface shading on the fake stones to add the displacements unique for the stones.

Quote from: Dune on February 19, 2020, 05:26:56 AMI do this by just using a color adjust and setting white point way down to eliminate all color hues. Rough, but simple.
Yeah I do that too. Using a boolean NOT scalar can work as well, even rougher/more bold.

Richard's method is a bit more controlable...When I started doing this I used colour adjust shaders instead of bias scalars. Matter of preference I guess.

cyphyr

I started with colour adjust shaders but I figured that if the FSS had a weird extreme shader applied to it then merely ramping the colour may not be enough and may lead to some unexpected masking errors.

Using a displacement to scalar and then ramping that with a bias function eliminates any interference from the colour part of the surface shader.
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Dune

You're absolutely right. It comes down to how obvious the interference of colors is. And for very dark colored stones a mere color adjust may not be enough.

Tangled-Universe

Quote from: cyphyr on February 19, 2020, 07:03:39 AMI started with colour adjust shaders but I figured that if the FSS had a weird extreme shader applied to it then merely ramping the colour may not be enough and may lead to some unexpected masking errors.

Using a displacement to scalar and then ramping that with a bias function eliminates any interference from the colour part of the surface shader.

I forgot to mention I used a colour to greyscsale colour shader before the colour adjust, but that only mitigates a part of the problem you mention.
This was all pre-displacement-to-scalar era where I had to find tricks to make it work.
But yes, you're absolutely right and displacement shader to scalar gives best results.

WAS

Scalar to Boolean, in the example I posted cuts out the need for colour adjusts, or bias, etc. It will only be 1 for any data or 0 for none, so you get a defined mask of the stones.

If you are having color pickup issues, see also the color continuity fix for fake stones in the same file.

sboerner

Wow, thanks everyone. I hadn't had a chance to check this thread before now and appreciate the interest and many suggestions.

Briefly, though (and I should have mentioned this), I did try masking the FSS and sending it through a color adjust node. The problem seems to be that in addition to normal displacements the floor is also displaced horizontally with a redirect. So when the masks were applied everything more or less exploded.  :-\

The redirected displacements are only needed to add detail to the vertical face of a shelf on the floor (not shown in this frame). Hmm. I wonder if I can constrain those by altitude or slope so they don't affect the horizontal surfaces.

I'll be going through everyone's posts more carefully when I have time later today and will try a few things. If I'm still stuck I'll put together a simplified tgd and post it.

Thanks again. This is such a great forum.