From 3e73e7bbb42a0226dba951372c90c59ac7d036aa Mon Sep 17 00:00:00 2001 From: Evan Goers Date: Mon, 23 Apr 2012 06:07:12 +0000 Subject: Added constant attenuation value. --- src/render/draw.cc | 3 ++- src/ui/modelview.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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; } diff --git a/src/ui/modelview.cc b/src/ui/modelview.cc index 813fddb..d1c5c96 100755 --- a/src/ui/modelview.cc +++ b/src/ui/modelview.cc @@ -20,7 +20,7 @@ namespace ui { const float LIGHT_DISTANCE = -10.0f; -const float LIGHT_ATTENUATION = 0.05f; +const float LIGHT_ATTENUATION = 0.1f; ModelView::ModelView(Widget *parent) : Widget(parent) { -- cgit v1.2.3