Solved multiple texture loading problem.

This commit is contained in:
Warwick 2022-07-20 16:30:40 +01:00
parent 40f12dd510
commit 3d3aaa3c3c
2 changed files with 2 additions and 5 deletions

View file

@ -121,8 +121,5 @@ void main()
color = color / (color + vec3(1.0)); color = color / (color + vec3(1.0));
color = pow(color, vec3(1.0/2.2)); color = pow(color, vec3(1.0/2.2));
//FragColor = texture(texture_diffuse1, ourTexCoord); FragColor = texture(texture_diffuse1, ourTexCoord) * vec4(color, 0.0);
FragColor = texture(texture_metalness1, ourTexCoord);
//FragColor = texture(texture_diffuse1, ourTexCoord) * vec4(color, 0.0);
//FragColor = vec4(CameraPos,1.0);
} }

View file

@ -59,7 +59,7 @@ void Mesh::draw(ShaderLoader &shader) {
error.log(("material." + name + number).c_str() + std::string(" ") + error.log(("material." + name + number).c_str() + std::string(" ") +
std::to_string(i) + " " + std::to_string(textures[i].id)); std::to_string(i) + " " + std::to_string(textures[i].id));
shader.setInt(("material." + name + number).c_str(), i); shader.setInt((name + number).c_str(), i);
glBindTexture(GL_TEXTURE_2D, textures[i].id); glBindTexture(GL_TEXTURE_2D, textures[i].id);
// error.log(std::to_string(i)); // error.log(std::to_string(i));
} }