diff options
author | Andrey Nazarov <skuller@skuller.net> | 2013-03-17 22:42:17 +0400 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2013-03-20 22:04:53 +0400 |
commit | 14780fed28b9af75f7a2263b04eb5411d5250e98 (patch) | |
tree | 85f25fc1201cf13bcaa3b851fa377a8cc068f3f4 /src/refresh/sw/alias.c | |
parent | 74917d2df4e157096285e7908a6395048790817c (diff) |
Improve software lighting.
Apply ‘sw_modulate’ to world lightmaps. Treat negative dynamic lights
the same way as OpenGL renderer does. Properly transform dynamic lights
for moving entities. Bilinear filter lightmap samples for entity
lighting. Fix ‘r_fullbight’ and surfaces without lightmaps to be really
full bright.
Diffstat (limited to 'src/refresh/sw/alias.c')
-rw-r--r-- | src/refresh/sw/alias.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/refresh/sw/alias.c b/src/refresh/sw/alias.c index 0970f6d..dad1748 100644 --- a/src/refresh/sw/alias.c +++ b/src/refresh/sw/alias.c @@ -472,8 +472,6 @@ static void R_AliasSetupSkin(void) /* ================ R_AliasSetupLighting - - FIXME: put lighting into tables ================ */ static void R_AliasSetupLighting(void) @@ -484,13 +482,11 @@ static void R_AliasSetupLighting(void) // all components of light should be identical in software if (currententity->flags & RF_FULLBRIGHT) { - for (i = 0; i < 3; i++) - light[i] = 1.0; + VectorSet(light, 1, 1, 1); } else { R_LightPoint(currententity->origin, light); } - if (currententity->flags & RF_MINLIGHT) { for (i = 0; i < 3; i++) if (light[i] < 0.1) @@ -511,6 +507,9 @@ static void R_AliasSetupLighting(void) } } + for (i = 0; i < 3; i++) + clamp(light[i], 0, 1); + j = LUMINANCE(light[0], light[1], light[2]) * 256; r_ambientlight = 0; |