diff options
author | Tim Angus <tim@ngus.net> | 2016-04-09 17:57:28 +0100 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2016-04-09 17:57:28 +0100 |
commit | f45fbef604e05144057dec8d1dbfc5d4f5a2a822 (patch) | |
tree | 152d2a428b078f7a89756ea9e156695fc69f1686 /src/renderergl1/tr_shader.c | |
parent | 7f9e97d611b4b267d9dd913144cb9632f96c90c2 (diff) | |
parent | 87abdd914988724e164ffb16380ad26be8420b84 (diff) |
Merge branch 'master' into gpp
Diffstat (limited to 'src/renderergl1/tr_shader.c')
-rw-r--r-- | src/renderergl1/tr_shader.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/renderergl1/tr_shader.c b/src/renderergl1/tr_shader.c index 2a66afd0..34d6d64e 100644 --- a/src/renderergl1/tr_shader.c +++ b/src/renderergl1/tr_shader.c @@ -1569,6 +1569,23 @@ static qboolean ParseShader( char **text ) 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 ); if ( !token[0] ) { |