//shader的路径+名字
Shader "Custom/TestShader01" {
//属性区
Properties {
//变量名(“显示名”,Texture2D)= 默认值
_MainTex ("Albedo (RGB)", 2D) = "white" {}
// _Color("颜色",Color) = (1,1,1,1)
// _Rect("Rect",Rect) = "White"{}
// _Cube("Cube",Cube) = "White" {}
// _Range("滑动条",Range(1,10)) = 5
// _Float("浮点类型",Float) = 1.2
// _Vector("向量",Vector) = (0,0,0,0)
}
SubShader {
//标签: "RenderType"="Transparent"
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Standard fullforwardshadows
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
half _Glossiness;
half _Metallic;
fixed4 _Color;
void surf (Input IN, inout SurfaceOutputStandard o) {
//提取Uv下像素颜色
fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
//漫反射颜色
o.Albedo = c.rgb;
//像素透明度
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
网友评论