I’m making a 2D game in Unity, and I’m trying to use Texture2D.getPixels with a DXT5 compressed texture in order to make a spritesheet. It isn’t coming out quite right.
Here’s the original texture:
And here’s what it looks like after using getPixels() to grab all of its colors, and write it into a new Texture:
Any ideas as to why this might now be working? I’ve tried this with uncompressed images, and it’s worked just fine. It’s clearly grabbing the colors, but the resulting image is transformed somehow.
If you need more information, let me know.
I’m using a modified third party tool to create spritesheets and sprite animations in the editor. The sprites are grabbed from the spritesheet at runtime…which may be the solution to the main memory problem. If the actual animation frames aren’t needed after making the spritesheet, then I may not need to keep the textures in the editor. I’ll try that later and let you know if that works. I don’t know offhand if the tool needs the textures to remain in the editor after the spritesheet is built.
Back to the problem at hand: That one line of code is executed in the editor at development time. The texture I’m using is a NPOT .png, resolution 625x226.
The target platform for the game is PC, hypothetically XBox if we can get it done enough. I don’t think this matters too much, as we need the textures at development time.