summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_scene.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2015-12-09 05:25:58 -0800
committerTim Angus <tim@ngus.net>2016-04-07 11:13:30 +0100
commit9cdedf11eff894db8f9f572ab52eae37fdacf473 (patch)
treef1ea453fd0b9c6ae6f5ecc946a11fcdc449969ba /src/renderergl2/tr_scene.c
parentc9cf340a4eb8d81b44e8c02b167b9ab6319167fd (diff)
OpenGL2: Use correct sunlight color for sunlight specular.
Diffstat (limited to 'src/renderergl2/tr_scene.c')
-rw-r--r--src/renderergl2/tr_scene.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/renderergl2/tr_scene.c b/src/renderergl2/tr_scene.c
index 94997a8c..7e326a88 100644
--- a/src/renderergl2/tr_scene.c
+++ b/src/renderergl2/tr_scene.c
@@ -336,35 +336,30 @@ void RE_BeginScene(const refdef_t *fd)
}
else
{
+#if defined(USE_OVERBRIGHT)
+ float scale = pow(2, r_mapOverBrightBits->integer - tr.overbrightBits - 8);
+#else
+ float scale = (1 << r_mapOverBrightBits->integer) / 255.0f;
+#endif
tr.refdef.colorScale = r_forceSun->integer ? r_forceSunMapLightScale->value : tr.mapLightScale;
+ if (r_forceSun->integer)
+ VectorScale(tr.sunLight, scale * r_forceSunLightScale->value, tr.refdef.sunCol);
+ else
+ VectorScale(tr.sunLight, scale, tr.refdef.sunCol);
+
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
{
-#if defined(USE_OVERBRIGHT)
- float scale = pow(2, r_mapOverBrightBits->integer - tr.overbrightBits - 8);
-#else
- float scale = (1 << r_mapOverBrightBits->integer) / 255.0f;
-#endif
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);
- }
}
}