Tangent Space Normals in Material Editor

Please, let me know if what I think here is correct or not!

There’s not much technical documentation so I guess it’s all trying.

  • We connect a normal map in the Normal plug in the Material Editor and it’s expressed in Tangent Space (as commonly happens),
  • Its values are compressed, because it expects colors from a texture, so it’s (0,1) instead of vectors (-1,1)
  • Its values are purple looking, meaning normal (0,0,1) → (0.5, 0.5, 1) (bluish)
  • That makes me think the normal vector is Z , equals to UP vector in Unreal.

Ok. I test this on a plane in the material editor. I try to get a fake semi-sphere on it. Just the normal and a basic color, nothing like Pixel Offset or world position offset to change the orientation.

  • The z coord (normal to surface) is calculated using spherical coordinates. Should be 0.5 on the sides, 1 on UV (0,0)
  • The X coord is the tangent and should follow the U coord on the shader.
  • The Y coord is the bi-normal, and I suspect it should follow the -V* coordinate, because V coord goes top to bottom and it should be bottom (-1) to top (1).

Is all of this ok?. This is a mess, there must be something wrong because It doesn’t work.

I don’t know what spaces this expects and documentation lacks technical information. Should the tangent space follow the UE4 X(fwd), Y(right), Z(up) standard? Or some other way?

What is Unreal expecting to be passed to the Normal plug if you connect values other than a texture? World space or tangent space?

Normal input pin expects Tangent Space Normal in XY -1 to 1, Z 0 to 1 range. If you disable Tangent Space normals in material settings, Normal input pin expects World Space Normal in XYZ -1 to 1 range.

2 Likes