moved loadMTL Texture to init to improve performance

This commit is contained in:
dompia5 2024-02-01 17:01:03 +01:00
parent d28c6eecb9
commit e514ce6699

View File

@ -419,7 +419,6 @@ void renderScene(GLFWwindow* window)
//drawObjectColor(plant2Context, plantModelMatrix, glm::vec3(1,1,1), program);
// drawObjectColor(plant3Context,glm::translate(glm::vec3(1.0f, 0.5f, 3.0f)) *glm::scale(glm::vec3(0.03f)) *glm::rotate(glm::mat4(1.0f), glm::radians(-90.0f), glm::vec3(1.0f, 0.0f, 0.0f)),glm::vec3(1, 1, 1), program);
loadMTLAndGetTextureID("./models/plant_1_1.mtl", plant3Material);
drawObjectTexture_plant(plant2Context, plantModelMatrix, plant3Material, program_pbr);
//drawObjectColor(plant2Context, plantModelMatrix, glm::vec3(1, 1, 1), program);
@ -475,6 +474,7 @@ void init(GLFWwindow* window)
texture::grid = Core::LoadTexture("textures/grid.png");
texture::planet1 = Core::LoadTexture("textures/tek_1.jpg");
loadMTLAndGetTextureID("./models/plant_1_1.mtl", plant3Material);
}