Compressed textures on iOS (PVRTC)

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
aarkling
Gnoblar
Posts: 2
Joined: Wed May 03, 2017 3:53 pm
x 1

Compressed textures on iOS (PVRTC)

Post by aarkling »

We're trying to get PVR textures to work on iOS in the Metal render system. Unfortunately the texture loading looks like it's broken right now. Here are my initial thoughts.
  • Looking through the Metal render system code, it looks like compressed textures are mostly implemented (lots of references to PVR/Metal flags etc) but not working yet?
  • Digging into it, it looks to me like compressed textures are not compatible with texture arrays right now in ogre? I don't know of any theoretical reason why that should be the case.
  • I tried this on OSX too but got a different error.
This is the error I got when trying to load a PVR texture with or without mips baked in.

Code: Select all

OGRE EXCEPTION(2:InvalidParametersException): Cannot return subvolume of compressed PixelBuffer in PixelBox::getSubVolume at /Users/ajmal/Flippy/Flippy3D/ogre/OgreMain/src/OgrePixelFormat.cpp (line 134)
This code snippet with the check that fails:

Code: Select all

Ogre::PixelBox::getSubVolume(Ogre::Box const&) const at /Users/ajmal/Flippy/Flippy3D/ogre/OgreMain/src/OgrePixelFormat.cpp:134
if(def.left == left && def.top == top && def.front == front &&
               def.right == right && def.bottom == bottom && def.back == back)
That doesn't seam right. Here (def.front, def.back) are (0,1), (1,2), (2,3) .... etc for n mips. And (this->front, this->back) is (0, 40). Not sure where the 40 is coming from.

Any suggestions on getting this working on Metal?
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5588
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1413
Contact:

Re: Compressed textures on iOS (PVRTC)

Post by dark_sylinc »

Uh oh. Yeah I'm afraid PVRTC isn't well tested so these issues are definitely possible.
Digging into it, it looks to me like compressed textures are not compatible with texture arrays right now in ogre? I don't know of any theoretical reason why that should be the case.
Mmm... I don't think I ever tried loading texture arrays from file (except cubemaps), so this is definitely possible.
Texture arrays have been a sort of 2nd class citizen in Ogre due to them being introduced much later on (and not being really thoroughly used until 2.1). Ogre 2.2 will be fixing this but there's no ETA.

If you get to fix these issues I'll be happy to look at the PR.
Post Reply