一个非常简单的着色器示例代码

 1 Shader "Custom/MyShader"{
 2 
 3 Properties{
 4 _Int ("Int",Int)=2
 5 }
 6 
 7 SubShader{
 8 //显卡a使用的子着色器
 9 Tags{"RenderType"="Opaque"}
10  CGPROGRAM
11  #pragma surface surf Lambert
12  struct Input
13  {
14  float4 color :COLOR;
15  };
16  void surf(Input IN,inout SurfaceOutput o)
17  {
18  o.Albedo=1;
19  }
20  ENDCG
21 }
22 Fallback "Diffuse"
23 }

 

Shader "Custom/MyShader"{

Properties{

}
SubShader
{

Pass
{

}

}
FallBack "Diffuse"
}

  

posted @ 2017-02-20 14:27  露夕逝  阅读(995)  评论(0编辑  收藏  举报