mirror of https://bitbucket.org/CPMADevs/cnq3
fixed broken rendering when the 2nd stage of a collapsed shader stage pair had non-white colors
This commit is contained in:
parent
a646bfdc87
commit
b49c880fe5
|
@ -1,6 +1,8 @@
|
|||
|
||||
DD Mmm 17 - 1.49
|
||||
|
||||
fix: broken rendering when the 2nd stage of a collapsed shader stage pair had non-white colors
|
||||
|
||||
fix: shader stages using "wave" were not animated when the server time was too large
|
||||
|
||||
add: con_scaleMode specifies the console text scaling mode
|
||||
|
|
|
@ -185,7 +185,7 @@ static void GL2_DynLights_MultitextureStage( int stage )
|
|||
GL_TexEnv( pStage->mtEnv );
|
||||
R_BindAnimatedImage( &pStage->bundle );
|
||||
|
||||
stageVars_t svarsMT;
|
||||
static stageVars_t svarsMT; // this is a huge struct
|
||||
R_ComputeTexCoords( pStage, svarsMT );
|
||||
qglEnableClientState( GL_TEXTURE_COORD_ARRAY );
|
||||
qglTexCoordPointer( 2, GL_FLOAT, 0, svarsMT.texcoords );
|
||||
|
|
|
@ -1697,7 +1697,6 @@ static void CollapseStages()
|
|||
int numStages = shader.numStages;
|
||||
shaderStage_t* aStages = &stages[0];
|
||||
|
||||
#define CollapseSuccess { aStages[0].mtStages = 1; aStages += 2; numStages -= 2; continue; }
|
||||
#define CollapseFailure { ++aStages; --numStages; continue; }
|
||||
|
||||
while (numStages >= 2) {
|
||||
|
@ -1723,13 +1722,30 @@ static void CollapseStages()
|
|||
if ( collapse[i].blendA == -1 )
|
||||
CollapseFailure;
|
||||
|
||||
// Check that all colors are pure white on the second stage
|
||||
// because the stage iterator can't currently specify
|
||||
// another color array.
|
||||
// Example shader broken without this extra test:
|
||||
// "textures/sfx/diamond2cjumppad"
|
||||
// The ring pulses in and out instead of only out.
|
||||
static stageVars_t svarsMT;
|
||||
R_ComputeColors( &aStages[1], svarsMT );
|
||||
const int* colors = (const int*)svarsMT.colors;
|
||||
const int colorCount = tess.numVertexes;
|
||||
int allOnes = -1;
|
||||
for ( int c = 0; c < colorCount; ++c )
|
||||
allOnes &= colors[c];
|
||||
if ( allOnes != -1 )
|
||||
CollapseFailure;
|
||||
|
||||
aStages[0].stateBits &= ~GLS_BLEND_BITS;
|
||||
aStages[0].stateBits |= collapse[i].multitextureBlend;
|
||||
aStages[1].mtEnv = collapse[i].multitextureEnv;
|
||||
CollapseSuccess;
|
||||
aStages[0].mtStages = 1;
|
||||
aStages += 2;
|
||||
numStages -= 2;
|
||||
}
|
||||
|
||||
#undef CollapseSuccess
|
||||
#undef CollapseFailure
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue