diff options
Diffstat (limited to 'src/render.c')
-rw-r--r-- | src/render.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/render.c b/src/render.c index a03fe7f..eed7920 100644 --- a/src/render.c +++ b/src/render.c @@ -505,13 +505,20 @@ static void render_setup_lighting(Game *game) { specular[1] = 1.0; specular[2] = 1.0; specular[3] = 1.0; + ambient[0] = 0.0; + ambient[1] = 0.0; + ambient[2] = 0.0; + ambient[3] = 1.0; glLightfv(GL_LIGHT0, GL_POSITION, pos); glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); glLightfv(GL_LIGHT0, GL_SPECULAR, specular); + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, dir); glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 45.0); glLightf(GL_LIGHT0, GL_SPOT_EXPONENT, 20.0); + glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 1.0); glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.05); + glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.02); glEnable(GL_LIGHT0); pos[0] = -1.0; @@ -526,9 +533,14 @@ static void render_setup_lighting(Game *game) { specular[1] = 0.01; specular[2] = 0.01; specular[3] = 1.0; + ambient[0] = 0.0; + ambient[1] = 0.0; + ambient[2] = 0.0; + ambient[3] = 1.0; glLightfv(GL_LIGHT1, GL_POSITION, pos); glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse); glLightfv(GL_LIGHT1, GL_SPECULAR, specular); + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); glEnable(GL_LIGHT1); } |