diff --git a/engine/gl/gl_backend.c b/engine/gl/gl_backend.c index 130b1c0e6..c1ba3fca5 100644 --- a/engine/gl/gl_backend.c +++ b/engine/gl/gl_backend.c @@ -2383,7 +2383,7 @@ static void BE_SendPassBlendDepthMask(unsigned int sbits) } #ifdef GL_ALPHA_TEST //alpha test doesn't exist in gles2 - if (delta & SBITS_ATEST_BITS) + if ((delta & SBITS_ATEST_BITS) && !gl_config.nofixedfunc) { switch (sbits & SBITS_ATEST_BITS) { diff --git a/engine/gl/gl_model.c b/engine/gl/gl_model.c index d0652eea4..48dc6e004 100644 --- a/engine/gl/gl_model.c +++ b/engine/gl/gl_model.c @@ -4383,7 +4383,11 @@ void * RMod_LoadSpriteFrame (void * pin, mspriteframe_t **ppframe, int framenum, Q_strncatz(name, va("_%i.tga", framenum), sizeof(name)); pspriteframe->shader = R_RegisterShader(name, "{\n" - "program defaultsprite\n" + "if gl_blendsprites\n" + "program defaultsprite\n" + "else\n" + "program defaultsprite#MASK=1\n" + "endif\n" "{\n" "map $diffuse\n" "alphafunc ge128\n" diff --git a/engine/gl/r_bishaders.h b/engine/gl/r_bishaders.h index a214863bc..bb8a0fcfd 100644 --- a/engine/gl/r_bishaders.h +++ b/engine/gl/r_bishaders.h @@ -860,7 +860,12 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND "uniform vec4 e_colourident;\n" "void main ()\n" "{\n" -"gl_FragColor = fog4blend(texture2D(s_t0, tc) * vc * e_colourident);\n" +"vec4 col = texture2D(s_t0, tc);\n" +"#ifdef MASK\n" +"if (col.a < 0.5)\n" +"discard;\n" +"#endif\n" +"gl_FragColor = fog4blend(col * vc * e_colourident);\n" "}\n" "#endif\n" }, diff --git a/engine/qclib/pr_edict.c b/engine/qclib/pr_edict.c index 6b92522c7..8057c0e6d 100644 --- a/engine/qclib/pr_edict.c +++ b/engine/qclib/pr_edict.c @@ -529,7 +529,7 @@ char *PR_ValueString (progfuncs_t *progfuncs, etype_t type, eval_t *val) } break; case ev_field: - fielddef = ED_FieldAtOfs (progfuncs, val->_int ); + fielddef = ED_FieldAtOfs (progfuncs, val->_int + progfuncs->funcs.fieldadjust); if (!fielddef) sprintf (line, ".??? (%i)", val->_int); else diff --git a/engine/shaders/glsl/defaultsprite.glsl b/engine/shaders/glsl/defaultsprite.glsl index c9850e9ea..f2adb6d25 100644 --- a/engine/shaders/glsl/defaultsprite.glsl +++ b/engine/shaders/glsl/defaultsprite.glsl @@ -22,6 +22,11 @@ varying vec4 vc; uniform vec4 e_colourident; void main () { - gl_FragColor = fog4blend(texture2D(s_t0, tc) * vc * e_colourident); + vec4 col = texture2D(s_t0, tc); +#ifdef MASK + if (col.a < 0.5) + discard; +#endif + gl_FragColor = fog4blend(col * vc * e_colourident); } #endif