Jump to content
  • Advertisement
Sign in to follow this  
Maurice

Texture tilling problem

This topic is 3814 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

Hi, I seem to have run into a slight problem when trying to make a panoramic viewer. For this program I'am using very large textures. Around 6000 to 8000 pixels wide and halve of that in height (2:1 aspect). The width and height of the images are a factor of the texture width. The images are supplied in jpg format. The image is loaded completely into memory and fed to the glTexImage2D() routine to create ("cut out") individual textures. With the help of the following piece of code that is placed before the glTexParameteri() functions. glPixelStorei( GL_UNPACK_ROW_LENGTH, Texture->Width ); glPixelStorei( GL_UNPACK_SKIP_PIXELS, col * Texture->TextureSize ); glPixelStorei( GL_UNPACK_SKIP_ROWS, row * Texture->TextureSize ); The large image is cut up into tiles each 256x256 pixels. 'col' and 'row' indicate which texture tile is currently selected. When I use the following code before loading the texture into the video memory the resulting panoramic view is perfect, save for the large pixels showing up. The large image is 100% displayed correctly. glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP ); Now when I change the top two lines to GL_LINEAR I get black lines running along the borders of the Tiles. glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP ); See the following screenshot of the resulting display: Using GL_CLAMP Now changing the GL_CLAMP into GL_CLAMP_TO_EDGE gives a better view, but it is still not what I want to see. I still get some visible lines between the different tiles. glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); See the following screenshot of the resulting display: Using GL_CLAMP_TO_EDGE How do I get rid of those line between the texture tiles ? Is it possible to use GL_NEAREST and bend the resulting image completely on the GFX card ? any idea's thoughts ?

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!