Can anyone explain why this color is purple?

So I’m fairly new with Shaders and Shader Graph, right now I’m doing a combination of tutorials and experimenting.

I’ working on trying to lerp colors and textures and I keep coming across this result:

So here I’m trying to lerp between grey and green based on an object’s normal vector. Why is it turning purple though? I cannot figure this out.

When I switch out the colors for textures I have the same thing happening. I’d really appreciate some help with this!

Lerp is not clamping values, so it overshoots. You need to clamp it between 0 and 1 if you want to get expected result.
Or remap [-1, 1] to [0, 1] as this is what you are going to get from normal vector.
BTW, inverse lerp might work not how you expect.

1 Like

Not sure what you mean about the inverse lerp not working how I expect, but the clamping did the trick! Thanks so much!

1 Like