From 0cb4914ac9fb8c23d95c083569339e7d642c188f Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 16 May 2020 11:16:24 +0200 Subject: [PATCH] fixed a bug in gl_FragDepth computation in raycaster --- raycaster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raycaster.cpp b/raycaster.cpp index e7e191d7..d311dfa5 100644 --- a/raycaster.cpp +++ b/raycaster.cpp @@ -890,7 +890,7 @@ void enable_raycaster() { #ifndef GLES_ONLY fmain += - " gl_FragDepth = (" + to_glsl(-vnear+vfar)+"+w*" + to_glsl(2*vnear*vfar)+"/z)/" + to_glsl(vnear-vfar)+";\n" + " gl_FragDepth = (" + to_glsl(-vnear-vfar)+"+w*" + to_glsl(2*vnear*vfar)+"/z)/" + to_glsl(vnear-vfar)+";\n" " gl_FragDepth = (gl_FragDepth + 1.) / 2.;\n"; #endif