// Unlit color shader. Very simple textured and colored shader.


// - no lighting

// - no lightmap support

// - per-material color

 

// Change this string to move shader to new location

Shader "NAKAI/Unlit/Texture Colored" {

    Properties {

        // Adds Color field we can modify

        _Color ("Main Color", Color) = (1, 1, 1, 1)       

        _MainTex ("Base (RGB)", 2D) = "white" {}

    }

 

    SubShader {

        Tags { "RenderType"="Opaque" }

        LOD 100

       

        Pass {

            Lighting Off

           

            SetTexture [_MainTex] {

                // Sets our color as the 'constant' variable

                constantColor [_Color]

               

                // Multiplies color (in constant) with texture

                combine constant * texture

            }

        }

    }

}

 

 

Surface shader로 Unlit Shader을 만들려면 아래와 같이 커스텀 라이팅으로 Unlit을 만들어 준다.

 

CGPROGRAM

#pragma surface surf Custom

 

fixed4 LightingCustom(SurfaceOutput s, fixed3 lightDir, fixed atten){

fixed4 c;

c.rgb = s.Albedo;

c.a = s.Alpha;

return c;

}

+ Recent posts