hello,
I’ve come across a problem when using a cubemap texture and a cubemap sampler inside of a texture. When I associate a cubemap texture with a cubemap sampler inside of a shader, the cubemap texture then binds itself to every other object in the world (overriding any other texture binds I call).
here is some pseudo code of what i do:
//create the cube map texture using fbo
//bind the program shader
glEnable(GL_TEXTURE_CUBE_MAP);
glActiveTexture(GL_TEXTURE0 + next_unused_value);
glBindTexture(GL_TEXTURE_CUBE_MAP, cubemapGLuint);
//set up texture params for cubemapping
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
//repeat for s,t
glDisable(GL_TEXTURE_CUBE_MAP);
glActiveTexture(GL_TEXTURE0);
//draw my object
//detach the shader
I can’t seem to track down any reasons why the cube map will override textures especially since it isn’t bound when other objects are drawn.
Thanks,
Mitch