1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-11 18:00:34 +00:00

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

View File

@ -890,7 +890,7 @@ void enable_raycaster() {
#ifndef GLES_ONLY #ifndef GLES_ONLY
fmain += 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"; " gl_FragDepth = (gl_FragDepth + 1.) / 2.;\n";
#endif #endif