转载http://www.xuanyusong.com/archives/3466
原文: http://qiita.com/YosukeM/items/a9d88672a8bf516f78a7
我改了一下他的shader.
Shader"Custom/PlayerDiffuse"{
Properties{
_NotVisibleColor("NotVisibleColor (RGB)",Color)=(0.3,0.3,0.3,1)
_MainTex("Base (RGB)",2D)="white"{}
}
SubShader{
Tags{"Queue"="Geometry+500""RenderType"="Opaque"}
LOD200
Pass{
ZTestGreater
LightingOff
ZWriteOff
// Color [_NotVisibleColor]
BlendSrcAlphaOneMinusSrcAlpha
SetTexture[_MainTex]{ConstantColor[_NotVisibleColor]combineconstant *texture}
}
Pass{
ZTestLEqual
Material{
Diffuse(1,1,1,1)
Ambient(1,1,1,1)
}
LightingOff
SetTexture[_MainTex]{combinetexture}
}
}
FallBack"Diffuse"
}