{
  "ver": "1.0.27",
  "uuid": "a8d32911-ed30-4276-b226-042abd867f53",
  "importer": "effect",
  "compiledShaders": [
    {
      "glsl1": {
        "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\nvoid main () {\n  vec4 pos = vec4(a_position, 1);\n  #if CC_USE_MODEL\n    pos = cc_matViewProj * cc_matWorld * pos;\n  #else\n    pos = cc_matViewProj * pos;\n  #endif\n  gl_Position = pos;\n  v_uv0 = a_uv0;\n}",
        "frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n  uniform float alphaThreshold;\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n  #if USE_ALPHA_TEST\n      if (color.a < alphaThreshold) discard;\n  #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n  #if USE_ALPHA_TEST\n      if (alpha < alphaThreshold) discard;\n  #endif\n}\nvarying vec2 v_uv0;\nuniform sampler2D texture;\nuniform vec4 color;\nuniform vec2 center;\nuniform float time;\nuniform float ringWidth;\nuniform float waveSpeed;\nuniform float shrink;\nuniform float fadePow;\nvoid main () {\n  vec4 tex = texture2D(texture, v_uv0);\n  float dist = distance(v_uv0, center);\n  float alpha = 0.0;\n  vec2 lowerDist = center;\n  vec2 upperDist = vec2(1.0 - center.x, 1.0 - center.y);\n  float maxDist = max(max(lowerDist.x, lowerDist.y), max(upperDist.x, upperDist.y));\n  float fadeStartDist = maxDist * 0.25;\n  float fadeEndDist = maxDist * 0.95;\n  for (int i = 0; i < 3; ++i) {\n      float ringStartTime = float(i) * 0.3;\n      if (time < ringStartTime) continue;\n      float ringTime = time - ringStartTime;\n      float radius = ringTime * waveSpeed;\n      if (radius > maxDist) continue;\n      if (radius > 1.5) continue;\n      float inner = radius - ringWidth;\n      float a = smoothstep(inner, radius, dist)\n              * (1.0 - smoothstep(radius, radius + 0.01, dist));\n      a *= sin(dist * shrink - ringTime * 6.0) * 0.5 + 0.5;\n      a *= pow(1.0 - radius / 1.5, fadePow);\n      if (radius > fadeStartDist) {\n          float boundaryFade = 1.0 - smoothstep(fadeStartDist, fadeEndDist, radius);\n          a *= boundaryFade;\n      }\n      alpha += a;\n  }\n  alpha = clamp(alpha, 0.0, 1.0);\n  gl_FragColor = vec4(color.rgb, alpha * color.a);\n  ALPHA_TEST(gl_FragColor);\n}"
      },
      "glsl3": {
        "vert": "\nprecision highp float;\nuniform CCGlobal {\n  mat4 cc_matView;\n  mat4 cc_matViewInv;\n  mat4 cc_matProj;\n  mat4 cc_matProjInv;\n  mat4 cc_matViewProj;\n  mat4 cc_matViewProjInv;\n  vec4 cc_cameraPos;\n  vec4 cc_time;\n  mediump vec4 cc_screenSize;\n  mediump vec4 cc_screenScale;\n};\nuniform CCLocal {\n  mat4 cc_matWorld;\n  mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec2 a_uv0;\nout vec2 v_uv0;\nvoid main () {\n  vec4 pos = vec4(a_position, 1);\n  #if CC_USE_MODEL\n    pos = cc_matViewProj * cc_matWorld * pos;\n  #else\n    pos = cc_matViewProj * pos;\n  #endif\n  gl_Position = pos;\n  v_uv0 = a_uv0;\n}",
        "frag": "\nprecision highp float;\nuniform CCGlobal {\n  mat4 cc_matView;\n  mat4 cc_matViewInv;\n  mat4 cc_matProj;\n  mat4 cc_matProjInv;\n  mat4 cc_matViewProj;\n  mat4 cc_matViewProjInv;\n  vec4 cc_cameraPos;\n  vec4 cc_time;\n  mediump vec4 cc_screenSize;\n  mediump vec4 cc_screenScale;\n};\n#if USE_ALPHA_TEST\n  uniform ALPHA_TEST {\n    float alphaThreshold;\n  };\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n  #if USE_ALPHA_TEST\n      if (color.a < alphaThreshold) discard;\n  #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n  #if USE_ALPHA_TEST\n      if (alpha < alphaThreshold) discard;\n  #endif\n}\nin vec2 v_uv0;\nuniform sampler2D texture;\nuniform fs_uniforms {\n    vec4  color;\n    vec2  center;\n    float time;\n    float ringCount;\n    float ringWidth;\n    float waveSpeed;\n    float shrink;\n    float fadePow;\n};\nvoid main () {\n  vec4 tex = texture2D(texture, v_uv0);\n  float dist = distance(v_uv0, center);\n  float alpha = 0.0;\n  vec2 lowerDist = center;\n  vec2 upperDist = vec2(1.0 - center.x, 1.0 - center.y);\n  float maxDist = max(max(lowerDist.x, lowerDist.y), max(upperDist.x, upperDist.y));\n  float fadeStartDist = maxDist * 0.25;\n  float fadeEndDist = maxDist * 0.95;\n  for (int i = 0; i < 3; ++i) {\n      float ringStartTime = float(i) * 0.3;\n      if (time < ringStartTime) continue;\n      float ringTime = time - ringStartTime;\n      float radius = ringTime * waveSpeed;\n      if (radius > maxDist) continue;\n      if (radius > 1.5) continue;\n      float inner = radius - ringWidth;\n      float a = smoothstep(inner, radius, dist)\n              * (1.0 - smoothstep(radius, radius + 0.01, dist));\n      a *= sin(dist * shrink - ringTime * 6.0) * 0.5 + 0.5;\n      a *= pow(1.0 - radius / 1.5, fadePow);\n      if (radius > fadeStartDist) {\n          float boundaryFade = 1.0 - smoothstep(fadeStartDist, fadeEndDist, radius);\n          a *= boundaryFade;\n      }\n      alpha += a;\n  }\n  alpha = clamp(alpha, 0.0, 1.0);\n  gl_FragColor = vec4(color.rgb, alpha * color.a);\n  ALPHA_TEST(gl_FragColor);\n}"
      }
    }
  ],
  "subMetas": {}
}