TerrainTransparency

Description
This is a shader to allow transparent textures on terrains. It does this by overriding the terrain shader, checking for a transparent texture, and, if it finds one, adjusting the terrain's visibility to the transparent texture's splatmap opacity data.

Features:
 * Enables the use of a transparent texture on the terrain.

The main use of this shader is for adding 'holes' or 'caves' to terrains, although you can also use it for making terrain areas partially transparent, or for making a terrain non-rectangular.

Usage

 * Copy the shader code below and paste it into a new shader file within your project's Assets folder. (you can name it whatever you want)
 * Create a completely transparent image and add it as one of your terrain's textures.
 * Paint the transparent texture onto your terrain, and wherever you paint, the terrain will become transparent!

Notes:
 * For the transparency to work, you must place the transparent texture into one of the first four slots. (technical reason; the 'first pass' shader that is overridden can only access the first four splatmaps)
 * If you apply the transparent texture with only partial opacity, you can make existing textures 'partially transparency'.
 * To remove the transparency, just paint over it with another texture.
 * The terrain collider will still be active on transparent parts of the terrain. To fix this, you would need to make a script that disables the collider when the player is over a transparent area.