[Shader?] How to make shader show either white or a transparent texture?

Hello!

Is there a material that I can use to make a texture show as pure white and transparent? Almost all the shaders I’m trying out will tint my material white but not make it pure white. If such a shader isn’t available, could someone show me to a place where I can learn the Cg to make it happen?

I’ve only written one shader. It was simple and two years ago.

Shader Goals:

  • Shader takes a float 0-1.
  • If float is 0, show unlit transparent texture.
  • If float is 1, show pure white and transparency
  • If in the middle, texture should be fading to white.

I’m not good with shaders, but maybe it isn’t showing as pure while because of Unity’s ambient light? you could use pragma noambient to prevent that Õ 3 Õ

Could you use a Sprite for this purpose? (e.g. create a 16x16 pure white texture, import it as a sprite) The default sprite shader would work nicely.

Alternately, check out the AlphaSelfIllum shader (the shader I can’t believe is STILL not included by default in Unity).