[1,["9ef8ppzllDiqyQ2A2+6cKU"],["_effectAsset"],[["cc.Material",["_name","_techniqueData"],1],["cc.EffectAsset",["_name","shaders","techniques"],0]],[[0,0,1,3],[1,0,1,2,4]],[[[[0,"mask_material",{"0":{"props":{"x_offset":5,"y_offset":5,"x_mul":10000,"y_mul":10000},"defines":{"USE_TEXTURE":true,"USE_ALPHA_TEST":false,"INPUT_IS_GAMMA":false}}}]],0,0,[0],[0],[0]],[[[1,"mask_effect",[{"hash":2844738459,"record":null,"name":"mask_effect|vs|fs","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 vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\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  #if USE_TEXTURE\n  v_uv0 = a_uv0;\n  #endif\n  v_color = a_color;\n  gl_Position = pos;\n}","frag":"\nprecision highp float;\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 vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\nuniform sampler2D texture_mask;\n#endif\nuniform input_param {\n  uniform texture_mask1;\n  float x_offset;\n  float y_offset;\n  float x_mul;\n  float y_mul;\n  float mask_a;\n  bool  invert;\n  bool  over_invert;\n};\nvoid main () {\n  vec4 o = vec4(1, 1, 1, 1);\n  vec4 o_mask = vec4(1, 1, 1, 1);\n  #if USE_TEXTURE\n  vec4 texture_tmp = texture(texture, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture\n      texture_tmp.a *= texture(texture, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n    o.a *= texture_tmp.a;\n  #else\n    o *= texture_tmp;\n  #endif\n  vec4 texture_mask_tmp = texture(texture_mask, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture_mask\n      texture_mask_tmp.a *= texture(texture_mask, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o_mask.rgb *= (texture_mask_tmp.rgb * texture_mask_tmp.rgb);\n    o_mask.a *= texture_mask_tmp.a;\n  #else\n    o_mask *= texture_mask_tmp;\n  #endif\n    if(v_uv0.x >= x_offset && v_uv0.x <= (1.0/x_mul + x_offset) && v_uv0.y <= (1.0/y_mul + y_offset) && v_uv0.y >=  y_offset)\n    {\n      o_mask = texture2D(texture_mask, vec2(x_mul* (v_uv0.x - x_offset) ,y_mul * (v_uv0.y - y_offset)));\n      if(invert == true)\n      {\n        o.a = o_mask.a * mask_a;\n      }\n      else\n      {\n        o.a *= 1.0 - o_mask.a * mask_a;\n      }\n    }\n    else\n    {\n      if(over_invert == true)\n      {\n      }\n      else\n      {\n        o.a = 0.0;\n      }\n    }\n  #endif\n  o *= v_color;\n  ALPHA_TEST(o);\n  gl_FragColor = o;\n}"},"glsl1":{"vert":"\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\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  #if USE_TEXTURE\n  v_uv0 = a_uv0;\n  #endif\n  v_color = a_color;\n  gl_Position = pos;\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 vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\nuniform sampler2D texture_mask;\n#endif\nuniform float x_offset;\nuniform float y_offset;\nuniform float x_mul;\nuniform float y_mul;\nuniform float mask_a;\nuniform bool invert;\nuniform bool over_invert;\nvoid main () {\n  vec4 o = vec4(1, 1, 1, 1);\n  vec4 o_mask = vec4(1, 1, 1, 1);\n  #if USE_TEXTURE\n  vec4 texture_tmp = texture2D(texture, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture\n      texture_tmp.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n    o.a *= texture_tmp.a;\n  #else\n    o *= texture_tmp;\n  #endif\n  vec4 texture_mask_tmp = texture2D(texture_mask, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture_mask\n      texture_mask_tmp.a *= texture2D(texture_mask, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o_mask.rgb *= (texture_mask_tmp.rgb * texture_mask_tmp.rgb);\n    o_mask.a *= texture_mask_tmp.a;\n  #else\n    o_mask *= texture_mask_tmp;\n  #endif\n    if(v_uv0.x >= x_offset && v_uv0.x <= (1.0/x_mul + x_offset) && v_uv0.y <= (1.0/y_mul + y_offset) && v_uv0.y >=  y_offset)\n    {\n      o_mask = texture2D(texture_mask, vec2(x_mul* (v_uv0.x - x_offset) ,y_mul * (v_uv0.y - y_offset)));\n      if(invert == true)\n      {\n        o.a = o_mask.a * mask_a;\n      }\n      else\n      {\n        o.a *= 1.0 - o_mask.a * mask_a;\n      }\n    }\n    else\n    {\n      if(over_invert == true)\n      {\n      }\n      else\n      {\n        o.a = 0.0;\n      }\n    }\n  #endif\n  o *= v_color;\n  ALPHA_TEST(o);\n  gl_FragColor = o;\n}"},"builtins":{"globals":{"blocks":[{"name":"CCGlobal","defines":[]}],"samplers":[]},"locals":{"blocks":[{"name":"CCLocal","defines":[]}],"samplers":[]}},"defines":[{"name":"USE_TEXTURE","type":"boolean","defines":[]},{"name":"CC_USE_MODEL","type":"boolean","defines":[]},{"name":"USE_ALPHA_TEST","type":"boolean","defines":[]},{"name":"CC_USE_ALPHA_ATLAS_texture","type":"boolean","defines":["USE_TEXTURE"]},{"name":"INPUT_IS_GAMMA","type":"boolean","defines":["USE_TEXTURE"]},{"name":"CC_USE_ALPHA_ATLAS_texture_mask","type":"boolean","defines":["USE_TEXTURE"]}],"blocks":[{"name":"ALPHA_TEST","binding":0,"members":[{"name":"alphaThreshold","type":13,"count":1}],"defines":["USE_ALPHA_TEST"]},{"name":"input_param","binding":1,"members":[{"name":"texture_mask1","type":"uniform","count":1},{"name":"x_offset","type":13,"count":1},{"name":"y_offset","type":13,"count":1},{"name":"x_mul","type":13,"count":1},{"name":"y_mul","type":13,"count":1},{"name":"mask_a","type":13,"count":1},{"name":"invert","type":1,"count":1},{"name":"over_invert","type":1,"count":1}],"defines":[]}],"samplers":[{"name":"texture","type":29,"count":1,"binding":30,"defines":["USE_TEXTURE"]},{"name":"texture_mask","type":29,"count":1,"binding":31,"defines":["USE_TEXTURE"]}]}],[{"passes":[{"program":"mask_effect|vs|fs","blendState":{"targets":[{"blend":true}]},"rasterizerState":{"cullMode":0},"properties":{"texture":{"value":"white","type":29,"inspector":{"tooltip":"mask图片,设置无效,控件控制"}},"alphaThreshold":{"type":13,"value":[0.5]},"texture_mask":{"value":"white","type":29,"inspector":{"tooltip":"mask图片,设置无效,控件控制"}},"invert":{"type":1,"value":[true]},"over_invert":{"type":1,"value":[true]},"x_offset":{"type":13,"value":[0]},"y_offset":{"type":13,"value":[0]},"x_mul":{"type":13,"value":[0]},"y_mul":{"type":13,"value":[0]}}}]}]]],0,0,[],[],[]]]]