I am trying to bind 2 textures for my shader. But for some reason, it always seems like the last image I defined. Am I doing something wrong?
GLuint textures[2]; glEnable(GL_TEXTURE_2D); glGenTextures(2, textures); glBindTexture(GL_TEXTURE_2D, textures[0]); glfwLoadTexture2D("C:\\front.tga", GLFW_BUILD_MIPMAPS_BIT); glBindTexture(GL_TEXTURE_2D, textures[1]); glfwLoadTexture2D("C:\\reflect.tga", GLFW_BUILD_MIPMAPS_BIT);
In this case, I see 'reflect.tga' for reflection and refraction in my shader ...
const vec3 Xunitvec = vec3 (1.0, 0.0, 0.0); const vec3 Yunitvec = vec3 (0.0, 1.0, 0.0); uniform vec3 BaseColor; uniform float Depth; uniform float MixRatio;
source share