Dot Product with Camera Vector Material

So I’m trying to achieve this with the dot product

https://docs.unrealengine.com/latest/images/Engine/Rendering/Materials/ExpressionReference/Math/DotProductExample.jpg

But all I’m getting is a graident if I use the camera vector with a vector parameter. What am I doing wrong?

Hi Marassassin -

The Dot product is functioning correctly as you have it plugged up. The issue is that you have a normal map plugged into the dot product so it is using the vectors described by the map to determine the first set of vectors placed into the dot product. What I think you might be after is having the normal vectors influence the dot products results after a Vertex and Camera Vector have been passed in (like in the first image above).

To that end, I would take the results of the Vertex and Camera Vector from the first image and multiply it by the red and green channels of your normal map then add the results together. This should get your the result I believe you are looking for. (See my screenshot below.)

If you are intersted or what to delve further, I would also recommend taking a look at [this website][1] for a great video on understanding how exactly the dot product works.

Thank You

Eric Ketchum

Actually what he needs to do is transform the normal map from tangent to world space.

RyanB is correct, depending on what you are ultimately looking for you can add a Transform node after your normal.

Thanks guys, I was just trying to add a glow from the middle of some lava I was creating. All of these helped me understand the DotProduct more so I really appreciate it.