From 455ca1cacf5440b8fc4030e39d0927585c056861 Mon Sep 17 00:00:00 2001 From: milek7 Date: Wed, 17 Oct 2018 21:54:03 +0200 Subject: [PATCH] shader fix --- shaders/light_common.glsl | 2 +- shaders/mat_normalmap.frag | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shaders/light_common.glsl b/shaders/light_common.glsl index 3db9c42b..2f68bbee 100644 --- a/shaders/light_common.glsl +++ b/shaders/light_common.glsl @@ -38,7 +38,7 @@ vec3 apply_fog(vec3 color) vec2 calc_light(vec3 light_dir) { #ifdef NORMALMAP - vec3 normal = f_tbn * normalize(texture(normalmap, f_coord).rgb * 2.0 - 1.0); + vec3 normal = normalize(f_tbn * normalize(texture(normalmap, f_coord).rgb * 2.0 - 1.0)); #else vec3 normal = normalize(f_normal); #endif diff --git a/shaders/mat_normalmap.frag b/shaders/mat_normalmap.frag index 94294c26..044efe34 100644 --- a/shaders/mat_normalmap.frag +++ b/shaders/mat_normalmap.frag @@ -44,7 +44,7 @@ void main() if (tex_color.a < opacity) discard; - vec3 normal = f_tbn * normalize(texture(normalmap, f_coord).rgb * 2.0 - 1.0); + vec3 normal = normalize(f_tbn * normalize(texture(normalmap, f_coord).rgb * 2.0 - 1.0)); vec3 refvec = reflect(f_pos.xyz, normal); #if ENVMAP_ENABLED vec3 envcolor = texture(envmap, refvec).rgb;