Jump to content

  • Log In with Google      Sign In   
  • Create Account


problem with glCopyTexSubImage


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Farfadet   Members   -  Reputation: 175

Like
0Likes
Like

Posted 24 November 2010 - 09:13 AM

I'm copying a texture to another one using FBO's and glCopyTexImage2D - glCopyTexSubImage2D. Both textures are 1024*1024 pixels. It works, except that the image is offset by 27 pixels vertically in the destination texture. If I specify an offset of y = -27 in glCopyTexImage2D , the images match, but of course I miss a strip of the source. This is true for both glCopyTexImage2D and glCopyTexSubImage2D, with or without specifying the margin in width/height. Anybody experienced something like this ? I have an ATI Mobility Radeon X1400. Thanks.



Sponsor:

#2 karwosts   Members   -  Reputation: 840

Like
0Likes
Like

Posted 24 November 2010 - 09:23 AM

I don't have a solution for you, but note that 27 pixels is right about the height of a windows titlebar. Somewhere it's possible that there is one command that is accounting for the height of the titlebar and one that isn't, so you get the vertical offset.

I don't know how to correct it, but maybe you can use this information somehow to continue your search.

Maybe you can change the x/y specified to glCopy instead of changing the yoffset. It says that x/y are in screen aligned window coordinates, so this might be relative to the window and not just the opengl canvas, but I'm not really sure.

#3 Farfadet   Members   -  Reputation: 175

Like
0Likes
Like

Posted 24 November 2010 - 09:02 PM

Well, I followed your idea and noticed that the offset is related to the windows settings (such as border margin), and even to the window size. The further the window dimensions are from the texture's (1024*1024), the bigger the offset. This means that the copy of the texture attached to the FBO takes place as if the window framebuffer's dimensions were considered, not the FBO's. However, it is the FBO/texture image that's copied. I tried about every possible combination of glViewPort, but nothing changes (and that's logical, since glViewPort involves the rendering pipeline, and here I use glCopyTexImage). The strange thing is that after copying, I use the same FBO to render on the texture, with the proper glViewPort, and there it works perfectly well. This might simply be a bug in the ATI driver.

Next I'll try copying the texture by rendering it to the destination texture.

Thanks a lot




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS