From caa1348f9478fcd834a1fdcbafed7cccf6b582e2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 8 Nov 2021 15:31:07 +0200 Subject: [PATCH] Tweak eye position calculation in shaders --- shaderlib/common.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shaderlib/common.glsl b/shaderlib/common.glsl index b83ff380..481d86c4 100644 --- a/shaderlib/common.glsl +++ b/shaderlib/common.glsl @@ -47,7 +47,7 @@ void standard_transform() vec3 world_binormal = cross(world_normal, world_tangent); out mat3 world_tbn_matrix = mat3(world_tangent, world_binormal, world_normal); - vec3 eye_pos = (inverse(eye_world_matrix)*vec4(0.0, 0.0, 0.0, 1.0)).xyz; + vec3 eye_pos = world_eye_matrix[3].xyz; out vec3 world_look_dir = normalize(world_vertex.xyz-eye_pos); out float fog_coord = eye_vertex.z; -- 2.45.2