[Shader] 그라데이션 (Gradient)
Shader "BackgroundGradient" {
Properties {
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Begin Color", Color) = (1,1,1,1)
_Color2 ("End Color", Color) = (1,1,1,1)
}
SubShader {
Tags {
"Queue"="Background"
"IgnoreProjector"="True"
}
LOD 100
ZWrite On
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
fixed4 _Color;
fixed4 _Color2;
struct v2f {
float4 pos : SV_POSITION;
fixed4 col : COLOR;
};
v2f vert (appdata_full v) {
v2f o;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
o.col = lerp(_Color, _Color2, v.texcoord.y);
return o;
}
float4 frag (v2f i) : COLOR {
float4 c = i.col;
c.a = 1;
return c;
}
ENDCG
}
}
}
'Unity' 카테고리의 다른 글
[UnityUI] Horizontal Page Scroll (0) | 2016.08.08 |
---|---|
[UnityUI] Nested ScrollRect (0) | 2016.08.08 |
[UnityUI] Text LetterSpacing (0) | 2016.08.08 |
[UnityUI] Text Gradient (0) | 2016.08.08 |
그라데이션 배경 (Gradient Shader 활용) (0) | 2015.11.19 |
[Struct] Point (0) | 2015.11.07 |
[Struct] Size (0) | 2015.11.07 |
[Shader] 텍스처 회전 (Texture Rotation) (0) | 2015.09.08 |
C# 리스트(List)를 이용해 만든 우선순위큐(PriorityQueue) (0) | 2015.07.23 |
리플렉션 응용 (C# Reflection) (0) | 2015.07.01 |