Merge pull request #82892 from clayjohn/tangent-binormal-transform

Only perform modelview transform on tangent and binormal when vertex shader is in local space
This commit is contained in:
Rémi Verschelde 2023-10-06 12:53:05 +02:00
commit c05f521e16
No known key found for this signature in database
GPG Key ID: C3336907360768E1
3 changed files with 3 additions and 6 deletions

View File

@ -417,13 +417,12 @@ void main() {
normal = modelview_normal * normal;
#endif
#endif
#if defined(TANGENT_USED) || defined(NORMAL_MAP_USED) || defined(LIGHT_ANISOTROPY_USED)
binormal = modelview_normal * binormal;
tangent = modelview_normal * tangent;
#endif
#endif // !defined(SKIP_TRANSFORM_USED) && !defined(VERTEX_WORLD_COORDS_USED)
// Using world coordinates
#if !defined(SKIP_TRANSFORM_USED) && defined(VERTEX_WORLD_COORDS_USED)

View File

@ -411,13 +411,12 @@ void vertex_shader(vec3 vertex_input,
normal = modelview_normal * normal;
#endif
#endif
#ifdef TANGENT_USED
binormal = modelview_normal * binormal;
tangent = modelview_normal * tangent;
#endif
#endif // !defined(SKIP_TRANSFORM_USED) && !defined(VERTEX_WORLD_COORDS_USED)
//using world coordinates
#if !defined(SKIP_TRANSFORM_USED) && defined(VERTEX_WORLD_COORDS_USED)

View File

@ -408,13 +408,12 @@ void main() {
normal = modelview_normal * normal;
#endif
#endif
#if defined(TANGENT_USED) || defined(NORMAL_MAP_USED) || defined(LIGHT_ANISOTROPY_USED)
binormal = modelview_normal * binormal;
tangent = modelview_normal * tangent;
#endif
#endif // !defined(SKIP_TRANSFORM_USED) && !defined(VERTEX_WORLD_COORDS_USED)
//using world coordinates
#if !defined(SKIP_TRANSFORM_USED) && defined(VERTEX_WORLD_COORDS_USED)