I’m programming a cooldown timer for an iOS action adventure game. The timer needs to be represented as a transparent, darkened overlay in the form of a clock, which rotates from fully dark, to 3/4, to 1/2, to 1/4 to fully bright (i.e. invisible).
This makes the animation dead easy, but unfortunately has the side effect of using the alpha channel, meaning it can no longer be made transparent. My graphic shows as solid black.
I tried solving this with a two pass shader for the transparency. Unfortunately it didn’t work:
I don’t understand what you want transparency based on, or why you want vertex lighting on a GUI element. A mockup at 3-4 stages, over a textured background of some kind, would be most helpful.
I wasn’t getting good results with the alpha animation – too jagged. I did get great results with a few boolean branches, but that looked way too slow. Here’s a compromise; please tell how it performs if any of you use it on iOS – I only profiled it in PVRUniSCo. Just start putting 9’s after the decimal point, for artifact correction. You’ve got to transform the UVs to take up a -1 to 1 square, e.g. x 2 - 1 for a Unity cube.
Maybe this will help you with the fixed function shader; I don’t know. You shouldn’t be using a fixed function shader or alpha testing.