diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/gl.cc | 5 | ||||
-rw-r--r-- | src/render/gl.h | 3 | ||||
-rw-r--r-- | src/render/state.cc | 8 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/render/gl.cc b/src/render/gl.cc index 932fe34..7b05da7 100644 --- a/src/render/gl.cc +++ b/src/render/gl.cc @@ -270,6 +270,11 @@ void specular(Color const & specular) glMaterialfv(GL_FRONT, GL_SPECULAR, specular.ptr()); } +void shininess(Color const & shine) +{ + glMaterialfv(GL_FRONT, GL_SHININESS, shine.ptr()); +} + void matrixmode(GLenum mode) { glMatrixMode(mode); diff --git a/src/render/gl.h b/src/render/gl.h index c5da4db..cf9e89d 100644 --- a/src/render/gl.h +++ b/src/render/gl.h @@ -257,6 +257,9 @@ void color(const float r, const float g, const float b, const float a = 1.0f); /// specify the specular reflectivity color void specular(math::Color const & specular); +/// specify the shininess +void shininess(math::Color const & shine); + /// Push the current transformation matrix to the stack void push(); diff --git a/src/render/state.cc b/src/render/state.cc index 6f791b3..8ada29c 100644 --- a/src/render/state.cc +++ b/src/render/state.cc @@ -234,7 +234,8 @@ void State::use_material_layer(const model::Material * material, const model::La } math::Color color(layer->color()); - math::Color specular(layer->color()); + math::Color specular(layer->specular()); + math::Color shine(layer->shininess()); // apply color generation rules switch (layer->rgbgen()) { @@ -283,6 +284,7 @@ void State::use_material_layer(const model::Material * material, const model::La gl::color(color); gl::specular(specular); + gl::shininess(shine); // lighted or fullbright if (state_power && layer->fullbright()) { @@ -328,7 +330,6 @@ void State::use_material_layer(const model::Material * material, const model::La } else { color.assign(0.0f, 0.0f, 0.0f); } - gl::material(GL_FRONT, GL_SHININESS, 4); } @@ -361,9 +362,6 @@ void State::reset() gl::disable(GL_TEXTURE_CUBE_MAP); gl::disable(GL_TEXTURE_2D); - // default specular shininess setting - gl::material(GL_FRONT, GL_SHININESS, 8); - gl::color(math::Color(1.0f)); gl::specular(math::Color(0.0f)); } |