aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-08-06 15:48:20 +0000
committertaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-08-06 15:48:20 +0000
commit31606fee6eb5917e602103067b1f0d85ae1ff476 (patch)
tree15db6cf920dfb0f9a4adba14f9b57f7d82c8de5f /src
parent56564957104fbeaa1ba41698275a28d18a194c29 (diff)
Give the spotlight an ambient component
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@223 84d2e878-0bd5-11dd-ad15-13eda11d74c5
Diffstat (limited to 'src')
-rw-r--r--src/render.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/render.c b/src/render.c
index 53d1716..e3b5a44 100644
--- a/src/render.c
+++ b/src/render.c
@@ -405,9 +405,6 @@ static void render_setup_lighting(Game *game) {
ambient[0] = 0.07; ambient[1] = 0.07; ambient[2] = 0.07; ambient[3] = 1.0;
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient);
- /* All lights have zero ambient (shader will ignore them) */
- ambient[0] = 0.0; ambient[1] = 0.0; ambient[2] = 0.0;
-
/* Lander craft's headlight */
pos[0] = game->lander->x;
pos[1] = game->lander->y;
@@ -424,6 +421,7 @@ static void render_setup_lighting(Game *game) {
glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.02);
glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.005);
/* Headlight colours */
+ ambient[0] = 0.2; ambient[1] = 0.2; ambient[2] = 0.2;
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); /* Initialised to zero above */
diffuse[0] = 1.0; diffuse[1] = 1.0; diffuse[2] = 1.0; diffuse[3] = 1.0;
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
@@ -432,6 +430,7 @@ static void render_setup_lighting(Game *game) {
glEnable(GL_LIGHT0);
/* A very dim fill-in light. Adds a tiny amount of shape to things, and lifts the floor a little */
+ ambient[0] = 0.0; ambient[1] = 0.0; ambient[2] = 0.0;
glLightfv(GL_LIGHT1, GL_AMBIENT, ambient); /* Initialised to zero above */
pos[0] = -1.0; pos[1] = 0.8; pos[2] = 4.0; pos[3] = 0.0;
glLightfv(GL_LIGHT1, GL_POSITION, pos);