summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_scene.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderergl2/tr_scene.c')
-rw-r--r--src/renderergl2/tr_scene.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/renderergl2/tr_scene.c b/src/renderergl2/tr_scene.c
index 51bb412e..24108046 100644
--- a/src/renderergl2/tr_scene.c
+++ b/src/renderergl2/tr_scene.c
@@ -336,31 +336,30 @@ void RE_BeginScene(const refdef_t *fd)
}
else
{
+#if defined(USE_OVERBRIGHT)
+ float scale = (1 << (r_mapOverBrightBits->integer - tr.overbrightBits)) / 255.0f;
+#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
{
- 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);
- }
}
}