michael pan
michael pan

Reputation: 599

issue with texture2d on iPad2

We are running into a situation where for the same shader, a texture renders fine on iPad1, but not on the iPad2, when using GL_LUMINANCE. We've traced it to the texture2D call in the fragment shader. The vec4 returned by the texture2D call on the iPad1 contains the intensity value of the texture, but the vec4 returned by texture2D on the iPad2 is constant.

It looks like someone else also is seeing this problem [http://www.imgtec.com/forum/forum_posts.asp?TID=1267&PID=4307]. However, they are using GL_HALF_FLOAT_OES, while we are using GL_FLOAT.

Has anyone else seen this issue, and is there a workaround?

Upvotes: 1

Views: 338

Answers (1)

zai chang
zai chang

Reputation: 759

For a GL_LUMINANCE floating point texture, the iPad 2 clips luminance values to 0.0 - 1.0, so you should normalize the texture data before calling glTexImage2D. However, on the iPad 1 you're able to pass any floating point texture value to the shader.

Not sure why this inconsistency exists (GL driver bug?) but if anyone have a good explanation that'd be great.

Upvotes: 1

Related Questions