What is it that Layer Weight node's Facing output is supposed to be?

So intuitively this should be the angle between the surface normal and the direction the camera is facing, right? I would have thought it would output a linear range of values from 0° to 90° normalized to range from 0 to 1. This would be usefull. However… if that was the case if we took a color ramp node and divided it into 9 separate equal parts and then fed the output at 0.5 value as Layer Weight node’s Blend property we should get a different color every 10 degrees, correct? But it is not the case:

https://s7.postimg.org/y40n3r7e3/Capture.jpg

So what is it that Facing output is supposed to represent? Does anyone have any thoughts? Am I missing something?

This explains what it does

I have just measured some values from a colour ramp based on the facing node. I created a cylinder with 36 faces - viewed head on and applied a linear colour ramp.

This is how the values change with angle based on the setting of the Facing value


Although not linear - a setting of around 0.75 appears to give the most linear response in this graph (i.e. a 45 degree angle corresponds to the colour in the centre of the colour ramp).

Maybe it’s like the roughness setting in the new Principled shader - in that you need to take the square root. So if you want an exact 50:50 split in the colour ramp - you need to take the square root of the half way point (i.e. 0.5). This would correspond to a Facing value of 0.707.

Yeah. :smiley: So still what is Facing value range supposed to represent? It’s not linear. Yes it does what it says. 0 is one, 1 is another, what is inbetween is what interests me.

“The formula is IOR = 1/(1 - blend) – brecht May 1 '15 at 9:31” What IOR? Layer weight assumes some random IOR value is it 1.45? Is it just me, or is this not making a whole lot of sense in terms of a usable intuitive value?

almost the opposite of Fresnel
Face means face in direct view of camera

Fresnel deal with faces not in line with camera !

happy cl

Try putting the value 0.70710678 into the facing value of your scene in the OP - does this make the colours match your 10 degree increments?

We are slowly getting there but, no 0.70710678 is not working.

OK, so Facing seems to be the same as inverted dot product of incoming and normal. Incoming and normal vectors are normalised so is that cos of the angle?

how abut this one

LayerWeight-> Facing yields a (1 - dot(normal, incoming)). Dotproduct is a cosine of the angle between those vectors,

happy cl

1 Like

I think you should get a much correct response if you are in orthographic view, or if you put the camera far far away with a large focal.

paolo

The sample image is with orthographic camera, changing it to perspective with high focal lenght does not produce different results.

If I take the output and invert it and then take arccos of it it does not match the degrees still.

Sorry, I was deceived by the camera visible in the viewport.

Something wrong with the formula IOR = 1/(1 - blend), when blend = 1 you get NaN.

paolo

Not really.

If blend is equal to 1, then your formula is

IOR = 1/(1-1)

IOR = 1/(0)

The NaN is a divide by zero error

no texture so only one mat on your object!

try to add a gradient and a mapping node and it should work

happy cl

Lost you. Could you expand on what you meant?

Here is the test scene.

Oh, OK, I have not used this hosting before maybe use disposable webmail to get the download link…

Sorry moony, it’s because of the hot weather today here in town driving me nuts, or are you kidding me?

paolo

like this

happy bl

I would like to kindly remind you the title of the thread:
What is it that Layer Weight node’s Facing output is supposed to be?

I just think that having the Facing values as a range of angles would be far more intuitive to work with when making effects such as custom fresnel curve with nodes (it’s too subtle of an effect to make a difference, but still) or to use it to achieve effects like micro roughness. That’s why I am interested in what the values represent numerically. I would like to convert Facing output to a linear range of angles, however as far it seems it is unclear what the current values are supposed to be.