ÀÌÆåÆ®¿¡´Â ¶óÀÌÆÃÀÌ ÇÊ¿ä ¾ø´Ù. 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·Î ¿¥ºñ¾ðÆ® ¶óÀÌÆÃÀÇ ¿µÇâÀ» ¹ÞÁö ¾Êµµ·Ï ÇÏ¿´´Ù. À¯´ÏƼ ¸Å´º¾ó¿¡ ÀÖ´Â ¶óÀÌÆà °ü·Ã ¿É¼ÇÀº ´ÙÀ½°ú °°´Ù.
ÅؽºÃĸ¦ »ç¿ëÇÏ´Â ÀÌÆåÆ®ÀÇ ¼ÎÀÌ´õ¸¦ ¸¸µé¾î º¸ÀÚ. 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 |