]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_light.c
Implemented r_ambient (mainly for sake of Nehahra's insanely dark maps).
[xonotic/darkplaces.git] / r_light.c
index af8003c245ff75ffd28647780f965c28d7f7fe7e..defa8f0d58ddc1463364dfed8351a0dee3f56af1 100644 (file)
--- a/r_light.c
+++ b/r_light.c
@@ -203,6 +203,8 @@ LIGHT SAMPLING
 mplane_t               *lightplane;
 vec3_t                 lightspot;
 
+extern cvar_t r_ambient;
+
 int RecursiveLightPoint (vec3_t color, mnode_t *node, vec3_t start, vec3_t end)
 {
        float           front, back, frac;
@@ -303,7 +305,7 @@ void R_LightPoint (vec3_t color, vec3_t p)
        end[1] = p[1];
        end[2] = p[2] - 2048;
 
-       color[0] = color[1] = color[2] = 0;
+       color[0] = color[1] = color[2] = r_ambient.value * 2.0f;
        RecursiveLightPoint (color, cl.worldmodel->nodes, p, end);
 }