FBO rendering different result between Glaxay S2 and S3
Posted
by
BruceJones
on Game Development
See other posts from Game Development
or by BruceJones
Published on 2012-12-16T14:39:56Z
Indexed on
2012/12/16
17:23 UTC
Read the original article
Hit count: 233
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 S2/Note
Can anyone explain the difference?
© Game Development or respective owner