Hello Guest

Author Topic: Texture Atlas - Split Alpha Channel  (Read 5042 times)

jmcguirk

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Texture Atlas - Split Alpha Channel
« on: September 05, 2013, 12:44:40 am »
Howdy!

First off - a big fan of the tk2d framework. Absolutely could not build our game without it.

Wanted to check about the feasibility of getting something like this in Tk2D

http://www.tasharen.com/forum/index.php?topic=4018.msg19784#msg19784

We're basically struggling with textures that have a ton of alpha, but look like garbage with compression turned on. We've tried a few techniques to improve it, but can't quite get the quality we're looking for - lots of artifacts/bleeding in 0 alpha

It seems like uploading the alpha channel as uncompressed (or maybe even compressed separately) might do the trick - even if its a bit larger on disk and winds up costing us another draw call (or maybe more draw calls since it might break batching?)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Texture Atlas - Split Alpha Channel
« Reply #1 on: September 05, 2013, 12:14:35 pm »
I don't think you need to split alpha channels like that - in most cases, simply using a PNG instead of Unity's JPG is probably sufficient. Vote for this card on our trello if you'd like the feature.
https://trello.com/c/gOpyGcVj

jmcguirk

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Texture Atlas - Split Alpha Channel
« Reply #2 on: September 05, 2013, 03:57:10 pm »
Thanks for the quick reply!

Hm - am I right that the Trello card is proposing something slightly different?

Seems like the proposal is to keep the texture as PNG compressed bytes on disk, do the decoding in memory - then upload the raw uncompressed bytes to the GPU?

That would appear to result in a smaller on-disk size (and less time fetching from disk) at the trade off of some CPU time to do the decompression. It also means you've got the memory overhead of the truecolor texture in memory.

I think what I'm suggesting is a tiny bit different in that I'd like to continue leaving the RGB channels as PVR compressed (as I'm seeing acceptable quality there) - which gives a reasonable size and memory pressure - but upload a second texture containing true-color alpha.

Forgive my ignorance here - I could be totally wrong :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Texture Atlas - Split Alpha Channel
« Reply #3 on: September 05, 2013, 04:03:03 pm »
Yup. Indeed it is. Here's the correct link
https://trello.com/c/pVklVzlL

ps. you can already do it by hand. The proposed solution will automate that.

jmcguirk

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Texture Atlas - Split Alpha Channel
« Reply #4 on: September 05, 2013, 04:14:26 pm »
Ahh - yeah that looks exactly like what I want.

Voted! :)