Files
filament/shaders/src/common_shading.fs
Romain Guy 35959b547c Use unnormalized vectors to compute bump mapping. (#1813)
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).
2019-10-29 09:41:15 +00:00

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