您当前的位置: 首页 >  unity

程序员正茂

暂无认证

  • 0浏览

    0关注

    283博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Unity主题色shader

程序员正茂 发布时间:2021-03-16 12:02:27 ,浏览量:0

 

// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

 Shader "Custom/MyShader2" {
 Properties {
     _MainTex ("Texture", 2D) = "white" { }
	 _TintColor("Tint Color", Color)=(1,1,1,1)
 }
 SubShader {
     Pass {
 
 CGPROGRAM
 #pragma vertex vert
 #pragma fragment frag
 
 #include "UnityCG.cginc"
 
 sampler2D _MainTex;
 
 struct v2f {
     float4  pos : SV_POSITION;
     float2  uv : TEXCOORD0;
 };
 
 float4 _MainTex_ST;
 float4 _TintColor;
 
 v2f vert (appdata_base v)
 {
     v2f o;
     o.pos = UnityObjectToClipPos (v.vertex);
     o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
     return o;
 }
 
 half4 frag (v2f i) : COLOR
 {
     half4 texcol = tex2D (_MainTex, i.uv);
     texcol.rgb = dot(texcol.rgb, float3(0.3, 0.59, 0.11))*_TintColor;
     return texcol;
 }
 ENDCG
 
     }
 }
 Fallback "VertexLit"
 } 

 

关注
打赏
1660743125
查看更多评论
立即登录/注册

微信扫码登录

0.0394s