Texture Rendering Artifacts

Started by
1 comment, last by RAZORUNREAL 16 years, 9 months ago
Hello all, i get curious distortions while scaling textures down to use them as image pyramid. For that i do: 1) Write data from host into a texture buffer (glDrawPixels or glTexSubImage2D). 2) This texture is used for the next scale level. So i apply it and draw a quad with:

glBegin(GL_QUADS);
{
   // draw first scale
   glTexCoord2f(0.0,0.0);
   glVertex3f(-1.0,-1.0,1.0f); // down left

   glTexCoord2f(1.0,0.0);
   glVertex3f(0.0,-1.0,1.0f); // down right

   glTexCoord2f(1.0,1.0);
   glVertex3f(0.0,0.0,1.0f); // up right

   glTexCoord2f(0.0,1.0);
   glVertex3f(-1.0,0.0,1.0f); // up left
}
glEnd();

Please note that glVertex3f is getting parameters for only a fourth of the texture buffer. The rest of the buffer is used for the next scale levels. The data I draw contains only a simple rectangle. I have also applied different scaling filters. In the following image, you see a bilinear kernel applied to the down scale procedure. What i get is a distortion while crossing the diagonal from upper left to down right on each scale level. Distortion while crossing the diagonal I checked the following things: 1) Use of floating point precision (16-bit and 32-bit). No change! 2) Use of own fragment shader (bilinear-, barlett-, gauss-filtering). No change! 3) The data initially written down are precise at all. These effects are appearing after the first scaling. I cannot use mipmaps since i want to control the build procedure. Do anyone know how this effect can be avoided? Thank's in advance Stefan
Advertisement
Can't anyone help me?
Quote:Original post by smay
Please note that glVertex3f is getting parameters for only a fourth of the texture buffer. The rest of the buffer is used for the next scale levels.


Um... Your texture coordinates still go from 0 to 1, so the whole texture is used. glVertex3f only changes the position on screen. Still, I don't know why you get that slice.
___________________________________________________David OlsenIf I've helped you, please vote for PigeonGrape!

This topic is closed to new replies.

Advertisement