Jump to content
  • Advertisement
Sign in to follow this  
smay

Texture Rendering Artifacts

This topic is 4026 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!