Texture: Rectangle-Extension

Hallo!

I want to copy my screen output to a texture. I use the Rectangle-Ext therefore together with glCopyTexSubImage2D.

My Problem is: The re-rendering of the textur looks not as good as the original vertex-picture.
For example I draw a yellow quad directly through verteces: color is bright and border is sharp.
when i draw the copied texture the color is less bright and the border is misty.

So why do I have this problem, and how can I solve it?

My texture gets the exactly size of the window to be captured, so it is 1:1 rendering.

http://kaioa.com/k/badsample.png

Left is a pot texture right is a npot texture. The sampling points seem to be a tad off with npot textures.

Try using a pot texture instead. (npot textures are just fine for 3d stuff tho.)

What interpolation mode are you using on your texture object - GL_LINEAR? Try GL_NEAREST or let the texture coordinates range from 1.0/width to 1.0 - 1.0/width and not from 0 to width to achieve pixel perfect sampling.

Yours,
Stefan

Must have been very tired, sorry for any confusion that I caused.

  1. For npot textures the coordinates range to (width,height) unlike pot textures which go to (1,1)
  2. To sample the center of the texels the texture coordinates should go from (1/(2width),1/(2height)) to (1-1/(2width), 1-1/(2height)) for pot textures and (0.5, 0.5) to (width-0.5, height-0.5) for npot. Hope I got it right this time.
    At least my recommendation with the GL_NEAREST filter wasn’t wrong :wink: