Merge remote branch 'icculus/master'
This commit is contained in:
commit
0c20b6e140
|
|
@ -77,7 +77,7 @@ extern const vec3_t g_vec3_axis_z;
|
||||||
#define FLOAT_SNAP(f,snap) ( (float)( floor( (f) / (snap) + 0.5 ) * (snap) ) )
|
#define FLOAT_SNAP(f,snap) ( (float)( floor( (f) / (snap) + 0.5 ) * (snap) ) )
|
||||||
#define FLOAT_TO_INTEGER(f) ( (float)( floor( (f) + 0.5 ) ) )
|
#define FLOAT_TO_INTEGER(f) ( (float)( floor( (f) + 0.5 ) ) )
|
||||||
|
|
||||||
#define RGBTOGRAY(x) ( (x)[0] * 0.2989f + (x)[1] * 0.5870f + (x)[2] * 0.1140f )
|
#define RGBTOGRAY(x) ( (float)((x)[0]) * 0.2989f + (float)((x)[1]) * 0.5870f + (float)((x)[2]) * 0.1140f )
|
||||||
|
|
||||||
#define Q_rint(in) ((vec_t)floor(in+0.5))
|
#define Q_rint(in) ((vec_t)floor(in+0.5))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1546,7 +1546,8 @@ void DirtyRawLightmap( int rawLightmapNum )
|
||||||
rawLightmap_t *lm;
|
rawLightmap_t *lm;
|
||||||
surfaceInfo_t *info;
|
surfaceInfo_t *info;
|
||||||
trace_t trace;
|
trace_t trace;
|
||||||
|
qboolean noDirty;
|
||||||
|
|
||||||
|
|
||||||
/* bail if this number exceeds the number of raw lightmaps */
|
/* bail if this number exceeds the number of raw lightmaps */
|
||||||
if( rawLightmapNum >= numRawLightmaps )
|
if( rawLightmapNum >= numRawLightmaps )
|
||||||
|
|
@ -1578,6 +1579,20 @@ void DirtyRawLightmap( int rawLightmapNum )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
noDirty = qfalse;
|
||||||
|
for( i = 0; i < trace.numSurfaces; i++ )
|
||||||
|
{
|
||||||
|
/* get surface */
|
||||||
|
info = &surfaceInfos[ trace.surfaces[ i ] ];
|
||||||
|
|
||||||
|
/* check twosidedness */
|
||||||
|
if( info->si->noDirty )
|
||||||
|
{
|
||||||
|
noDirty = qtrue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* gather dirt */
|
/* gather dirt */
|
||||||
for( y = 0; y < lm->sh; y++ )
|
for( y = 0; y < lm->sh; y++ )
|
||||||
|
|
@ -1596,6 +1611,13 @@ void DirtyRawLightmap( int rawLightmapNum )
|
||||||
/* only look at mapped luxels */
|
/* only look at mapped luxels */
|
||||||
if( *cluster < 0 )
|
if( *cluster < 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* don't apply dirty on this surface */
|
||||||
|
if( noDirty )
|
||||||
|
{
|
||||||
|
*dirt = 1.0f;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* copy to trace */
|
/* copy to trace */
|
||||||
trace.cluster = *cluster;
|
trace.cluster = *cluster;
|
||||||
|
|
|
||||||
|
|
@ -749,7 +749,8 @@ typedef struct shaderInfo_s
|
||||||
qb_t noFog; /* ydnar: supress fogging */
|
qb_t noFog; /* ydnar: supress fogging */
|
||||||
qb_t clipModel; /* ydnar: solid model hack */
|
qb_t clipModel; /* ydnar: solid model hack */
|
||||||
qb_t noVertexLight; /* ydnar: leave vertex color alone */
|
qb_t noVertexLight; /* ydnar: leave vertex color alone */
|
||||||
|
qb_t noDirty; /* jal: do not apply the dirty pass to this surface */
|
||||||
|
|
||||||
byte styleMarker; /* ydnar: light styles hack */
|
byte styleMarker; /* ydnar: light styles hack */
|
||||||
|
|
||||||
float vertexScale; /* vertex light scale */
|
float vertexScale; /* vertex light scale */
|
||||||
|
|
|
||||||
|
|
@ -1523,6 +1523,12 @@ static void ParseShaderFile( const char *filename )
|
||||||
GetTokenAppend( shaderText, qfalse );
|
GetTokenAppend( shaderText, qfalse );
|
||||||
si->floodlightDirectionScale = atof( token );
|
si->floodlightDirectionScale = atof( token );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* jal: q3map_nodirty : skip dirty */
|
||||||
|
else if( !Q_stricmp( token, "q3map_nodirty" ) )
|
||||||
|
{
|
||||||
|
si->noDirty = qtrue;
|
||||||
|
}
|
||||||
|
|
||||||
/* q3map_lightmapSampleSize <value> */
|
/* q3map_lightmapSampleSize <value> */
|
||||||
else if( !Q_stricmp( token, "q3map_lightmapSampleSize" ) )
|
else if( !Q_stricmp( token, "q3map_lightmapSampleSize" ) )
|
||||||
|
|
@ -1668,7 +1674,7 @@ static void ParseShaderFile( const char *filename )
|
||||||
si->offset = atof( token );
|
si->offset = atof( token );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ydnar: q3map_textureSize <width> <height> (substitute for q3map_lightimage derivation for terrain) */
|
/* ydnar: q3map_fur <numlayers> <offset> <fade> */
|
||||||
else if( !Q_stricmp( token, "q3map_fur" ) )
|
else if( !Q_stricmp( token, "q3map_fur" ) )
|
||||||
{
|
{
|
||||||
GetTokenAppend( shaderText, qfalse );
|
GetTokenAppend( shaderText, qfalse );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user