Fix bug with loading material textures
This commit is contained in:
parent
d8d2c73438
commit
0db5c5d81a
@ -171,7 +171,7 @@ int main() {
|
|||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
std::vector<Vertex> vertices = {
|
std::vector<Vertex> vertices = {
|
||||||
// positions // normals // texture coords
|
// positions // normals // texture coords
|
||||||
Vertex{glm::vec3(-0.5f, -0.5f, -0.5f), glm::vec3(-1.0f, 0.0f, 0.0f), glm::vec2(0.0f, 1.0f)},
|
Vertex{glm::vec3(-0.5f, -0.5f, -0.5f), glm::vec3(-1.0f, 0.0f, 0.0f), glm::vec2(0.0f, 1.0f)},
|
||||||
Vertex{glm::vec3( 0.5f, 0.5f, 0.5f), glm::vec3( 1.0f, 0.0f, 0.0f), glm::vec2(1.0f, 0.0f)},
|
Vertex{glm::vec3( 0.5f, 0.5f, 0.5f), glm::vec3( 1.0f, 0.0f, 0.0f), glm::vec2(1.0f, 0.0f)},
|
||||||
Vertex{glm::vec3( 0.5f, 0.5f, -0.5f), glm::vec3( 1.0f, 0.0f, 0.0f), glm::vec2(1.0f, 1.0f)},
|
Vertex{glm::vec3( 0.5f, 0.5f, -0.5f), glm::vec3( 1.0f, 0.0f, 0.0f), glm::vec2(1.0f, 1.0f)},
|
||||||
@ -710,7 +710,7 @@ std::vector<Texture2D> Model::load_material_textures(aiMaterial *material, aiTex
|
|||||||
std::string absolute_path = directory + '/' + path.C_Str();
|
std::string absolute_path = directory + '/' + path.C_Str();
|
||||||
|
|
||||||
bool skip = false;
|
bool skip = false;
|
||||||
for (unsigned int j = 0; i < loaded_textures.size(); ++j) {
|
for (unsigned int j = 0; j < loaded_textures.size(); ++j) {
|
||||||
if (std::strcmp(loaded_textures[j].filename, absolute_path.c_str()) == 0) {
|
if (std::strcmp(loaded_textures[j].filename, absolute_path.c_str()) == 0) {
|
||||||
textures.push_back(loaded_textures[j]);
|
textures.push_back(loaded_textures[j]);
|
||||||
skip = true;
|
skip = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user