more information for the InfoWindow,

set correct values for cloth material,
enable specular map
This commit is contained in:
Anakin
2017-01-22 14:37:06 +01:00
parent 5f104e46f2
commit 91488c55b2
6 changed files with 82 additions and 40 deletions

View File

@@ -177,6 +177,7 @@ void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program, bool wireframe)
for (auto& it : m_drawList)
{
bool tmp_transparent(false);
bool tmp_specular(false);
float shininess;
QVector3D specularColor;
@@ -185,6 +186,7 @@ void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program, bool wireframe)
{
m_materials->at(it.textureIndex).texture->bind();
tmp_transparent = m_materials->at(it.textureIndex).transparent;
tmp_specular = m_materials->at(it.textureIndex).flags[7];
shininess = m_materials->at(it.textureIndex).shininess;
specularColor = m_materials->at(it.textureIndex).specularColor.toVector3D();
}
@@ -199,8 +201,9 @@ void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program, bool wireframe)
// Set normal matrix
program->setUniformValue("n_matrix", (normMatrix * it.modelMatrix).normalMatrix());
// decide if this is transparent
// set some more values
program->setUniformValue("b_transparent", tmp_transparent);
program->setUniformValue("b_specular", tmp_specular);
// set some material attributes
program->setUniformValue("materialShininess", shininess);