Skip to content

Commit 04b9d04

Browse files
jsanmiyaa-maurice
authored andcommitted
Fix compilation bug in uber-shader for NORMALS define.
PiperOrigin-RevId: 148495415 Change-Id: I735d785afb5b0596e4187e057f6f3a42fc025116
1 parent 24fd624 commit 04b9d04

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

assets/shaders/uber_shader.glslv

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ varying vec3 vPosition;
4949
attribute vec3 aNormal;
5050
varying vec3 vNormal;
5151
#endif // PHONG_SHADING
52-
attribute vec3 aTangent;
53-
varying vec3 vTangent;
52+
attribute vec4 aTangent;
53+
varying vec4 vTangent;
5454
varying vec3 vObjectSpacePosition;
5555
varying vec3 vTangentSpaceLightVector;
56-
varying vec3 vTangentSpaceCameraVector
56+
varying vec3 vTangentSpaceCameraVector;
5757
uniform vec3 light_pos; // in object space
5858
uniform vec3 camera_pos; // in object space
5959
#endif // NORMALS
@@ -98,7 +98,7 @@ void main()
9898
vObjectSpacePosition = aPosition.xyz;
9999

100100
vec3 n = normalize(vNormal);
101-
vec3 t = normalize(vTangent);
101+
vec3 t = normalize(vTangent.xyz);
102102
vec3 b = normalize(cross(n, t)) * aTangent.w;
103103

104104
mat3 world_to_tangent_matrix = mat3(t, b, n);

0 commit comments

Comments
 (0)