Blitting text/textures works fine in emulator but not on actual phone

Started by Lavos, April 26, 2012, 04:45:17 AM

Previous topic - Next topic

Lavos

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:
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:
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?


Lavos

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...

EgonOlsen

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?