mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
panini: fix shader-primitvie cooperation
This commit is contained in:
parent
fd9fb83540
commit
c88827c09f
@ -1096,11 +1096,12 @@ void enable_raycaster() {
|
|||||||
" if(col.w == 1.) {\n";
|
" if(col.w == 1.) {\n";
|
||||||
|
|
||||||
if(hyperbolic) fmain +=
|
if(hyperbolic) fmain +=
|
||||||
" mediump float z = at0.z * sinh(go);\n"
|
" mediump vec4 t = at0 * sinh(go);\n";
|
||||||
" mediump float w = 1.;\n";
|
|
||||||
else fmain +=
|
else fmain +=
|
||||||
" mediump float z = at0.z * go;\n"
|
" mediump vec4 t = at0 * go;\n";
|
||||||
" mediump float w = 1.;\n";
|
|
||||||
|
fmain +=
|
||||||
|
" t.w = 1.;\n";
|
||||||
|
|
||||||
if(levellines) {
|
if(levellines) {
|
||||||
if(hyperbolic)
|
if(hyperbolic)
|
||||||
@ -1109,11 +1110,13 @@ void enable_raycaster() {
|
|||||||
fmain += "gl_FragColor.xyz *= 0.5 + 0.5 * cos(z * uLevelLines * 2. * PI);\n";
|
fmain += "gl_FragColor.xyz *= 0.5 + 0.5 * cos(z * uLevelLines * 2. * PI);\n";
|
||||||
fsh += "uniform mediump float uLevelLines;\n";
|
fsh += "uniform mediump float uLevelLines;\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(panini_alpha)
|
||||||
|
fmain += panini_shader();
|
||||||
|
|
||||||
#ifndef GLES_ONLY
|
#ifndef GLES_ONLY
|
||||||
/* todo: fix for Panini */
|
|
||||||
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)+"+t.w*" + to_glsl(2*vnear*vfar)+"/t.z)/" + to_glsl(vnear-vfar)+";\n"
|
||||||
" gl_FragDepth = (gl_FragDepth + 1.) / 2.;\n";
|
" gl_FragDepth = (gl_FragDepth + 1.) / 2.;\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user