If we assume the tangents and bitangents were generated using mikktspace, we should use the unnormalized vectors, as indicated at mikktspace.com or in http://www.metalliandy.com/mikktspace/downloads/mikktspace/mikktspace.h (see last comment at the end of the file).
14 lines
819 B
GLSL
14 lines
819 B
GLSL
// These variables should be in a struct but some GPU drivers ignore the
|
|
// precision qualifier on individual struct members
|
|
highp mat3 shading_tangentToWorld; // TBN matrix
|
|
highp vec3 shading_position; // position of the fragment in world space
|
|
vec3 shading_view; // normalized vector from the fragment to the eye
|
|
vec3 shading_normal; // normalized transformed normal, in world space
|
|
vec3 shading_geometricNormal; // normalized geometric normal, in world space
|
|
vec3 shading_reflected; // reflection of view about normal
|
|
float shading_NoV; // dot(normal, view), always strictly >= MIN_N_DOT_V
|
|
|
|
#if defined(MATERIAL_HAS_CLEAR_COAT)
|
|
vec3 shading_clearCoatNormal; // normalized clear coat layer normal, in world space
|
|
#endif
|