calculate normal matrix once in cpp (performance),

added bool variable to turn light on/off (still needs button),
This commit is contained in:
Anakin
2017-01-17 20:18:04 +01:00
parent f5863752e2
commit a521dfc292
4 changed files with 34 additions and 17 deletions

View File

@@ -191,6 +191,9 @@ void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program, bool wireframe)
// Set model matrix
program->setUniformValue("m_matrix", it.modelMatrix);
// Set normal matrix
program->setUniformValue("n_matrix", (normMatrix * it.modelMatrix).normalMatrix());
// decide if this is transparent
program->setUniformValue("b_transparent", tmp_transparent);