diff options
Diffstat (limited to 'src/RobotRace.java')
-rw-r--r-- | src/RobotRace.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/RobotRace.java b/src/RobotRace.java index ba042af..fb4ab1e 100644 --- a/src/RobotRace.java +++ b/src/RobotRace.java @@ -202,6 +202,10 @@ public class RobotRace extends Base { // too dark and the effect disappears, so make diffuse more bright float[] diffuseRGBA = {.7f, .7f, .7f, 1.0f}; + // default is 100% specular, but that causes the surfaces pointing to + // the normal to be fully white. + gl.glLightfv(GL_LIGHT0, GL_SPECULAR, new float[] {0, 0, 0, 0.5f}, 0); + // set the light-source colors gl.glLightfv(GL_LIGHT0, GL_AMBIENT, ambientRGBA, 0); gl.glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuseRGBA, 0); @@ -334,8 +338,12 @@ public class RobotRace extends Base { // Draw the robots drawRobots(); + // use color of race track, not lighting + gl.glEnable(GL_COLOR_MATERIAL); // Draw race track raceTrack.draw(gs.trackNr); + // restore + gl.glDisable(GL_COLOR_MATERIAL); // Draw terrain terrain.draw(); |