break;
case RENDERPATH_GL20:
case RENDERPATH_GLES2:
+ if (vid_multisampling.integer)
+ {
+ if (gl_state.alphatest && r_transparent_alphatocoverage.integer)
+ qglEnable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);
+ else
+ qglDisable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);
+ CHECKGLERROR
+ }
break;
}
}
matrix4x4_t tempmatrix;
r_waterstate_waterplane_t *waterplane = (r_waterstate_waterplane_t *)surfacewaterplane;
if (rsurface.texture->currentmaterialflags & MATERIALFLAG_ALPHATEST)
- permutation |= SHADERPERMUTATION_ALPHAKILL;
- // Alpha to Coverage
- // fixme: move to gl_backend
- if (vid_multisampling.integer && r_transparent_alphatocoverage.integer)
{
- if (rsurface.texture->currentmaterialflags & MATERIALFLAG_ALPHATEST)
- {
- qglEnable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);CHECKGLERROR
- }
- else
- {
- qglDisable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);CHECKGLERROR
- }
+ permutation |= SHADERPERMUTATION_ALPHAKILL;
+ GL_AlphaTest(true);
}
+ else
+ GL_AlphaTest(false);
if (rsurface.texture->r_water_waterscroll[0] && rsurface.texture->r_water_waterscroll[1])
permutation |= SHADERPERMUTATION_NORMALMAPSCROLLBLEND; // todo: make generic
if (rsurfacepass == RSURFPASS_BACKGROUND)
CHECKGLERROR
R_Mesh_ResetTextureState();
GL_BlendFunc(GL_ONE, GL_ZERO);
+ GL_AlphaTest(false);
GL_DepthRange(0, 1);
GL_PolygonOffset(r_refdef.polygonfactor, r_refdef.polygonoffset);
GL_DepthTest(true);
GL_DepthMask(false);
GL_Color(0, 0, 0, 1);
GL_Scissor(r_refdef.view.viewport.x, r_refdef.view.viewport.y, r_refdef.view.viewport.width, r_refdef.view.viewport.height);
-
+
r_shadow_rendermode = R_SHADOW_RENDERMODE_NONE;
if (gl_ext_separatestencil.integer && vid.support.ati_separate_stencil)