Skip to content

Commit

Permalink
Only perform modelview transform on tangent and binormal when vertex …
Browse files Browse the repository at this point in the history
…shader is in local space
  • Loading branch information
clayjohn committed Oct 6, 2023
1 parent f2ba8ec commit af1d81d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions drivers/gles3/shaders/scene.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit af1d81d

Please sign in to comment.