Planetside Software Forums

General => Terragen Discussion => Topic started by: N-drju on October 31, 2016, 06:36:58 PM

Title: SSS as a mask... and not at the same time
Post by: N-drju on October 31, 2016, 06:36:58 PM
Okay, so here's a million dollar question, not very different from the idea behind quantum superposition... :P

I need, a fractal terrain restrained with a simple shape shader. BUT! I also need a canyon running through that masked terrain which will use some kind of inverted mask, cutting the elevation back to zero. SSS does not have mask plug, so I cannot exclude a part of it in any way! How can I do such thing and have two masks contradicting each other? :-\
Title: Re: SSS as a mask... and not at the same time
Post by: Oshyan on October 31, 2016, 11:17:36 PM
Can't you just use a Merge shader?

- Oshyan
Title: Re: SSS as a mask... and not at the same time
Post by: bobbystahr on November 01, 2016, 01:05:13 AM
Quote from: Oshyan on October 31, 2016, 11:17:36 PM
Can't you just use a Merge shader?

- Oshyan

Yeah the Subtract should work...rendering now or I'd try
Title: Re: SSS as a mask... and not at the same time
Post by: Dune on November 01, 2016, 03:22:45 AM
That is very simple; just mask the fractal by that SSS, then add a surface layer with the canyon mask, and set smoothing. The terrain will drop (or rise) to zero. In the latter case, you can use the displacement offset to level it to the way you need it. In order to have it work correctly without using the offset, it's best to use the colors of the fractal to only displace the terrain upwards.
But a subtract of masks would work, and also a black canyon mask after the white terrain mask.
Title: Re: SSS as a mask... and not at the same time
Post by: N-drju on November 01, 2016, 04:32:44 AM
I'm sorry to say that but none of the solutions you offered seem to do the trick. :(

@ Dune - I think it's my fault - I should have probably mentioned that I am using a fractal warp shader too with large values (25) in order to automatically wind the canyon. Now, I thought that the solution might be similar to what we have discussed while flattening and elevating parts of the terrain. However, if we use your solution with fractal warp present, then it creates some unwanted effects. See the image.

[attach=1]

How can we repair this?

@ Bobby, Oshyan - I am rather puzzled by the fact that merge shader does not do anything at all... I'm not sure if I set everything up correctly. Would you mind taking a look at it? Only the main SSS seems to be "read" by the program.

[attach=2]

And this is what I am after. But it's done with a "planetwide" fractal terrain:

[attach=3]
Title: Re: SSS as a mask... and not at the same time
Post by: N-drju on November 01, 2016, 05:12:16 AM
Got it! :D

After some tweaking and messing around with the node network I finally got the effects I needed. I employed surface shader as Ulco suggested but got the order of the nodes right only later. Attached is one of the solutions for the "mask superposition" problem. ;) Taken into account is also the cool effect of the fractal warping that is crucial for the canyon itself. This option removes all the terrible terrain features as well.

[attach=1]

Still, do provide your insights as to why the merge shader is not behaving as it should. It just doesn't seem right to me. ???
Title: Re: SSS as a mask... and not at the same time
Post by: Dune on November 01, 2016, 07:07:34 AM
Yes, that linking was the idea. But I would use the fractal warp shader, but a normal warp and vector displacement for more control. Add the fractal warp later (if necessary) with smaller effect.

The merge shader is using both displacement and a mask, as far as I can see, but you only mix displacement.....
Title: Re: SSS as a mask... and not at the same time
Post by: N-drju on November 01, 2016, 08:03:48 AM
Hm, yes I notice that my canyon always takes the same "path" so to say. So how can I modify it to be able to pick random paths? I'm not sure how to use normal warp and vector displacement. :( I understand that this might be key to "randomness"?
Title: Re: SSS as a mask... and not at the same time
Post by: Dune on November 01, 2016, 11:30:52 AM
I made you something quick  ;) Change the fractals seed and you've got another valley.
Title: Re: SSS as a mask... and not at the same time
Post by: N-drju on November 02, 2016, 03:54:54 AM
Wow, thank you so much for going through all that trouble for me Ulco. :( I'm downloading now, and will perform some experiments during weekend. Very appreciative of your help!
Title: Re: SSS as a mask... and not at the same time
Post by: Dune on November 02, 2016, 08:34:32 AM
It's only 30 seconds of 'work'  ;)
Title: Re: SSS as a mask... and not at the same time
Post by: N-drju on November 02, 2016, 01:27:10 PM
And I couldn't crack it for 30 minutes! :D :D