SSS as a mask... and not at the same time

Started by N-drju, October 31, 2016, 06:36:58 PM

Previous topic - Next topic

N-drju

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? :-\
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Oshyan


bobbystahr

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
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Dune

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.

N-drju

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]
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

N-drju

#5
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. ???
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Dune

#6
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.....

N-drju

#7
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"?
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Dune

I made you something quick  ;) Change the fractals seed and you've got another valley.

N-drju

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!
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Dune


N-drju

"This year - a factory of semiconductors. Next year - a factory of whole conductors!"