Commit 04d8c453 authored by Anakin's avatar Anakin

fdsgds<gv<df

parent ed66d77b
......@@ -277,9 +277,6 @@ void OpenGLController::updateScene()
for (unsigned int modelIndex = 0; modelIndex < vModels.size(); modelIndex++)
{
// give the MVPs to the shader
glBindBuffer(GL_UNIFORM_BUFFER, gluiInstanceBufferID);
glBufferSubData(GL_UNIFORM_BUFFER, sizeof(glm::mat4), NULL, &getMVPMatrix(0));
glBindBuffer(GL_UNIFORM_BUFFER, 0);
//glUniformMatrix4fv(gluiMatrixID, 1, GL_FALSE, &getMVPMatrix(modelIndex)[0][0]);
......@@ -385,4 +382,14 @@ void OpenGLController::loadMsh(const char * path)
tempBufferData.data(),
GL_STATIC_DRAW
);
//TODO: limit to max model count
std::vector<glm::mat4> tempMVPs;
for (int i = 0; i < vModels.size(); i++)
tempMVPs.push_back(getMVPMatrix(i));
glBindBuffer(GL_UNIFORM_BUFFER, gluiInstanceBufferID);
glBufferSubData(GL_UNIFORM_BUFFER, sizeof(glm::mat4) * vModels.size(), NULL, tempMVPs.data());
glBindBuffer(GL_UNIFORM_BUFFER, 0);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment