@@ -23,20 +23,20 @@ uniform float specularExponent;
2323
2424void main()
2525{
26- vec4 texelColor = texture (texture0, vec2 (fragTexCoord.x, fragTexCoord.y));
26+ vec4 texelColor = texture2D (texture0, vec2 (fragTexCoord.x, fragTexCoord.y));
2727 vec3 specular = vec3 (0.0 );
2828 vec3 viewDir = normalize (viewPos - fragPosition);
2929 vec3 lightDir = normalize (lightPos - fragPosition);
3030
31- vec3 normal;
31+ vec3 normal = vec3 ( 0.0 ) ;
3232 if (useNormalMap)
3333 {
34- normal = texture (normalMap, vec2 (fragTexCoord.x, fragTexCoord.y)).rgb;
34+ normal = texture2D (normalMap, vec2 (fragTexCoord.x, fragTexCoord.y)).rgb;
3535
36- // Transform normal values to the range -1.0 ... 1.0
36+ // Transform normal values to the range -1.0 ... 1.0
3737 normal = normalize (normal* 2.0 - 1.0 );
3838
39- // Transform the normal from tangent-space to world-space for lighting calculation
39+ // Transform the normal from tangent-space to world-space for lighting calculation
4040 normal = normalize (normal* TBN);
4141 }
4242 else
@@ -56,7 +56,7 @@ void main()
5656
5757 specular += specCo;
5858
59- finalColor = (texelColor* ((tint + vec4 (specular, 1.0 ))* vec4 (lightDot, 1.0 )));
59+ vec4 finalColor = (texelColor* ((tint + vec4 (specular, 1.0 ))* vec4 (lightDot, 1.0 )));
6060 finalColor += texelColor* (vec4 (1.0 , 1.0 , 1.0 , 1.0 )/ 40.0 )* tint;
6161
6262 // Gamma correction
0 commit comments