We’re very close the the completion of our game and are in the stage of tweaking some of the graphics. The game is a 2d sprite-based game and as such we don’t want to use texture compression.
The elements of the game are drawn in layers, all using a single alpha-blending shader. Our source textures are 32 bit TGA files, 8 bits per channel with alpha. Everything works fine if I use texture compression (the default PRVTC 4bits) or if I use RGBA32 uncompressed. However, if I use RGBA16, which I want to do to save half the memory, then my sprites appear to be slightly transparent, and I’m at a loss to explain why.
I’ve confirmed that the source alpha is set up properly (set to 0 for all appropriate pixels) and I’ve tried using both normal alpha blending and premultiplied alpha blending so I can only assume that something is going wrong in the conversion to 16 bit which is resulting in a change to the alpha channel.
Just for info, here is the shader I’m using:
Shader "Unlit/AlphaBlend"
{
Properties
{
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader
{
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Cull Back
ZWrite On
ZTest Always
Lighting Off
Pass
{
Blend SrcAlpha OneMinusSrcAlpha
SetTexture [_MainTex] {}
}
}
}