Seems to work pretty well although a lot of it was copy paste and trial and error for me! Hope it is of use to someone. YMMV
edit:
Also note that in the Warehouse/Occlusion demo there is a similar shader LightmapOnlyShader.shader which is used to make decals of windows on walls etc. but it doesn’t work with transparent decals. the following does work with transparent
Shader "iPhone/Decal"
{
Properties
{
_Color ("Main Color", Color) = (1,1,1,1)
_SpecColor ("Spec Color", Color) = (1,1,1,1)
_Emission ("Emmisive Color", Color) = (0,0,0,0)
_Shininess ("Shininess", Range (0.01, 1)) = 0.7
_MainTex ("Base (RGB)", 2D) = "white" {}
_DecalTex ("Decal (RGBA)", 2D) = "black" {}
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Material
{
Diffuse [_Color]
Ambient [_Color]
Shininess [_Shininess]
Specular [_SpecColor]
Emission [_Emission]
}
Pass
{
BindChannels
{
Bind "Vertex", vertex
Bind "normal", normal
Bind "texcoord1", texcoord0 // decal uses 2nd uv
Bind "texcoord", texcoord1 // main uses 1st uv
}
Lighting On
SeperateSpecular On
SetTexture [_MainTex] {combine texture * primary DOUBLE}
SetTexture [_DecalTex] {combine texture lerp (texture) previous}
}
}
}