implemented light into cpp,
bug: everything is dark, need to calculate the normal matrix once in cpp and not for every pixel
This commit is contained in:
@@ -225,6 +225,10 @@ void OglViewerWidget::paintGL()
|
||||
// Set view-projection matrix
|
||||
m_program.setUniformValue("vp_matrix", m_projection * view);
|
||||
|
||||
// Set Light
|
||||
m_program.setUniformValue("light.position", m_light.position);
|
||||
m_program.setUniformValue("light.intensities", m_light.intensities);
|
||||
|
||||
// Draw cube geometry
|
||||
m_dataEngine->drawGeometry(&m_program, m_wireframe);
|
||||
}
|
||||
|
Reference in New Issue
Block a user