利用镜面反射让游戏闪耀起来

来源:互联网 发布:端口占用查询工具 编辑:程序博客网 时间:2024/05/20 02:25
Shader "BlinnPhong"{    Properties    {        _MainTex("MainTex", 2D) = "white" {}        _MainTint("MainTint", Color) = (1, 1, 1, 1)        _SpecPower("SpecPower", Range(0, 1)) = 0.5    }    SubShader    {        Tags        {            "RenderType" = "Opaque"        }        LOD 200        CGPROGRAM        #pragma surface surf BlinnPhong        sampler2D _MainTex;        float4 _MainTint;        float _SpecPower;        struct Input        {            float2 uv_MainTex;        };        void surf(Input IN, inout SurfaceOutput o)        {            half4 c = tex2D(_MainTex, IN.uv_MainTex) * _MainTint;            o.Specular = _SpecPower;            o.Gloss = 1.0;            o.Albedo = c.rgb;            o.Alpha = c.a;        }        ENDCG    }}


原创粉丝点击