I have a Cube shape with wood and metal texture applied to it now i create a second shape that is plane also get the metal texture that i used for specular also get applied to it, please help me understand why is it happening, why cant i get the normal texture on the new shape without specular being added to it. by my understanding its the shader material value that i added need adjusting… i am just guessing as of now please guide me.
this the code and material i set
this is during initialization
mLightShader->Bind();
mLightShader->SetInt("material.diffuse", 0);
mLightShader->SetInt("material.specular", 1);
void OpenGLTexture2D::Bind(uint32_t slot) const
{
glBindTextureUnit(slot, mRendererID);
}
this in the loop
for (unsigned int i = 0; i < 10; i++)
{
mTexture3->Bind();
mTexture2->Bind(1);
glm::mat4 Model = glm::mat4(1.0f);
Model = glm::translate(Model, cubePositions[i]);
float angle = 20.0f * i;
Model = glm::rotate(Model, glm::radians(angle), glm::vec3(1.0f, 0.3f, 0.5f));
mLightShader->SetMat4("u_Model", Model);
mCubeA->Render();
}
mTexture->Bind();
mLightShader->Bind();
Model = glm::mat4(1.0f);
Model = glm::translate(Model, glm::vec3(1.0f, -2.0f, 1.0f));
mLightShader->SetMat4("u_Model", Model);
mPlaneVA->Bind();
RenderCommand::DrawIndexed(mPlaneVA);
mLightShader->Unbind();