Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Goers <mega@osirion.org>2012-04-23 06:07:12 +0000
committerEvan Goers <mega@osirion.org>2012-04-23 06:07:12 +0000
commit3e73e7bbb42a0226dba951372c90c59ac7d036aa (patch)
tree8330761f2f3228ce84cf2045539f25bd87168499 /src/render
parent4762531e81fc694008c2a3d2b3818d8972916ca5 (diff)
Added constant attenuation value.
Diffstat (limited to 'src/render')
-rw-r--r--src/render/draw.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index efdbd84..8f9f978 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -113,6 +113,7 @@ int add_light(const math::Vector3f & location, float attenuation, const math::Co
// set up the light
// we use a simple averaging of the color times the specified attenuation value(such as 0.00025f).
// FIXME: use a more standardized and realistic way of doing this.
+ glLightf(gllight, GL_CONSTANT_ATTENUATION, ((color[0] + color[1] + color[2]) / 3.0f) * attenuation);
glLightf(gllight, GL_LINEAR_ATTENUATION, ((color[0] + color[1] + color[2]) / 3.0f) * attenuation);
glLightfv(gllight, GL_POSITION, gllight_location);
@@ -174,7 +175,7 @@ void pass_prepare(float seconds)
zone_light_location[i] = globe->location()[i];
zone_light_color[i] = globe->color()[i];
}
- GLenum zone_gllight = add_light(zone_light_location, 0.00025f, globe->color());
+ GLenum zone_gllight = add_light(zone_light_location, 0.0005f, globe->color());
gl::enable(zone_gllight);
has_zone_light = true;
}