27 for (
auto& command : m_commands)
30 auto shaderProgram = command.material->GetShaderProgram();
31 shaderProgram->SetUniform(
"uModel", command.modelMatrix);
32 shaderProgram->SetUniform(
"uView", cameraData.
viewMatrix);
34 shaderProgram->SetUniform(
"uCameraPos", cameraData.
position);
37 auto& light = lights[0];
38 shaderProgram->SetUniform(
"uLight.color", light.color);
39 shaderProgram->SetUniform(
"uLight.direction", glm::normalize(-light.position));
53 shaderProgram2D->Bind();
55 for (
auto& command : m_commands2D)
58 shaderProgram2D->SetUniform(
"uModel", command.modelMatrix);
59 shaderProgram2D->SetUniform(
"uView", cameraData.
viewMatrix);
60 shaderProgram2D->SetUniform(
"uProjection", cameraData.
orthoMatrix);
61 shaderProgram2D->SetUniform(
"uSize", command.size.x, command.size.y);
62 shaderProgram2D->SetUniform(
"uPivot", command.pivot.x, command.pivot.y);
63 shaderProgram2D->SetUniform(
"uUVMin", command.lowerLeftUV.x, command.lowerLeftUV.y);
64 shaderProgram2D->SetUniform(
"uUVMax", command.upperRightUV.x, command.upperRightUV.y);
65 shaderProgram2D->SetUniform(
"uColor", command.color);
66 shaderProgram2D->SetTexture(
"uTex", command.texture);