Hello people of the wasteland :),
你好荒地人:),
Brief: There is a problem with GL_RGB internal texture format on iOS platform.
简介:iOS平台上的GL_RGB内部纹理格式存在问题。
In my application I try to save some memory by using GL_RGB instead of GL_RGBA as an internal format. I'm using the next code piece to achieve this. Nothing else is changed.
在我的应用程序中,我尝试使用GL_RGB而不是GL_RGBA作为内部格式来节省一些内存。我正在使用下一个代码片来实现这一目标。没有其他改变。
glTexImage2D(_textureTargetType,
0,
GL_RGB, // pixel internalFormat
texWidth, // image width
texHeight, // image height
0, // border
GL_RGBA, // pixel format
GL_UNSIGNED_BYTE, // pixel data type
bitmapData);
On MacOS these changes went fluently, no problems. But on iOS, particularly 4.3 (OpenGL ES2.0) it gives me GL_INVALID_OPERATION everytime I try to render textured polgons with this texture. As nothing except this format is changed I think the problem is in incompatibility of GL_RGB internal format with OpenGL ES2.0. This is just my guess, I'm no guru.
在MacOS上,这些变化很流畅,没有任何问题。但是在iOS上,特别是4.3(OpenGL ES2.0),每当我尝试使用此纹理渲染纹理化的polgons时,它就会给我GL_INVALID_OPERATION。除了这种格式之外什么都没有改变我认为问题在于GL_RGB内部格式与OpenGL ES2.0不兼容。这只是我的猜测,我不是大师。
This doesn't work in simulator nor iPod touch 4th gen.
这不适用于模拟器或iPod touch第4代。
Thank you for any reasonable suggestion.
谢谢你提出任何合理的建议。
1 个解决方案
#1
6
According to the documentation, "internalformat
must match format
. No conversion between formats is supported during texture image processing." See the Khronos website. OpenGL does not have this limitation, so this code will work on Mac OS, but not the more limited OpenGL ES on iOS devices.
根据文档,“internalformat必须匹配格式。纹理图像处理期间不支持格式之间的转换。”请参阅Khronos网站。 OpenGL没有此限制,因此此代码适用于Mac OS,但不适用于iOS设备上更有限的OpenGL ES。
#1
6
According to the documentation, "internalformat
must match format
. No conversion between formats is supported during texture image processing." See the Khronos website. OpenGL does not have this limitation, so this code will work on Mac OS, but not the more limited OpenGL ES on iOS devices.
根据文档,“internalformat必须匹配格式。纹理图像处理期间不支持格式之间的转换。”请参阅Khronos网站。 OpenGL没有此限制,因此此代码适用于Mac OS,但不适用于iOS设备上更有限的OpenGL ES。