首页 > 代码库 > 【Shader】人物选中高亮状态
【Shader】人物选中高亮状态
Shader "OutLine/RedOutLine" { Properties { _Switch("Value",Range(0,1)) = 0 _MainTex("Texture",2D) = "white"{} _BumpMap("Bumpmap",2D) = "bump" {} _RimColor("RimColor",Color) = (0.26,0.19,0.16,0.0) _RimPower("RimPower",Range(0.5,8.0)) = 3.0 } SubShader { Tags{ "RenderType" = "Opaque" } CGPROGRAM #pragma surface surf Lambert struct Input { float2 uv_MainTex; float2 uv_BumpMap; float3 viewDir; }; sampler2D _MainTex; sampler2D _BumpMap; float4 _RimColor; float _RimPower; float _Switch; void surf(Input IN, inout SurfaceOutput o) { o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgb; o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); half rim = 0; if (_Switch != 0) { rim = 1.0 - saturate(dot(normalize(IN.viewDir), o.Normal)); } //saturate //限制值于[0,1]之间 o.Emission = _RimColor.rgb * pow(rim, _RimPower); } ENDCG } Fallback "Diffuse" }
【Shader】人物选中高亮状态
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。