Shader "QO/Effect/Transition1" {
Properties {
 _tex0 ("_tex0 : Original  Image (RGBA)", 2D) = "white" {}
 _tex1 ("_tex1 : Transform Image (RGBA)", 2D) = "white" {}
 _tex2 ("_tex2 : Pattern (GrayScale)", 2D) = "white" {}
 _time ("_time : TimeRate", Range(0,1)) = 0
 _grad ("_grad : Gradation Level", Float) = 0.1
}
SubShader { 
 LOD 200
 Tags { "QUEUE"="Transparent" "RenderType"="Transparent" }
 Pass {
  Tags { "QUEUE"="Transparent" "RenderType"="Transparent" }
  Blend SrcAlpha OneMinusSrcAlpha
Program "vp" {
SubProgram "gles " {
"!!GLES


#ifdef VERTEX

varying lowp vec2 xlv_TEXCOORD0;
varying lowp vec4 xlv_COLOR0;
uniform highp mat4 glstate_matrix_mvp;
attribute vec4 _glesMultiTexCoord0;
attribute vec4 _glesVertex;
void main ()
{
  lowp vec2 tmpvar_1;
  highp vec2 tmpvar_2;
  tmpvar_2 = _glesMultiTexCoord0.xy;
  tmpvar_1 = tmpvar_2;
  gl_Position = (glstate_matrix_mvp * _glesVertex);
  xlv_COLOR0 = vec4(1.0, 1.0, 1.0, 1.0);
  xlv_TEXCOORD0 = tmpvar_1;
}



#endif
#ifdef FRAGMENT

varying lowp vec2 xlv_TEXCOORD0;
uniform lowp float _grad;
uniform lowp float _time;
uniform sampler2D _tex2;
uniform sampler2D _tex1;
uniform sampler2D _tex0;
void main ()
{
  mediump float grad_1;
  mediump vec4 toImage_2;
  mediump vec4 fromImage_3;
  mediump vec3 trans_4;
  lowp vec3 tmpvar_5;
  tmpvar_5 = texture2D (_tex2, xlv_TEXCOORD0).xyz;
  trans_4 = tmpvar_5;
  lowp vec4 tmpvar_6;
  tmpvar_6.w = 1.0;
  tmpvar_6.xyz = texture2D (_tex0, xlv_TEXCOORD0).xyz;
  fromImage_3 = tmpvar_6;
  lowp vec4 tmpvar_7;
  tmpvar_7.w = 1.0;
  tmpvar_7.xyz = texture2D (_tex1, xlv_TEXCOORD0).xyz;
  toImage_2 = tmpvar_7;
  lowp float tmpvar_8;
  tmpvar_8 = (_grad * 0.5);
  grad_1 = tmpvar_8;
  mediump float tmpvar_9;
  tmpvar_9 = max (0.0, (trans_4.x - grad_1));
  mediump float t_10;
  t_10 = max (min (((_time - tmpvar_9) / (min (1.0, (trans_4.x + grad_1)) - tmpvar_9)), 1.0), 0.0);
  mediump vec4 tmpvar_11;
  tmpvar_11.xyz = toImage_2.xyz;
  tmpvar_11.w = (toImage_2.w * (t_10 * (t_10 * (3.0 - (2.0 * t_10)))));
  mediump vec4 tmpvar_12;
  tmpvar_12.xyz = fromImage_3.xyz;
  tmpvar_12.w = (1.0 - tmpvar_11.w);
  mediump vec4 tmpvar_13;
  tmpvar_13.xyz = ((toImage_2.xyz * tmpvar_11.w) + (fromImage_3.xyz * tmpvar_12.w));
  tmpvar_13.w = (tmpvar_11.w + tmpvar_12.w);
  gl_FragData[0] = tmpvar_13;
}



#endif"
}
}
Program "fp" {
SubProgram "gles " {
"!!GLES"
}
}
 }
}
Fallback "VertexLit"
}