Shader "Unlit/Card"
{
Properties
{
tex0 ("Texture0", 2D) = "white" {}
tex1 ("Texture1", 2D) = "white" {}
tex2 ("Texture2", 2D) = "white" {}
tex3 ("Texture3", 2D) = "white" {}
tex4 ("Texture4", 2D) = "white" {}
tex5 ("Texture5", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// make fog work
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
UNITY_FOG_COORDS(1)
float4 vertex : SV_POSITION;
};
sampler2D tex0;
sampler2D tex1;
sampler2D tex2;
sampler2D tex3;
sampler2D tex4;
sampler2D tex5;
float4 tex0_ST;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, tex0);
UNITY_TRANSFER_FOG(o,o.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
/*
// sample the texture
fixed4 col = tex2D(_MainTex, i.uv);
// apply fog
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
*/
float t = _Time.x;
fixed3 mask = tex2D(tex1,i.uv).rgb;
fixed4 img = tex2D(tex0,i.uv);
img.rg*=1.1;
fixed2 flow = tex2D(tex3,i.uv).gr;
flow.y+=t*3.;
fixed4 plas = tex2D(tex2,flow*1.2) * mask.r;
plas *= 15.5;
plas *= fixed4(0.239, 0.224,0.488,1.);
fixed2 ct = i.uv;
ct.y -=t*0.5;
fixed4 clouds = tex2D(tex4,ct*2.);
float clouds_a = clouds.a;
clouds *= 4.5;
clouds *= fixed4(0.275,0.23,0.161,1.);
clouds_a *= mask.b;
img += clouds * mask.b;
img += plas * mask.r ;
img += (sin(t*15.)+1.) * mask.g * fixed4(0.239, 0.224,0.488,1.)*2.;
ct.x += t * 0.5;
fixed4 clouds_overall = tex2D(tex5,ct * 0.5);
clouds_overall *= fixed4(0.275,0.23,0.161,1.);
// gl_FragColor = img +clouds_overall;
return img +clouds_overall;
}
ENDCG
}
}
}