From 31606fee6eb5917e602103067b1f0d85ae1ff476 Mon Sep 17 00:00:00 2001 From: taw27 Date: Wed, 6 Aug 2008 15:48:20 +0000 Subject: Give the spotlight an ambient component git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@223 84d2e878-0bd5-11dd-ad15-13eda11d74c5 --- src/render.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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); -- cgit v1.2.3