From aa5a643e3b32449cb287bb0c5bb6735cd4f3803b Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 16 Jun 2016 17:31:17 +0200 Subject: [PATCH] Fix incorrect multiplication order of TBN matrix (Bug #3440) --- files/shaders/parallax.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/shaders/parallax.glsl b/files/shaders/parallax.glsl index 52ea0d2cc..097a59ed1 100644 --- a/files/shaders/parallax.glsl +++ b/files/shaders/parallax.glsl @@ -1,8 +1,8 @@ #define PARALLAX_SCALE 0.04 #define PARALLAX_BIAS -0.02 -vec2 getParallaxOffset(vec3 eyeDir, mat3 tbn, float height) +vec2 getParallaxOffset(vec3 eyeDir, mat3 tbnTranspose, float height) { - vec3 TSeyeDir = normalize((vec4(normalize(tbn * eyeDir),0)).xyz); + vec3 TSeyeDir = normalize(eyeDir * tbnTranspose); return TSeyeDir.xy * ( height * PARALLAX_SCALE + PARALLAX_BIAS ); }