首页 > 编程语言 > 详细

Unity3D研究院之处理摄像机与角色之间被挡时的局部透明效果

时间:2015-06-01 12:53:44      阅读:243      评论:0      收藏:0      [点我收藏+]

1.通过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" }
LOD 200

Pass
{
ZTest Greater
Lighting Off
ZWrite Off
// Color [_NotVisibleColor]
Blend SrcAlpha OneMinusSrcAlpha
SetTexture [_MainTex] { ConstantColor [_NotVisibleColor] combine constant * texture }

}

Pass {
ZTest LEqual
Material
{
Diffuse (1,1,1,1)
Ambient (1,1,1,1)
}
Lighting Off
SetTexture [_MainTex] { combine texture }
}

}
FallBack "Diffuse"
}

Unity3D研究院之处理摄像机与角色之间被挡时的局部透明效果

原文:http://www.cnblogs.com/xwwFrank/p/4543534.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!