1
votes

I have a problem with the rendering to texture in my Android based game (OpenGl ES2.0). I wasn't aware of the issue as on most devices this problem doesn't exists and everything is drawn just fine.
Regarding the screenshot attached below, the red bar on the left is drawn on the main framebuffer and because of that it is properly displayed. Everything else is rendered on off-screen texture which is then rendered on the main framebuffer. I'm attaching the screenshot made on Samsung Galaxy Y S5360 (I'm not aware if this issue occur on other devices) as well as the code responsible for off-screen framebuffer/texture creation:

GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texture[i]);
GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);      
GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, framebuffer[i]);
GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, texture[i], 0);

if(GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER) != GLES20.GL_FRAMEBUFFER_COMPLETE) {
// ...

Bad rendering

1
The issue's still there. No one has any idea what can go wrong on Galaxy Y? - Eric
I have exact the same problem you have in my game on Galaxy Y (and only on that device). Every thing I draw directly works, some framebuffer objects get that same glitch I did some testing, and the glitch only happen in certain sizes, but I am still looking for a solution. Did you solve the problem somehow? - fbafelipe
Unfortunately I don't have a device on which I could test the issue. If you'll find the solution please post it here. Good luck - Eric
One of my teammates have a Galaxy Y, I did a lot of debugging, but could not make it work. It work just fine in other devices, and it only bug with some framebuffer sizes. The workaround I done was to just use a different framebuffer size (and do scale when drawing) if the device is a Galaxy Y, its ugly but at least it works. - fbafelipe

1 Answers

0
votes

If I'm not mistaken, Samsung Galaxy Y S5360 has only OpenGL ES-CM 1.1 See http://geekprison.com/2163-samsung-galaxy-y-s5360-pricespecification-announced-for-india/