mirror of
https://github.com/LearnOpenGL-CN/LearnOpenGL-CN.git
synced 2025-08-23 04:35:28 +08:00
Update 02 Mesh.md
纹理编号是整型, 应该调用setInt
This commit is contained in:
@@ -170,7 +170,7 @@ void Draw(Shader shader)
|
|||||||
else if(name == "texture_specular")
|
else if(name == "texture_specular")
|
||||||
number = std::to_string(specularNr++);
|
number = std::to_string(specularNr++);
|
||||||
|
|
||||||
shader.setFloat(("material." + name + number).c_str(), i);
|
shader.setInt(("material." + name + number).c_str(), i);
|
||||||
glBindTexture(GL_TEXTURE_2D, textures[i].id);
|
glBindTexture(GL_TEXTURE_2D, textures[i].id);
|
||||||
}
|
}
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
|
Reference in New Issue
Block a user