//
// >> 흘러가는 형태의 불
//
Shader "Custom/Fire"
{
Properties
{
_MainTex("Albedo (RGB)", 2D) = "white" {} // :: 불 모양
_MainTex2("Albedo (RGB)", 2D) = "white" {} // :: 흘러가는 불 기둥
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent" } // :: 투명도 적용
LOD 200
CGPROGRAM
#pragma surface surf Standard alpha:fade // :: 투명도 적용
sampler2D _MainTex;
sampler2D _MainTex2;
struct Input
{
float2 uv_MainTex;
float2 uv_MainTex2;
};
void surf (Input IN, inout SurfaceOutputStandard o)
{
fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
fixed4 d = tex2D (_MainTex2, float2(IN.uv_MainTex2.x, IN.uv_MainTex2.y - _Time.y)); // :: -y 위로 흘러가도록
// :: Emission : Light 영향을 적게
// :: c 텍스쳐와 d 텍스쳐를 곱해서 둘이 겹쳐져 흘러가는 것
o.Emission = c.rgb * d.rgb;
o.Alpha = c.a * d.a; // :: 투명도
}
ENDCG
}
FallBack "Diffuse"
}