I am currently working on a shader that inverts the colors of what is behind it, but I need it to also support transparency. I got help about the color inversion and it works nicely, bug now any pixel that has its alpha set to 0 will be white instead of transparent. This means i can’t use PNG’s with transparency as textures.
I am thinking about using two blend modes, and decide in the fragment shader which one to use. Something like:
if (baseTex.a == 0)
{
Blend SrcAlpha OneMinusSrcAlpha //normal transparency blending
}
else
{
Blend OneMinusDstColor OneMinusSrcAlpha //invert color blending
}