一个非常简单的顶点片元着色器
1 Shader "Custom/MyShader"{ 2 3 Properties{ 4 5 } 6 SubShader 7 { 8 Pass 9 { 10 CGPROGRAM 11 #pragma vertex vert 12 #pragma fragment frag 13 float4 vert(float4 v:POSITION):SV_POSITION 14 { 15 return mul(UNITY_MATRIX_MVP,v); 16 } 17 18 fixed4 frag():SV_Target 19 { 20 return fixed4(1.0,0.0,0.0,1.0); 21 } 22 ENDCG 23 } 24 } 25 FallBack "Diffuse" 26 }