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>2009-10-04 09:13:33 +0000
committerStijn Buys <ingar@osirion.org>2009-10-04 09:13:33 +0000
commit6028ed9f0e2ab97749127457ed68ce458efd70b3 (patch)
treee363088d8bb0e7aa921c17226477b9a1085550be
parent9e6f1cc494a329d32d0d8f0ca0acd563b3acaf7f (diff)
use GL_REFLECTION_MAP instead of GL_SPHERE_MAP for envmapping
-rw-r--r--src/render/draw.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index dea24bc..4e5e2a9 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -112,7 +112,7 @@ void pass_prepare(float seconds)
for (size_t i = 0; i < 3; i++) {
zone_light[i] = globe->location()[i];
zone_color[i] = globe->color()[i];
- diffuse_light[i] = globe->color()[i] * 0.4;
+ diffuse_light[i] = globe->color()[i] * 0.4f;
}
zone_light[3] = 1.0f;
diffuse_light[3] = 1.0f;
@@ -592,8 +592,9 @@ void draw_model_fragments(model::Model *model,
//bool use_color_array = true; // glEnableClientState(GL_COLOR_ARRAY) is set
// TODO this should probably be initialized somewhere else
- glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
- glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+ glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
+ glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
+ glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
for (model::Model::Groups::iterator git = model->groups().begin(); git != model->groups().end(); git++) {
@@ -714,6 +715,7 @@ void draw_model_fragments(model::Model *model,
// enable env mapping
gl::enable(GL_TEXTURE_GEN_S);
gl::enable(GL_TEXTURE_GEN_T);
+ gl::enable(GL_TEXTURE_GEN_R);
use_env = true;
}
@@ -723,6 +725,7 @@ void draw_model_fragments(model::Model *model,
// disable env mapping
gl::disable(GL_TEXTURE_GEN_S);
gl::disable(GL_TEXTURE_GEN_T);
+ gl::disable(GL_TEXTURE_GEN_R);
use_env = false;
}
}
@@ -746,6 +749,7 @@ void draw_model_fragments(model::Model *model,
// disable env mapping
gl::disable(GL_TEXTURE_GEN_S);
gl::disable(GL_TEXTURE_GEN_T);
+ gl::disable(GL_TEXTURE_GEN_R);
use_env = false;
}
@@ -781,6 +785,7 @@ void draw_model_fragments(model::Model *model,
// disable env mapping
gl::disable(GL_TEXTURE_GEN_S);
gl::disable(GL_TEXTURE_GEN_T);
+ gl::disable(GL_TEXTURE_GEN_R);
use_env = false;
}