Added more pixel format support for PVRTCCodec

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
oiram
Halfling
Posts: 87
Joined: Sun Dec 13, 2009 5:06 am
x 6

Added more pixel format support for PVRTCCodec

Post by oiram »

Many pixel format could be save into pvr file, like RGBA8, RGB8, LA8 etc, not just PVRTC2 and PVRTC4.
I add these pixel format for image reading.

Code: Select all

    enum
    {
		OGL_RGBA_4444 = 0x10,
		OGL_RGBA_5551,
		OGL_RGBA_8888,
		OGL_RGB_565,
		OGL_RGB_555,
		OGL_RGB_888,
		OGL_I_8,
		OGL_AI_88,
		OGL_PVRTC2,
		OGL_PVRTC4,
		OGL_BGRA_8888,
		OGL_A_8,
    };
Not any image could be compress to PVRTC2 or PVRTC4, like normal map. Because PVRTC compression artifacts normal map, so it's need to save as R8G8B8 pixel format.
And pvr file can save many pixel format just like enum list above.
I add some code for PVRTC Codec enhancement, patch was submitted already. :)

https://sourceforge.net/tracker/?func=d ... tid=302997
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Added more pixel format support for PVRTCCodec

Post by masterfalcon »

Not a bad idea. But could you give an example of why you would use a PVR container for those pixel formats over others like PNG, JPEG, etc?
oiram
Halfling
Posts: 87
Joined: Sun Dec 13, 2009 5:06 am
x 6

Re: Added more pixel format support for PVRTCCodec

Post by oiram »

For only ios platform, my 3dmax plugin converts all images to pvr format file: Diffusemap -> PVRTC4, Normalmap -> RGB8, SpecularMap -> PVRTC4...
Even if not plugin case, then before developers publish app, they would use tools to compression images to pvr.
PVRTC is a container that could handle many pixel format, and all images are .pvr file ext just keep unified...
So I want PVRTC codec could handle this... :oops:
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Added more pixel format support for PVRTCCodec

Post by masterfalcon »

Ah, ok.
oiram
Halfling
Posts: 87
Joined: Sun Dec 13, 2009 5:06 am
x 6

Re: Added more pixel format support for PVRTCCodec

Post by oiram »

If we do that on ios platform, then we don't need FreeImage or Devil anymore.
I remember that we plan to decrease size for ogre main on 1.9 road map that use PVRTC for all image pixel formats that's a good choice.
:)