summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/renderergl2/glsl/lightall_fp.glsl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/renderergl2/glsl/lightall_fp.glsl b/src/renderergl2/glsl/lightall_fp.glsl
index 51e4634f..b937483e 100644
--- a/src/renderergl2/glsl/lightall_fp.glsl
+++ b/src/renderergl2/glsl/lightall_fp.glsl
@@ -332,8 +332,8 @@ void main()
#endif
#if defined(USE_DELUXEMAP)
- L = (2.0 * texture2D(u_DeluxeMap, var_TexCoords.zw).xyz - vec3(1.0));
- L = L * u_EnableTextures.y + var_LightDir.xyz;
+ L = texture2D(u_DeluxeMap, var_TexCoords.zw).xyz - vec3(0.5);
+ L = L * u_EnableTextures.y + var_LightDir.xyz;
#elif defined(USE_LIGHT) && !defined(USE_FAST_LIGHT)
L = var_LightDir.xyz;
#endif
@@ -378,12 +378,12 @@ void main()
#if defined(USE_LIGHT) && !defined(USE_FAST_LIGHT)
#if defined(USE_NORMALMAP)
#if defined(SWIZZLE_NORMALMAP)
- N.xy = 2.0 * texture2D(u_NormalMap, texCoords).ag - vec2(1.0);
+ N.xy = texture2D(u_NormalMap, texCoords).ag - vec2(0.5);
#else
- N.xy = 2.0 * texture2D(u_NormalMap, texCoords).rg - vec2(1.0);
+ N.xy = texture2D(u_NormalMap, texCoords).rg - vec2(0.5);
#endif
N.xy *= u_EnableTextures.x;
- N.z = sqrt(1.0 - clamp(dot(N.xy, N.xy), 0.0, 1.0));
+ N.z = sqrt(0.25 - dot(N.xy, N.xy));
N = normalize(tangentToWorld * N);
#else
N = normalize(var_Normal.xyz);