Reputation: 1066
I am having a trouble with some android device's artifact like this image attached below.
I am running a my own rendering engine designed by opengl and c++, and I render same things on Mac, Windows, IOS and Anroid. In only one specific device, Google Tango Tablet, I can see the artifact gradient. I tried it using glsl without a texture and I tried it using a texture but either way, the result is the same.
It is a texture rendered with blend& texture options.
1. glBlendFunc(GL_SRC_COLOR,GL_ONE_MINUS_SRC_COLOR);
2. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
other 5 android devices have no problem with this.
What is the best approach to solve this?
Upvotes: 1
Views: 277
Reputation: 6766
I think that the device probably has a 565 render target, so the 8888 texture source ends up getting quantized down. The bit depth of the render target is probably set in GLSurfaceView.java (although it might not be depending on what framework your app is based on). It might be possible to choose a higher bit depth, but not all devices support better than 565 for the main one.
One possible fix is enable dithering with glEnable(GL_DITHER), this will break up the gradient and make it much harder to spot.
However, once you have more stuff in your scene you'll find that gradient artifacts become pretty difficult to spot anyway because of the noise from everything else that's going on.
Upvotes: 1