Started by uuderzo, June 17, 2020, 06:25:45 am

#### uuderzo

##### June 17, 2020, 06:25:45 am
Just curious.

Is there a reason of missing heading range parameter in the surface shader node?
It should be quite natural thinking of it when dealing with snow on northern side of a peak an so on.
Instead, a complex network of nodes is required to do the computation based on surface normals.

Just curious.

#### Hetzen

##### June 17, 2020, 07:17:17 am #1
Actually, it's a lot easier than you think.

Connect a Get Normal in Texture into the input of a Dot Product node, then connect a Constant Vector to the other input. In the Constant Vector set the direction you want to mask, so 0,0,-1 for south, and the Dot Product will output white on the surface facing that direction.

#### uuderzo

##### June 17, 2020, 07:45:42 am #2
I already tried this but i suspect that the output of the dot product is not directly usable as a colour.

Thank you!

#### uuderzo

##### June 17, 2020, 08:45:51 am #3
Just for better understanding of the mechanics...

If i would (just for knowledge) like to plug the dot product (which produces a scalar number) into an input color such as the Planet surface shader input, how should i operate?

#### WAS

##### June 17, 2020, 01:56:53 pm #4
Quote from: uuderzo on June 17, 2020, 08:45:51 amJust for better understanding of the mechanics...

If i would (just for knowledge) like to plug the dot product (which produces a scalar number) into an input color such as the Planet surface shader input, how should i operate?

You can apply colour, but because it's a scalar, the "black" is data as well, and will overlay onto the terrain. So it is really best to use it as a mask, and use a surface layer for colour, as you'd still need to mask out the black.

Here is a example using it as a mask of surface layer colour, and also example of colourizing the scalar and using it as input as well.

#### uuderzo

##### June 18, 2020, 02:51:18 am #5
Ok, more or less i got it.

I have only one dubt about directly plugging your "Clamp 0 1 colour 01" node (that should be a legal color) into the "Planet 01" node.
I'd expect to get the surface diffusion color in preview, without the shading due to the light, that should be provided by the surface shader.
Instead, i obtain a flat black render.

Is this because the correct perspective projection of the color function is performed by the shader node? And without this node there is no projection matrix information?

#### WAS

##### June 19, 2020, 01:23:18 pm #6
Clamp 01 Colour is just the scalar, colorized. There is no displacement data, etc, and everything that is not red (a south facing slope) will be black. So yes, it would need to be applied to a surface layer that is applying the effect as a surface to your displacement chain.