开发者

issue with texture2d on iPad2

开发者 https://www.devze.com 2023-02-28 08:45 出处:网络
We are running into a situation where fo开发者_如何学运维r 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

We are running into a situation where fo开发者_如何学运维r 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消