@@ -23,20 +23,20 @@ uniform float specularExponent;
23
23
24
24
void main()
25
25
{
26
- vec4 texelColor = texture (texture0, vec2 (fragTexCoord.x, fragTexCoord.y));
26
+ vec4 texelColor = texture2D (texture0, vec2 (fragTexCoord.x, fragTexCoord.y));
27
27
vec3 specular = vec3 (0.0 );
28
28
vec3 viewDir = normalize (viewPos - fragPosition);
29
29
vec3 lightDir = normalize (lightPos - fragPosition);
30
30
31
- vec3 normal;
31
+ vec3 normal = vec3 ( 0.0 ) ;
32
32
if (useNormalMap)
33
33
{
34
- normal = texture (normalMap, vec2 (fragTexCoord.x, fragTexCoord.y)).rgb;
34
+ normal = texture2D (normalMap, vec2 (fragTexCoord.x, fragTexCoord.y)).rgb;
35
35
36
- // Transform normal values to the range -1.0 ... 1.0
36
+ // Transform normal values to the range -1.0 ... 1.0
37
37
normal = normalize (normal* 2.0 - 1.0 );
38
38
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
40
40
normal = normalize (normal* TBN);
41
41
}
42
42
else
@@ -56,7 +56,7 @@ void main()
56
56
57
57
specular += specCo;
58
58
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 )));
60
60
finalColor += texelColor* (vec4 (1.0 , 1.0 , 1.0 , 1.0 )/ 40.0 )* tint;
61
61
62
62
// Gamma correction
0 commit comments