Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-11-11 13:40:19 +0000
committerStijn Buys <ingar@osirion.org>2012-11-11 13:40:19 +0000
commit89d8f7f384dcd6c201288bf6fe86ab19e59e1a5c (patch)
tree1324fc641af737d055fa48e107a32b02c4700ca4
parent72f480d7f34e22104fbcfd1561b037b65365fc1f (diff)
Corrected light attenuation values.
-rw-r--r--src/render/draw.cc4
-rwxr-xr-xsrc/ui/modelview.cc10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index 1d99077..12a64ad 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -111,9 +111,9 @@ void pass_prepare(float seconds)
// add zone lights
if (globe->has_flag(core::Entity::Bright)) {
- float zone_light_brightness = (globe->color().r + globe->color().g + globe->color().b) / 3;
+ float zone_light_brightness = math::max(globe->color().r, math::max(globe->color().g, globe->color().b));
Light *zone_light = new Light(globe->location(), globe->color());
- zone_light->set_attenuation(zone_light_brightness * 1.5f, zone_light_brightness * 0.00001f, zone_light_brightness * 0.000000001f);
+ zone_light->set_attenuation(zone_light_brightness * 2.0f, 0.0f, 0.0f);
lightenv_zone.add(zone_light);
}
diff --git a/src/ui/modelview.cc b/src/ui/modelview.cc
index 8069ac7..b8d2a86 100755
--- a/src/ui/modelview.cc
+++ b/src/ui/modelview.cc
@@ -22,7 +22,7 @@ namespace ui
{
const float LIGHT_DISTANCE = -10.0f;
-const float LIGHT_ATTENUATION = 0.5f;
+const float LIGHT_ATTENUATION = 1.5f;
ModelView::ModelView(Widget *parent) : Widget(parent)
{
@@ -194,9 +194,9 @@ void ModelView::draw_globe()
// set up light environment
render::Light *light = new render::Light(
math::Vector3f(LIGHT_DISTANCE * reference_radius, 0, 0),
- math::Color(1.0f, 1.0f, 1.0f)
+ math::Color(0.5f, 0.5f, 0.5f)
);
- light->set_attenuation(0.0f, LIGHT_ATTENUATION, 0.0f);
+ light->set_attenuation(LIGHT_ATTENUATION, 0.0f, 0.0f);
render::LightEnvironment lightenv;
lightenv.add(light);
@@ -294,9 +294,9 @@ void ModelView::draw_model()
// set up light environment
render::Light *light = new render::Light(
math::Vector3f(LIGHT_DISTANCE * reference_radius, 0, 0),
- math::Color(1.0f, 1.0f, 1.0f)
+ math::Color(0.5f, 0.5f, 0.5f)
);
- light->set_attenuation(0.0f, LIGHT_ATTENUATION, 0.0f);
+ light->set_attenuation(LIGHT_ATTENUATION, 0.0f, 0.0f);
render::LightEnvironment lightenv;
lightenv.add(light);