Texture wrapping works in emulator but not on device (Galaxy S5)

Started by spookey, November 22, 2015, 10:44:33 AM

Previous topic - Next topic

spookey

Hi all,

I have a project where the user just flies around a textured .OBJ object, and everything works well in the emulator, but when I run it on the device, all textures behave as if I had set setClamping() to true.  It must be a clamping/wrapping issue because when I use setClamping(true) on all textures, the results are identical on the emulator and the device. But the model needs the wrapped textures and I don't know how to enforce this on the device.

EgonOlsen

Shouldn't happen and I've never heard of anything like it. Have you tried it on another device? Do you have a test case for this?

EgonOlsen


spookey

I'll be able to test on another device in a few hours. I use the latest version, I even downloaded it again this morning. There are no other problems with the texturing - they all load fine and if I use calcTextureWrap() or calcTextureSphere() it works. All textures are 256x256.

EgonOlsen

Really strange. If it doesn't work on the other device as well, I need a test case. If it does, you might want to try to play around with texture settings on the S5 (like enabling/disabling mipmaps, 16bit color, etc compression...).

spookey

So I tested it on a Galaxy S3 mini and it works. Where are the texture settings in jPCT or do I need to make explicit OpenGL calls?  I tried inserting this before world.renderScene(fb) but it didn't help:

GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_REPEAT);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_REPEAT);


EgonOlsen

No, you are not supposed to make explicit GL calls. What you have there is basically what jPCT-AE does anyway. I've no idea, why it fails on the S5. I've never heard of any problems with the S5, so I'm quite puzzled by this. It uses an Adreno GPU...I've multiple devices with Adreno GPUs and none shows auch a behaviour.
A few more questions: Which Android version are you using? Samsung's or some custom ROM? I've had issues with some of the 'optimizations' in custom ROMs before, hence the question.
And which OpenGL version are you using? If it's 1.x, try 2.0 instead and see if that helps.

spookey

I use Samsung's Android (5.0) and I have installed every update that came so far. But it does have some strange behavior lately, such as the default keyboard mysteriously resetting to Samsung's keyboard and there's a facebook virus that redirects Chrome. Could this be related? I'll try again after a factory reset.

spookey

The OpenGL version is 2.0. I actually use jPCT-AE with Google Cardboard's API.

EgonOlsen


EgonOlsen

Have you tried how it behaves without cardboard API? Can you create a minimal test case that shows the issue?

spookey

I made a test case without the Cardboard API, but it worked. So the API must be causing the problem, but it works with Cardboard on the S3.. I'll try a few things and will let you know what happened.

EgonOlsen

That's strange, because the repeat mode is bound to the texture. Once uploaded, I don't see how it can be changed by some other API. FrameBuffer has a prewarm-method, that uploads all textures know to the TextureManager at once. Maybe it's worth a try to call that in onSurfaceChanged right after the texture loading.

EgonOlsen

....sorry, TextureManager has that method, or course. Not FrameBuffer...

spookey

This is the test case that demonstrates the issue. It's a textured castle (it takes a while to load because it's big). This should display correctly in the emulator but not on the S5. But if you change the code to not use Cardboard, the problem disappears. https://dl.dropboxusercontent.com/u/1608884/testcase.zip