Hello,
A strange problem occurred to me after developing a dynamic cube mapping:
It seems that the cubemap textures aren’t fully updated when running the demo in windowed mode with resolution 1024x768. There’s a small area of garbage in every cubeface texture. It looks like it’s not updating the whole texture. If I run the same piece in fullscreen mode 1024x768 the textures update just fine.
Other resolutions like 640x480 or 800x600 work just fine too, fullscreen or not.
My cubemaps are 256x256. I tried to lower them as low as 64x64 but it didn’t make any difference.
I runned some tests I’ve cut the problem down to the updating function as static cubemaps seem to work fine in any resolution or screen mode.
Here’s the function I use:
void Mirroring::renderEnvironment() { unsigned int i; glViewport(0, 0, 256, 256); /* Setup 90 FOV perspective */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(90.0f, 1.0f, 1.0f, 5000.0f); glMatrixMode(GL_MODELVIEW); for(i = 0; i < 6; i++) { glClear(GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glRotatef(rotations[i][0], rotations[i][1], rotations[i][2], rotations[i][3]); if(i == 0 | | i == 1) { glRotatef(180.0f, 0.0f, 0.0f, 1.0f); } renderBg(); renderLeaves(); glBindTexture(GL_TEXTURE_CUBE_MAP_EXT, cubeMap); glCopyTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT+i, 0, 0, 0, 0, 0, 256, 256); } sys.resize(win.getWidth(), win.getHeight()); glClear(GL_DEPTH_BUFFER_BIT); glViewport(0, 0, win.getWidth(), win.getHeight()); }
I hope the code appears ok as this is my first post
If someone has been similar problems I’d be glad to here how they’re been solved.
Cheers,