Shader "WSP/FrameWork6"
{
Properties
{
//[特征]_Name("Display name,Type")=Default value
[HDR]_Color("颜色",Color) = (1,1,1,1)
}
SubShader
{
pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex:POSITION;
};
struct v2f
{
float4 pos:SV_POSITION;
};
//注意和Properties内名称格式一致
fixed4 _Color;
v2f vert(appdata v)
{
v2f o = (v2f)0;
//o.pos= mul(UNITY_MATRIX_VP,mul(unity_ObjectToWorld,v.vertex));
o.pos = UnityObjectToClipPos(v.vertex);
return o;
};
float4 frag(v2f i):SV_TARGET
{
//返回值的名称格式注意一致
return _Color;
};
ENDCG
}
}
}