# Node to calculate angle to camera

I'm looking for a node that allocates a value based on the normal's angle to the camera (I've seen some people use it to fake fresnel), but I can't seem to remember what it was called, so was wondering if anyone could clue me in? Cheers.

• Perhaps Layer Weight? – lbalazscs Nov 27 '16 at 12:13
• @lbalazscs I think that's the one! – Danial Nov 27 '16 at 12:58
• You do know there is an actual Fresnel node right? – PGmath Nov 28 '16 at 14:57
• @PGmath Yeah. I'm not using it for fresnel though, and layer weight seems to be more flexible. – Danial Nov 28 '16 at 15:02

The Vector Math 'Dot Product' node takes two vectors and returns a Value based on the magnitudes of those vectors and the angle between them. If you pass this node the Normal and Incoming vectors then the result will be larger if the ray is along the normal and approach zero as it becomes more of a glancing blow. Specifically,

Dot Product = MagnitudeA x MagnitudeB x cos(angle)

So if the two vectors are Normalized (which can be ensured by passing them through a Vector Math 'Normalize' node) then the Value output by the Dot Product will simply be the Cosine of the angle between them.

This can be used to mimic the Layer Weight 'Facing' node as follows : Or you can emulate a Fresnel effect by including a Power Math node : Varying the inputs or manipulating the Vectors can achieve effects not normally possible with the standard 'Fresnel' and 'Layer Weight' input nodes.