From bb28d7fd0e7d54d2f4ac5a35254205ea369c7004 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 21 Sep 2025 20:37:01 +0200 Subject: [PATCH] Update normalmap.fs --- .../shaders/resources/shaders/glsl100/normalmap.fs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl100/normalmap.fs b/examples/shaders/resources/shaders/glsl100/normalmap.fs index 197e81ed1..a1b992811 100644 --- a/examples/shaders/resources/shaders/glsl100/normalmap.fs +++ b/examples/shaders/resources/shaders/glsl100/normalmap.fs @@ -23,20 +23,20 @@ uniform float specularExponent; void main() { - vec4 texelColor = texture(texture0, vec2(fragTexCoord.x, fragTexCoord.y)); + vec4 texelColor = texture2D(texture0, vec2(fragTexCoord.x, fragTexCoord.y)); vec3 specular = vec3(0.0); vec3 viewDir = normalize(viewPos - fragPosition); vec3 lightDir = normalize(lightPos - fragPosition); - vec3 normal; + vec3 normal = vec3(0.0); if (useNormalMap) { - normal = texture(normalMap, vec2(fragTexCoord.x, fragTexCoord.y)).rgb; + normal = texture2D(normalMap, vec2(fragTexCoord.x, fragTexCoord.y)).rgb; - //Transform normal values to the range -1.0 ... 1.0 + // Transform normal values to the range -1.0 ... 1.0 normal = normalize(normal*2.0 - 1.0); - //Transform the normal from tangent-space to world-space for lighting calculation + // Transform the normal from tangent-space to world-space for lighting calculation normal = normalize(normal*TBN); } else @@ -56,7 +56,7 @@ void main() specular += specCo; - finalColor = (texelColor*((tint + vec4(specular, 1.0))*vec4(lightDot, 1.0))); + vec4 finalColor = (texelColor*((tint + vec4(specular, 1.0))*vec4(lightDot, 1.0))); finalColor += texelColor*(vec4(1.0, 1.0, 1.0, 1.0)/40.0)*tint; // Gamma correction