diff options
author | SmileTheory <SmileTheory@gmail.com> | 2013-04-22 21:52:16 -0700 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-05-03 16:11:37 +0100 |
commit | 9d3c009673517a8edf82bf0e1f63eca4eadb4a28 (patch) | |
tree | 96d622ef79738b1e65f2e6b24d47d29463f94f22 /src/renderergl2/tr_scene.c | |
parent | b8a640fbc8403f5de74cd54cd40cc5b629e86665 (diff) |
Don't scale shadow multipliers by overbrightbits, and improve documentation.
Diffstat (limited to 'src/renderergl2/tr_scene.c')
-rw-r--r-- | src/renderergl2/tr_scene.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/src/renderergl2/tr_scene.c b/src/renderergl2/tr_scene.c index 1f6c765e..71e816b4 100644 --- a/src/renderergl2/tr_scene.c +++ b/src/renderergl2/tr_scene.c @@ -361,19 +361,34 @@ void RE_RenderScene( const refdef_t *fd ) { VectorSet(tr.refdef.sunCol, 0, 0, 0); VectorSet(tr.refdef.sunAmbCol, 0, 0, 0); } - else if (r_forceSun->integer == 1) - { - float scale = pow(2, r_mapOverBrightBits->integer - tr.overbrightBits - 8); - tr.refdef.colorScale = r_forceSunMapLightScale->value; - VectorScale(tr.sunLight, scale * r_forceSunLightScale->value, tr.refdef.sunCol); - VectorScale(tr.sunLight, scale * r_forceSunAmbientScale->value, tr.refdef.sunAmbCol); - } else { - float scale = pow(2, r_mapOverBrightBits->integer - tr.overbrightBits - 8); - tr.refdef.colorScale = tr.mapLightScale; - VectorScale(tr.sunLight, scale, tr.refdef.sunCol); - VectorScale(tr.sunAmbient, scale, tr.refdef.sunAmbCol); + tr.refdef.colorScale = r_forceSun->integer ? r_forceSunMapLightScale->value : tr.mapLightScale; + + if (r_sunlightMode->integer == 1) + { + tr.refdef.sunCol[0] = + tr.refdef.sunCol[1] = + tr.refdef.sunCol[2] = 1.0f; + + tr.refdef.sunAmbCol[0] = + tr.refdef.sunAmbCol[1] = + tr.refdef.sunAmbCol[2] = r_forceSun->integer ? r_forceSunAmbientScale->value : tr.sunShadowScale; + } + else + { + float scale = pow(2, r_mapOverBrightBits->integer - tr.overbrightBits - 8); + if (r_forceSun->integer) + { + VectorScale(tr.sunLight, scale * r_forceSunLightScale->value, tr.refdef.sunCol); + VectorScale(tr.sunLight, scale * r_forceSunAmbientScale->value, tr.refdef.sunAmbCol); + } + else + { + VectorScale(tr.sunLight, scale, tr.refdef.sunCol); + VectorScale(tr.sunLight, scale * tr.sunShadowScale, tr.refdef.sunAmbCol); + } + } } if (r_forceAutoExposure->integer) |