fixed a bug in gl_FragDepth computation in raycaster

This commit is contained in:
Zeno Rogue 2020-05-16 11:16:24 +02:00
parent 823fb3a0e6
commit 0cb4914ac9
1 changed files with 1 additions and 1 deletions

View File

@ -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