texture2D function on Android 3.2

Hi,

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.

Regards,
Daniel

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)

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.