2D Toolkit Forum

2D Toolkit => FAQs => Topic started by: pbaker on February 22, 2012, 04:42:08 am

Title: Replacing the atlas texture with one saved out of PVRTexTool
Post by: pbaker on February 22, 2012, 04:42:08 am
Hi,

Unity supports PVR textures exported from the PVRTexTool, so I was wondering how I would get the 2D Toolkit to use an atlas texture that I've compressed to PVR? i.e. Commit in a sprite collection, open the atlas in PVRTextTool, save out as a PVR, then use this texture in game. The reason why I want to do this is the PVRTexTool produces much better quality for textures with alpha than the default Unity PVR compression.
Thanks

Paul
Title: Re: Replacing the atlas texture with one saved out of PVRTexTool
Post by: unikronsoftware on February 22, 2012, 09:19:19 am
You can do this but you will need to change a few things around.
1. change the texture on the atlas material to your .pvr file.
2. secondly, you will need to change the parameter in tk2dSpriteCollectionData. Look for public Texture[] textures; and remove the [HideInInspector] attribute. You will then be able to change that in the inspector. Simply change that texture to your .pvr file and you're done.

Keep in mind, that textures variable will be modified back to the original texture whenever you Commit the sprite collection again, but that's inevitable, you'll have to recompress the texture manually again anyway.

I'll make this slightly easier in the next version by exposing all these variables in an advanced tab or something like that.
Title: Re: Replacing the atlas texture with one saved out of PVRTexTool
Post by: pbaker on February 22, 2012, 11:15:17 pm
Awesome, thanks!