Merge pull request #65130 from BastiaanOlij/fix_mobile_signed_tangent

Fix vector type for signed tangent in mobile shader
This commit is contained in:
Rémi Verschelde 2022-08-31 09:12:31 +02:00 committed by GitHub
commit c40855f818
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -240,7 +240,7 @@ void main() {
#endif #endif
#if defined(TANGENT_USED) || defined(NORMAL_MAP_USED) || defined(LIGHT_ANISOTROPY_USED) #if defined(TANGENT_USED) || defined(NORMAL_MAP_USED) || defined(LIGHT_ANISOTROPY_USED)
vec3 signed_tangent_attrib = tangent_attrib * 2.0 - 1.0; vec2 signed_tangent_attrib = tangent_attrib * 2.0 - 1.0;
vec3 tangent = oct_to_vec3(vec2(signed_tangent_attrib.x, abs(signed_tangent_attrib.y) * 2.0 - 1.0)); vec3 tangent = oct_to_vec3(vec2(signed_tangent_attrib.x, abs(signed_tangent_attrib.y) * 2.0 - 1.0));
float binormalf = sign(signed_tangent_attrib.y); float binormalf = sign(signed_tangent_attrib.y);
vec3 binormal = normalize(cross(normal, tangent) * binormalf); vec3 binormal = normalize(cross(normal, tangent) * binormalf);