diff options
author | Evan Goers <mega@osirion.org> | 2012-01-24 06:44:19 +0000 |
---|---|---|
committer | Evan Goers <mega@osirion.org> | 2012-01-24 06:44:19 +0000 |
commit | 5d4e993e485ae3432eabb45caf4e4d43c9bc54e6 (patch) | |
tree | 2369f024c56e9211d95d10bc86d3220f21443137 /src/ui | |
parent | d20adb868fe02e9e7aa8a262b3cd4c5dd01d5eea (diff) |
Added a 'specular' material parameter. Defaults to 'color' values.
Tweaked lighting a bit.
Diffstat (limited to 'src/ui')
-rwxr-xr-x | src/ui/modelview.cc | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/ui/modelview.cc b/src/ui/modelview.cc index ec840c1..65954d8 100755 --- a/src/ui/modelview.cc +++ b/src/ui/modelview.cc @@ -190,21 +190,15 @@ void ModelView::draw() // we set up the light in camera space GLfloat modelview_light[] = { -10.0f * model->radius(), 0, 0, 1.0f }; GLfloat ambient_light[] = { 0.1f, 0.1f, 0.1f, 1.0f }; - GLfloat diffuse_light[4]; - GLfloat specular_light[4]; - for (size_t i = 0; i < 3; i++) { - diffuse_light[i] = 0.8f; - specular_light[i] = 0.4f; - } - diffuse_light[3] = 1.0f; - specular_light[3] = 1.0f; + GLfloat diffuse_light[] = { 0.75f, 0.75f, 0.75f, 1.0f }; + GLfloat specular_light[] = { 0.75f, 0.75f, 0.75f, 1.0f }; glLightfv(GL_LIGHT1, GL_POSITION, modelview_light); glLightfv(GL_LIGHT1, GL_AMBIENT, ambient_light); glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse_light); glLightfv(GL_LIGHT1, GL_SPECULAR, specular_light); - glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.05f); + glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.75f); gl::enable(GL_LIGHT1); |