I'm creating a custom lighting shader using the Unity Shader Graph and I want to add support for normal maps. I've read a bit and from what I understand I need to transform my normal map from tangent space to world space. I've watched this video , where around 8:00 mark there is a formula for calculating this: Red * Tangent + Green * Bitangent + Blue * Normal
. I've tried to recreate it like this:
And here is how the normal is read:
This issue is that it doesn't seem to work. The normals are correct only if the object has no rotation (look at the position of the reflections):
However if I rotate it upside down the lighting is also upside down:
What am I doing wrong?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.