{
  "__type__": "cc.EffectAsset",
  "_name": "__builtin-editor-gizmo",
  "_objFlags": 0,
  "_native": "",
  "properties": {
    "diffuseColor": {
      "type": 9,
      "value": [
        1,
        1,
        1,
        1
      ]
    }
  },
  "techniques": [
    {
      "stages": [
        "transparent"
      ],
      "passes": [
        {
          "cullMode": 0,
          "depthTest": false,
          "depthWrite": false,
          "blend": true,
          "blendEq": 32774,
          "blendSrc": 770,
          "blendDst": 771,
          "blendAlphaEq": 32774,
          "blendSrcAlpha": 1,
          "blendDstAlpha": 771,
          "program": "8db6ba48e8f72d1a5eb1d05aefc76c445f3fd56bbbc9d4669831b0e0"
        }
      ],
      "queue": 0,
      "priority": 0
    }
  ],
  "shaders": [
    {
      "vert": "\n#define _IS_VERT_SHADER 1\n\n  precision highp float;\n\n  \n\nuniform mat4 cc_matView;\n\nuniform mat4 cc_matViewProj;\n\nuniform vec3 cc_cameraPos;                       \n\nuniform vec3 cc_sceneAmbient;                    \n\n  \n\nuniform mat4 cc_matWorld;\nuniform mat3 cc_matWorldIT;\n\n  \n\n#ifndef USE_DIFFUSE_TEXTURE\n  #ifndef USE_EMISSIVE_TEXTURE\n    #ifndef USE_SPECULAR_TEXTURE\n      #ifndef USE_NORMAL_TEXTURE\n        #define _NOT_USE_TEXTURE 1\n      #endif\n    #endif\n  #endif\n#endif\n\n#if USE_TILING_OFFSET && _USE_ATTRIBUTE_UV0\n  uniform vec2 mainTiling;\n  uniform vec2 mainOffset;\n#endif\n\n#ifdef _IS_VERT_SHADER\n  attribute vec3 a_position;\n#endif\n\n#ifndef _NOT_USE_TEXTURE\n\n  #if _USE_ATTRIBUTE_UV0\n    #ifdef _IS_VERT_SHADER\n      attribute mediump vec2 a_uv0;\n    #endif\n\n    varying mediump vec2 v_uv0;\n  #endif\n\n#endif\n\n#if _USE_ATTRIBUTE_COLOR\n\n  #ifdef _IS_VERT_SHADER\n    attribute lowp vec4 a_color;\n  #endif\n\n  varying lowp vec4 v_color;\n#endif\n\n#if _USE_ATTRIBUTE_NORMAL\n  #ifdef _IS_VERT_SHADER\n    attribute vec3 a_normal;\n  #endif\n#endif\n\n#ifdef _IS_VERT_SHADER\n\n  void ATTRIBUTE_TO_VARYING () {\n\n    #if _USE_ATTRIBUTE_COLOR\n        v_color = a_color;\n    #endif\n\n    #ifndef _NOT_USE_TEXTURE\n      #if _USE_ATTRIBUTE_UV0\n        v_uv0 = a_uv0;\n\n        #if USE_TILING_OFFSET\n          v_uv0 = v_uv0 * mainTiling + mainOffset;\n        #endif\n      #endif\n    #endif\n\n  }\n\n#endif\n\nvoid MUL_ATTR_COLOR (inout vec4 color) {\n  #if _USE_ATTRIBUTE_COLOR\n    #ifdef _IS_VERT_SHADER\n      color *= a_color;\n    #else\n      color *= v_color;\n    #endif\n  #endif\n}\n\nvoid MUL_ATTR_NORMAL (inout vec3 normal) {\n  #if _USE_ATTRIBUTE_NORMAL\n    #ifdef _IS_VERT_SHADER\n      normal *= a_normal;\n    #endif\n  #endif\n}\nvoid MUL_ATTR_NORMAL (inout vec4 normal) {\n  #if _USE_ATTRIBUTE_NORMAL\n    #ifdef _IS_VERT_SHADER\n      normal.xyz *= a_normal;\n    #endif\n  #endif\n}\n\n  varying vec3 v_worldNormal;\n  varying vec3 v_worldPosition;\n  varying vec3 v_localPosition;\n  varying vec3 v_right;\n  varying vec3 v_up;\n  varying vec3 v_forward;\n\n  void main () {\n    vec4 pos = vec4(a_position, 1);\n\n    v_localPosition = a_position;\n    v_worldPosition = (cc_matWorld * pos).xyz;\n    v_worldNormal = cc_matWorldIT * a_normal;\n    v_right = vec3(cc_matView[0][0], cc_matView[1][0], cc_matView[2][0]);\n    v_up = vec3(cc_matView[0][1], cc_matView[1][1], cc_matView[2][1]);\n    v_forward = vec3(cc_matView[0][2], cc_matView[1][2], cc_matView[2][2]);\n\n    gl_Position = cc_matViewProj * cc_matWorld * pos;\n  }\n\n\n",
      "frag": "\n#define _IS_FRAG_SHADER 1\n\n  precision highp float;\n  \n  \n\nvec3 gammaToLinearSpaceRGB(in vec3 sRGB) { \n  return sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);\n}\n\nvec3 linearToGammaSpaceRGB(in vec3 RGB) { \n  vec3 S1 = sqrt(RGB);\n  vec3 S2 = sqrt(S1);\n  vec3 S3 = sqrt(S2);\n  return 0.585122381 * S1 + 0.783140355 * S2 - 0.368262736 * S3;\n}\n\nvec4 gammaToLinearSpaceRGBA(in vec4 sRGBA) {\n  return vec4(gammaToLinearSpaceRGB(sRGBA.rgb), sRGBA.a);\n}\n\nvec4 linearToGammaSpaceRGBA(in vec4 RGBA) {\n  return vec4(linearToGammaSpaceRGB(RGBA.rgb), RGBA.a);\n}\n\nvec4 linearToLinear (in vec4 value) {\n  return value;\n}\n\n#if INPUT_IS_GAMMA\n  #define TEXEL_TO_LINEAR gammaToLinearSpaceRGBA\n#else\n  #define TEXEL_TO_LINEAR linearToLinear\n#endif\n\n#if OUTPUT_TO_GAMMA\n  #define LINEAR_TO_OUTPUT_TEXEL linearToGammaSpaceRGBA\n#else\n  #define LINEAR_TO_OUTPUT_TEXEL linearToLinear\n#endif\n\n  \n\nmat3 transpose(mat3 v) {\n    mat3 tmp;\n    tmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n    tmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n    tmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\n    return tmp;\n}\n\nvoid ClipQuadToHorizon(inout vec3 L[5], out int n) {\n    \n    int config = 0;\n    if (L[0].z > 0.0) config += 1;\n    if (L[1].z > 0.0) config += 2;\n    if (L[2].z > 0.0) config += 4;\n    if (L[3].z > 0.0) config += 8;\n    config = 15;\n\n    \n    n = 0;\n\n    if (config == 0)\n    {\n        \n    }\n    else if (config == 1) \n    {\n        n = 3;\n        L[1] = -L[1].z * L[0] + L[0].z * L[1];\n        L[2] = -L[3].z * L[0] + L[0].z * L[3];\n    }\n    else if (config == 2) \n    {\n        n = 3;\n        L[0] = -L[0].z * L[1] + L[1].z * L[0];\n        L[2] = -L[2].z * L[1] + L[1].z * L[2];\n    }\n    else if (config == 3) \n    {\n        n = 4;\n        L[2] = -L[2].z * L[1] + L[1].z * L[2];\n        L[3] = -L[3].z * L[0] + L[0].z * L[3];\n    }\n    else if (config == 4) \n    {\n        n = 3;\n        L[0] = -L[3].z * L[2] + L[2].z * L[3];\n        L[1] = -L[1].z * L[2] + L[2].z * L[1];\n    }\n    else if (config == 5) \n    {\n        n = 0;\n    }\n    else if (config == 6) \n    {\n        n = 4;\n        L[0] = -L[0].z * L[1] + L[1].z * L[0];\n        L[3] = -L[3].z * L[2] + L[2].z * L[3];\n    }\n    else if (config == 7) \n    {\n        n = 5;\n        L[4] = -L[3].z * L[0] + L[0].z * L[3];\n        L[3] = -L[3].z * L[2] + L[2].z * L[3];\n    }\n    else if (config == 8) \n    {\n        n = 3;\n        L[0] = -L[0].z * L[3] + L[3].z * L[0];\n        L[1] = -L[2].z * L[3] + L[3].z * L[2];\n        L[2] =  L[3];\n    }\n    else if (config == 9) \n    {\n        n = 4;\n        L[1] = -L[1].z * L[0] + L[0].z * L[1];\n        L[2] = -L[2].z * L[3] + L[3].z * L[2];\n    }\n    else if (config == 10) \n    {\n        n = 0;\n    }\n    else if (config == 11) \n    {\n        n = 5;\n        L[4] = L[3];\n        L[3] = -L[2].z * L[3] + L[3].z * L[2];\n        L[2] = -L[2].z * L[1] + L[1].z * L[2];\n    }\n    else if (config == 12) \n    {\n        n = 4;\n        L[1] = -L[1].z * L[2] + L[2].z * L[1];\n        L[0] = -L[0].z * L[3] + L[3].z * L[0];\n    }\n    else if (config == 13) \n    {\n        n = 5;\n        L[4] = L[3];\n        L[3] = L[2];\n        L[2] = -L[1].z * L[2] + L[2].z * L[1];\n        L[1] = -L[1].z * L[0] + L[0].z * L[1];\n    }\n    else if (config == 14) \n    {\n        n = 5;\n        L[4] = -L[0].z * L[3] + L[3].z * L[0];\n        L[0] = -L[0].z * L[1] + L[1].z * L[0];\n    }\n    else if (config == 15) \n    {\n        n = 4;\n    }\n\n    if (n == 3)\n        L[3] = L[0];\n    if (n == 4)\n        L[4] = L[0];\n}\n\nfloat IntegrateEdge(vec3 v1, vec3 v2) {\n    float cosTheta = dot(v1, v2);\n    float theta = acos(cosTheta);\n    return cross(v1, v2).z * ((theta > 0.001) ? theta/sin(theta) : 4.0);\n}\n\nvec3 LTC_Evaluate(vec3 N, vec3 V, vec3 P, mat3 Minv, vec3 points[4]) {\n    \n    vec3 T1, T2;\n    T1 = normalize(V - N*dot(V, N));\n    T2 = cross(N, T1);\n\n    \n    Minv = Minv * transpose(mat3(T1, T2, N));\n\n    \n    vec3 L[5];\n    L[0] = Minv * (points[0] - P);\n    L[1] = Minv * (points[1] - P);\n    L[2] = Minv * (points[2] - P);\n    L[3] = Minv * (points[3] - P);\n\n    int n;\n    ClipQuadToHorizon(L, n);\n\n    if (n == 0)\n        return vec3(0, 0, 0);\n\n    \n    L[0] = normalize(L[0]);\n    L[1] = normalize(L[1]);\n    L[2] = normalize(L[2]);\n    L[3] = normalize(L[3]);\n    L[4] = normalize(L[4]);\n\n    \n    float sum = 0.0;\n\n    sum += IntegrateEdge(L[0], L[1]);\n    sum += IntegrateEdge(L[1], L[2]);\n    sum += IntegrateEdge(L[2], L[3]);\n    if (n >= 4)\n        sum += IntegrateEdge(L[3], L[4]);\n    if (n == 5)\n        sum += IntegrateEdge(L[4], L[0]);\n\n    sum = max(0.0, sum);\n\n    vec3 Lo_i = vec3(sum, sum, sum);\n\n    return Lo_i;\n}\n\n  \n\nuniform mat4 cc_matView;\n\nuniform mat4 cc_matViewProj;\n\nuniform vec3 cc_cameraPos;                       \n\nuniform vec3 cc_sceneAmbient;                    \n\n  uniform vec4 diffuseColor;\n\n  varying vec3 v_worldNormal;\n  varying vec3 v_worldPosition;\n  varying vec3 v_localPosition;\n  varying vec3 v_right;\n  varying vec3 v_up;\n  varying vec3 v_forward;\n\n  void main () {\n    vec3 N = normalize(v_worldNormal);\n    vec3 V = normalize(cc_cameraPos - v_worldPosition);\n\n    \n    \n\n    vec3 points[4];\n    vec3 up = vec3(0, 1, 0);\n    points[0] = (v_forward * 3.0 + v_right + up) * 40.0;\n    points[1] = (v_forward * 3.0 - v_right + up) * 40.0;\n    points[2] = (v_forward * 3.0 - v_right - up) * 40.0;\n    points[3] = (v_forward * 3.0 + v_right - up) * 40.0;\n    vec3 diffuse = diffuseColor.rgb * (0.2 + LTC_Evaluate(N, V, v_localPosition, mat3(1), points) * 0.8);\n\n    gl_FragColor = LINEAR_TO_OUTPUT_TEXEL(vec4(diffuse, diffuseColor.a));\n  }\n\n\n",
      "defines": [
        {
          "name": "USE_DIFFUSE_TEXTURE",
          "type": "boolean",
          "defines": []
        },
        {
          "name": "USE_EMISSIVE_TEXTURE",
          "type": "boolean",
          "defines": [
            "USE_DIFFUSE_TEXTURE"
          ]
        },
        {
          "name": "USE_SPECULAR_TEXTURE",
          "type": "boolean",
          "defines": [
            "USE_DIFFUSE_TEXTURE",
            "USE_EMISSIVE_TEXTURE"
          ]
        },
        {
          "name": "USE_NORMAL_TEXTURE",
          "type": "boolean",
          "defines": [
            "USE_DIFFUSE_TEXTURE",
            "USE_EMISSIVE_TEXTURE",
            "USE_SPECULAR_TEXTURE"
          ]
        },
        {
          "name": "USE_TILING_OFFSET",
          "type": "boolean",
          "defines": []
        },
        {
          "name": "_USE_ATTRIBUTE_UV0",
          "type": "boolean",
          "defines": []
        },
        {
          "name": "_USE_ATTRIBUTE_COLOR",
          "type": "boolean",
          "defines": []
        },
        {
          "name": "_USE_ATTRIBUTE_NORMAL",
          "type": "boolean",
          "defines": []
        },
        {
          "name": "INPUT_IS_GAMMA",
          "type": "boolean",
          "defines": []
        },
        {
          "name": "OUTPUT_TO_GAMMA",
          "type": "boolean",
          "defines": []
        }
      ],
      "uniforms": [
        {
          "name": "mainTiling",
          "type": 5,
          "property": true,
          "defines": [
            "USE_TILING_OFFSET",
            "_USE_ATTRIBUTE_UV0"
          ]
        },
        {
          "name": "mainOffset",
          "type": 5,
          "property": true,
          "defines": [
            "USE_TILING_OFFSET",
            "_USE_ATTRIBUTE_UV0"
          ]
        },
        {
          "name": "diffuseColor",
          "type": 7,
          "defines": []
        }
      ],
      "attributes": [
        {
          "name": "a_position",
          "type": 6,
          "defines": []
        },
        {
          "name": "a_uv0",
          "type": 5,
          "defines": [
            "_USE_ATTRIBUTE_UV0"
          ]
        },
        {
          "name": "a_color",
          "type": 7,
          "defines": [
            "_USE_ATTRIBUTE_COLOR"
          ]
        },
        {
          "name": "a_normal",
          "type": 6,
          "defines": [
            "_USE_ATTRIBUTE_NORMAL"
          ]
        }
      ],
      "extensions": [],
      "name": "8db6ba48e8f72d1a5eb1d05aefc76c445f3fd56bbbc9d4669831b0e0"
    }
  ]
}