Shader/Unity Shader 공부

Unity Shader) 03_VertexLit_Simple

Hwanggoon 2014. 4. 23. 21:51

Shader "Hwanggoon/VertexLit Simple"
{
 Properties
 {
  _MainColor ("Main Color", color) = (0,0,1,1)
  _MainTex ("Main Texture", 2d) = "white"{} // 숫자가 아닌 문자 값으로 할수 있으며, {}는 옵션이다.
 }
 
 SubShader
 {
  Pass
  {
   Material
   {
    Diffuse [_MainColor]
    Ambient [_MainColor]
   }

   Lighting On // Texture 를 그리기 전에 라이트 설정을 해야한다.

   SetTexture [_MainTex]
   {
    Combine texture * primary double
    // Combine : 생상 결합 저정 코드
    // texture : 현재 택스쳐 색상
    // primary : 이전 라이팅 연산된 색상
    // double : 결과값을 x2 해주는 키워드
   }
  }
 }
}