Shader "QO/Effect/Mosaic" {
Properties {
 _tex0 ("_tex0  : Original Image (RGBA)", 2D) = "white" {}
 _tex1 ("_tex1  : Transform Image (RGBA)", 2D) = "white" {}
 _X ("x pixels", Float) = 0
 _Y ("y pixels", Float) = 0
 _MX ("min x pixels", Float) = 16
 _MY ("min y pixels", Float) = 9
 _time ("time rate", Range(0,1)) = 0
}
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 mediump vec4 xlv_TEXCOORD0;
varying lowp vec4 xlv_COLOR0;
uniform highp mat4 glstate_matrix_mvp;
attribute vec4 _glesMultiTexCoord0;
attribute vec4 _glesVertex;
void main ()
{
  gl_Position = (glstate_matrix_mvp * _glesVertex);
  xlv_COLOR0 = vec4(1.0, 1.0, 1.0, 1.0);
  xlv_TEXCOORD0 = _glesMultiTexCoord0;
}



#endif
#ifdef FRAGMENT

varying mediump vec4 xlv_TEXCOORD0;
uniform mediump float _time;
uniform mediump float _MY;
uniform mediump float _MX;
uniform mediump float _Y;
uniform mediump float _X;
uniform sampler2D _tex1;
uniform sampler2D _tex0;
void main ()
{
  mediump float tmpvar_1;
  tmpvar_1 = (1.0 - sin((_time * 3.14)));
  mediump float tmpvar_2;
  tmpvar_2 = ((tmpvar_1 * _X) + _MX);
  mediump float tmpvar_3;
  tmpvar_3 = ((tmpvar_1 * _Y) + _MY);
  mediump vec2 tmpvar_4;
  tmpvar_4.x = max (0.0, min (1.0, (floor((xlv_TEXCOORD0.x * tmpvar_2)) / tmpvar_2)));
  tmpvar_4.y = max (0.0, min (1.0, (floor((xlv_TEXCOORD0.y * tmpvar_3)) / tmpvar_3)));
  lowp vec4 tmpvar_5;
  tmpvar_5 = texture2D (_tex0, tmpvar_4);
  mediump float tmpvar_6;
  mediump float t_7;
  t_7 = max (min ((((1.0 - _time) - 0.45) / 0.11), 1.0), 0.0);
  tmpvar_6 = (t_7 * (t_7 * (3.0 - (2.0 * t_7))));
  mediump vec4 tmpvar_8;
  tmpvar_8.xyz = tmpvar_5.xyz;
  tmpvar_8.w = tmpvar_6;
  lowp vec4 tmpvar_9;
  tmpvar_9 = texture2D (_tex1, tmpvar_4);
  mediump vec4 tmpvar_10;
  tmpvar_10.xyz = tmpvar_9.xyz;
  tmpvar_10.w = (1.0 - tmpvar_6);
  mediump vec4 tmpvar_11;
  tmpvar_11.xyz = ((tmpvar_8.xyz * tmpvar_6) + (tmpvar_10.xyz * tmpvar_10.w));
  tmpvar_11.w = (tmpvar_6 + tmpvar_10.w);
  gl_FragData[0] = tmpvar_11;
}



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