This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Multiple textures with Mali-GPUs don't work properly

Note: This was originally posted on 6th February 2013 at http://forums.arm.com

Hi,

I have a problem with Mali-GPUs and multiple textures with OpenGL ES 2 (at least, I think it could be a problem with the Mali-GPU).

So, here my problem:
I just want to use multiple textures in my Android-App with OpenGL-ES 2.0, but the necessary code in the fragment shader doesn't work with most Samsung devices (tested Galaxy Nexus, galaxy S3, Galaxy Note 2, Galaxy S2). The texture wich is new calculated in the fragment shader (see code below), doesn't show up on this devices, but on the Nexus 4, it works fine. So, I conclude, that this problem could be caused by the Mali-GPU in the Samsung devices.

Here the fragment shader code I am using:
precision mediump float;            
uniform sampler2D uTexture;
uniform sampler2D refractTexture;   
varying vec2 vTexCoordinate;
varying vec2 vRefTexCoordinate;

void main() {  
   vec2 scaleVec = vec2(0.05, 0.05); 
      vec4 bumpTex = 2.0 * texture2D(refractTexture, vRefTexCoordinate) - 1.0; 
   vec2 refCoords = vTexCoordinate.xy + bumpTex.xy * scaleVec; 

    gl_FragColor = texture2D(uTexture, refCoords);

}


The error seems to be in following line:
vec4 bumpTex = 2.0 * texture2D(refractTexture, vRefTexCoordinate) - 1.0;
If I delete this line (and the follwing line vec2 refCoords =...), the texture appears (it's just not calculated, but at least, it is visible). I have no idea, why this works on a Nexus 4, but not on a Mali-device.

Are there any known problems wiht the texture2d()-function on the Mali-GPUs or is it just my fault (but, how I said, on other non-mali devices it works properly)?

I would be glad about any tips and support relating to my problem.
Parents Reply Children
No data