mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-24 05:01:40 +00:00
Apply greyscaling to fog blocks
This commit is contained in:
parent
386a00fc2b
commit
5e575ae82e
2 changed files with 34 additions and 0 deletions
|
@ -1568,6 +1568,23 @@ static qboolean ParseShader( char **text )
|
||||||
return qfalse;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( r_greyscale->integer )
|
||||||
|
{
|
||||||
|
float luminance;
|
||||||
|
|
||||||
|
luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] );
|
||||||
|
VectorSet( shader.fogParms.color, luminance, luminance, luminance );
|
||||||
|
}
|
||||||
|
else if ( r_greyscale->value )
|
||||||
|
{
|
||||||
|
float luminance;
|
||||||
|
|
||||||
|
luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] );
|
||||||
|
shader.fogParms.color[0] = LERP( shader.fogParms.color[0], luminance, r_greyscale->value );
|
||||||
|
shader.fogParms.color[1] = LERP( shader.fogParms.color[1], luminance, r_greyscale->value );
|
||||||
|
shader.fogParms.color[2] = LERP( shader.fogParms.color[2], luminance, r_greyscale->value );
|
||||||
|
}
|
||||||
|
|
||||||
token = COM_ParseExt( text, qfalse );
|
token = COM_ParseExt( text, qfalse );
|
||||||
if ( !token[0] )
|
if ( !token[0] )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1856,6 +1856,23 @@ static qboolean ParseShader( char **text )
|
||||||
return qfalse;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( r_greyscale->integer )
|
||||||
|
{
|
||||||
|
float luminance;
|
||||||
|
|
||||||
|
luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] );
|
||||||
|
VectorSet( shader.fogParms.color, luminance, luminance, luminance );
|
||||||
|
}
|
||||||
|
else if ( r_greyscale->value )
|
||||||
|
{
|
||||||
|
float luminance;
|
||||||
|
|
||||||
|
luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] );
|
||||||
|
shader.fogParms.color[0] = LERP( shader.fogParms.color[0], luminance, r_greyscale->value );
|
||||||
|
shader.fogParms.color[1] = LERP( shader.fogParms.color[1], luminance, r_greyscale->value );
|
||||||
|
shader.fogParms.color[2] = LERP( shader.fogParms.color[2], luminance, r_greyscale->value );
|
||||||
|
}
|
||||||
|
|
||||||
token = COM_ParseExt( text, qfalse );
|
token = COM_ParseExt( text, qfalse );
|
||||||
if ( !token[0] )
|
if ( !token[0] )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue