From f1fe9a0286a3d2db63b4914335bc44a338cee3c1 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 15 Dec 2018 10:02:57 +0100 Subject: [PATCH] - fix vanilla light mode angle calculation --- wadsrc/static/shaders/glsl/main.fp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wadsrc/static/shaders/glsl/main.fp b/wadsrc/static/shaders/glsl/main.fp index 8f5bb1fb6..e6ec4c63f 100644 --- a/wadsrc/static/shaders/glsl/main.fp +++ b/wadsrc/static/shaders/glsl/main.fp @@ -126,9 +126,9 @@ float R_WallColormap(float lightnum, float z) { // R_ScaleFromGlobalAngle calculation float projection = 160.0; // projection depends on SCREENBLOCKS!! 160 is the fullscreen value - vec3 line_v1 = pixelpos.xyz; // in vanilla this is the first curline vertex - vec3 line_normal = vWorldNormal.xyz; - float texscale = projection * clamp(dot(normalize(uCameraPos.xyz - line_v1), line_normal), 0.0, 1.0) / z; + vec2 line_v1 = pixelpos.xz; // in vanilla this is the first curline vertex + vec2 line_normal = vWorldNormal.xz; + float texscale = projection * clamp(dot(normalize(uCameraPos.xz - line_v1), line_normal), 0.0, 1.0) / z; float lightz = clamp(16.0 * texscale, 0.0, 47.0);