Jump to content
  • Advertisement
Sign in to follow this  
NicolasJay

OpenGL GLES2.0 Tile textures wrapping/flickering

This topic is 2683 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 am working on a tile based game for Android. The tiles are 128x128px. I have a map editor for windows that arranges the tiles. In the windows editor, which uses the fixed function opengl pipeline, the tiles paint fine...but when I try to draw the tiles on the phone, i get wierd texture wrapping problems. It usually jumps back and forth (i.e. leftmost column of pixels appears wraps to the left and vice versa) I tried declaring float presision highp in the shader, but that didn't help =/ does anyone have any ideas how i can fix this? the problem is very inconsistent and flickery, so I have to assume its a precission error somewhere along the pipeline..not sure where though.

thanks


EDIT:
haven't gotten home to try it yet, but I think I have found the solution;
[source lang="cpp"]
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
[/source]

Share this post


Link to post
Share on other sites
Advertisement
it's hard to say without seeing the shader code, but the inconsistant flickering you're discribing can be caused by failing to initialize one of the varibles you're shader code is trying to use. For instance if you use this -->> lightdir = normalize(lightPos - position);<<--- but forget to initialize either 'lightPos' or 'position' you will end up with inconsistant flickering like what you described.

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!