What shader do I need to tint an object and fade transparency per vertex?

I checked out the Shader Wiki to see if there’s already a user-created shader that
does what I want to do but I’m not sure if there is and I’m just missing it. Shader programming is a mystery to me and the manual wasn’t much help.

The specific effect I’m trying to do is to have my object disappear if it goes outside of an area, but in a smooth and stylish way. So if its transform.position is past for example +10Z, then the alpha value of each vertex is Lerped between the whole object’s current alpha value and 0 based on that vertex’s Z position between 10 and 11.

For another effect on the same object, I want to be able to tint the entire thing some percent between a solid hue and its texture map’s hue, and set its overall transparency- I am guessing that enabling vertex colors to do the fade effect will allow me to do this too. I can’t modify the textures, because all my prefab instances are using the same texture map but their hue and alpha need to change independently.

The objects I want to tint and fade are bumped/specular, and I don’t need to have a texture map for transparency on them at all. Is there a shader that already fits this purpose, or do I have to make my own?

You could do it in a shader, but I would suggest doing it in a script that modifies the alpha of the main color in a transparent shader.

var beginFadeDist : float; //How far from the origin should we be before we start fading
var fadeDist : float;  //How many units after that before it is totally faded.

function Update() {
      var playerDist : float = transform.position.magnitude;
      //Dist from the origin

       var lerpValue = playerDist - beginFadeDist;
       //subtract out the starting point.
       if(lerpValue < 0) return;
       //If we are closer than the start distance, escape and skip the last part.

       var newColor = renderer.material.color;
       //get the current color.
       newColor.a = Mathf.Clamp01(1 - lerpValue /fadeDist);
       //When we are exactly at fadeDist, the alpha will be 0, and it will be clamped after that. 

       renderer.material.color = newColor;
       //assign the new value to the material.
}