Is there a way to change the range of GL_CLAMP or easily edit the U/V Coordinates? In an OBJ renderer that I am working on, texture clamping seems to be putting up a fuss.
The cube on the left is using the following code. The upper-right part of the image is what it looks like using GL_MIRROR in place of GL_CLAMP, but scaling the object and moving the camera around makes the textures go crazy, so it looks like a square. The bottom-right part of the image is the texture that is mapped to it.
glGenTextures( 1, &GL_texture[loaded_textures] ); glBindTexture( GL_TEXTURE_2D, GL_texture[loaded_textures] ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, surface->w, surface->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels );
Any idea what I am doing wrong here?