Hello Guest

Author Topic: Replacing the atlas texture with one saved out of PVRTexTool  (Read 20304 times)

pbaker

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Replacing the atlas texture with one saved out of PVRTexTool
« 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Replacing the atlas texture with one saved out of PVRTexTool
« Reply #1 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.

pbaker

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Replacing the atlas texture with one saved out of PVRTexTool
« Reply #2 on: February 22, 2012, 11:15:17 pm »
Awesome, thanks!