aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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);