Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/draw.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index 5d960fe..ed9c6a6 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -330,6 +330,7 @@ void draw_pass_globes()
// FIXME is this ever reset ?
GLfloat globe_specular[] = { 0.25f, 0.25f, 0.25f, 1.0f };
glMaterialfv(GL_FRONT, GL_SPECULAR, globe_specular);
+ float fake_light_location[4];
// Globes have to be rendered distance sorted, closest last.
// Globes behind farplane are rescaled and repositioned.
@@ -349,7 +350,6 @@ void draw_pass_globes()
if (has_zone_light) {
// nudge zone light
// FIXME doesn't work correctly with multiple zone lights
- float fake_light_location[4];
for (size_t i = 0; i < 3; i++) {
fake_light_location[i] = zone_light_location[i] + location[i] - globe->location()[i];
}
@@ -401,7 +401,11 @@ void draw_pass_globes()
if (has_zone_light) {
// restore zone light
- glLightfv(zone_gllight, GL_POSITION, zone_light_location.ptr());
+ for (size_t i = 0; i < 3; i++) {
+ fake_light_location[i] = zone_light_location[i];
+ }
+ fake_light_location[3] = 1.0f;
+ glLightfv(zone_gllight, GL_POSITION, fake_light_location);
}
}
}