Commit 2cf39cd0 authored by Christopher Tenter's avatar Christopher Tenter

fix face color bug #refs 1458

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16747 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 66ccd3aa
......@@ -260,7 +260,7 @@ void MaterialNode::enter(GLState& _state, const DrawModes::DrawMode& _drawmode
}
if ( ( applyProperties_ & ColorMaterial ) && (_drawmode & DrawModes::SOLID_FACES_COLORED_FLAT_SHADED) )
if ( ( applyProperties_ & ColorMaterial ) && (_drawmode & (DrawModes::SOLID_FACES_COLORED_FLAT_SHADED|DrawModes::SOLID_FACES_COLORED_SMOOTH_SHADED)) )
{
materialBackup_.colorMaterial_ = glIsEnabled(GL_COLOR_MATERIAL);
......
......@@ -442,24 +442,7 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
_state.set_base_color(base_color_backup);
}
if ( ( _drawMode & DrawModes::SOLID_FACES_COLORED_SMOOTH_SHADED ) && mesh_.has_face_colors() && mesh_.has_vertex_normals() && mesh_.n_faces() > 0)
{
Vec4f base_color_backup = _state.base_color();
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->setSmoothShading();
drawMesh_->usePerVertexNormals();
drawMesh_->usePerFaceColors();
draw_faces();
ACG::GLState::depthRange(0.0, 1.0);
_state.set_base_color(base_color_backup);
}
if ( ( _drawMode & DrawModes::SOLID_SMOOTH_SHADED_FEATURES ) && mesh_.has_halfedge_normals() && mesh_.n_faces() > 0)
{
......@@ -493,6 +476,25 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
_state.set_base_color(base_color_backup);
}
if ( ( _drawMode & DrawModes::SOLID_FACES_COLORED_SMOOTH_SHADED ) && mesh_.has_face_colors() && mesh_.has_vertex_normals() && mesh_.n_faces() > 0)
{
Vec4f base_color_backup = _state.base_color();
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->setSmoothShading();
drawMesh_->usePerVertexNormals();
drawMesh_->usePerFaceColors();
draw_faces();
ACG::GLState::depthRange(0.0, 1.0);
_state.set_base_color(base_color_backup);
}
if ( ( _drawMode & DrawModes::SOLID_TEXTURED ) && mesh_.has_vertex_texcoords2D())
{
......@@ -555,7 +557,6 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
// Textured by using coordinates stored in halfedges
if ( ( _drawMode & DrawModes::SOLID_2DTEXTURED_FACE_SHADED ) && mesh_.has_face_normals() && mesh_.n_faces() > 0)
{
ACG::GLState::enable(GL_TEXTURE_2D);
// enable_arrays( PER_FACE_VERTEX_ARRAY | PER_FACE_TEXCOORD_ARRAY | PER_FACE_PER_VERTEX_NORMAL_ARRAY );
......@@ -574,7 +575,6 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
}
// Rebind the previous texture
ACG::GLState::bindTexture(lastTarget,lastBuffer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment