// 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;
}
'게임개발 > Shader' 카테고리의 다른 글
쉐이더에서 한번에 샘플링 할 수 있는 텍스쳐 갯수는? (How many textures do you sample in Shader?) (0) | 2016.03.15 |
---|---|
GGX라는 용어에 대해 (0) | 2016.02.03 |
Surface Shader compile directives (0) | 2015.10.04 |
Writing vertex and fragment shaders (0) | 2015.10.04 |
Surface Shader (0) | 2015.10.04 |