Why don’t you save the Alpha information in the Green channel and use Red (or maybe blue, sometimes it compresses better) for your black and white diffuse stuff?
It’s one channel wasted, but it’s still a win I think.
Well… the point here is to just have the 2 channels. I don’t think this is that bizzare of a scenario. The pipeline would be better across the board if I could access the alpha channel.
But this is a good idea in a worst case scenario that this issue doesn’t and wont have a solution.
I’m very curious what image format you’re saving to. I only know of two formats that can do true single channel color greyscale and alpha in a single file, and that’s PSD and PNG. It’s really rare that anyone uses those formats though, so it’s entirely plausible that Unity ignores the alpha for images that only have a single color channel. PSD handling can also be funny since there can be multiple alpha channels, including the layer opacity, and Unity doesn’t really give any options for choosing which one.
If you are saving to a format with greyscale + alpha I would recommend converting to RGB + alpha and see if Unity handles it better. If so it might be a bug you want to report, but don’t expect it to get fixed any time soon. It might seem wasteful to do so, but the image format and layout you save in has little to do with the image format and layout used by the actual GPU.
There are very few true one or two channel formats that Unity lets you use for imported textures, mainly because several classifications of hardware don’t necessarily have support for them, and only one that’s compressed (BC5, which is desktop & console only). Generally if you need two channels the easiest solution is to use a red and green channel like @AcidArrow mentioned. Even if you import a greyscale texture, by default it will likely be converted to an RGB texture of some kind anyway, DXT1 for PC & Console, ETC for android, PVRTC for iOS. All three of these texture formats can only do RGB (or RGBA for PVRTC). For alpha, DXT5 is 2x the memory size of DXT1, and the other two drop the quality of the RGB channels when alpha is added. Technically ASTC has a greyscale + alpha mode, which is an advanced Android device format, but it’s not universally supported by hardware, and I don’t know if Unity supports that mode.
I see… i had tried both PSD and PNG and it sounds like the best solution is to just admit defeat and use the R and G channels, not a huge deal, but it would have been nice to cut the bulk of my files by 50% size.
Again, you’re probably not loosing or gaining anything in the actual game. Your greyscale textures are most likely being converted into an RGB texture anyway. If you were using the “Single Channel” Texture Type option, the resulting single channel texture is 2x the size of the RGB one on all platforms (since Unity defaults to an uncompressed A8 texture)!
I also confirmed what you were seeing that for greyscale images with alpha, Unity cannot see the alpha.