I'm working on a pong game and have recently set up FBO rendering so that I can apply some post-processing shaders. This proceeds as so:

  • Bind texture A to framebuffer
  • Draw balls
  • Bind texture B to framebuffer
  • Draw texture A using fade shader on fullscreen quad
  • Bind screen to framebuffer
  • Draw texture B using normal textured quad shader

Neither texture A or B are cleared at any point, this way the balls leave trails on screen, see below for the fade shader.

Fade Shader

private final String fragmentShaderCode =
        "precision highp float;" +
        "uniform sampler2D u_Texture;" +
        "varying vec2 v_TexCoordinate;" +
        "vec4 color;" +
        "void main(void)" +
        "{" +
        "   color = texture2D(u_Texture, v_TexCoordinate);" +
        "   color.a *= 0.8;" +
        "   gl_FragColor = color;" +

This works fine with the Samsung Galaxy S3/ Note2, but cause a strange effect doesnt work on Galaxy S2 or Note1. See pictures:

Galaxy S3/Note2

Galaxy S3/Note2

Galaxy S2/Note

Galaxy S2/Note

Can anyone explain the difference?


Folowing VinceFR's comment, we've tried adding the following. When the renderbuffers are initialised they are briefly bound to the framebuffer and set the background to a uniform buffer with:


The result is unchanged on the S3, on the S2 it has improved a certain amount, but problems still exist:

Galaxy S2_2

note the 20 in the bottom right corner is supposed to be there.

  • \$\begingroup\$ Have you checked for glerrors? \$\endgroup\$ Commented Dec 16, 2012 at 17:24
  • \$\begingroup\$ Yep, no errors. \$\endgroup\$
    – BruceJones
    Commented Dec 16, 2012 at 18:21
  • 2
    \$\begingroup\$ try to draw a black background explicitly.I had a similar visual effect when i was drawing on a surface whith no background \$\endgroup\$
    – VinceFR
    Commented Dec 18, 2012 at 10:28
  • \$\begingroup\$ Make sure your background color's alpha, the depth clear value, the viewport and the scissor area are set up properly. EDIT: why did an old topic come up as new? \$\endgroup\$
    – maul
    Commented Mar 7, 2013 at 8:47
  • \$\begingroup\$ We tried clearing color and depth on start (didnt help). Doing so between frames would make it so the intended effect didnt work as it is a cumulative effect. viewport is set up properly, it works on GS3 after all. not sure what you mean by scissor area but id imagine thats fine for the same reason. We couldnt find a solution for this so in the end we had to remove the effect. \$\endgroup\$
    – BruceJones
    Commented Mar 19, 2013 at 11:21

1 Answer 1


Try to draw a black background explicitly. I had a similar visual effect when I was drawing on a surface with no background.

  • \$\begingroup\$ Thanks for your answer Vince, have edited the original question accordingly \$\endgroup\$
    – BruceJones
    Commented Dec 19, 2012 at 22:56
  • \$\begingroup\$ Add, when clearing the FBO, ensure that the viewport is properly set. It appears that you are missing the upper and lower bits. \$\endgroup\$
    – rioki
    Commented Mar 7, 2013 at 13:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .