mirror of
https://github.com/ioquake/ioq3.git
synced 2025-05-29 16:11:31 +00:00
OpenGL2: Use an OpenGL 3.2 core context if available.
This commit is contained in:
parent
51ca4d35ea
commit
d549b642bc
20 changed files with 313 additions and 349 deletions
|
@ -115,6 +115,7 @@ static void DrawTris (shaderCommands_t *input) {
|
|||
GLSL_SetUniformMat4(sp, UNIFORM_MODELVIEWPROJECTIONMATRIX, glState.modelviewProjection);
|
||||
VectorSet4(color, 1, 1, 1, 1);
|
||||
GLSL_SetUniformVec4(sp, UNIFORM_COLOR, color);
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
|
||||
R_DrawElements(input->numIndexes, input->firstIndex);
|
||||
}
|
||||
|
@ -383,6 +384,8 @@ static void ProjectDlightTexture( void ) {
|
|||
GL_State( GLS_ATEST_GT_0 | GLS_SRCBLEND_DST_COLOR | GLS_DSTBLEND_ONE | GLS_DEPTHFUNC_EQUAL );
|
||||
}
|
||||
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 1);
|
||||
|
||||
R_DrawElements(tess.numIndexes, tess.firstIndex);
|
||||
|
||||
backEnd.pc.c_totalIndexes += tess.numIndexes;
|
||||
|
@ -746,6 +749,7 @@ static void ForwardDlight( void ) {
|
|||
// include GLS_DEPTHFUNC_EQUAL so alpha tested surfaces don't add light
|
||||
// where they aren't rendered
|
||||
GL_State( GLS_SRCBLEND_ONE | GLS_DSTBLEND_ONE | GLS_DEPTHFUNC_EQUAL );
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
|
||||
GLSL_SetUniformMat4(sp, UNIFORM_MODELMATRIX, backEnd.or.transformMatrix);
|
||||
|
||||
|
@ -858,6 +862,7 @@ static void ProjectPshadowVBOGLSL( void ) {
|
|||
// include GLS_DEPTHFUNC_EQUAL so alpha tested surfaces don't add light
|
||||
// where they aren't rendered
|
||||
GL_State( GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA | GLS_DEPTHFUNC_EQUAL );
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
|
||||
GL_BindToTMU( tr.pshadowMaps[l], TB_DIFFUSEMAP );
|
||||
|
||||
|
@ -939,6 +944,7 @@ static void RB_FogPass( void ) {
|
|||
} else {
|
||||
GL_State( GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA );
|
||||
}
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
|
||||
R_DrawElements(tess.numIndexes, tess.firstIndex);
|
||||
}
|
||||
|
@ -1081,6 +1087,23 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input )
|
|||
}
|
||||
|
||||
GL_State( pStage->stateBits );
|
||||
if ((pStage->stateBits & GLS_ATEST_BITS) == GLS_ATEST_GT_0)
|
||||
{
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 1);
|
||||
}
|
||||
else if ((pStage->stateBits & GLS_ATEST_BITS) == GLS_ATEST_LT_80)
|
||||
{
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 2);
|
||||
}
|
||||
else if ((pStage->stateBits & GLS_ATEST_BITS) == GLS_ATEST_GE_80)
|
||||
{
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
vec4_t baseColor;
|
||||
|
@ -1368,6 +1391,7 @@ static void RB_RenderShadowmap( shaderCommands_t *input )
|
|||
GLSL_SetUniformFloat(sp, UNIFORM_LIGHTRADIUS, backEnd.viewParms.zFar);
|
||||
|
||||
GL_State( 0 );
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
|
||||
//
|
||||
// do multitexture
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue