calculate normal matrix once in cpp (performance),
added bool variable to turn light on/off (still needs button),
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user