View Full Version : texture2D function on Android 3.2

01-17-2012, 10:43 AM

i'm pretty new to OpenGL ES 2.0 and I try to produce a fragment shader that gives me a texture and a simple diffuse lighting. It works fine with the texture only:

gl_FragColor = texture2D(uTex, vTexCoord);
If i use my calculated diffuse value on a constant vector, the result is as expected, too:

gl_FragColor = diffuse * vec4(0.0, 0.0, 1.0, 1.0);

Here is the problem: If I multiply the texture lookup result by the diffuse float, there is no render result at all on the screen:

gl_FragColor = diffuse * texture2D(uTex, vTexCoord);
The device is a Motorola XOOM with Android 3.2. Any help is highly appreciated.


04-07-2012, 01:29 PM
What exactly do you have inside the "diffuse" variable? Have you initialized it? :?: :!: :?:

Also, can you show what do you have in "uTex, vTexCoord"? This information might help to point what could be the cause of your problem. 8)