转载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"
}
本文分享了一个Unity Shader自定义示例,通过调整Shader代码实现特定的视觉效果。该Shader包含两个Pass,分别用于处理不可见部分的颜色及可见部分的纹理。
1809

被折叠的 条评论
为什么被折叠?



