mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2024-11-23 04:12:42 +00:00
fixed incorrect state bits for shaders when loading a map with no lighting
This commit is contained in:
parent
0087c2bf14
commit
7939488266
4 changed files with 10 additions and 1 deletions
|
@ -107,6 +107,8 @@ chg: r_fullbright is now latched again
|
|||
|
||||
chg: negative r_swapInterval values will request adaptive v-sync when using an OpenGL back-end
|
||||
|
||||
fix: incorrect shader state when loading a map with no lighting
|
||||
|
||||
fix: fog-only non-sky shaders were incorrectly handled as sky shaders, which broke fog on many maps
|
||||
|
||||
fix: r_monitor on Linux is now 0-based and the value doesn't change incorrectly on its own anymore
|
||||
|
|
|
@ -226,6 +226,8 @@ static void R_GetLightmapTransform( int* number, vec2_t scale, vec2_t bias )
|
|||
scale[1] = 1.0f;
|
||||
bias[0] = 0.0f;
|
||||
bias[1] = 0.0f;
|
||||
if ( *number <= LIGHTMAP_2D || *number >= tr.numLightmaps )
|
||||
*number = LIGHTMAP_BROKEN;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -328,6 +328,7 @@ typedef struct {
|
|||
} shaderStage_t;
|
||||
|
||||
|
||||
#define LIGHTMAP_BROKEN -4 // invalid data in the .bsp file
|
||||
#define LIGHTMAP_2D -3 // shader is for 2D rendering
|
||||
#define LIGHTMAP_BY_VERTEX -2 // pre-lit triangle models
|
||||
#define LIGHTMAP_NONE -1
|
||||
|
|
|
@ -2351,7 +2351,11 @@ shader_t* R_FindShader( const char *name, int lightmapIndex, qbool mipRawImage )
|
|||
stages[0].type = ST_DIFFUSE;
|
||||
stages[0].bundle.image[0] = image;
|
||||
|
||||
if ( shader.lightmapIndex == LIGHTMAP_NONE ) {
|
||||
if ( shader.lightmapIndex == LIGHTMAP_BROKEN ) {
|
||||
stages[0].rgbGen = CGEN_VERTEX;
|
||||
stages[0].alphaGen = AGEN_VERTEX;
|
||||
stages[0].stateBits = GLS_DEFAULT;
|
||||
} else if ( shader.lightmapIndex == LIGHTMAP_NONE ) {
|
||||
// dynamic colors at vertexes
|
||||
stages[0].rgbGen = CGEN_LIGHTING_DIFFUSE;
|
||||
stages[0].stateBits = GLS_DEFAULT;
|
||||
|
|
Loading…
Reference in a new issue