Cubemap sampler with cubemap texture

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

Do a XML frame grab with http://glintercept.nutty.org/ and have a look at what textures are bound with each draw call.

(Use the AuthorStd profile and press CTRL-SHIFT-F)

thanks for the program. It helped me track down my issue. FYI, I was disabling GL_TEXTURE_CUBE_MAP in a different active texture than the one I originally created the cube map and had never originally turned off GL_TEXTURE_CUBE_MAP there.

Thanks again, looking at it from a different angle helped me locate the issue.

Mitch

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.