avoid double matrix load

This commit is contained in:
Ian Curtis 2018-09-16 08:43:13 +00:00
parent a7e851d578
commit 5dab9910e2

View file

@ -178,8 +178,6 @@ bool CNew3D::RenderScene(int priority, bool renderOverlay, Layer layer)
continue; continue;
} }
m_r3dShader.SetModelStates(&m);
for (auto &mesh : *m.meshes) { for (auto &mesh : *m.meshes) {
if (mesh.highPriority) { if (mesh.highPriority) {
@ -190,7 +188,7 @@ bool CNew3D::RenderScene(int priority, bool renderOverlay, Layer layer)
if (mesh.highPriority != renderOverlay) continue; if (mesh.highPriority != renderOverlay) continue;
if (!matrixLoaded) { if (!matrixLoaded) {
glLoadMatrixf(m.modelMat); m_r3dShader.SetModelStates(&m);
matrixLoaded = true; // do this here to stop loading matrices we don't need. Ie when rendering non transparent etc matrixLoaded = true; // do this here to stop loading matrices we don't need. Ie when rendering non transparent etc
} }