Why does my shader make geometry disappear on scene reload?

I created a new shader that uses vertex color alpha, a tint color, and a single alpha texture. I can assign this shader to my object, and it behaves just like I want it to. Then, I save my scene, exit Unity, relaunch Unity. Now any object assigned to this shader appears completely transparent.

I know it hasn’t moved, because I can select it and see its wireframe. If I assign a different shader to the material, I can see the object again. I then assigning my custom shader again and it looks fine. But, if I exit Unity and restart, everything is gone again.

Here is the code for my shader. I’m wondering if turning lighting off has something to do with it?

------ See shader below --------

Shader "My Shaders/Alpha Vertex Alpha"
{
   Properties 
   {
      _Color ("Color Tint", Color) = (1,1,1,1)
      _MainTex ("SelfIllum Color (RGB) Alpha (A)", 2D) = "white"
   }
   Category 
   {
      Lighting Off
      ZWrite Off
      Cull Back
      Blend SrcAlpha OneMinusSrcAlpha
      Tags 
      {
         Queue=Transparent
      }
      BindChannels
      {
         Bind "Color", Color      // bind vertex color to 'primary' color
      }
      SubShader 
      {
         Pass 
         {
            SetTexture [_MainTex] 
            {
               constantColor[_Color]
               Combine Texture * constant, Texture * Primary
            }
         }
      } 
   }
   FallBack "Transparent/Diffuse"
}

Ok, so I’ve found that I can simply click on the object mesh (in the project tab), which brings up a preview window of the mesh. At that point, things begin to render properly again. WEIRD!

Also, by messing around with my shader, it seems that it is attempting to draw, but is always getting a transparent result. This makes me suspect that Unity is not sending the proper vertex color alpha correctly until I do one of these ‘click on the mesh’ or ‘reassign shader’ actions.

Does this ring any bells for anyone?

I answered this on the site where I get points for it. :stuck_out_tongue:

(Though I like this site a lot better.)

Thanks! Works fine now. I should have experimented with the binding stuff, but I was blinded by my desperation :?