Hi,
Basically, You was almost right. The cause was some lines below:
https://github.com/OGRECave/ogre/blob/m ... t.cpp#L151
I don't know, may be I am wrong, but that is my thoughts.
So, we are loading png image. OgreSTBICodec is used for that. And at some point it set image format, which was decoded:
https://github.com/OGRECave/ogre/blob/m ... c.cpp#L192
We are on iOS, so it is small endian:
https://github.com/OGRECave/ogre/blob/m ... mat.h#L111
At some point engine want to do OpenGL call. It must use OpenGL constants for that, so, need to convert Ogres PixelFormat to some OpenGL value.
mFormat is
PF_A8B8G8R8:
Code: Select all
GLenum format = GLES2PixelUtil::getGLOriginFormat(mFormat);
https://github.com/OGRECave/ogre/blob/m ... e.cpp#L164
And there we find
Code: Select all
getGLOriginFormat(...)
...
return GL_BGRA_EXT;
https://github.com/OGRECave/ogre/blob/m ... er.cpp#L97
So, we have a mismatch after conversion: original format (in OpenGL terms RGBA) -> Ogre format -> originl format (in OpenGL terms BGRA)
After I have changed return value (GL_BGRA_EXT -> GL_RGBA), png files were loaded correctly.
I am not an Ogre expert, so, it might be, that it is not a solution. It would be nice to hear some comments from Ogre experts regarding this issue and possible solution.
p.s. I wonder, how such issues was not raised before. It looks like png images were not displaying correctly on iOS at all. Same is for Ogre SampleBrowser: same issue. So, nobody uses Ogre on iOS? Or it is used on iOS, but without png?