InnerGlow.effect.meta 8.0 KB

123456789101112131415161718
  1. {
  2. "ver": "1.0.27",
  3. "uuid": "567ed4ab-b59f-48f4-9e17-c621f7d845c1",
  4. "importer": "effect",
  5. "compiledShaders": [
  6. {
  7. "glsl1": {
  8. "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\n#if USE_TEXTURE\n attribute vec2 a_uv0;\n varying vec2 v_uv0;\n#endif\nattribute vec4 a_color;\nvarying vec4 v_color;\nvoid main () {\n mat4 mvp;\n #if CC_USE_MODEL\n mvp = cc_matViewProj * cc_matWorld;\n #else\n mvp = cc_matViewProj;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n #if USE_TINT\n #endif\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}",
  9. "frag": "\n precision highp float;\n #if USE_TEXTURE\n varying vec2 v_uv0;\n uniform sampler2D texture;\n #endif\n varying vec4 v_color;\n uniform vec4 uGlowColor;\nuniform float uSize;\nuniform float uIntensity;\nuniform sampler2D uTex;\nvec4 InnerGlow_main(sampler2D Tex, vec2 UV, float Size, float Intensity, vec4 GlowColor)\n{\n float step1 = 0.005 * Size;\n float step2 = step1 * 2.0;\n vec4 result = vec4 (0, 0, 0, 0);\n vec2 texCoord = vec2(0, 0);\n texCoord = UV + vec2(-step2, -step2);\n result += (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step1, -step2);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(0, -step2);\n result += 6.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step1, -step2);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step2, -step2);\n result += (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step2, -step1);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step1, -step1);\n result += 16.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(0, -step1);\n result += 24.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step1, -step1);\n result += 16.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step2, -step1);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step2, 0);\n result += 6.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step1, 0);\n result += 24.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV;\n result += 36.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step1, 0);\n result += 24.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step2, 0);\n result += 6.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step2, step1);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step1, step1);\n result += 16.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(0, step1);\n result += 24.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step1, step1);\n result += 16.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step2, step1);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step2, step2);\n result += (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step1, step2);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(0, step2);\n result += 6.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step1, step2);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step2, step2);\n result += (1.0 - texture2D(Tex, texCoord).a);\n result = result*0.00390625;\n result = mix(texture2D(Tex, UV), GlowColor * Intensity, result * GlowColor.a);\n result.a = texture2D(Tex, UV).a;\n return clamp(result, 0.0, 1.0);\n}\nvoid main () {\n gl_FragColor = InnerGlow_main(texture, v_uv0, uSize, uIntensity, uGlowColor);\n}"
  10. },
  11. "glsl3": {
  12. "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;\n#if USE_TEXTURE\n in vec2 a_uv0;\n out vec2 v_uv0;\n#endif\nin vec4 a_color;\nout vec4 v_color;\nvoid main () {\n mat4 mvp;\n #if CC_USE_MODEL\n mvp = cc_matViewProj * cc_matWorld;\n #else\n mvp = cc_matViewProj;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n #if USE_TINT\n #endif\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}",
  13. "frag": "\n precision 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_TEXTURE\n in vec2 v_uv0;\n uniform sampler2D texture;\n #endif\n in vec4 v_color;\n uniform Constant {\n vec4 uGlowColor;\n float uSize;\n float uIntensity;\n};\nuniform sampler2D uTex;\nvec4 InnerGlow_main(sampler2D Tex, vec2 UV, float Size, float Intensity, vec4 GlowColor)\n{\n float step1 = 0.005 * Size;\n float step2 = step1 * 2.0;\n vec4 result = vec4 (0, 0, 0, 0);\n vec2 texCoord = vec2(0, 0);\n texCoord = UV + vec2(-step2, -step2);\n result += (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step1, -step2);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(0, -step2);\n result += 6.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step1, -step2);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step2, -step2);\n result += (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step2, -step1);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step1, -step1);\n result += 16.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(0, -step1);\n result += 24.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step1, -step1);\n result += 16.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step2, -step1);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step2, 0);\n result += 6.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step1, 0);\n result += 24.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV;\n result += 36.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step1, 0);\n result += 24.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step2, 0);\n result += 6.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step2, step1);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step1, step1);\n result += 16.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(0, step1);\n result += 24.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step1, step1);\n result += 16.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step2, step1);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step2, step2);\n result += (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(-step1, step2);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(0, step2);\n result += 6.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step1, step2);\n result += 4.0 * (1.0 - texture2D(Tex, texCoord).a);\n texCoord = UV + vec2(step2, step2);\n result += (1.0 - texture2D(Tex, texCoord).a);\n result = result*0.00390625;\n result = mix(texture2D(Tex, UV), GlowColor * Intensity, result * GlowColor.a);\n result.a = texture2D(Tex, UV).a;\n return clamp(result, 0.0, 1.0);\n}\nvoid main () {\n gl_FragColor = InnerGlow_main(texture, v_uv0, uSize, uIntensity, uGlowColor);\n}"
  14. }
  15. }
  16. ],
  17. "subMetas": {}
  18. }