Surceface Shader NoLighting

ÀÌÆåÆ®¿¡´Â ¶óÀÌÆÃÀÌ ÇÊ¿ä ¾ø´Ù.
Surface ¼ÎÀÌ´õ¿¡¼­ ¶óÀÌÆÃÀ» Àû¿ëÇÏ°í ½ÍÁö ¾Ê´Ù¸é ´ÙÀ½°ú °°ÀÌ Ä¿½ºÅÒ ¶óÀÌÆÃÀ» ¸¸µé¸é µÈ´Ù.

Shader "Custom/TestSurf" {
    Properties { }
    
    SubShader {
        CGPROGRAM

        #pragma surface surf NoLighting noambient

        struct Input {
            float4 c : Color;
        };

        fixed4 LightingNoLighting(SurfaceOutput s, fixed3 lightDir, fixed atten){
            fixed4 c;
            c.rgb = s.Albedo;
            c.a = s.Alpha;
            return c;
        }
        
        void surf (Input input, inout SurfaceOutput o) {
            o.Albedo = 0.3;
        }
        ENDCG
    }
}

Lambert ÇÔ¼ö ´ë½Å Ä¿½ºÅÒ ÇÔ¼ö NoLightingÀ» Àû¿ë ÇÏ¿´´Ù.
noambient·Î ¿¥ºñ¾ðÆ® ¶óÀÌÆÃÀÇ ¿µÇâÀ» ¹ÞÁö ¾Êµµ·Ï ÇÏ¿´´Ù.

À¯´ÏƼ ¸Å´º¾ó¿¡ ÀÖ´Â ¶óÀÌÆà °ü·Ã ¿É¼ÇÀº ´ÙÀ½°ú °°´Ù.
  • exclude_path:deferred, exclude_path:forward, exclude_path:prepass - Do not generate passes for given rendering path (Deferred Shading, Forward and Legacy Deferred respectively). *noshadow - ÀÌ ½¦ÀÌ´õ¿¡¼­ ¸ðµç ±×¸²ÀÚ ¸®½Ãºù(shadow receiving) Áö¿øÀ» ºñÈ°¼ºÈ­ÇÕ´Ï´Ù.
  • noambient - ¾Úºñ¾ðÆ® ¶óÀÌÆà ¶Ç´Â ¶óÀÌÆ® ÇÁ·Îºê¸¦ Àû¿ëÇÏÁö ¾Ê½À´Ï´Ù.
  • novertexlights - Forward ·»´õ¸µ¿¡¼­ ¶óÀÌÆ® ÇÁ·Îºê ¶Ç´Â Á¤Á¡ ´ç ¶óÀÌÆ®¸¦ Àû¿ëÇÏÁö ¾Ê½À´Ï´Ù.
  • nolightmap - ÀÌ ½¦ÀÌ´õ¿¡¼­ ¸ðµç ¶óÀÌÆ®¸Ê Áö¿øÀ» ºñÈ°¼ºÈ­ÇÕ´Ï´Ù.
  • nodirlightmap - ÀÌ ½¦ÀÌ´õ¿¡¼­ ½Ç½Ã°£ µ¿Àû Àü¿ª Á¶¸í(runtime dynamic global illumination) Áö¿øÀ» ºñÈ°¼ºÈ­ÇÕ´Ï´Ù.
  • nodirlightmap - ÀÌ ½¦ÀÌ´õ¿¡¼­ µð·º¼Å³Î ¶óÀÌÆ®¸Ê Áö¿øÀ» ºñÈ°¼ºÈ­ÇÕ´Ï´Ù.
  • nofog - Disables all built-in Fog support.
  • nometa - Does not generate a ¡°meta¡± pass (that¡¯s used by lightmapping & dynamic global illumination to extract surface information).
  • noforwardadd - Forward ·»´õ¸µ Ãß°¡ Æнº¸¦ ºñÈ°¼ºÈ­ÇÕ´Ï´Ù. ±×·¯¸é ½¦ÀÌ´õ´Â ÀüüÀûÀÎ µð·º¼Å³Î ¶óÀÌÆ® Áö¿øÇÏ°í, ´Ù¸¥ ¸ðµç ¶óÀÌÆ®´Â Á¤Á¡ ´ç/SH °è»êµË´Ï´Ù. ½¦ÀÌ´õµµ ´õ ÀÛ¾ÆÁý´Ï´Ù.

ÅؽºÃĸ¦ »ç¿ëÇÏ´Â ÀÌÆåÆ®ÀÇ ¼ÎÀÌ´õ¸¦ ¸¸µé¾î º¸ÀÚ.
Unity5ÀÇ "Unlit/Unlit Surface Shaders (Lightmap)" ¼ÎÀÌ´õ¸¦ »ç¿ëÇؼ­ ¼öÁ¤ ÇÏ¿´´Ù.

Shader "Custom/TestSurf" {
//Shader "Unlit/Unlit Surface Shaders (Lightmap)" { 
    Properties {
        _MainTex ("Base (RGB)", 2D) = "white" {}    
        _Color ("Color", Color) = (1, 1, 1, 1)
    }
 
    SubShader {
        Tags { "RenderType"="Opaque" "Queue" = "Geometry"}
   
        CGPROGRAM
 
 
        #pragma surface surf NoLighting  noambient
 
        sampler2D _MainTex;
        float4 _Color;
    
        struct Input {
            half2 uv_MainTex;       
        };
         
         fixed4 LightingNoLighting(SurfaceOutput s, fixed3 lightDir, fixed atten)
         {
             fixed4 c;
             c.rgb = s.Albedo;
             c.a = s.Alpha;
             return c;
         }
 
        void surf (Input IN, inout SurfaceOutput o)
        {  
            o.Albedo = tex2D(_MainTex, IN.uv_MainTex) *_Color.rgb;
        }
        ENDCG
    }
 
    Fallback "Mobile/VertexLit"
}


ÂüÁ¶)
http://usroom.tistory.com/entry/À¯´ÏƼ-surface-shader·Î-Unlit-shader-¸¸µé±â
http://forum.unity3d.com/threads/surface-shader-unlit-unity-5.330244/
http://docs.unity3d.com/kr/current/Manual/SL-SurfaceShaders.html