About Store Forum Documentation Contact



Post Reply 
PVRTC4 and MipMaps
Author Message
cmontiel Offline
Member

Post: #1
PVRTC4 and MipMaps
How to import a .png and create a pvrtc4 with 5 mipmaps for example? I am using this code:

img.ImportTry(path,IMAGE_PVRTC4,IMAGE_2D,5);

but returns false. If I change 5 => 1 , it works but with only 1 mipmap.

No problems with other image types. SupportPVRTC(); is called in InitPre.
06-25-2014 07:14 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: PVRTC4 and MipMaps
I don't remember but I think it's possible that PVRTC requires either just one (1) or full chain of mip maps (0).
Either way on OpenGL ES (mobile) all textures are required to be like that (either one 1, or full 0).
06-25-2014 11:41 PM
Find all posts by this user Quote this message in a reply
cmontiel Offline
Member

Post: #3
RE: PVRTC4 and MipMaps
Returns false with 0 too.
06-26-2014 02:42 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: PVRTC4 and MipMaps
Please provide the source image you're importing and I'll test this.
06-26-2014 04:10 AM
Find all posts by this user Quote this message in a reply
cmontiel Offline
Member

Post: #5
RE: PVRTC4 and MipMaps
Any .png or .jpg. I've tested with 6 images with same result, can't import if mip maps is not 1. This one for example.


Attached File(s) Image(s)
   
(This post was last modified: 06-26-2014 07:02 AM by cmontiel.)
06-26-2014 07:01 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: PVRTC4 and MipMaps
Thanks, this is related to your texture being non-pow-2 which is a requirement for PVRTC, I'm checking if I can handle that automatically by the engine.

However in your case you should import to original type (-1) and then resize with copyTry to PVRTC and set pow2 sizes.

Also please use the Editor for managing assets, I'll fix that for the editor as well.
06-26-2014 07:54 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: PVRTC4 and MipMaps
Thank you for reporting the issue, I've managed to resolve this (it's available in the source now and will be available in next Binary release).
06-26-2014 09:09 AM
Find all posts by this user Quote this message in a reply
cmontiel Offline
Member

Post: #8
RE: PVRTC4 and MipMaps
Thanks! smile
(This post was last modified: 06-26-2014 12:43 PM by cmontiel.)
06-26-2014 12:42 PM
Find all posts by this user Quote this message in a reply
cmontiel Offline
Member

Post: #9
RE: PVRTC4 and MipMaps
On Mac, conversion works with any mipmaps number.

PD: New PVRTC4 library that you introduced in EE2.0 is awsome, it has much more quality, In my game for ios I can use pvrtc4 for most of textures reducing 120MB in ram! (270Mb => 150Mb now) and it is faster loading.
(This post was last modified: 06-29-2014 12:52 AM by cmontiel.)
06-29-2014 12:48 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #10
RE: PVRTC4 and MipMaps
That's why it's always recommended to stay up to date with latest EE versions smile

Perhaps on Mac it works because of OpenGL and some ability to create textures with more mip maps than they can support normally.

I use even PVRTC2 for 3D model Textures, and PVRTC4 for most of 2D Gui Images.
06-29-2014 01:45 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #11
RE: PVRTC4 and MipMaps
Hi, The editor will automatically choose the best possible format for each platform - you don't need to do anything at all.
06-30-2014 04:07 AM
Find all posts by this user Quote this message in a reply
Post Reply