1

I'm developing a 2D game for Android and i'm using the framework which has been told in the book which named Beginning Android Games by Mario Zechner.So my framework is well designed and using OpenGL 1.1.It's similar to libgdx.

When i put my textures adjacent each other in my 2d surface,there are some spaces size as 1 px.But this problem only occur on my tablet.There aren't a problem like this on my phone.It's like in this picture:

my problem

What can be the problem?I can't fix it from one week.

UPDATE:

      batcher.beginBatch(Assets.ground);
      konum =(int) (dunya.myMan.position.x/500);
      for(int i=konum;i<8+konum;i++)
      batcher.drawSprite(500*i, 61, 500, 122, Assets.groundRegion);

      batcher.endBatch();
2

1 Answer 1

0

Likely you're translating your quads by non-integral values, which can cause textures to get sampled off-center, and can cause some artifacts like that.

If you make sure that all your 2d translations line up with screen pixels, I think you won't see the problem anymore.

4
  • What you mean with "non-integral values"? Jun 3, 2012 at 20:59
  • @droidmachine: I mean values that are not integers. Don't translate a quad by 1.75 pixels. Make translations only 1, or 2, or 3 pixels, etc.
    – Tim
    Jun 3, 2012 at 21:13
  • I should have also mentioned that you need your orthographic projection dimensions to also match the number of pixels on the screen. What's your projection set up like? @droidmachine
    – Tim
    Jun 3, 2012 at 21:43
  • Yes i'm using orthographic projection. Jun 3, 2012 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.