Author Topic: Blitting text/textures works fine in emulator but not on actual phone  (Read 985 times)

Offline Lavos

  • byte
  • *
  • Posts: 2
    • View Profile
Hi, I've been running into a strange issue that I haven't been able to find any answers for...

I'm trying to blit a background texture behind the game and a text string (using raft's AGLFont class) in the foreground:

In initialization:
Code: [Select]
font = new Paint();
font.setTextSize(20);
overlayFont = new AGLFont(font);
background = new Texture(BitmapHelper.rescale(BitmapHelper.convert(getResources().getDrawable(R.drawable.backtexture)), 512, 256));

And in the drawing method:
Code: [Select]
Display display = getWindowManager().getDefaultDisplay();
fb.blit(background, 0, 0, 0, 0, 512, 256, display.getWidth(), display.getHeight(), 100, false);
world.renderScene(fb);
world.draw(fb);
overlayFont.blitString(fb, "testing", 100, 100, 100, new RGBColor(100,90,25));
fb.display();

This works just fine on the emulator, but not on an actual device. I've tested this on two different phones (a Droid X and a Nexus S) and in both cases, neither the background nor the text show up at all. Any clue what I might be doing wrong?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11775
    • View Profile
    • http://www.jpct.net
Re: Blitting text/textures works fine in emulator but not on actual phone
« Reply #1 on: April 26, 2012, 10:18:08 am »

Offline Lavos

  • byte
  • *
  • Posts: 2
    • View Profile
Re: Blitting text/textures works fine in emulator but not on actual phone
« Reply #2 on: April 26, 2012, 11:34:24 pm »
Tried it, but unfortunately the problem still persists =(

Edit: Looks like I figured it out, but the solution is bizarre as well. Changing the clipping distance from 4000 to 3000 causes both the texture and text to appear without a problem...
« Last Edit: April 27, 2012, 01:43:51 am by Lavos »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11775
    • View Profile
    • http://www.jpct.net
Re: Blitting text/textures works fine in emulator but not on actual phone
« Reply #3 on: April 27, 2012, 10:54:59 am »
That's a known issue with some clipping distances that has it's source somewhere in the mix between depth buffer accuracy and gpu accuracy. I thought that it had been fixed for all cases...obviously not. Which OpenGL version are you using and can you create a test case for this?