From 722914d5c4c2b4b169445733e65ab75c380d2a9e Mon Sep 17 00:00:00 2001 From: caizhitao Date: Mon, 17 Feb 2020 09:32:23 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=94=AF=E6=8C=812.3.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../builtin-2d-sprite-explain.effect.meta | 10 ++--- assets/effects/sprite-flash-light.effect | 2 +- assets/effects/sprite-flash-light.effect.meta | 10 ++--- assets/effects/sprite-gaussian-blur-v1.effect | 2 +- .../sprite-gaussian-blur-v1.effect.meta | 10 ++--- assets/effects/sprite-glow-inner.effect.meta | 10 ++--- assets/effects/sprite-glow-outter.effect.meta | 10 ++--- assets/effects/sprite-gray.effect | 2 +- assets/effects/sprite-gray.effect.meta | 10 ++--- assets/effects/sprite-mosaic.effect | 2 +- assets/effects/sprite-mosaic.effect.meta | 10 ++--- assets/effects/sprite-old-photo.effect | 2 +- assets/effects/sprite-old-photo.effect.meta | 10 ++--- assets/effects/sprite-outline.effect.meta | 10 ++--- assets/effects/sprite-point-light.effect | 2 +- assets/effects/sprite-point-light.effect.meta | 10 ++--- .../sprite-round-corner-crop-v1.effect | 2 +- .../sprite-round-corner-crop-v1.effect.meta | 10 ++--- .../sprite-round-corner-crop-v2.effect | 2 +- .../sprite-round-corner-crop-v2.effect.meta | 10 ++--- .../materials/builtin-2d-sprite-explain.mtl | 13 ++++--- .../builtin-2d-sprite-explain.mtl.meta | 2 +- assets/materials/sprite-flash-light.mtl | 34 +++++++++-------- assets/materials/sprite-flash-light.mtl.meta | 2 +- assets/materials/sprite-gaussian-blur-v1.mtl | 15 +++++--- .../sprite-gaussian-blur-v1.mtl.meta | 2 +- assets/materials/sprite-glow-inner.mtl | 38 ++++++++++--------- assets/materials/sprite-glow-inner.mtl.meta | 2 +- assets/materials/sprite-glow-outter.mtl | 38 ++++++++++--------- assets/materials/sprite-glow-outter.mtl.meta | 2 +- assets/materials/sprite-gray.mtl | 15 +++++--- assets/materials/sprite-gray.mtl.meta | 2 +- assets/materials/sprite-mosaic.mtl | 20 ++++++---- assets/materials/sprite-mosaic.mtl.meta | 2 +- assets/materials/sprite-old-photo.mtl | 15 +++++--- assets/materials/sprite-old-photo.mtl.meta | 2 +- assets/materials/sprite-outline.mtl | 36 ++++++++++-------- assets/materials/sprite-outline.mtl.meta | 2 +- assets/materials/sprite-point-light.mtl | 18 +++++---- assets/materials/sprite-point-light.mtl.meta | 2 +- .../materials/sprite-round-corner-crop-v1.mtl | 15 +++++--- .../sprite-round-corner-crop-v1.mtl.meta | 2 +- .../materials/sprite-round-corner-crop-v2.mtl | 15 +++++--- .../sprite-round-corner-crop-v2.mtl.meta | 2 +- assets/scenes/FlashLightEffectScene.fire | 29 ++++++++++++++ assets/scenes/FlashLightEffectScene.fire.meta | 2 +- assets/scenes/GaussianBlurV1EffectScene.fire | 29 ++++++++++++++ .../GaussianBlurV1EffectScene.fire.meta | 2 +- assets/scenes/GlowInnerEffectScene.fire | 29 ++++++++++++++ assets/scenes/GlowInnerEffectScene.fire.meta | 2 +- assets/scenes/GlowOutterEffectScene.fire | 29 ++++++++++++++ assets/scenes/GlowOutterEffectScene.fire.meta | 2 +- assets/scenes/GrayEffectScene.fire | 29 ++++++++++++++ assets/scenes/GrayEffectScene.fire.meta | 2 +- assets/scenes/MosaicEffectScene.fire | 29 ++++++++++++++ assets/scenes/MosaicEffectScene.fire.meta | 2 +- assets/scenes/OldPhotoEffectScene.fire | 29 ++++++++++++++ assets/scenes/OldPhotoEffectScene.fire.meta | 2 +- assets/scenes/OutlineEffectScene.fire | 29 ++++++++++++++ assets/scenes/OutlineEffectScene.fire.meta | 2 +- assets/scenes/PointLightEffectScene.fire | 29 ++++++++++++++ assets/scenes/PointLightEffectScene.fire.meta | 2 +- assets/scenes/PreviewEffectScene.fire | 29 ++++++++++++++ assets/scenes/PreviewEffectScene.fire.meta | 2 +- .../scenes/RoundCornerCropV1EffectScene.fire | 29 ++++++++++++++ .../RoundCornerCropV1EffectScene.fire.meta | 2 +- .../scenes/RoundCornerCropV2EffectScene.fire | 29 ++++++++++++++ .../RoundCornerCropV2EffectScene.fire.meta | 2 +- assets/textures/ball_0.png.meta | 4 +- assets/textures/ball_1.png.meta | 4 +- assets/textures/bg.png.meta | 4 +- assets/textures/cocos_logo.png.meta | 4 +- assets/textures/freedom.jpg.meta | 4 +- assets/textures/gaussian_blur.png.meta | 4 +- assets/textures/video_btn.png.meta | 4 +- assets/textures/xmlBMFont.png.meta | 4 +- project.json | 2 +- settings/project.json | 6 ++- 78 files changed, 627 insertions(+), 217 deletions(-) diff --git a/assets/effects/builtin-2d-sprite-explain.effect.meta b/assets/effects/builtin-2d-sprite-explain.effect.meta index a8d2556..bfdf519 100644 --- a/assets/effects/builtin-2d-sprite-explain.effect.meta +++ b/assets/effects/builtin-2d-sprite-explain.effect.meta @@ -1,15 +1,15 @@ { - "ver": "1.0.23", + "ver": "1.0.25", "uuid": "8f277982-dc0a-4030-90cc-b336a928a372", "compiledShaders": [ { "glsl1": { - "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\n\nattribute vec3 a_position;\n\nattribute vec4 a_color;\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\n\nattribute vec2 a_uv0;\n\nvarying vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform float alphaThreshold;\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\n\nvarying vec2 v_uv0;\n\nuniform sampler2D texture;\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n}\n" + "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}" }, "glsl3": { - "vert": "\nprecision highp float;\nuniform CCGlobal {\n vec4 cc_time;\n\n vec4 cc_screenSize;\n\n vec4 cc_screenScale;\n\n vec4 cc_nativeSize;\n\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\n vec4 cc_exposure;\n\n vec4 cc_mainLitDir;\n\n vec4 cc_mainLitColor;\n\n vec4 cc_ambientSky;\n vec4 cc_ambientGround;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\n\nin vec3 a_position;\n\nin vec4 a_color;\n\nout vec4 v_color;\n\n#if USE_TEXTURE\n\nin vec2 a_uv0;\n\nout vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform ALPHA_TEST {\n float alphaThreshold;\n }\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nin vec4 v_color;\n\n#if USE_TEXTURE\n\nin vec2 v_uv0;\n\nuniform sampler2D texture;\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n}\n" + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}" } } ], diff --git a/assets/effects/sprite-flash-light.effect b/assets/effects/sprite-flash-light.effect index 4038f72..4f7a180 100644 --- a/assets/effects/sprite-flash-light.effect +++ b/assets/effects/sprite-flash-light.effect @@ -151,7 +151,7 @@ CCProgram fs %{ // 是否启用迷雾效果 // ps:编辑器还不支持 bool 类型的样子,因此用float来定义 float enableFog; - } + }; /** * 添加光束颜色 diff --git a/assets/effects/sprite-flash-light.effect.meta b/assets/effects/sprite-flash-light.effect.meta index 723f225..b2284be 100644 --- a/assets/effects/sprite-flash-light.effect.meta +++ b/assets/effects/sprite-flash-light.effect.meta @@ -1,15 +1,15 @@ { - "ver": "1.0.23", + "ver": "1.0.25", "uuid": "e9682cd1-a19c-4fcb-ad8c-cf1783b805e6", "compiledShaders": [ { "glsl1": { - "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\n\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform float alphaThreshold;\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if ENABLE_LIGHT\nuniform vec4 lightColor;\nuniform vec2 lightCenterPoint;\nuniform float lightAngle;\nuniform float lightWidth;\nuniform float enableGradient;\nuniform float cropAlpha;\nuniform float enableFog;\n/**\n * 添加光束颜色\n */\nvec4 addLightColor(vec4 textureColor, vec4 lightColor, vec2 lightCenterPoint, float lightAngle, float lightWidth) {\n\n if (lightWidth <= 0.0) {\n return textureColor;\n }\n\n float angleInRadians = radians(lightAngle);\n\n float dis = 0.0;\n if (mod(lightAngle, 180.0) != 0.0) {\n\n float lightOffsetX = lightCenterPoint.x - ((1.0 - lightCenterPoint.y) / tan(angleInRadians));\n\n float dx = lightOffsetX + (1.0 - v_uv0.y) / tan(angleInRadians);\n\n float offsetDis = abs(v_uv0.x - dx);\n\n dis = sin(angleInRadians) * offsetDis;\n } else {\n dis = abs(v_uv0.y - lightCenterPoint.y);\n }\n \n float a = 1.0 ;\n\n if (bool(cropAlpha)) {\n a *= step(0.01, textureColor.a);\n }\n\n if (!bool(enableFog)) {\n a *= step(dis, lightWidth * 0.5);\n }\n\n if (bool(enableGradient)) {\n a *= 1.0 - dis / (lightWidth * 0.5);\n }\n\n vec4 finalLightColor = lightColor * a;\n\n return textureColor * textureColor.a + finalLightColor;\n}\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n \n #if ENABLE_LIGHT\n gl_FragColor = addLightColor(gl_FragColor, lightColor, lightCenterPoint, lightAngle, lightWidth);\n #endif\n}\n" + "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\n#if ENABLE_LIGHT\nuniform vec4 lightColor;\nuniform vec2 lightCenterPoint;\nuniform float lightAngle;\nuniform float lightWidth;\nuniform float enableGradient;\nuniform float cropAlpha;\nuniform float enableFog;\nvec4 addLightColor(vec4 textureColor, vec4 lightColor, vec2 lightCenterPoint, float lightAngle, float lightWidth) {\n if (lightWidth <= 0.0) {\n return textureColor;\n }\n float angleInRadians = radians(lightAngle);\n float dis = 0.0;\n if (mod(lightAngle, 180.0) != 0.0) {\n float lightOffsetX = lightCenterPoint.x - ((1.0 - lightCenterPoint.y) / tan(angleInRadians));\n float dx = lightOffsetX + (1.0 - v_uv0.y) / tan(angleInRadians);\n float offsetDis = abs(v_uv0.x - dx);\n dis = sin(angleInRadians) * offsetDis;\n } else {\n dis = abs(v_uv0.y - lightCenterPoint.y);\n }\n float a = 1.0 ;\n if (bool(cropAlpha)) {\n a *= step(0.01, textureColor.a);\n }\n if (!bool(enableFog)) {\n a *= step(dis, lightWidth * 0.5);\n }\n if (bool(enableGradient)) {\n a *= 1.0 - dis / (lightWidth * 0.5);\n }\n vec4 finalLightColor = lightColor * a;\n return textureColor * textureColor.a + finalLightColor;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if ENABLE_LIGHT\n gl_FragColor = addLightColor(gl_FragColor, lightColor, lightCenterPoint, lightAngle, lightWidth);\n #endif\n}" }, "glsl3": { - "vert": "\nprecision highp float;\nuniform CCGlobal {\n vec4 cc_time;\n\n vec4 cc_screenSize;\n\n vec4 cc_screenScale;\n\n vec4 cc_nativeSize;\n\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\n vec4 cc_exposure;\n\n vec4 cc_mainLitDir;\n\n vec4 cc_mainLitColor;\n\n vec4 cc_ambientSky;\n vec4 cc_ambientGround;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\n\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform ALPHA_TEST {\n float alphaThreshold;\n }\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nin vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if ENABLE_LIGHT\nuniform Light {\n\n vec4 lightColor;\n\n vec2 lightCenterPoint;\n\n float lightAngle;\n\n float lightWidth;\n\n float enableGradient;\n\n float cropAlpha;\n\n float enableFog;\n}\n\n/**\n * 添加光束颜色\n */\nvec4 addLightColor(vec4 textureColor, vec4 lightColor, vec2 lightCenterPoint, float lightAngle, float lightWidth) {\n\n if (lightWidth <= 0.0) {\n return textureColor;\n }\n\n float angleInRadians = radians(lightAngle);\n\n float dis = 0.0;\n if (mod(lightAngle, 180.0) != 0.0) {\n\n float lightOffsetX = lightCenterPoint.x - ((1.0 - lightCenterPoint.y) / tan(angleInRadians));\n\n float dx = lightOffsetX + (1.0 - v_uv0.y) / tan(angleInRadians);\n\n float offsetDis = abs(v_uv0.x - dx);\n\n dis = sin(angleInRadians) * offsetDis;\n } else {\n dis = abs(v_uv0.y - lightCenterPoint.y);\n }\n \n float a = 1.0 ;\n\n if (bool(cropAlpha)) {\n a *= step(0.01, textureColor.a);\n }\n\n if (!bool(enableFog)) {\n a *= step(dis, lightWidth * 0.5);\n }\n\n if (bool(enableGradient)) {\n a *= 1.0 - dis / (lightWidth * 0.5);\n }\n\n vec4 finalLightColor = lightColor * a;\n\n return textureColor * textureColor.a + finalLightColor;\n}\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n \n #if ENABLE_LIGHT\n gl_FragColor = addLightColor(gl_FragColor, lightColor, lightCenterPoint, lightAngle, lightWidth);\n #endif\n}\n" + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\n#if ENABLE_LIGHT\nuniform Light {\n vec4 lightColor;\n vec2 lightCenterPoint;\n float lightAngle;\n float lightWidth;\n float enableGradient;\n float cropAlpha;\n float enableFog;\n};\nvec4 addLightColor(vec4 textureColor, vec4 lightColor, vec2 lightCenterPoint, float lightAngle, float lightWidth) {\n if (lightWidth <= 0.0) {\n return textureColor;\n }\n float angleInRadians = radians(lightAngle);\n float dis = 0.0;\n if (mod(lightAngle, 180.0) != 0.0) {\n float lightOffsetX = lightCenterPoint.x - ((1.0 - lightCenterPoint.y) / tan(angleInRadians));\n float dx = lightOffsetX + (1.0 - v_uv0.y) / tan(angleInRadians);\n float offsetDis = abs(v_uv0.x - dx);\n dis = sin(angleInRadians) * offsetDis;\n } else {\n dis = abs(v_uv0.y - lightCenterPoint.y);\n }\n float a = 1.0 ;\n if (bool(cropAlpha)) {\n a *= step(0.01, textureColor.a);\n }\n if (!bool(enableFog)) {\n a *= step(dis, lightWidth * 0.5);\n }\n if (bool(enableGradient)) {\n a *= 1.0 - dis / (lightWidth * 0.5);\n }\n vec4 finalLightColor = lightColor * a;\n return textureColor * textureColor.a + finalLightColor;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if ENABLE_LIGHT\n gl_FragColor = addLightColor(gl_FragColor, lightColor, lightCenterPoint, lightAngle, lightWidth);\n #endif\n}" } } ], diff --git a/assets/effects/sprite-gaussian-blur-v1.effect b/assets/effects/sprite-gaussian-blur-v1.effect index 2df18ef..811cc08 100644 --- a/assets/effects/sprite-gaussian-blur-v1.effect +++ b/assets/effects/sprite-gaussian-blur-v1.effect @@ -105,7 +105,7 @@ CCProgram fs %{ // // 标准方差值 // float stDev; - } + }; /** * 获取权重(对应二维高斯函数公式,见 https://zh.wikipedia.org/wiki/%E9%AB%98%E6%96%AF%E6%A8%A1%E7%B3%8A ) diff --git a/assets/effects/sprite-gaussian-blur-v1.effect.meta b/assets/effects/sprite-gaussian-blur-v1.effect.meta index fd00a2d..8e30721 100644 --- a/assets/effects/sprite-gaussian-blur-v1.effect.meta +++ b/assets/effects/sprite-gaussian-blur-v1.effect.meta @@ -1,15 +1,15 @@ { - "ver": "1.0.23", + "ver": "1.0.25", "uuid": "41f4d474-d707-45bb-af93-637573f92d54", "compiledShaders": [ { "glsl1": { - "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\n\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform float alphaThreshold;\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if ENABLE_GAUSSIAN_BLUR\n\nuniform vec2 textureSize;\n/**\n * 获取权重(对应二维高斯函数公式,见 https:\n\n */\nfloat getWeight(float x, float y) {\n return (1.0 / (2.0 * 3.141592653589793 * pow(1.5, 2.0))) * pow(1.0 / 2.718281828459045, (pow(x, 2.0) + pow(y, 2.0)) / (2.0 * pow(1.5, 2.0)));\n}\n\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n #if ENABLE_GAUSSIAN_BLUR\n\n const float size = floor(1.5 * 6.0 + 1.0);\n const float halfSize = floor(size / 2.0);\n\n float totalWeight = getWeight(0.0, 0.0);\n\n for(float x = 1.0; x <= halfSize; x++) {\n totalWeight += getWeight(x, 0.0) * 2.0;\n }\n\n for(float y = 1.0; y <= halfSize; y++) {\n totalWeight += getWeight(0.0, y) * 2.0;\n }\n\n for(float x = 1.0; x <= halfSize; x++) {\n for (float y = 1.0; y<= halfSize; y++) {\n totalWeight += getWeight(x, y) * 4.0;\n }\n }\n\n vec4 finalColor = vec4(0.0, 0.0, 0.0, 0.0);\n\n float onePxWidth = 1.0 / textureSize.x;\n float onePxHeight = 1.0 / textureSize.y;\n for(float x = -halfSize; x<= halfSize; x++) {\n for (float y = -halfSize; y<= halfSize; y++) {\n\n float weight = getWeight(x, y) / totalWeight;\n\n finalColor += texture2D(texture, v_uv0 + vec2(onePxWidth * x, onePxHeight * y)) * weight;\n }\n }\n gl_FragColor = finalColor;\n #endif\n}\n" + "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\n#if ENABLE_GAUSSIAN_BLUR\nuniform vec2 textureSize;\nfloat getWeight(float x, float y) {\n return (1.0 / (2.0 * 3.141592653589793 * pow(1.5, 2.0))) * pow(1.0 / 2.718281828459045, (pow(x, 2.0) + pow(y, 2.0)) / (2.0 * pow(1.5, 2.0)));\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if ENABLE_GAUSSIAN_BLUR\n const float size = floor(1.5 * 6.0 + 1.0);\n const float halfSize = floor(size / 2.0);\n float totalWeight = getWeight(0.0, 0.0);\n for(float x = 1.0; x <= halfSize; x++) {\n totalWeight += getWeight(x, 0.0) * 2.0;\n }\n for(float y = 1.0; y <= halfSize; y++) {\n totalWeight += getWeight(0.0, y) * 2.0;\n }\n for(float x = 1.0; x <= halfSize; x++) {\n for (float y = 1.0; y<= halfSize; y++) {\n totalWeight += getWeight(x, y) * 4.0;\n }\n }\n vec4 finalColor = vec4(0.0, 0.0, 0.0, 0.0);\n float onePxWidth = 1.0 / textureSize.x;\n float onePxHeight = 1.0 / textureSize.y;\n for(float x = -halfSize; x<= halfSize; x++) {\n for (float y = -halfSize; y<= halfSize; y++) {\n float weight = getWeight(x, y) / totalWeight;\n finalColor += texture2D(texture, v_uv0 + vec2(onePxWidth * x, onePxHeight * y)) * weight;\n }\n }\n gl_FragColor = finalColor;\n #endif\n}" }, "glsl3": { - "vert": "\nprecision highp float;\nuniform CCGlobal {\n vec4 cc_time;\n\n vec4 cc_screenSize;\n\n vec4 cc_screenScale;\n\n vec4 cc_nativeSize;\n\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\n vec4 cc_exposure;\n\n vec4 cc_mainLitDir;\n\n vec4 cc_mainLitColor;\n\n vec4 cc_ambientSky;\n vec4 cc_ambientGround;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\n\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform ALPHA_TEST {\n float alphaThreshold;\n }\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nin vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if ENABLE_GAUSSIAN_BLUR\n\nuniform GaussianBlur {\n\n vec2 textureSize;\n\n}\n\n/**\n * 获取权重(对应二维高斯函数公式,见 https:\n\n */\nfloat getWeight(float x, float y) {\n return (1.0 / (2.0 * 3.141592653589793 * pow(1.5, 2.0))) * pow(1.0 / 2.718281828459045, (pow(x, 2.0) + pow(y, 2.0)) / (2.0 * pow(1.5, 2.0)));\n}\n\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n #if ENABLE_GAUSSIAN_BLUR\n\n const float size = floor(1.5 * 6.0 + 1.0);\n const float halfSize = floor(size / 2.0);\n\n float totalWeight = getWeight(0.0, 0.0);\n\n for(float x = 1.0; x <= halfSize; x++) {\n totalWeight += getWeight(x, 0.0) * 2.0;\n }\n\n for(float y = 1.0; y <= halfSize; y++) {\n totalWeight += getWeight(0.0, y) * 2.0;\n }\n\n for(float x = 1.0; x <= halfSize; x++) {\n for (float y = 1.0; y<= halfSize; y++) {\n totalWeight += getWeight(x, y) * 4.0;\n }\n }\n\n vec4 finalColor = vec4(0.0, 0.0, 0.0, 0.0);\n\n float onePxWidth = 1.0 / textureSize.x;\n float onePxHeight = 1.0 / textureSize.y;\n for(float x = -halfSize; x<= halfSize; x++) {\n for (float y = -halfSize; y<= halfSize; y++) {\n\n float weight = getWeight(x, y) / totalWeight;\n\n finalColor += texture(texture, v_uv0 + vec2(onePxWidth * x, onePxHeight * y)) * weight;\n }\n }\n gl_FragColor = finalColor;\n #endif\n}\n" + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\n#if ENABLE_GAUSSIAN_BLUR\nuniform GaussianBlur {\n vec2 textureSize;\n};\nfloat getWeight(float x, float y) {\n return (1.0 / (2.0 * 3.141592653589793 * pow(1.5, 2.0))) * pow(1.0 / 2.718281828459045, (pow(x, 2.0) + pow(y, 2.0)) / (2.0 * pow(1.5, 2.0)));\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if ENABLE_GAUSSIAN_BLUR\n const float size = floor(1.5 * 6.0 + 1.0);\n const float halfSize = floor(size / 2.0);\n float totalWeight = getWeight(0.0, 0.0);\n for(float x = 1.0; x <= halfSize; x++) {\n totalWeight += getWeight(x, 0.0) * 2.0;\n }\n for(float y = 1.0; y <= halfSize; y++) {\n totalWeight += getWeight(0.0, y) * 2.0;\n }\n for(float x = 1.0; x <= halfSize; x++) {\n for (float y = 1.0; y<= halfSize; y++) {\n totalWeight += getWeight(x, y) * 4.0;\n }\n }\n vec4 finalColor = vec4(0.0, 0.0, 0.0, 0.0);\n float onePxWidth = 1.0 / textureSize.x;\n float onePxHeight = 1.0 / textureSize.y;\n for(float x = -halfSize; x<= halfSize; x++) {\n for (float y = -halfSize; y<= halfSize; y++) {\n float weight = getWeight(x, y) / totalWeight;\n finalColor += texture(texture, v_uv0 + vec2(onePxWidth * x, onePxHeight * y)) * weight;\n }\n }\n gl_FragColor = finalColor;\n #endif\n}" } } ], diff --git a/assets/effects/sprite-glow-inner.effect.meta b/assets/effects/sprite-glow-inner.effect.meta index 49a706e..d619895 100644 --- a/assets/effects/sprite-glow-inner.effect.meta +++ b/assets/effects/sprite-glow-inner.effect.meta @@ -1,15 +1,15 @@ { - "ver": "1.0.23", + "ver": "1.0.25", "uuid": "90211f16-c00e-4c37-a192-43ec50c9ea35", "compiledShaders": [ { "glsl1": { - "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\n\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform float alphaThreshold;\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if SHOW_INNER_GLOW\n\nuniform vec4 glowColor;\nuniform float glowColorSize;\nuniform float glowThreshold;\n\n/**\n * 获取纹理uv颜色 \n *\n * 主要实现:超出边界的统一返回 vec4(0.0, 0.0, 0.0, 0.0)\n * \n * 在 Cocos Creator 2.2.1 的编辑器中,超出边界的uv并不是返回 vec4(0.0, 0.0, 0.0, 0.0),实际返回为\n * \n * * 超出左边界的uv,返回 v_uv0.x = 0 的颜色\n * * 超出右边界的uv,返回 v_uv0.x = 1 的颜色\n * * 超出上边界的uv,返回 v_uv0.y = 1 的颜色\n * * 超出下边界的uv,返回 v_uv0.y = 0 的颜色\n *\n * 和实际在浏览器上显示(超出边界即为透明)的有区别,为了统一,这里适配一下,这样子,在编辑器上预览的效果就能和实际浏览器的保持一致\n */\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture2D(texture, v_uv0);\n}\n\n/**\n * 获取指定角度方向,距离为xxx的像素的透明度\n *\n * @param angle 角度 [0.0, 360.0]\n * @param dist 距离 [0.0, 1.0]\n *\n * @return alpha [0.0, 1.0]\n */\nfloat getColorAlpha(float angle, float dist) {\n\n float radian = radians(angle);\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian))); \n return color.a;\n}\n\n/**\n * 获取指定距离的周边像素的透明度平均值\n *\n * @param dist 距离 [0.0, 1.0]\n *\n * @return average alpha [0.0, 1.0]\n */\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n\n}\n\n/**\n * 获取发光的透明度\n */\nfloat getGlowAlpha() {\n\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n\n vec4 srcColor = getTextureColor(texture, v_uv0);\n if (srcColor.a <= glowThreshold) {\n return srcColor.a;\n }\n\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= getTextureColor(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n\n #if SHOW_INNER_GLOW\n\n vec4 color_dest = o;\n\n float alpha = getGlowAlpha();\n\n if (alpha > glowThreshold) {\n\n alpha = 1.0 - alpha;\n\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n }\n\n vec4 color_src = glowColor * alpha;\n\n gl_FragColor = color_src * color_src.a + color_dest;\n #endif\n}\n" + "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\n#if SHOW_INNER_GLOW\nuniform vec4 glowColor;\nuniform float glowColorSize;\nuniform float glowThreshold;\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture2D(texture, v_uv0);\n}\nfloat getColorAlpha(float angle, float dist) {\n float radian = radians(angle);\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian)));\n return color.a;\n}\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n}\nfloat getGlowAlpha() {\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n vec4 srcColor = getTextureColor(texture, v_uv0);\n if (srcColor.a <= glowThreshold) {\n return srcColor.a;\n }\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= getTextureColor(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_INNER_GLOW\n vec4 color_dest = o;\n float alpha = getGlowAlpha();\n if (alpha > glowThreshold) {\n alpha = 1.0 - alpha;\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n }\n vec4 color_src = glowColor * alpha;\n gl_FragColor = color_src * color_src.a + color_dest;\n #endif\n}" }, "glsl3": { - "vert": "\nprecision highp float;\nuniform CCGlobal {\n vec4 cc_time;\n\n vec4 cc_screenSize;\n\n vec4 cc_screenScale;\n\n vec4 cc_nativeSize;\n\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\n vec4 cc_exposure;\n\n vec4 cc_mainLitDir;\n\n vec4 cc_mainLitColor;\n\n vec4 cc_ambientSky;\n vec4 cc_ambientGround;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\n\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform ALPHA_TEST {\n float alphaThreshold;\n }\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nin vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if SHOW_INNER_GLOW\n\nuniform glow {\n\n vec4 glowColor;\n\n float glowColorSize;\n\n float glowThreshold;\n\n};\n\n/**\n * 获取纹理uv颜色 \n *\n * 主要实现:超出边界的统一返回 vec4(0.0, 0.0, 0.0, 0.0)\n * \n * 在 Cocos Creator 2.2.1 的编辑器中,超出边界的uv并不是返回 vec4(0.0, 0.0, 0.0, 0.0),实际返回为\n * \n * * 超出左边界的uv,返回 v_uv0.x = 0 的颜色\n * * 超出右边界的uv,返回 v_uv0.x = 1 的颜色\n * * 超出上边界的uv,返回 v_uv0.y = 1 的颜色\n * * 超出下边界的uv,返回 v_uv0.y = 0 的颜色\n *\n * 和实际在浏览器上显示(超出边界即为透明)的有区别,为了统一,这里适配一下,这样子,在编辑器上预览的效果就能和实际浏览器的保持一致\n */\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture(texture, v_uv0);\n}\n\n/**\n * 获取指定角度方向,距离为xxx的像素的透明度\n *\n * @param angle 角度 [0.0, 360.0]\n * @param dist 距离 [0.0, 1.0]\n *\n * @return alpha [0.0, 1.0]\n */\nfloat getColorAlpha(float angle, float dist) {\n\n float radian = radians(angle);\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian))); \n return color.a;\n}\n\n/**\n * 获取指定距离的周边像素的透明度平均值\n *\n * @param dist 距离 [0.0, 1.0]\n *\n * @return average alpha [0.0, 1.0]\n */\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n\n}\n\n/**\n * 获取发光的透明度\n */\nfloat getGlowAlpha() {\n\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n\n vec4 srcColor = getTextureColor(texture, v_uv0);\n if (srcColor.a <= glowThreshold) {\n return srcColor.a;\n }\n\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= getTextureColor(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n\n #if SHOW_INNER_GLOW\n\n vec4 color_dest = o;\n\n float alpha = getGlowAlpha();\n\n if (alpha > glowThreshold) {\n\n alpha = 1.0 - alpha;\n\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n }\n\n vec4 color_src = glowColor * alpha;\n\n gl_FragColor = color_src * color_src.a + color_dest;\n #endif\n}\n" + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\n#if SHOW_INNER_GLOW\nuniform glow {\n vec4 glowColor;\n float glowColorSize;\n float glowThreshold;\n};\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture(texture, v_uv0);\n}\nfloat getColorAlpha(float angle, float dist) {\n float radian = radians(angle);\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian)));\n return color.a;\n}\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n}\nfloat getGlowAlpha() {\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n vec4 srcColor = getTextureColor(texture, v_uv0);\n if (srcColor.a <= glowThreshold) {\n return srcColor.a;\n }\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= getTextureColor(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_INNER_GLOW\n vec4 color_dest = o;\n float alpha = getGlowAlpha();\n if (alpha > glowThreshold) {\n alpha = 1.0 - alpha;\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n }\n vec4 color_src = glowColor * alpha;\n gl_FragColor = color_src * color_src.a + color_dest;\n #endif\n}" } } ], diff --git a/assets/effects/sprite-glow-outter.effect.meta b/assets/effects/sprite-glow-outter.effect.meta index f19e5af..533590a 100644 --- a/assets/effects/sprite-glow-outter.effect.meta +++ b/assets/effects/sprite-glow-outter.effect.meta @@ -1,15 +1,15 @@ { - "ver": "1.0.23", + "ver": "1.0.25", "uuid": "89f30b2e-b75e-49b1-9dfc-cb341cadd30a", "compiledShaders": [ { "glsl1": { - "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\n\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n\n#if USE_TEXTURE\n\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform float alphaThreshold;\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n/**\n * 获取纹理uv颜色 \n *\n * 主要实现:超出边界的统一返回 vec4(0.0, 0.0, 0.0, 0.0)\n * \n * 在 Cocos Creator 2.2.1 的编辑器中,超出边界的uv并不是返回 vec4(0.0, 0.0, 0.0, 0.0),实际返回为\n * \n * * 超出左边界的uv,返回 v_uv0.x = 0 的颜色\n * * 超出右边界的uv,返回 v_uv0.x = 1 的颜色\n * * 超出上边界的uv,返回 v_uv0.y = 1 的颜色\n * * 超出下边界的uv,返回 v_uv0.y = 0 的颜色\n *\n * 和实际在浏览器上显示(超出边界即为透明)的有区别,为了统一,这里适配一下,这样子,在编辑器上预览的效果就能和实际浏览器的保持一致\n */\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture2D(texture, v_uv0);\n}\n\n#if SHOW_OUTTER_GLOW\n\nuniform vec4 glowColor;\nuniform float glowColorSize;\nuniform float glowThreshold;\n\n/**\n * 获取指定角度方向,距离为xxx的像素的透明度\n *\n * @param angle 角度 [0.0, 360.0]\n * @param dist 距离 [0.0, 1.0]\n *\n * @return alpha [0.0, 1.0]\n */\nfloat getColorAlpha(float angle, float dist) {\n\n float radian = angle * 0.01745329252;\n\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian))); \n return color.a;\n}\n\n/**\n * 获取指定距离的周边像素的透明度平均值\n *\n * @param dist 距离 [0.0, 1.0]\n *\n * @return average alpha [0.0, 1.0]\n */\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n\n}\n\n/**\n * 获取发光的透明度\n */\nfloat getGlowAlpha() {\n\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= getTextureColor(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n\n #if SHOW_OUTTER_GLOW\n\n float alpha = getGlowAlpha();\n\n if (alpha <= glowThreshold) {\n\n alpha = alpha / glowThreshold;\n\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n } else {\n\n alpha = 0.0;\n }\n\n vec4 color_dest = glowColor * alpha;\n vec4 color_src = o;\n\n gl_FragColor = color_src * color_src.a + color_dest * (1.0 - color_src.a);\n #endif\n}\n" + "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture2D(texture, v_uv0);\n}\n#if SHOW_OUTTER_GLOW\nuniform vec4 glowColor;\nuniform float glowColorSize;\nuniform float glowThreshold;\nfloat getColorAlpha(float angle, float dist) {\n float radian = angle * 0.01745329252;\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian)));\n return color.a;\n}\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n}\nfloat getGlowAlpha() {\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= getTextureColor(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_OUTTER_GLOW\n float alpha = getGlowAlpha();\n if (alpha <= glowThreshold) {\n alpha = alpha / glowThreshold;\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n } else {\n alpha = 0.0;\n }\n vec4 color_dest = glowColor * alpha;\n vec4 color_src = o;\n gl_FragColor = color_src * color_src.a + color_dest * (1.0 - color_src.a);\n #endif\n}" }, "glsl3": { - "vert": "\nprecision highp float;\nuniform CCGlobal {\n vec4 cc_time;\n\n vec4 cc_screenSize;\n\n vec4 cc_screenScale;\n\n vec4 cc_nativeSize;\n\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\n vec4 cc_exposure;\n\n vec4 cc_mainLitDir;\n\n vec4 cc_mainLitColor;\n\n vec4 cc_ambientSky;\n vec4 cc_ambientGround;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\n\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n\n#if USE_TEXTURE\n\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform ALPHA_TEST {\n float alphaThreshold;\n }\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nin vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n/**\n * 获取纹理uv颜色 \n *\n * 主要实现:超出边界的统一返回 vec4(0.0, 0.0, 0.0, 0.0)\n * \n * 在 Cocos Creator 2.2.1 的编辑器中,超出边界的uv并不是返回 vec4(0.0, 0.0, 0.0, 0.0),实际返回为\n * \n * * 超出左边界的uv,返回 v_uv0.x = 0 的颜色\n * * 超出右边界的uv,返回 v_uv0.x = 1 的颜色\n * * 超出上边界的uv,返回 v_uv0.y = 1 的颜色\n * * 超出下边界的uv,返回 v_uv0.y = 0 的颜色\n *\n * 和实际在浏览器上显示(超出边界即为透明)的有区别,为了统一,这里适配一下,这样子,在编辑器上预览的效果就能和实际浏览器的保持一致\n */\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture(texture, v_uv0);\n}\n\n#if SHOW_OUTTER_GLOW\n\nuniform glow {\n\n vec4 glowColor;\n\n float glowColorSize;\n\n float glowThreshold;\n\n};\n\n/**\n * 获取指定角度方向,距离为xxx的像素的透明度\n *\n * @param angle 角度 [0.0, 360.0]\n * @param dist 距离 [0.0, 1.0]\n *\n * @return alpha [0.0, 1.0]\n */\nfloat getColorAlpha(float angle, float dist) {\n\n float radian = angle * 0.01745329252;\n\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian))); \n return color.a;\n}\n\n/**\n * 获取指定距离的周边像素的透明度平均值\n *\n * @param dist 距离 [0.0, 1.0]\n *\n * @return average alpha [0.0, 1.0]\n */\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n\n}\n\n/**\n * 获取发光的透明度\n */\nfloat getGlowAlpha() {\n\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= getTextureColor(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n\n #if SHOW_OUTTER_GLOW\n\n float alpha = getGlowAlpha();\n\n if (alpha <= glowThreshold) {\n\n alpha = alpha / glowThreshold;\n\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n } else {\n\n alpha = 0.0;\n }\n\n vec4 color_dest = glowColor * alpha;\n vec4 color_src = o;\n\n gl_FragColor = color_src * color_src.a + color_dest * (1.0 - color_src.a);\n #endif\n}\n" + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture(texture, v_uv0);\n}\n#if SHOW_OUTTER_GLOW\nuniform glow {\n vec4 glowColor;\n float glowColorSize;\n float glowThreshold;\n};\nfloat getColorAlpha(float angle, float dist) {\n float radian = angle * 0.01745329252;\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian)));\n return color.a;\n}\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n}\nfloat getGlowAlpha() {\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= getTextureColor(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_OUTTER_GLOW\n float alpha = getGlowAlpha();\n if (alpha <= glowThreshold) {\n alpha = alpha / glowThreshold;\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n } else {\n alpha = 0.0;\n }\n vec4 color_dest = glowColor * alpha;\n vec4 color_src = o;\n gl_FragColor = color_src * color_src.a + color_dest * (1.0 - color_src.a);\n #endif\n}" } } ], diff --git a/assets/effects/sprite-gray.effect b/assets/effects/sprite-gray.effect index 50e1327..709971c 100644 --- a/assets/effects/sprite-gray.effect +++ b/assets/effects/sprite-gray.effect @@ -80,7 +80,7 @@ CCProgram fs %{ uniform GrayPhoto { // 灰化程度 float grayLevel; - } + }; #endif void main () { diff --git a/assets/effects/sprite-gray.effect.meta b/assets/effects/sprite-gray.effect.meta index c6f3b27..f6cd754 100644 --- a/assets/effects/sprite-gray.effect.meta +++ b/assets/effects/sprite-gray.effect.meta @@ -1,15 +1,15 @@ { - "ver": "1.0.23", + "ver": "1.0.25", "uuid": "2e5b29d9-dd5e-4f3d-92e9-e580745b3bc8", "compiledShaders": [ { "glsl1": { - "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\n\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform float alphaThreshold;\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if USE_GRAY\nuniform float grayLevel;\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n #if USE_GRAY\n vec4 srcColor = o;\n\n float gray = 0.2126 * o.r + 0.7152 * o.g + 0.0722 * o.b;\n vec4 grayColor = vec4(gray, gray, gray, o.a);\n\n o = srcColor + (grayColor - srcColor) * grayLevel;\n #endif\n gl_FragColor = o;\n}\n" + "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\n#if USE_GRAY\nuniform float grayLevel;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n #if USE_GRAY\n vec4 srcColor = o;\n float gray = 0.2126 * o.r + 0.7152 * o.g + 0.0722 * o.b;\n vec4 grayColor = vec4(gray, gray, gray, o.a);\n o = srcColor + (grayColor - srcColor) * grayLevel;\n #endif\n gl_FragColor = o;\n}" }, "glsl3": { - "vert": "\nprecision highp float;\nuniform CCGlobal {\n vec4 cc_time;\n\n vec4 cc_screenSize;\n\n vec4 cc_screenScale;\n\n vec4 cc_nativeSize;\n\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\n vec4 cc_exposure;\n\n vec4 cc_mainLitDir;\n\n vec4 cc_mainLitColor;\n\n vec4 cc_ambientSky;\n vec4 cc_ambientGround;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\n\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform ALPHA_TEST {\n float alphaThreshold;\n }\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nin vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if USE_GRAY\nuniform GrayPhoto {\n\n float grayLevel;\n}\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n #if USE_GRAY\n vec4 srcColor = o;\n\n float gray = 0.2126 * o.r + 0.7152 * o.g + 0.0722 * o.b;\n vec4 grayColor = vec4(gray, gray, gray, o.a);\n\n o = srcColor + (grayColor - srcColor) * grayLevel;\n #endif\n gl_FragColor = o;\n}\n" + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\n#if USE_GRAY\nuniform GrayPhoto {\n float grayLevel;\n};\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n #if USE_GRAY\n vec4 srcColor = o;\n float gray = 0.2126 * o.r + 0.7152 * o.g + 0.0722 * o.b;\n vec4 grayColor = vec4(gray, gray, gray, o.a);\n o = srcColor + (grayColor - srcColor) * grayLevel;\n #endif\n gl_FragColor = o;\n}" } } ], diff --git a/assets/effects/sprite-mosaic.effect b/assets/effects/sprite-mosaic.effect index c27bb95..2cb8c69 100644 --- a/assets/effects/sprite-mosaic.effect +++ b/assets/effects/sprite-mosaic.effect @@ -85,7 +85,7 @@ CCProgram fs %{ float xBlockCount; // Y轴方块数量 float yBlockCount; - } + }; /** * 获取v_uv0最终映射的马赛格格子的坐标 diff --git a/assets/effects/sprite-mosaic.effect.meta b/assets/effects/sprite-mosaic.effect.meta index 0f09437..d9a8d87 100644 --- a/assets/effects/sprite-mosaic.effect.meta +++ b/assets/effects/sprite-mosaic.effect.meta @@ -1,15 +1,15 @@ { - "ver": "1.0.23", + "ver": "1.0.25", "uuid": "9638979d-62b3-4e5b-adea-7ad706e66e65", "compiledShaders": [ { "glsl1": { - "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\n\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform float alphaThreshold;\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if USE_MOSAIC\nuniform float xBlockCount;\nuniform float yBlockCount;\n/**\n * 获取v_uv0最终映射的马赛格格子的坐标\n *\n * @return 映射后坐标\n */\nvec2 getUvMapPos() {\n\n float xCount;\n if (xBlockCount <= 0.0) {\n xCount = 1.0;\n } else {\n xCount = xBlockCount;\n }\n float blockWidth = 1.0 / xCount;\n\n float blockXIndex = floor(v_uv0.x / blockWidth);\n\n float yCount; \n if (yBlockCount <= 0.0) {\n yCount = 1.0;\n } else {\n yCount = yBlockCount;\n }\n float blockHeight = 1.0 / yCount;\n float blockYIndex = floor(v_uv0.y / blockHeight);\n\n return vec2(blockWidth * (blockXIndex + 0.5), blockHeight * (blockYIndex + 0.5));\n}\n\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n vec2 realPos = v_uv0;\n #if USE_MOSAIC\n realPos = getUvMapPos();\n #endif\n\n #if USE_TEXTURE\n o *= texture2D(texture, realPos);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, realPos + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n}\n" + "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\n#if USE_MOSAIC\nuniform float xBlockCount;\nuniform float yBlockCount;\nvec2 getUvMapPos() {\n float xCount;\n if (xBlockCount <= 0.0) {\n xCount = 1.0;\n } else {\n xCount = xBlockCount;\n }\n float blockWidth = 1.0 / xCount;\n float blockXIndex = floor(v_uv0.x / blockWidth);\n float yCount;\n if (yBlockCount <= 0.0) {\n yCount = 1.0;\n } else {\n yCount = yBlockCount;\n }\n float blockHeight = 1.0 / yCount;\n float blockYIndex = floor(v_uv0.y / blockHeight);\n return vec2(blockWidth * (blockXIndex + 0.5), blockHeight * (blockYIndex + 0.5));\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n vec2 realPos = v_uv0;\n #if USE_MOSAIC\n realPos = getUvMapPos();\n #endif\n #if USE_TEXTURE\n o *= texture2D(texture, realPos);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, realPos + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}" }, "glsl3": { - "vert": "\nprecision highp float;\nuniform CCGlobal {\n vec4 cc_time;\n\n vec4 cc_screenSize;\n\n vec4 cc_screenScale;\n\n vec4 cc_nativeSize;\n\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\n vec4 cc_exposure;\n\n vec4 cc_mainLitDir;\n\n vec4 cc_mainLitColor;\n\n vec4 cc_ambientSky;\n vec4 cc_ambientGround;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\n\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform ALPHA_TEST {\n float alphaThreshold;\n }\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nin vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if USE_MOSAIC\nuniform Mosaic {\n\n float xBlockCount;\n\n float yBlockCount;\n}\n\n/**\n * 获取v_uv0最终映射的马赛格格子的坐标\n *\n * @return 映射后坐标\n */\nvec2 getUvMapPos() {\n\n float xCount;\n if (xBlockCount <= 0.0) {\n xCount = 1.0;\n } else {\n xCount = xBlockCount;\n }\n float blockWidth = 1.0 / xCount;\n\n float blockXIndex = floor(v_uv0.x / blockWidth);\n\n float yCount; \n if (yBlockCount <= 0.0) {\n yCount = 1.0;\n } else {\n yCount = yBlockCount;\n }\n float blockHeight = 1.0 / yCount;\n float blockYIndex = floor(v_uv0.y / blockHeight);\n\n return vec2(blockWidth * (blockXIndex + 0.5), blockHeight * (blockYIndex + 0.5));\n}\n\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n vec2 realPos = v_uv0;\n #if USE_MOSAIC\n realPos = getUvMapPos();\n #endif\n\n #if USE_TEXTURE\n o *= texture(texture, realPos);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, realPos + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n}\n" + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\n#if USE_MOSAIC\nuniform Mosaic {\n float xBlockCount;\n float yBlockCount;\n};\nvec2 getUvMapPos() {\n float xCount;\n if (xBlockCount <= 0.0) {\n xCount = 1.0;\n } else {\n xCount = xBlockCount;\n }\n float blockWidth = 1.0 / xCount;\n float blockXIndex = floor(v_uv0.x / blockWidth);\n float yCount;\n if (yBlockCount <= 0.0) {\n yCount = 1.0;\n } else {\n yCount = yBlockCount;\n }\n float blockHeight = 1.0 / yCount;\n float blockYIndex = floor(v_uv0.y / blockHeight);\n return vec2(blockWidth * (blockXIndex + 0.5), blockHeight * (blockYIndex + 0.5));\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n vec2 realPos = v_uv0;\n #if USE_MOSAIC\n realPos = getUvMapPos();\n #endif\n #if USE_TEXTURE\n o *= texture(texture, realPos);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, realPos + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}" } } ], diff --git a/assets/effects/sprite-old-photo.effect b/assets/effects/sprite-old-photo.effect index b7e248a..9ef393f 100644 --- a/assets/effects/sprite-old-photo.effect +++ b/assets/effects/sprite-old-photo.effect @@ -80,7 +80,7 @@ CCProgram fs %{ uniform OldPhoto { // 老化程度 float oldLevel; - } + }; /** * 获取老化颜色 diff --git a/assets/effects/sprite-old-photo.effect.meta b/assets/effects/sprite-old-photo.effect.meta index 7f012f6..86a3470 100644 --- a/assets/effects/sprite-old-photo.effect.meta +++ b/assets/effects/sprite-old-photo.effect.meta @@ -1,15 +1,15 @@ { - "ver": "1.0.23", + "ver": "1.0.25", "uuid": "211eddf3-c53d-46e3-8c09-c1bf38e644e2", "compiledShaders": [ { "glsl1": { - "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\n\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform float alphaThreshold;\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if USE_OLD_PHOTO\nuniform float oldLevel;\n/**\n * 获取老化颜色\n * \n * @param color 原始颜色 \n *\n * @return 老化后的颜色\n */\nvec4 getOldPhotoColor(vec4 color) {\n float r = 0.393 * color.r + 0.769 * color.g + 0.189 * color.b; \n float g = 0.349 * color.r + 0.686 * color.g + 0.168 * color.b; \n float b = 0.272 * color.r + 0.534 * color.g + 0.131 * color.b;\n return vec4(r, g, b, color.a);\n}\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n #if USE_OLD_PHOTO\n vec4 srcColor = o;\n vec4 oldColor = getOldPhotoColor(srcColor);\n\n o = srcColor + (oldColor - srcColor) * oldLevel;\n #endif\n gl_FragColor = o;\n}\n" + "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\n#if USE_OLD_PHOTO\nuniform float oldLevel;\nvec4 getOldPhotoColor(vec4 color) {\n float r = 0.393 * color.r + 0.769 * color.g + 0.189 * color.b;\n float g = 0.349 * color.r + 0.686 * color.g + 0.168 * color.b;\n float b = 0.272 * color.r + 0.534 * color.g + 0.131 * color.b;\n return vec4(r, g, b, color.a);\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n #if USE_OLD_PHOTO\n vec4 srcColor = o;\n vec4 oldColor = getOldPhotoColor(srcColor);\n o = srcColor + (oldColor - srcColor) * oldLevel;\n #endif\n gl_FragColor = o;\n}" }, "glsl3": { - "vert": "\nprecision highp float;\nuniform CCGlobal {\n vec4 cc_time;\n\n vec4 cc_screenSize;\n\n vec4 cc_screenScale;\n\n vec4 cc_nativeSize;\n\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\n vec4 cc_exposure;\n\n vec4 cc_mainLitDir;\n\n vec4 cc_mainLitColor;\n\n vec4 cc_ambientSky;\n vec4 cc_ambientGround;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\n\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform ALPHA_TEST {\n float alphaThreshold;\n }\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nin vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if USE_OLD_PHOTO\nuniform OldPhoto {\n\n float oldLevel;\n}\n\n/**\n * 获取老化颜色\n * \n * @param color 原始颜色 \n *\n * @return 老化后的颜色\n */\nvec4 getOldPhotoColor(vec4 color) {\n float r = 0.393 * color.r + 0.769 * color.g + 0.189 * color.b; \n float g = 0.349 * color.r + 0.686 * color.g + 0.168 * color.b; \n float b = 0.272 * color.r + 0.534 * color.g + 0.131 * color.b;\n return vec4(r, g, b, color.a);\n}\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n #if USE_OLD_PHOTO\n vec4 srcColor = o;\n vec4 oldColor = getOldPhotoColor(srcColor);\n\n o = srcColor + (oldColor - srcColor) * oldLevel;\n #endif\n gl_FragColor = o;\n}\n" + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\n#if USE_OLD_PHOTO\nuniform OldPhoto {\n float oldLevel;\n};\nvec4 getOldPhotoColor(vec4 color) {\n float r = 0.393 * color.r + 0.769 * color.g + 0.189 * color.b;\n float g = 0.349 * color.r + 0.686 * color.g + 0.168 * color.b;\n float b = 0.272 * color.r + 0.534 * color.g + 0.131 * color.b;\n return vec4(r, g, b, color.a);\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n #if USE_OLD_PHOTO\n vec4 srcColor = o;\n vec4 oldColor = getOldPhotoColor(srcColor);\n o = srcColor + (oldColor - srcColor) * oldLevel;\n #endif\n gl_FragColor = o;\n}" } } ], diff --git a/assets/effects/sprite-outline.effect.meta b/assets/effects/sprite-outline.effect.meta index f71aaa4..160aa3f 100644 --- a/assets/effects/sprite-outline.effect.meta +++ b/assets/effects/sprite-outline.effect.meta @@ -1,15 +1,15 @@ { - "ver": "1.0.23", + "ver": "1.0.25", "uuid": "559dcd1e-233b-4e1f-b1da-733c9232f06f", "compiledShaders": [ { "glsl1": { - "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\n\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform float alphaThreshold;\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if SHOW_OUT_LINE\n\nuniform vec4 outlineColor;\nuniform float outlineWidth;\n\nfloat getBgAlpha() {\n vec4 color_up = texture2D(texture, v_uv0 + vec2(0, outlineWidth)); \n vec4 color_down = texture2D(texture, v_uv0 - vec2(0, outlineWidth)); \n vec4 color_left = texture2D(texture, v_uv0 - vec2(outlineWidth, 0)); \n vec4 color_right = texture2D(texture, v_uv0 + vec2(outlineWidth, 0)); \n vec4 color_up_left = texture2D(texture, v_uv0 + vec2(outlineWidth, -outlineWidth)); \n vec4 color_up_right = texture2D(texture, v_uv0 + vec2(outlineWidth, outlineWidth)); \n vec4 color_down_left = texture2D(texture, v_uv0 + vec2(-outlineWidth, -outlineWidth)); \n vec4 color_down_right = texture2D(texture, v_uv0 + vec2(-outlineWidth, outlineWidth)); \n float total = color_right.a + color_left.a + color_down.a + color_up.a + color_up_left.a + color_up_right.a + color_down_left.a + color_down_right.a; \n return clamp(total, 0.0, 1.0);\n}\n\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n\n #if SHOW_OUT_LINE\n\n if (outlineWidth == 0.0) {\n return;\n }\n\n vec4 color_dest = outlineColor * getBgAlpha();\n\n vec4 color_src = o;\n\n gl_FragColor = color_src * color_src.a + color_dest * (1.0 - color_src.a);\n #endif\n}\n" + "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\n#if SHOW_OUT_LINE\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nfloat getBgAlpha() {\n vec4 color_up = texture2D(texture, v_uv0 + vec2(0, outlineWidth));\n vec4 color_down = texture2D(texture, v_uv0 - vec2(0, outlineWidth));\n vec4 color_left = texture2D(texture, v_uv0 - vec2(outlineWidth, 0));\n vec4 color_right = texture2D(texture, v_uv0 + vec2(outlineWidth, 0));\n vec4 color_up_left = texture2D(texture, v_uv0 + vec2(outlineWidth, -outlineWidth));\n vec4 color_up_right = texture2D(texture, v_uv0 + vec2(outlineWidth, outlineWidth));\n vec4 color_down_left = texture2D(texture, v_uv0 + vec2(-outlineWidth, -outlineWidth));\n vec4 color_down_right = texture2D(texture, v_uv0 + vec2(-outlineWidth, outlineWidth));\n float total = color_right.a + color_left.a + color_down.a + color_up.a + color_up_left.a + color_up_right.a + color_down_left.a + color_down_right.a;\n return clamp(total, 0.0, 1.0);\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_OUT_LINE\n if (outlineWidth == 0.0) {\n return;\n }\n vec4 color_dest = outlineColor * getBgAlpha();\n vec4 color_src = o;\n gl_FragColor = color_src * color_src.a + color_dest * (1.0 - color_src.a);\n #endif\n}" }, "glsl3": { - "vert": "\nprecision highp float;\nuniform CCGlobal {\n vec4 cc_time;\n\n vec4 cc_screenSize;\n\n vec4 cc_screenScale;\n\n vec4 cc_nativeSize;\n\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\n vec4 cc_exposure;\n\n vec4 cc_mainLitDir;\n\n vec4 cc_mainLitColor;\n\n vec4 cc_ambientSky;\n vec4 cc_ambientGround;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\n\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform ALPHA_TEST {\n float alphaThreshold;\n }\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nin vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if SHOW_OUT_LINE\n\nuniform Outline {\n\n vec4 outlineColor;\n\n float outlineWidth;\n\n};\n\nfloat getBgAlpha() {\n vec4 color_up = texture(texture, v_uv0 + vec2(0, outlineWidth)); \n vec4 color_down = texture(texture, v_uv0 - vec2(0, outlineWidth)); \n vec4 color_left = texture(texture, v_uv0 - vec2(outlineWidth, 0)); \n vec4 color_right = texture(texture, v_uv0 + vec2(outlineWidth, 0)); \n vec4 color_up_left = texture(texture, v_uv0 + vec2(outlineWidth, -outlineWidth)); \n vec4 color_up_right = texture(texture, v_uv0 + vec2(outlineWidth, outlineWidth)); \n vec4 color_down_left = texture(texture, v_uv0 + vec2(-outlineWidth, -outlineWidth)); \n vec4 color_down_right = texture(texture, v_uv0 + vec2(-outlineWidth, outlineWidth)); \n float total = color_right.a + color_left.a + color_down.a + color_up.a + color_up_left.a + color_up_right.a + color_down_left.a + color_down_right.a; \n return clamp(total, 0.0, 1.0);\n}\n\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n\n #if SHOW_OUT_LINE\n\n if (outlineWidth == 0.0) {\n return;\n }\n\n vec4 color_dest = outlineColor * getBgAlpha();\n\n vec4 color_src = o;\n\n gl_FragColor = color_src * color_src.a + color_dest * (1.0 - color_src.a);\n #endif\n}\n" + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\n#if SHOW_OUT_LINE\nuniform Outline {\n vec4 outlineColor;\n float outlineWidth;\n};\nfloat getBgAlpha() {\n vec4 color_up = texture(texture, v_uv0 + vec2(0, outlineWidth));\n vec4 color_down = texture(texture, v_uv0 - vec2(0, outlineWidth));\n vec4 color_left = texture(texture, v_uv0 - vec2(outlineWidth, 0));\n vec4 color_right = texture(texture, v_uv0 + vec2(outlineWidth, 0));\n vec4 color_up_left = texture(texture, v_uv0 + vec2(outlineWidth, -outlineWidth));\n vec4 color_up_right = texture(texture, v_uv0 + vec2(outlineWidth, outlineWidth));\n vec4 color_down_left = texture(texture, v_uv0 + vec2(-outlineWidth, -outlineWidth));\n vec4 color_down_right = texture(texture, v_uv0 + vec2(-outlineWidth, outlineWidth));\n float total = color_right.a + color_left.a + color_down.a + color_up.a + color_up_left.a + color_up_right.a + color_down_left.a + color_down_right.a;\n return clamp(total, 0.0, 1.0);\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_OUT_LINE\n if (outlineWidth == 0.0) {\n return;\n }\n vec4 color_dest = outlineColor * getBgAlpha();\n vec4 color_src = o;\n gl_FragColor = color_src * color_src.a + color_dest * (1.0 - color_src.a);\n #endif\n}" } } ], diff --git a/assets/effects/sprite-point-light.effect b/assets/effects/sprite-point-light.effect index 04a5715..c9dc59a 100644 --- a/assets/effects/sprite-point-light.effect +++ b/assets/effects/sprite-point-light.effect @@ -111,7 +111,7 @@ CCProgram fs %{ // 是否启用迷雾效果 // ps:编辑器还不支持 bool 类型的样子,因此没在 CCEffect 中定义 bool enableFog; - } + }; /** * 添加某个扩散点后混合后的纹理颜色 diff --git a/assets/effects/sprite-point-light.effect.meta b/assets/effects/sprite-point-light.effect.meta index 704e51e..cffa772 100644 --- a/assets/effects/sprite-point-light.effect.meta +++ b/assets/effects/sprite-point-light.effect.meta @@ -1,15 +1,15 @@ { - "ver": "1.0.23", + "ver": "1.0.25", "uuid": "72a182fc-08a6-4faa-8e36-8bd84b4a0b53", "compiledShaders": [ { "glsl1": { - "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\n\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform float alphaThreshold;\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if ENABLE_DIFFUSION\nuniform vec4 centerColor;\nuniform vec2 centerPoint;\nuniform float radius;\nuniform bool cropAlpha;\nuniform bool enableFog;\n/**\n * 添加某个扩散点后混合后的纹理颜色\n */\nvec4 addLightColor(vec4 textureColor, vec2 centerPoint, float radius, vec4 centerColor) {\n\n float dis = distance(v_uv0, centerPoint);\n\n float a = 1.0 ;\n\n if (cropAlpha) {\n a *= step(0.01, textureColor.a);\n }\n\n if (!enableFog) {\n a *= step(dis, radius);\n }\n\n a *= 1.0 - (dis / radius);\n\n vec4 lightColor = centerColor * a;\n\n return textureColor * textureColor.a + lightColor;\n}\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n \n #if ENABLE_DIFFUSION\n gl_FragColor = addLightColor(gl_FragColor, centerPoint, radius, centerColor);\n #endif\n}\n" + "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\n#if ENABLE_DIFFUSION\nuniform vec4 centerColor;\nuniform vec2 centerPoint;\nuniform float radius;\nuniform bool cropAlpha;\nuniform bool enableFog;\nvec4 addLightColor(vec4 textureColor, vec2 centerPoint, float radius, vec4 centerColor) {\n float dis = distance(v_uv0, centerPoint);\n float a = 1.0 ;\n if (cropAlpha) {\n a *= step(0.01, textureColor.a);\n }\n if (!enableFog) {\n a *= step(dis, radius);\n }\n a *= 1.0 - (dis / radius);\n vec4 lightColor = centerColor * a;\n return textureColor * textureColor.a + lightColor;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if ENABLE_DIFFUSION\n gl_FragColor = addLightColor(gl_FragColor, centerPoint, radius, centerColor);\n #endif\n}" }, "glsl3": { - "vert": "\nprecision highp float;\nuniform CCGlobal {\n vec4 cc_time;\n\n vec4 cc_screenSize;\n\n vec4 cc_screenScale;\n\n vec4 cc_nativeSize;\n\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\n vec4 cc_exposure;\n\n vec4 cc_mainLitDir;\n\n vec4 cc_mainLitColor;\n\n vec4 cc_ambientSky;\n vec4 cc_ambientGround;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\n\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform ALPHA_TEST {\n float alphaThreshold;\n }\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nin vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if ENABLE_DIFFUSION\nuniform Diffusion {\n\n vec4 centerColor;\n\n vec2 centerPoint;\n\n float radius;\n\n bool cropAlpha;\n\n bool enableFog;\n}\n\n/**\n * 添加某个扩散点后混合后的纹理颜色\n */\nvec4 addLightColor(vec4 textureColor, vec2 centerPoint, float radius, vec4 centerColor) {\n\n float dis = distance(v_uv0, centerPoint);\n\n float a = 1.0 ;\n\n if (cropAlpha) {\n a *= step(0.01, textureColor.a);\n }\n\n if (!enableFog) {\n a *= step(dis, radius);\n }\n\n a *= 1.0 - (dis / radius);\n\n vec4 lightColor = centerColor * a;\n\n return textureColor * textureColor.a + lightColor;\n}\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n gl_FragColor = o;\n \n #if ENABLE_DIFFUSION\n gl_FragColor = addLightColor(gl_FragColor, centerPoint, radius, centerColor);\n #endif\n}\n" + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\n#if ENABLE_DIFFUSION\nuniform Diffusion {\n vec4 centerColor;\n vec2 centerPoint;\n float radius;\n bool cropAlpha;\n bool enableFog;\n};\nvec4 addLightColor(vec4 textureColor, vec2 centerPoint, float radius, vec4 centerColor) {\n float dis = distance(v_uv0, centerPoint);\n float a = 1.0 ;\n if (cropAlpha) {\n a *= step(0.01, textureColor.a);\n }\n if (!enableFog) {\n a *= step(dis, radius);\n }\n a *= 1.0 - (dis / radius);\n vec4 lightColor = centerColor * a;\n return textureColor * textureColor.a + lightColor;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if ENABLE_DIFFUSION\n gl_FragColor = addLightColor(gl_FragColor, centerPoint, radius, centerColor);\n #endif\n}" } } ], diff --git a/assets/effects/sprite-round-corner-crop-v1.effect b/assets/effects/sprite-round-corner-crop-v1.effect index 6e0e190..a203fc2 100644 --- a/assets/effects/sprite-round-corner-crop-v1.effect +++ b/assets/effects/sprite-round-corner-crop-v1.effect @@ -80,7 +80,7 @@ CCProgram fs %{ uniform RoundCorner { // 圆角半径 float radius; - } + }; #endif void main () { diff --git a/assets/effects/sprite-round-corner-crop-v1.effect.meta b/assets/effects/sprite-round-corner-crop-v1.effect.meta index 3e3ff59..1295ccd 100644 --- a/assets/effects/sprite-round-corner-crop-v1.effect.meta +++ b/assets/effects/sprite-round-corner-crop-v1.effect.meta @@ -1,15 +1,15 @@ { - "ver": "1.0.23", + "ver": "1.0.25", "uuid": "a4afedba-5234-44d7-9031-cba83051d521", "compiledShaders": [ { "glsl1": { - "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\n\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform float alphaThreshold;\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if ENABLE_ROUNDCORNER\nuniform float radius;\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n #if ENABLE_ROUNDCORNER\n\n float circleRadius = clamp(0.0, 0.5, radius);\n\n vec2 uv = v_uv0.xy - vec2(0.5, 0.5);\n\n float rx = abs(uv.x) - (0.5 - circleRadius);\n float ry = abs(uv.y) - (0.5 - circleRadius);\n\n float mx = step(0.5 - circleRadius, abs(uv.x));\n float my = step(0.5 - circleRadius, abs(uv.y));\n\n float len = length(vec2(rx, ry));\n\n float a = 1.0 - mx * my * step(circleRadius, len) * smoothstep(0., circleRadius * 0.01, len - circleRadius);\n o = vec4(o.rgb, o.a * a);\n #endif\n gl_FragColor = o;\n}\n" + "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\n#if ENABLE_ROUNDCORNER\nuniform float radius;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n #if ENABLE_ROUNDCORNER\n float circleRadius = clamp(0.0, 0.5, radius);\n vec2 uv = v_uv0.xy - vec2(0.5, 0.5);\n float rx = abs(uv.x) - (0.5 - circleRadius);\n float ry = abs(uv.y) - (0.5 - circleRadius);\n float mx = step(0.5 - circleRadius, abs(uv.x));\n float my = step(0.5 - circleRadius, abs(uv.y));\n float len = length(vec2(rx, ry));\n float a = 1.0 - mx * my * step(circleRadius, len) * smoothstep(0., circleRadius * 0.01, len - circleRadius);\n o = vec4(o.rgb, o.a * a);\n #endif\n gl_FragColor = o;\n}" }, "glsl3": { - "vert": "\nprecision highp float;\nuniform CCGlobal {\n vec4 cc_time;\n\n vec4 cc_screenSize;\n\n vec4 cc_screenScale;\n\n vec4 cc_nativeSize;\n\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\n vec4 cc_exposure;\n\n vec4 cc_mainLitDir;\n\n vec4 cc_mainLitColor;\n\n vec4 cc_ambientSky;\n vec4 cc_ambientGround;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\n\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform ALPHA_TEST {\n float alphaThreshold;\n }\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nin vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if ENABLE_ROUNDCORNER\nuniform RoundCorner {\n\n float radius;\n}\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n #if ENABLE_ROUNDCORNER\n\n float circleRadius = clamp(0.0, 0.5, radius);\n\n vec2 uv = v_uv0.xy - vec2(0.5, 0.5);\n\n float rx = abs(uv.x) - (0.5 - circleRadius);\n float ry = abs(uv.y) - (0.5 - circleRadius);\n\n float mx = step(0.5 - circleRadius, abs(uv.x));\n float my = step(0.5 - circleRadius, abs(uv.y));\n\n float len = length(vec2(rx, ry));\n\n float a = 1.0 - mx * my * step(circleRadius, len) * smoothstep(0., circleRadius * 0.01, len - circleRadius);\n o = vec4(o.rgb, o.a * a);\n #endif\n gl_FragColor = o;\n}\n" + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\n#if ENABLE_ROUNDCORNER\nuniform RoundCorner {\n float radius;\n};\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n #if ENABLE_ROUNDCORNER\n float circleRadius = clamp(0.0, 0.5, radius);\n vec2 uv = v_uv0.xy - vec2(0.5, 0.5);\n float rx = abs(uv.x) - (0.5 - circleRadius);\n float ry = abs(uv.y) - (0.5 - circleRadius);\n float mx = step(0.5 - circleRadius, abs(uv.x));\n float my = step(0.5 - circleRadius, abs(uv.y));\n float len = length(vec2(rx, ry));\n float a = 1.0 - mx * my * step(circleRadius, len) * smoothstep(0., circleRadius * 0.01, len - circleRadius);\n o = vec4(o.rgb, o.a * a);\n #endif\n gl_FragColor = o;\n}" } } ], diff --git a/assets/effects/sprite-round-corner-crop-v2.effect b/assets/effects/sprite-round-corner-crop-v2.effect index cb6c1a3..9bbda70 100644 --- a/assets/effects/sprite-round-corner-crop-v2.effect +++ b/assets/effects/sprite-round-corner-crop-v2.effect @@ -95,7 +95,7 @@ CCProgram fs %{ // 圆角y轴半径长度(相对于纹理高度) float yRadius; - } + }; #endif void main () { diff --git a/assets/effects/sprite-round-corner-crop-v2.effect.meta b/assets/effects/sprite-round-corner-crop-v2.effect.meta index 6c0bfb1..644b259 100644 --- a/assets/effects/sprite-round-corner-crop-v2.effect.meta +++ b/assets/effects/sprite-round-corner-crop-v2.effect.meta @@ -1,15 +1,15 @@ { - "ver": "1.0.23", + "ver": "1.0.25", "uuid": "7c24b57e-e819-4fc9-a8d2-b06cf61b782d", "compiledShaders": [ { "glsl1": { - "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\n\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform float alphaThreshold;\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nvarying vec4 v_color;\n\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if ENABLE_ROUNDCORNER\nuniform float xRadius;\nuniform float yRadius;\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n #if ENABLE_ROUNDCORNER\n\n float ellipseXRadius = clamp(0.0, 0.5, xRadius);\n float ellipseYRadius = clamp(0.0, 0.5, yRadius);\n\n vec2 uv = v_uv0.xy - vec2(0.5, 0.5);\n\n float rx = abs(uv.x) - (0.5 - ellipseXRadius);\n float ry = abs(uv.y) - (0.5 - ellipseYRadius);\n\n float mx = step(0.5 - ellipseXRadius, abs(uv.x));\n float my = step(0.5 - ellipseYRadius, abs(uv.y));\n\n float isOutOfEllipse = step(1.0, pow(rx, 2.0) / pow(xRadius, 2.0) + pow(ry, 2.0) / pow(yRadius, 2.0));\n\n float angleInRadian = atan(ry / rx);\n\n vec2 pointInEllipse = vec2(xRadius * cos(angleInRadian), yRadius * sin(angleInRadian));\n\n vec2 pointInBigEllipse = vec2((xRadius * 1.01) * cos(angleInRadian), (yRadius * 1.01)* sin(angleInRadian));\n\n float maxDis = distance(pointInBigEllipse, pointInEllipse);\n\n float curDis = distance(vec2(rx, ry), pointInEllipse);\n\n float smo = smoothstep(0.0, maxDis, curDis);\n\n float alpha = 1.0 - mx * my * isOutOfEllipse * smo;\n\n o = vec4(o.rgb, o.a * alpha);\n\n #endif\n gl_FragColor = o;\n}\n" + "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\n#if ENABLE_ROUNDCORNER\nuniform float xRadius;\nuniform float yRadius;\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n #if ENABLE_ROUNDCORNER\n float ellipseXRadius = clamp(0.0, 0.5, xRadius);\n float ellipseYRadius = clamp(0.0, 0.5, yRadius);\n vec2 uv = v_uv0.xy - vec2(0.5, 0.5);\n float rx = abs(uv.x) - (0.5 - ellipseXRadius);\n float ry = abs(uv.y) - (0.5 - ellipseYRadius);\n float mx = step(0.5 - ellipseXRadius, abs(uv.x));\n float my = step(0.5 - ellipseYRadius, abs(uv.y));\n float isOutOfEllipse = step(1.0, pow(rx, 2.0) / pow(xRadius, 2.0) + pow(ry, 2.0) / pow(yRadius, 2.0));\n float angleInRadian = atan(ry / rx);\n vec2 pointInEllipse = vec2(xRadius * cos(angleInRadian), yRadius * sin(angleInRadian));\n vec2 pointInBigEllipse = vec2((xRadius * 1.01) * cos(angleInRadian), (yRadius * 1.01)* sin(angleInRadian));\n float maxDis = distance(pointInBigEllipse, pointInEllipse);\n float curDis = distance(vec2(rx, ry), pointInEllipse);\n float smo = smoothstep(0.0, maxDis, curDis);\n float alpha = 1.0 - mx * my * isOutOfEllipse * smo;\n o = vec4(o.rgb, o.a * alpha);\n #endif\n gl_FragColor = o;\n}" }, "glsl3": { - "vert": "\nprecision highp float;\nuniform CCGlobal {\n vec4 cc_time;\n\n vec4 cc_screenSize;\n\n vec4 cc_screenScale;\n\n vec4 cc_nativeSize;\n\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\n vec4 cc_exposure;\n\n vec4 cc_mainLitDir;\n\n vec4 cc_mainLitColor;\n\n vec4 cc_ambientSky;\n vec4 cc_ambientGround;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\n\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\n\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n\n v_color = a_color;\n\n gl_Position = pos;\n}\n", - "frag": "\nprecision highp float;\n\n#if USE_ALPHA_TEST\n \n uniform ALPHA_TEST {\n float alphaThreshold;\n }\n#endif\n\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\n\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\n\nin vec4 v_color;\n\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n\n#if ENABLE_ROUNDCORNER\nuniform RoundCorner {\n\n float xRadius;\n\n float yRadius;\n}\n#endif\n\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n\n o *= v_color;\n\n ALPHA_TEST(o);\n\n #if ENABLE_ROUNDCORNER\n\n float ellipseXRadius = clamp(0.0, 0.5, xRadius);\n float ellipseYRadius = clamp(0.0, 0.5, yRadius);\n\n vec2 uv = v_uv0.xy - vec2(0.5, 0.5);\n\n float rx = abs(uv.x) - (0.5 - ellipseXRadius);\n float ry = abs(uv.y) - (0.5 - ellipseYRadius);\n\n float mx = step(0.5 - ellipseXRadius, abs(uv.x));\n float my = step(0.5 - ellipseYRadius, abs(uv.y));\n\n float isOutOfEllipse = step(1.0, pow(rx, 2.0) / pow(xRadius, 2.0) + pow(ry, 2.0) / pow(yRadius, 2.0));\n\n float angleInRadian = atan(ry / rx);\n\n vec2 pointInEllipse = vec2(xRadius * cos(angleInRadian), yRadius * sin(angleInRadian));\n\n vec2 pointInBigEllipse = vec2((xRadius * 1.01) * cos(angleInRadian), (yRadius * 1.01)* sin(angleInRadian));\n\n float maxDis = distance(pointInBigEllipse, pointInEllipse);\n\n float curDis = distance(vec2(rx, ry), pointInEllipse);\n\n float smo = smoothstep(0.0, maxDis, curDis);\n\n float alpha = 1.0 - mx * my * isOutOfEllipse * smo;\n\n o = vec4(o.rgb, o.a * alpha);\n\n #endif\n gl_FragColor = o;\n}\n" + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\n#if ENABLE_ROUNDCORNER\nuniform RoundCorner {\n float xRadius;\n float yRadius;\n};\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n #if ENABLE_ROUNDCORNER\n float ellipseXRadius = clamp(0.0, 0.5, xRadius);\n float ellipseYRadius = clamp(0.0, 0.5, yRadius);\n vec2 uv = v_uv0.xy - vec2(0.5, 0.5);\n float rx = abs(uv.x) - (0.5 - ellipseXRadius);\n float ry = abs(uv.y) - (0.5 - ellipseYRadius);\n float mx = step(0.5 - ellipseXRadius, abs(uv.x));\n float my = step(0.5 - ellipseYRadius, abs(uv.y));\n float isOutOfEllipse = step(1.0, pow(rx, 2.0) / pow(xRadius, 2.0) + pow(ry, 2.0) / pow(yRadius, 2.0));\n float angleInRadian = atan(ry / rx);\n vec2 pointInEllipse = vec2(xRadius * cos(angleInRadian), yRadius * sin(angleInRadian));\n vec2 pointInBigEllipse = vec2((xRadius * 1.01) * cos(angleInRadian), (yRadius * 1.01)* sin(angleInRadian));\n float maxDis = distance(pointInBigEllipse, pointInEllipse);\n float curDis = distance(vec2(rx, ry), pointInEllipse);\n float smo = smoothstep(0.0, maxDis, curDis);\n float alpha = 1.0 - mx * my * isOutOfEllipse * smo;\n o = vec4(o.rgb, o.a * alpha);\n #endif\n gl_FragColor = o;\n}" } } ], diff --git a/assets/materials/builtin-2d-sprite-explain.mtl b/assets/materials/builtin-2d-sprite-explain.mtl index e004343..cd5156c 100644 --- a/assets/materials/builtin-2d-sprite-explain.mtl +++ b/assets/materials/builtin-2d-sprite-explain.mtl @@ -1,13 +1,16 @@ { "__type__": "cc.Material", - "_name": "", + "_name": "builtin-2d-sprite-explain", "_objFlags": 0, "_native": "", "_effectAsset": { "__uuid__": "8f277982-dc0a-4030-90cc-b336a928a372" }, - "_defines": { - "USE_TEXTURE": true - }, - "_props": {} + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true + } + } + } } \ No newline at end of file diff --git a/assets/materials/builtin-2d-sprite-explain.mtl.meta b/assets/materials/builtin-2d-sprite-explain.mtl.meta index c9f9fa5..304d332 100644 --- a/assets/materials/builtin-2d-sprite-explain.mtl.meta +++ b/assets/materials/builtin-2d-sprite-explain.mtl.meta @@ -1,5 +1,5 @@ { - "ver": "1.0.2", + "ver": "1.0.3", "uuid": "ca058f99-941b-40f2-b208-d776de59abed", "dataAsSubAsset": null, "subMetas": {} diff --git a/assets/materials/sprite-flash-light.mtl b/assets/materials/sprite-flash-light.mtl index 5f05f49..3fe07bb 100644 --- a/assets/materials/sprite-flash-light.mtl +++ b/assets/materials/sprite-flash-light.mtl @@ -1,24 +1,28 @@ { "__type__": "cc.Material", - "_name": "", + "_name": "sprite-flash-light", "_objFlags": 0, "_native": "", "_effectAsset": { "__uuid__": "e9682cd1-a19c-4fcb-ad8c-cf1783b805e6" }, - "_defines": { - "USE_TEXTURE": true, - "ENABLE_LIGHT": true - }, - "_props": { - "lightColor": { - "__type__": "cc.Color", - "r": 255, - "g": 245, - "b": 0, - "a": 255 - }, - "lightAngle": 36, - "lightWidth": 0.2 + "_techniqueData": { + "0": { + "props": { + "lightColor": { + "__type__": "cc.Color", + "r": 255, + "g": 245, + "b": 0, + "a": 255 + }, + "lightAngle": 36, + "lightWidth": 0.2 + }, + "defines": { + "USE_TEXTURE": true, + "ENABLE_LIGHT": true + } + } } } \ No newline at end of file diff --git a/assets/materials/sprite-flash-light.mtl.meta b/assets/materials/sprite-flash-light.mtl.meta index efddce7..0660086 100644 --- a/assets/materials/sprite-flash-light.mtl.meta +++ b/assets/materials/sprite-flash-light.mtl.meta @@ -1,5 +1,5 @@ { - "ver": "1.0.2", + "ver": "1.0.3", "uuid": "43a22f18-72fc-4399-b5ae-8305705861f4", "dataAsSubAsset": null, "subMetas": {} diff --git a/assets/materials/sprite-gaussian-blur-v1.mtl b/assets/materials/sprite-gaussian-blur-v1.mtl index 7ffa495..438c884 100644 --- a/assets/materials/sprite-gaussian-blur-v1.mtl +++ b/assets/materials/sprite-gaussian-blur-v1.mtl @@ -1,14 +1,17 @@ { "__type__": "cc.Material", - "_name": "", + "_name": "sprite-gaussian-blur-v1", "_objFlags": 0, "_native": "", "_effectAsset": { "__uuid__": "41f4d474-d707-45bb-af93-637573f92d54" }, - "_defines": { - "USE_TEXTURE": true, - "ENABLE_GAUSSIAN_BLUR": true - }, - "_props": {} + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true, + "ENABLE_GAUSSIAN_BLUR": true + } + } + } } \ No newline at end of file diff --git a/assets/materials/sprite-gaussian-blur-v1.mtl.meta b/assets/materials/sprite-gaussian-blur-v1.mtl.meta index 62f0cc0..f87e417 100644 --- a/assets/materials/sprite-gaussian-blur-v1.mtl.meta +++ b/assets/materials/sprite-gaussian-blur-v1.mtl.meta @@ -1,5 +1,5 @@ { - "ver": "1.0.2", + "ver": "1.0.3", "uuid": "dd3d8f78-9b79-4ca7-9bf7-7a09f7b34108", "dataAsSubAsset": null, "subMetas": {} diff --git a/assets/materials/sprite-glow-inner.mtl b/assets/materials/sprite-glow-inner.mtl index 717e6e3..49c7500 100644 --- a/assets/materials/sprite-glow-inner.mtl +++ b/assets/materials/sprite-glow-inner.mtl @@ -1,26 +1,30 @@ { "__type__": "cc.Material", - "_name": "", + "_name": "sprite-glow-inner", "_objFlags": 0, "_native": "", "_effectAsset": { "__uuid__": "90211f16-c00e-4c37-a192-43ec50c9ea35" }, - "_defines": { - "USE_TEXTURE": true, - "USE_ALPHA_TEST": false, - "SHOW_INNER_GLOW": true - }, - "_props": { - "texture": null, - "glowColor": { - "__type__": "cc.Color", - "r": 255, - "g": 0, - "b": 0, - "a": 255 - }, - "glowColorSize": 0.2, - "glowThreshold": 0.1 + "_techniqueData": { + "0": { + "props": { + "texture": null, + "glowColor": { + "__type__": "cc.Color", + "r": 255, + "g": 0, + "b": 0, + "a": 255 + }, + "glowColorSize": 0.2, + "glowThreshold": 0.1 + }, + "defines": { + "USE_TEXTURE": true, + "USE_ALPHA_TEST": false, + "SHOW_INNER_GLOW": true + } + } } } \ No newline at end of file diff --git a/assets/materials/sprite-glow-inner.mtl.meta b/assets/materials/sprite-glow-inner.mtl.meta index cfcae2f..6ab4973 100644 --- a/assets/materials/sprite-glow-inner.mtl.meta +++ b/assets/materials/sprite-glow-inner.mtl.meta @@ -1,5 +1,5 @@ { - "ver": "1.0.2", + "ver": "1.0.3", "uuid": "2c760728-404d-4553-a1d0-7ab18263845c", "dataAsSubAsset": null, "subMetas": {} diff --git a/assets/materials/sprite-glow-outter.mtl b/assets/materials/sprite-glow-outter.mtl index a547d07..8fd1788 100644 --- a/assets/materials/sprite-glow-outter.mtl +++ b/assets/materials/sprite-glow-outter.mtl @@ -1,26 +1,30 @@ { "__type__": "cc.Material", - "_name": "", + "_name": "sprite-glow-outter", "_objFlags": 0, "_native": "", "_effectAsset": { "__uuid__": "89f30b2e-b75e-49b1-9dfc-cb341cadd30a" }, - "_defines": { - "USE_TEXTURE": true, - "USE_ALPHA_TEST": false, - "SHOW_OUTTER_GLOW": true - }, - "_props": { - "texture": null, - "glowColor": { - "__type__": "cc.Color", - "r": 255, - "g": 0, - "b": 0, - "a": 255 - }, - "glowColorSize": 0.15, - "glowThreshold": 1 + "_techniqueData": { + "0": { + "props": { + "texture": null, + "glowColor": { + "__type__": "cc.Color", + "r": 255, + "g": 0, + "b": 0, + "a": 255 + }, + "glowColorSize": 0.15, + "glowThreshold": 1 + }, + "defines": { + "USE_TEXTURE": true, + "USE_ALPHA_TEST": false, + "SHOW_OUTTER_GLOW": true + } + } } } \ No newline at end of file diff --git a/assets/materials/sprite-glow-outter.mtl.meta b/assets/materials/sprite-glow-outter.mtl.meta index fff69cd..ee40d49 100644 --- a/assets/materials/sprite-glow-outter.mtl.meta +++ b/assets/materials/sprite-glow-outter.mtl.meta @@ -1,5 +1,5 @@ { - "ver": "1.0.2", + "ver": "1.0.3", "uuid": "16dd0f06-6280-4d74-8483-a50e23c00733", "dataAsSubAsset": null, "subMetas": {} diff --git a/assets/materials/sprite-gray.mtl b/assets/materials/sprite-gray.mtl index b6eb2a7..f9abe9b 100644 --- a/assets/materials/sprite-gray.mtl +++ b/assets/materials/sprite-gray.mtl @@ -1,14 +1,17 @@ { "__type__": "cc.Material", - "_name": "", + "_name": "sprite-gray", "_objFlags": 0, "_native": "", "_effectAsset": { "__uuid__": "2e5b29d9-dd5e-4f3d-92e9-e580745b3bc8" }, - "_defines": { - "USE_TEXTURE": true, - "USE_GRAY": true - }, - "_props": {} + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true, + "USE_GRAY": true + } + } + } } \ No newline at end of file diff --git a/assets/materials/sprite-gray.mtl.meta b/assets/materials/sprite-gray.mtl.meta index 77e9bbd..d0003e1 100644 --- a/assets/materials/sprite-gray.mtl.meta +++ b/assets/materials/sprite-gray.mtl.meta @@ -1,5 +1,5 @@ { - "ver": "1.0.2", + "ver": "1.0.3", "uuid": "ee9df2cd-dc1c-4fa7-9ef6-b253eee81746", "dataAsSubAsset": null, "subMetas": {} diff --git a/assets/materials/sprite-mosaic.mtl b/assets/materials/sprite-mosaic.mtl index fea06f2..8b83907 100644 --- a/assets/materials/sprite-mosaic.mtl +++ b/assets/materials/sprite-mosaic.mtl @@ -1,17 +1,21 @@ { "__type__": "cc.Material", - "_name": "", + "_name": "sprite-mosaic", "_objFlags": 0, "_native": "", "_effectAsset": { "__uuid__": "9638979d-62b3-4e5b-adea-7ad706e66e65" }, - "_defines": { - "USE_TEXTURE": true, - "USE_MOSAIC": true - }, - "_props": { - "xBlockCount": 40, - "yBlockCount": 40 + "_techniqueData": { + "0": { + "props": { + "xBlockCount": 40, + "yBlockCount": 40 + }, + "defines": { + "USE_TEXTURE": true, + "USE_MOSAIC": true + } + } } } \ No newline at end of file diff --git a/assets/materials/sprite-mosaic.mtl.meta b/assets/materials/sprite-mosaic.mtl.meta index 9c1c661..a42075f 100644 --- a/assets/materials/sprite-mosaic.mtl.meta +++ b/assets/materials/sprite-mosaic.mtl.meta @@ -1,5 +1,5 @@ { - "ver": "1.0.2", + "ver": "1.0.3", "uuid": "f2651803-80c3-4665-bd81-2ad946a12dec", "dataAsSubAsset": null, "subMetas": {} diff --git a/assets/materials/sprite-old-photo.mtl b/assets/materials/sprite-old-photo.mtl index 5ee6bac..c74ad15 100644 --- a/assets/materials/sprite-old-photo.mtl +++ b/assets/materials/sprite-old-photo.mtl @@ -1,14 +1,17 @@ { "__type__": "cc.Material", - "_name": "", + "_name": "sprite-old-photo", "_objFlags": 0, "_native": "", "_effectAsset": { "__uuid__": "211eddf3-c53d-46e3-8c09-c1bf38e644e2" }, - "_defines": { - "USE_TEXTURE": true, - "USE_OLD_PHOTO": true - }, - "_props": {} + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true, + "USE_OLD_PHOTO": true + } + } + } } \ No newline at end of file diff --git a/assets/materials/sprite-old-photo.mtl.meta b/assets/materials/sprite-old-photo.mtl.meta index 84e4c7f..d5b9916 100644 --- a/assets/materials/sprite-old-photo.mtl.meta +++ b/assets/materials/sprite-old-photo.mtl.meta @@ -1,5 +1,5 @@ { - "ver": "1.0.2", + "ver": "1.0.3", "uuid": "268b1aff-299a-4735-9f5c-5aa8d4d51788", "dataAsSubAsset": null, "subMetas": {} diff --git a/assets/materials/sprite-outline.mtl b/assets/materials/sprite-outline.mtl index 73debb1..9420314 100644 --- a/assets/materials/sprite-outline.mtl +++ b/assets/materials/sprite-outline.mtl @@ -1,25 +1,29 @@ { "__type__": "cc.Material", - "_name": "", + "_name": "sprite-outline", "_objFlags": 0, "_native": "", "_effectAsset": { "__uuid__": "559dcd1e-233b-4e1f-b1da-733c9232f06f" }, - "_defines": { - "USE_TEXTURE": true, - "USE_ALPHA_TEST": false, - "SHOW_OUT_LINE": true - }, - "_props": { - "texture": null, - "outlineColor": { - "__type__": "cc.Color", - "r": 255, - "g": 0, - "b": 0, - "a": 255 - }, - "outlineWidth": 0.002 + "_techniqueData": { + "0": { + "props": { + "texture": null, + "outlineColor": { + "__type__": "cc.Color", + "r": 255, + "g": 0, + "b": 0, + "a": 255 + }, + "outlineWidth": 0.002 + }, + "defines": { + "USE_TEXTURE": true, + "USE_ALPHA_TEST": false, + "SHOW_OUT_LINE": true + } + } } } \ No newline at end of file diff --git a/assets/materials/sprite-outline.mtl.meta b/assets/materials/sprite-outline.mtl.meta index 9ce3939..f217ec0 100644 --- a/assets/materials/sprite-outline.mtl.meta +++ b/assets/materials/sprite-outline.mtl.meta @@ -1,5 +1,5 @@ { - "ver": "1.0.2", + "ver": "1.0.3", "uuid": "daf44951-2c80-4778-b99f-52cfc78ab053", "dataAsSubAsset": null, "subMetas": {} diff --git a/assets/materials/sprite-point-light.mtl b/assets/materials/sprite-point-light.mtl index 2d15cda..b6aad2c 100644 --- a/assets/materials/sprite-point-light.mtl +++ b/assets/materials/sprite-point-light.mtl @@ -1,16 +1,20 @@ { "__type__": "cc.Material", - "_name": "", + "_name": "sprite-point-light", "_objFlags": 0, "_native": "", "_effectAsset": { "__uuid__": "72a182fc-08a6-4faa-8e36-8bd84b4a0b53" }, - "_defines": { - "USE_TEXTURE": true, - "ENABLE_DIFFUSION": true - }, - "_props": { - "radius": 0.4 + "_techniqueData": { + "0": { + "props": { + "radius": 0.4 + }, + "defines": { + "USE_TEXTURE": true, + "ENABLE_DIFFUSION": true + } + } } } \ No newline at end of file diff --git a/assets/materials/sprite-point-light.mtl.meta b/assets/materials/sprite-point-light.mtl.meta index 78ee4d4..20d4d76 100644 --- a/assets/materials/sprite-point-light.mtl.meta +++ b/assets/materials/sprite-point-light.mtl.meta @@ -1,5 +1,5 @@ { - "ver": "1.0.2", + "ver": "1.0.3", "uuid": "d88d982e-4ed7-4f90-9566-2ac2fef4bcb3", "dataAsSubAsset": null, "subMetas": {} diff --git a/assets/materials/sprite-round-corner-crop-v1.mtl b/assets/materials/sprite-round-corner-crop-v1.mtl index 279cad8..5949806 100644 --- a/assets/materials/sprite-round-corner-crop-v1.mtl +++ b/assets/materials/sprite-round-corner-crop-v1.mtl @@ -1,14 +1,17 @@ { "__type__": "cc.Material", - "_name": "", + "_name": "sprite-round-corner-crop-v1", "_objFlags": 0, "_native": "", "_effectAsset": { "__uuid__": "a4afedba-5234-44d7-9031-cba83051d521" }, - "_defines": { - "USE_TEXTURE": true, - "ENABLE_ROUNDCORNER": true - }, - "_props": {} + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true, + "ENABLE_ROUNDCORNER": true + } + } + } } \ No newline at end of file diff --git a/assets/materials/sprite-round-corner-crop-v1.mtl.meta b/assets/materials/sprite-round-corner-crop-v1.mtl.meta index 3c0bafe..966d610 100644 --- a/assets/materials/sprite-round-corner-crop-v1.mtl.meta +++ b/assets/materials/sprite-round-corner-crop-v1.mtl.meta @@ -1,5 +1,5 @@ { - "ver": "1.0.2", + "ver": "1.0.3", "uuid": "642c2d0e-7eb6-4d65-96f2-d6e0d0305310", "dataAsSubAsset": null, "subMetas": {} diff --git a/assets/materials/sprite-round-corner-crop-v2.mtl b/assets/materials/sprite-round-corner-crop-v2.mtl index e8c7371..0f15feb 100644 --- a/assets/materials/sprite-round-corner-crop-v2.mtl +++ b/assets/materials/sprite-round-corner-crop-v2.mtl @@ -1,14 +1,17 @@ { "__type__": "cc.Material", - "_name": "", + "_name": "sprite-round-corner-crop-v2", "_objFlags": 0, "_native": "", "_effectAsset": { "__uuid__": "7c24b57e-e819-4fc9-a8d2-b06cf61b782d" }, - "_defines": { - "USE_TEXTURE": true, - "ENABLE_ROUNDCORNER": true - }, - "_props": {} + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true, + "ENABLE_ROUNDCORNER": true + } + } + } } \ No newline at end of file diff --git a/assets/materials/sprite-round-corner-crop-v2.mtl.meta b/assets/materials/sprite-round-corner-crop-v2.mtl.meta index c7d5f5d..a42b0ea 100644 --- a/assets/materials/sprite-round-corner-crop-v2.mtl.meta +++ b/assets/materials/sprite-round-corner-crop-v2.mtl.meta @@ -1,5 +1,5 @@ { - "ver": "1.0.2", + "ver": "1.0.3", "uuid": "a86e8864-5390-443f-b41b-b38e9d584c43", "dataAsSubAsset": null, "subMetas": {} diff --git a/assets/scenes/FlashLightEffectScene.fire b/assets/scenes/FlashLightEffectScene.fire index 40e2347..fb373e5 100755 --- a/assets/scenes/FlashLightEffectScene.fire +++ b/assets/scenes/FlashLightEffectScene.fire @@ -82,6 +82,9 @@ }, { "__id__": 167 + }, + { + "__id__": 168 } ], "_prefab": null, @@ -7636,5 +7639,31 @@ }, "_enabled": true, "_id": "03L/odvhhCMbGdMQ+Kowzg" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0 } ] \ No newline at end of file diff --git a/assets/scenes/FlashLightEffectScene.fire.meta b/assets/scenes/FlashLightEffectScene.fire.meta index 40bfa5a..42a3c7c 100644 --- a/assets/scenes/FlashLightEffectScene.fire.meta +++ b/assets/scenes/FlashLightEffectScene.fire.meta @@ -1,5 +1,5 @@ { - "ver": "1.2.5", + "ver": "1.2.6", "uuid": "54bdad42-93aa-4869-a465-c0eac37bf0d2", "asyncLoadAssets": false, "autoReleaseAssets": false, diff --git a/assets/scenes/GaussianBlurV1EffectScene.fire b/assets/scenes/GaussianBlurV1EffectScene.fire index b71595d..c0dd934 100755 --- a/assets/scenes/GaussianBlurV1EffectScene.fire +++ b/assets/scenes/GaussianBlurV1EffectScene.fire @@ -82,6 +82,9 @@ }, { "__id__": 48 + }, + { + "__id__": 49 } ], "_prefab": null, @@ -2155,5 +2158,31 @@ }, "_enabled": true, "_id": "77Tlx8YKFO6aLFI6G67OJ+" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0 } ] \ No newline at end of file diff --git a/assets/scenes/GaussianBlurV1EffectScene.fire.meta b/assets/scenes/GaussianBlurV1EffectScene.fire.meta index 50959ec..0dea8c1 100644 --- a/assets/scenes/GaussianBlurV1EffectScene.fire.meta +++ b/assets/scenes/GaussianBlurV1EffectScene.fire.meta @@ -1,5 +1,5 @@ { - "ver": "1.2.5", + "ver": "1.2.6", "uuid": "147d5b9f-b769-4112-9daf-2e28236161fa", "asyncLoadAssets": false, "autoReleaseAssets": false, diff --git a/assets/scenes/GlowInnerEffectScene.fire b/assets/scenes/GlowInnerEffectScene.fire index 4eb44b5..c8ac911 100755 --- a/assets/scenes/GlowInnerEffectScene.fire +++ b/assets/scenes/GlowInnerEffectScene.fire @@ -82,6 +82,9 @@ }, { "__id__": 131 + }, + { + "__id__": 132 } ], "_prefab": null, @@ -5878,5 +5881,31 @@ }, "_enabled": true, "_id": "1a7ypfDW1DQqGMHUC5Sf0L" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0 } ] \ No newline at end of file diff --git a/assets/scenes/GlowInnerEffectScene.fire.meta b/assets/scenes/GlowInnerEffectScene.fire.meta index 2fcdda5..0f20b69 100644 --- a/assets/scenes/GlowInnerEffectScene.fire.meta +++ b/assets/scenes/GlowInnerEffectScene.fire.meta @@ -1,5 +1,5 @@ { - "ver": "1.2.5", + "ver": "1.2.6", "uuid": "69a920f1-0509-4d54-b033-5fb5b1283b72", "asyncLoadAssets": false, "autoReleaseAssets": false, diff --git a/assets/scenes/GlowOutterEffectScene.fire b/assets/scenes/GlowOutterEffectScene.fire index 2268b98..38695bd 100755 --- a/assets/scenes/GlowOutterEffectScene.fire +++ b/assets/scenes/GlowOutterEffectScene.fire @@ -82,6 +82,9 @@ }, { "__id__": 131 + }, + { + "__id__": 132 } ], "_prefab": null, @@ -5878,5 +5881,31 @@ }, "_enabled": true, "_id": "86FdoQVK1Lo6LFPRQ25Wpn" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0 } ] \ No newline at end of file diff --git a/assets/scenes/GlowOutterEffectScene.fire.meta b/assets/scenes/GlowOutterEffectScene.fire.meta index 70fc27f..6b5f822 100644 --- a/assets/scenes/GlowOutterEffectScene.fire.meta +++ b/assets/scenes/GlowOutterEffectScene.fire.meta @@ -1,5 +1,5 @@ { - "ver": "1.2.5", + "ver": "1.2.6", "uuid": "6c0134dc-238e-4bed-b9a3-3f09c1e320a3", "asyncLoadAssets": false, "autoReleaseAssets": false, diff --git a/assets/scenes/GrayEffectScene.fire b/assets/scenes/GrayEffectScene.fire index 4ab5ca3..f6a7f52 100755 --- a/assets/scenes/GrayEffectScene.fire +++ b/assets/scenes/GrayEffectScene.fire @@ -82,6 +82,9 @@ }, { "__id__": 46 + }, + { + "__id__": 47 } ], "_prefab": null, @@ -2058,5 +2061,31 @@ }, "_enabled": true, "_id": "15Zc5pRfhPD5BBaIqSPNrC" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0 } ] \ No newline at end of file diff --git a/assets/scenes/GrayEffectScene.fire.meta b/assets/scenes/GrayEffectScene.fire.meta index b43374a..82aa537 100644 --- a/assets/scenes/GrayEffectScene.fire.meta +++ b/assets/scenes/GrayEffectScene.fire.meta @@ -1,5 +1,5 @@ { - "ver": "1.2.5", + "ver": "1.2.6", "uuid": "46f3cebd-8cc8-462a-885d-9a2984712368", "asyncLoadAssets": false, "autoReleaseAssets": false, diff --git a/assets/scenes/MosaicEffectScene.fire b/assets/scenes/MosaicEffectScene.fire index 465d746..ec923f5 100755 --- a/assets/scenes/MosaicEffectScene.fire +++ b/assets/scenes/MosaicEffectScene.fire @@ -82,6 +82,9 @@ }, { "__id__": 80 + }, + { + "__id__": 81 } ], "_prefab": null, @@ -3586,5 +3589,31 @@ }, "_enabled": true, "_id": "67qshjCz5HzY6Lsg7VINZL" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0 } ] \ No newline at end of file diff --git a/assets/scenes/MosaicEffectScene.fire.meta b/assets/scenes/MosaicEffectScene.fire.meta index a5b6525..aad5526 100644 --- a/assets/scenes/MosaicEffectScene.fire.meta +++ b/assets/scenes/MosaicEffectScene.fire.meta @@ -1,5 +1,5 @@ { - "ver": "1.2.5", + "ver": "1.2.6", "uuid": "4dcbd4ff-0bf9-4429-8c1f-44ad1b7a2192", "asyncLoadAssets": false, "autoReleaseAssets": false, diff --git a/assets/scenes/OldPhotoEffectScene.fire b/assets/scenes/OldPhotoEffectScene.fire index d3699b1..6b40e31 100755 --- a/assets/scenes/OldPhotoEffectScene.fire +++ b/assets/scenes/OldPhotoEffectScene.fire @@ -82,6 +82,9 @@ }, { "__id__": 46 + }, + { + "__id__": 47 } ], "_prefab": null, @@ -2058,5 +2061,31 @@ }, "_enabled": true, "_id": "3aYHIG9t9FUI79rHpB2dpu" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0 } ] \ No newline at end of file diff --git a/assets/scenes/OldPhotoEffectScene.fire.meta b/assets/scenes/OldPhotoEffectScene.fire.meta index 15dee3c..57ef75a 100644 --- a/assets/scenes/OldPhotoEffectScene.fire.meta +++ b/assets/scenes/OldPhotoEffectScene.fire.meta @@ -1,5 +1,5 @@ { - "ver": "1.2.5", + "ver": "1.2.6", "uuid": "7f52e736-cdaf-44df-bd73-e2120e59267b", "asyncLoadAssets": false, "autoReleaseAssets": false, diff --git a/assets/scenes/OutlineEffectScene.fire b/assets/scenes/OutlineEffectScene.fire index 034ef32..18da751 100755 --- a/assets/scenes/OutlineEffectScene.fire +++ b/assets/scenes/OutlineEffectScene.fire @@ -82,6 +82,9 @@ }, { "__id__": 46 + }, + { + "__id__": 47 } ], "_prefab": null, @@ -2058,5 +2061,31 @@ }, "_enabled": true, "_id": "580AzT6xFJvb7ohciGgehV" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0 } ] \ No newline at end of file diff --git a/assets/scenes/OutlineEffectScene.fire.meta b/assets/scenes/OutlineEffectScene.fire.meta index ae64c16..857bcdf 100644 --- a/assets/scenes/OutlineEffectScene.fire.meta +++ b/assets/scenes/OutlineEffectScene.fire.meta @@ -1,5 +1,5 @@ { - "ver": "1.2.5", + "ver": "1.2.6", "uuid": "dbecc9f5-b74f-4e1d-a024-bf3d5eac0847", "asyncLoadAssets": false, "autoReleaseAssets": false, diff --git a/assets/scenes/PointLightEffectScene.fire b/assets/scenes/PointLightEffectScene.fire index 78eb6aa..89f5187 100755 --- a/assets/scenes/PointLightEffectScene.fire +++ b/assets/scenes/PointLightEffectScene.fire @@ -82,6 +82,9 @@ }, { "__id__": 138 + }, + { + "__id__": 139 } ], "_prefab": null, @@ -6286,5 +6289,31 @@ }, "_enabled": true, "_id": "8aXDbxs9dKkpT0kIbw8yNe" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0 } ] \ No newline at end of file diff --git a/assets/scenes/PointLightEffectScene.fire.meta b/assets/scenes/PointLightEffectScene.fire.meta index 8811c04..3ecfd18 100644 --- a/assets/scenes/PointLightEffectScene.fire.meta +++ b/assets/scenes/PointLightEffectScene.fire.meta @@ -1,5 +1,5 @@ { - "ver": "1.2.5", + "ver": "1.2.6", "uuid": "7d64bd80-8e2c-4c7c-8d65-ea69b0c4b3d3", "asyncLoadAssets": false, "autoReleaseAssets": false, diff --git a/assets/scenes/PreviewEffectScene.fire b/assets/scenes/PreviewEffectScene.fire index 849c59e..337fafe 100755 --- a/assets/scenes/PreviewEffectScene.fire +++ b/assets/scenes/PreviewEffectScene.fire @@ -82,6 +82,9 @@ }, { "__id__": 82 + }, + { + "__id__": 83 } ], "_prefab": null, @@ -3651,5 +3654,31 @@ }, "_enabled": true, "_id": "44CYzl0BdCx7yrVmaW40BI" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0 } ] \ No newline at end of file diff --git a/assets/scenes/PreviewEffectScene.fire.meta b/assets/scenes/PreviewEffectScene.fire.meta index 13f312e..7fd3c5e 100644 --- a/assets/scenes/PreviewEffectScene.fire.meta +++ b/assets/scenes/PreviewEffectScene.fire.meta @@ -1,5 +1,5 @@ { - "ver": "1.2.5", + "ver": "1.2.6", "uuid": "3bf0537b-ca38-4d1d-9c51-4e6c8a6369b0", "asyncLoadAssets": false, "autoReleaseAssets": false, diff --git a/assets/scenes/RoundCornerCropV1EffectScene.fire b/assets/scenes/RoundCornerCropV1EffectScene.fire index fcf9e7f..a378a2e 100755 --- a/assets/scenes/RoundCornerCropV1EffectScene.fire +++ b/assets/scenes/RoundCornerCropV1EffectScene.fire @@ -82,6 +82,9 @@ }, { "__id__": 40 + }, + { + "__id__": 41 } ], "_prefab": null, @@ -1769,5 +1772,31 @@ }, "_enabled": true, "_id": "ffrfD4b9VHdpBJCBGtbsue" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0 } ] \ No newline at end of file diff --git a/assets/scenes/RoundCornerCropV1EffectScene.fire.meta b/assets/scenes/RoundCornerCropV1EffectScene.fire.meta index de081c1..be73fe1 100644 --- a/assets/scenes/RoundCornerCropV1EffectScene.fire.meta +++ b/assets/scenes/RoundCornerCropV1EffectScene.fire.meta @@ -1,5 +1,5 @@ { - "ver": "1.2.5", + "ver": "1.2.6", "uuid": "6c351889-b6c8-409f-b36c-4263b06d0b23", "asyncLoadAssets": false, "autoReleaseAssets": false, diff --git a/assets/scenes/RoundCornerCropV2EffectScene.fire b/assets/scenes/RoundCornerCropV2EffectScene.fire index 8136358..733de0e 100755 --- a/assets/scenes/RoundCornerCropV2EffectScene.fire +++ b/assets/scenes/RoundCornerCropV2EffectScene.fire @@ -82,6 +82,9 @@ }, { "__id__": 40 + }, + { + "__id__": 41 } ], "_prefab": null, @@ -1769,5 +1772,31 @@ }, "_enabled": true, "_id": "4dVJgUbN1DNLxYDQbGjRhE" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0 } ] \ No newline at end of file diff --git a/assets/scenes/RoundCornerCropV2EffectScene.fire.meta b/assets/scenes/RoundCornerCropV2EffectScene.fire.meta index c4bdbe0..daae957 100644 --- a/assets/scenes/RoundCornerCropV2EffectScene.fire.meta +++ b/assets/scenes/RoundCornerCropV2EffectScene.fire.meta @@ -1,5 +1,5 @@ { - "ver": "1.2.5", + "ver": "1.2.6", "uuid": "c2dec4ed-8129-40a2-9a1e-2440da772015", "asyncLoadAssets": false, "autoReleaseAssets": false, diff --git a/assets/textures/ball_0.png.meta b/assets/textures/ball_0.png.meta index 0cead14..c5223c1 100644 --- a/assets/textures/ball_0.png.meta +++ b/assets/textures/ball_0.png.meta @@ -1,5 +1,5 @@ { - "ver": "2.3.3", + "ver": "2.3.4", "uuid": "c996c862-3d09-4bc6-915d-e8a8e7226933", "type": "sprite", "wrapMode": "clamp", @@ -7,6 +7,8 @@ "premultiplyAlpha": false, "genMipmaps": false, "packable": true, + "width": 60, + "height": 60, "platformSettings": {}, "subMetas": { "ball_0": { diff --git a/assets/textures/ball_1.png.meta b/assets/textures/ball_1.png.meta index b9cef08..9c2dedc 100644 --- a/assets/textures/ball_1.png.meta +++ b/assets/textures/ball_1.png.meta @@ -1,5 +1,5 @@ { - "ver": "2.3.3", + "ver": "2.3.4", "uuid": "bdfd3151-8c13-406b-8f94-1f101c972e7e", "type": "sprite", "wrapMode": "clamp", @@ -7,6 +7,8 @@ "premultiplyAlpha": false, "genMipmaps": false, "packable": true, + "width": 80, + "height": 80, "platformSettings": {}, "subMetas": { "ball_1": { diff --git a/assets/textures/bg.png.meta b/assets/textures/bg.png.meta index 7d98f3c..6caba4b 100755 --- a/assets/textures/bg.png.meta +++ b/assets/textures/bg.png.meta @@ -1,5 +1,5 @@ { - "ver": "2.3.3", + "ver": "2.3.4", "uuid": "a8027877-d8d6-4645-97a0-52d4a0123dba", "type": "sprite", "wrapMode": "clamp", @@ -7,6 +7,8 @@ "premultiplyAlpha": false, "genMipmaps": false, "packable": true, + "width": 2, + "height": 2, "platformSettings": {}, "subMetas": { "bg": { diff --git a/assets/textures/cocos_logo.png.meta b/assets/textures/cocos_logo.png.meta index 1bc1da7..b35876c 100755 --- a/assets/textures/cocos_logo.png.meta +++ b/assets/textures/cocos_logo.png.meta @@ -1,5 +1,5 @@ { - "ver": "2.3.3", + "ver": "2.3.4", "uuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4", "type": "sprite", "wrapMode": "clamp", @@ -7,6 +7,8 @@ "premultiplyAlpha": false, "genMipmaps": false, "packable": true, + "width": 195, + "height": 270, "platformSettings": {}, "subMetas": { "cocos_logo": { diff --git a/assets/textures/freedom.jpg.meta b/assets/textures/freedom.jpg.meta index 72280f7..c88697b 100644 --- a/assets/textures/freedom.jpg.meta +++ b/assets/textures/freedom.jpg.meta @@ -1,5 +1,5 @@ { - "ver": "2.3.3", + "ver": "2.3.4", "uuid": "caf42253-1569-497e-83da-2d1696f5866b", "type": "sprite", "wrapMode": "clamp", @@ -7,6 +7,8 @@ "premultiplyAlpha": false, "genMipmaps": false, "packable": true, + "width": 755, + "height": 755, "platformSettings": {}, "subMetas": { "freedom": { diff --git a/assets/textures/gaussian_blur.png.meta b/assets/textures/gaussian_blur.png.meta index 269bc87..99f9daf 100644 --- a/assets/textures/gaussian_blur.png.meta +++ b/assets/textures/gaussian_blur.png.meta @@ -1,5 +1,5 @@ { - "ver": "2.3.3", + "ver": "2.3.4", "uuid": "c879710d-0419-46be-bf96-92ee1ca52324", "type": "sprite", "wrapMode": "clamp", @@ -7,6 +7,8 @@ "premultiplyAlpha": false, "genMipmaps": false, "packable": true, + "width": 317, + "height": 178, "platformSettings": {}, "subMetas": { "gaussian_blur": { diff --git a/assets/textures/video_btn.png.meta b/assets/textures/video_btn.png.meta index e89ca29..ff14e30 100644 --- a/assets/textures/video_btn.png.meta +++ b/assets/textures/video_btn.png.meta @@ -1,5 +1,5 @@ { - "ver": "2.3.3", + "ver": "2.3.4", "uuid": "2453b01d-4364-4d87-ab53-391d1a42d07d", "type": "sprite", "wrapMode": "clamp", @@ -7,6 +7,8 @@ "premultiplyAlpha": false, "genMipmaps": false, "packable": true, + "width": 60, + "height": 60, "platformSettings": {}, "subMetas": { "video_btn": { diff --git a/assets/textures/xmlBMFont.png.meta b/assets/textures/xmlBMFont.png.meta index 5321493..a9d2596 100644 --- a/assets/textures/xmlBMFont.png.meta +++ b/assets/textures/xmlBMFont.png.meta @@ -1,5 +1,5 @@ { - "ver": "2.3.3", + "ver": "2.3.4", "uuid": "a5454758-921f-46ab-a314-0a7936d03be7", "type": "sprite", "wrapMode": "clamp", @@ -7,6 +7,8 @@ "premultiplyAlpha": false, "genMipmaps": false, "packable": true, + "width": 1114, + "height": 512, "platformSettings": {}, "subMetas": { "xmlBMFont": { diff --git a/project.json b/project.json index 0046599..adfccd5 100755 --- a/project.json +++ b/project.json @@ -1,6 +1,6 @@ { "engine": "cocos2d-html5", "packages": "packages", - "version": "2.2.2", + "version": "2.3.0", "id": "7e74e9ed-5c28-4e81-ae0e-5a67f548022c" } \ No newline at end of file diff --git a/settings/project.json b/settings/project.json index 215ff90..917ecb3 100755 --- a/settings/project.json +++ b/settings/project.json @@ -4,7 +4,11 @@ true ] ], - "excluded-modules": [], + "excluded-modules": [ + "3D Physics/cannon.js", + "3D Physics/Builtin", + "3D Particle" + ], "group-list": [ "default" ], From 549bbdf5e2ce805c6050e039733be329b6450c72 Mon Sep 17 00:00:00 2001 From: caizhitao Date: Mon, 17 Feb 2020 09:38:49 +0800 Subject: [PATCH 2/9] =?UTF-8?q?effect=20properties=20=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E7=9A=84=20inspector=20->=20editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/effects/sprite-flash-light.effect | 14 +++++++------- assets/effects/sprite-gaussian-blur-v1.effect | 4 ++-- assets/effects/sprite-glow-inner.effect | 6 +++--- assets/effects/sprite-glow-outter.effect | 6 +++--- assets/effects/sprite-gray.effect | 2 +- assets/effects/sprite-mosaic.effect | 4 ++-- assets/effects/sprite-old-photo.effect | 2 +- assets/effects/sprite-outline.effect | 4 ++-- assets/effects/sprite-point-light.effect | 6 +++--- assets/effects/sprite-round-corner-crop-v1.effect | 5 ++--- assets/effects/sprite-round-corner-crop-v2.effect | 10 ++++------ 11 files changed, 30 insertions(+), 33 deletions(-) diff --git a/assets/effects/sprite-flash-light.effect b/assets/effects/sprite-flash-light.effect index 4f7a180..08925c0 100644 --- a/assets/effects/sprite-flash-light.effect +++ b/assets/effects/sprite-flash-light.effect @@ -22,7 +22,7 @@ CCEffect %{ # 光束颜色 lightColor: { value: [1.0, 1.0, 0.0, 1.0], - inspector: { + editor: { type: color, tooltip: "光束颜色" } @@ -31,7 +31,7 @@ CCEffect %{ # 光束中心点坐标 lightCenterPoint: { value: [0.2, 0.2], - inspector: { + editor: { tooltip: "光束中心点坐标" } } @@ -39,7 +39,7 @@ CCEffect %{ # 光束倾斜角度 lightAngle: { value: 36.0, - inspctor: { + editor: { tooltip: "光束倾斜角度", range: [0.0, 1.0], } @@ -48,7 +48,7 @@ CCEffect %{ # 光束宽度 lightWidth: { value: 0.2, - inspector: { + editor: { tooltip: "光束宽度" } } @@ -56,7 +56,7 @@ CCEffect %{ # 启用光束渐变 enableGradient: { value: 1.0, - inspecator: { + editor: { tooltip: "是否启用光束渐变。0:不启用,非0:启用" } } @@ -64,7 +64,7 @@ CCEffect %{ # 裁剪掉透明区域上的光 cropAlpha: { value: 1.0, - inspecator: { + editor: { tooltip: "是否裁剪透明区域上的光。0:不启用,非0:启用" } } @@ -72,7 +72,7 @@ CCEffect %{ # 是否启用迷雾效果 enableFog: { value: 0.0, - inspecator: { + editor: { tooltip: "是否启用迷雾效果。0:不启用,非0:启用" } } diff --git a/assets/effects/sprite-gaussian-blur-v1.effect b/assets/effects/sprite-gaussian-blur-v1.effect index 811cc08..08dd3ab 100644 --- a/assets/effects/sprite-gaussian-blur-v1.effect +++ b/assets/effects/sprite-gaussian-blur-v1.effect @@ -22,7 +22,7 @@ CCEffect %{ # # 标准方差值 # stDev: { # value: 0.84089642, - # inspector: { + # editor: { # tooltip: "标准方差值" # } # } @@ -30,7 +30,7 @@ CCEffect %{ # 纹理尺寸 textureSize: { value: [100.0, 100.0], - inspector: { + editor: { tooltip: "纹理尺寸px(宽 x 高)" } } diff --git a/assets/effects/sprite-glow-inner.effect b/assets/effects/sprite-glow-inner.effect index a3ddf1b..254a869 100644 --- a/assets/effects/sprite-glow-inner.effect +++ b/assets/effects/sprite-glow-inner.effect @@ -19,7 +19,7 @@ CCEffect %{ # 发光颜色 glowColor: { value: [1.0, 1.0, 0.0, 1.0], - inspector: { + editor: { type: color, tooltip: "发光颜色" } @@ -27,7 +27,7 @@ CCEffect %{ # 发光宽度 glowColorSize: { value: 0.2, - inspector: { + editor: { tooltip: "发光宽度", range: [0.0, 1.0], } @@ -37,7 +37,7 @@ CCEffect %{ # 一般用于解决图像边缘存在渐变透明的时,决定超过这个透明度阈值的边缘点才点发光,具体可以操作一下 glowThreshold: { value: 0.1, - inspector: { + editor: { tooltip: "发光阈值", range: [0.0, 1.0] } diff --git a/assets/effects/sprite-glow-outter.effect b/assets/effects/sprite-glow-outter.effect index 6241f18..2051afa 100644 --- a/assets/effects/sprite-glow-outter.effect +++ b/assets/effects/sprite-glow-outter.effect @@ -19,7 +19,7 @@ CCEffect %{ # 发光颜色 glowColor: { value: [1.0, 1.0, 0.0, 1.0], - inspector: { + editor: { type: color, tooltip: "发光颜色" } @@ -27,7 +27,7 @@ CCEffect %{ # 发光宽度 glowColorSize: { value: 0.15, - inspector: { + editor: { tooltip: "发光宽度", range: [0.0, 1.0], } @@ -36,7 +36,7 @@ CCEffect %{ # 只有小于等于这个透明度的点才会发光 glowThreshold: { value: 1.0, - inspector: { + editor: { tooltip: "发光阈值", range: [0.0, 1.0] } diff --git a/assets/effects/sprite-gray.effect b/assets/effects/sprite-gray.effect index 709971c..6587e94 100644 --- a/assets/effects/sprite-gray.effect +++ b/assets/effects/sprite-gray.effect @@ -21,7 +21,7 @@ CCEffect %{ # 灰化程度 grayLevel: { value: 1.0, - inspector: { + editor: { tooltip: "灰化程度", range: [0.0, 1.0] } diff --git a/assets/effects/sprite-mosaic.effect b/assets/effects/sprite-mosaic.effect index 2cb8c69..e449574 100644 --- a/assets/effects/sprite-mosaic.effect +++ b/assets/effects/sprite-mosaic.effect @@ -18,14 +18,14 @@ CCEffect %{ # X轴方块数量 xBlockCount: { value: 30.0, - inspector: { + editor: { tooltip: "X轴方向马赛克方块数量" } } # Y轴方块数量 yBlockCount: { value: 30.0, - inspector: { + editor: { tooltip: "Y轴方向马赛克方块数量" } } diff --git a/assets/effects/sprite-old-photo.effect b/assets/effects/sprite-old-photo.effect index 9ef393f..b86ecf0 100644 --- a/assets/effects/sprite-old-photo.effect +++ b/assets/effects/sprite-old-photo.effect @@ -21,7 +21,7 @@ CCEffect %{ # 老化程度 oldLevel: { value: 1.0, - inspector: { + editor: { tooltip: "老化程度", range: [0.0, 1.0] } diff --git a/assets/effects/sprite-outline.effect b/assets/effects/sprite-outline.effect index 50ea566..5076b6a 100644 --- a/assets/effects/sprite-outline.effect +++ b/assets/effects/sprite-outline.effect @@ -17,7 +17,7 @@ CCEffect %{ # 描边颜色 outlineColor: { value: [1.0, 0.0, 0.0, 1.0], - inspector: { + editor: { type: color, tooltip: "描边颜色", } @@ -26,7 +26,7 @@ CCEffect %{ # 描边宽度 outlineWidth: { value: 0.002, - inspector: { + editor: { tooltip: "描边宽度", range: [0.0, 1.0] } diff --git a/assets/effects/sprite-point-light.effect b/assets/effects/sprite-point-light.effect index c9dc59a..3b6794c 100644 --- a/assets/effects/sprite-point-light.effect +++ b/assets/effects/sprite-point-light.effect @@ -22,7 +22,7 @@ CCEffect %{ # 扩散颜色 centerColor: { value: [1.0, 1.0, 0.0, 1.0], - inspector: { + editor: { type: color, tooltip: "发光颜色" } @@ -31,7 +31,7 @@ CCEffect %{ # 扩散起点坐标 centerPoint: { value: [0.2, 0.2], - inspector: { + editor: { tooltip: "扩散起点坐标" } } @@ -39,7 +39,7 @@ CCEffect %{ # 扩散半径 radius: { value: 0.4, - inspector: { + editor: { tooltip: "扩散半径" } } diff --git a/assets/effects/sprite-round-corner-crop-v1.effect b/assets/effects/sprite-round-corner-crop-v1.effect index a203fc2..7101fcd 100644 --- a/assets/effects/sprite-round-corner-crop-v1.effect +++ b/assets/effects/sprite-round-corner-crop-v1.effect @@ -21,9 +21,8 @@ CCEffect %{ # 圆角半径 radius: { value: 0.4, - inspector: { - tooltip: "圆角半径", - range: [0.0, 0.5] + editor: { + tooltip: "圆角半径" } } }% diff --git a/assets/effects/sprite-round-corner-crop-v2.effect b/assets/effects/sprite-round-corner-crop-v2.effect index 9bbda70..a642409 100644 --- a/assets/effects/sprite-round-corner-crop-v2.effect +++ b/assets/effects/sprite-round-corner-crop-v2.effect @@ -24,18 +24,16 @@ CCEffect %{ # 圆角x轴半径长度(相对于纹理宽度) xRadius: { value: 0.4, - inspector: { - tooltip: "圆角x轴半径长度(相对于纹理宽度)", - range: [0.0, 0.5] + editor: { + tooltip: "圆角x轴半径长度(相对于纹理宽度)" } } # 圆角y轴半径长度(相对于纹理高度) yRadius: { value: 0.4, - inspector: { - tooltip: "圆角y轴半径长度(相对于纹理高度)", - range: [0.0, 0.5] + editor: { + tooltip: "圆角y轴半径长度(相对于纹理高度)" } } }% From 1f4110d26fc1802d69c77885f10a1bf1f235a354 Mon Sep 17 00:00:00 2001 From: caizhitao Date: Mon, 17 Feb 2020 09:55:50 +0800 Subject: [PATCH 3/9] bugfix for 2d-sprite-glow-inner --- ...ner.effect => 2d-sprite-glow-inner.effect} | 6 +- ....meta => 2d-sprite-glow-inner.effect.meta} | 6 +- assets/materials/2d-sprite-glow-inner.mtl | 18 + ...mtl.meta => 2d-sprite-glow-inner.mtl.meta} | 2 +- assets/materials/sprite-glow-inner.mtl | 30 -- assets/scenes/GlowInnerEffectScene.fire | 358 +++--------------- assets/scenes/PreviewEffectScene.fire | 25 +- 7 files changed, 94 insertions(+), 351 deletions(-) rename assets/effects/{sprite-glow-inner.effect => 2d-sprite-glow-inner.effect} (98%) rename assets/effects/{sprite-glow-inner.effect.meta => 2d-sprite-glow-inner.effect.meta} (83%) create mode 100644 assets/materials/2d-sprite-glow-inner.mtl rename assets/materials/{sprite-glow-inner.mtl.meta => 2d-sprite-glow-inner.mtl.meta} (56%) delete mode 100644 assets/materials/sprite-glow-inner.mtl diff --git a/assets/effects/sprite-glow-inner.effect b/assets/effects/2d-sprite-glow-inner.effect similarity index 98% rename from assets/effects/sprite-glow-inner.effect rename to assets/effects/2d-sprite-glow-inner.effect index 254a869..cc12637 100644 --- a/assets/effects/sprite-glow-inner.effect +++ b/assets/effects/2d-sprite-glow-inner.effect @@ -1,6 +1,5 @@ // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -// 内发光特效 -// 原理: 采样周边像素alpha取平均值,叠加发光效果 + CCEffect %{ techniques: - passes: @@ -14,7 +13,6 @@ CCEffect %{ properties: texture: { value: white } alphaThreshold: { value: 0.5 } - # 自定义参数 # 发光颜色 glowColor: { @@ -207,7 +205,7 @@ CCProgram fs %{ vec4 o = vec4(1, 1, 1, 1); #if USE_TEXTURE - o *= getTextureColor(texture, v_uv0); + o *= texture(texture, v_uv0); #if CC_USE_ALPHA_ATLAS_TEXTURE o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r; #endif diff --git a/assets/effects/sprite-glow-inner.effect.meta b/assets/effects/2d-sprite-glow-inner.effect.meta similarity index 83% rename from assets/effects/sprite-glow-inner.effect.meta rename to assets/effects/2d-sprite-glow-inner.effect.meta index d619895..263c6b9 100644 --- a/assets/effects/sprite-glow-inner.effect.meta +++ b/assets/effects/2d-sprite-glow-inner.effect.meta @@ -1,15 +1,15 @@ { "ver": "1.0.25", - "uuid": "90211f16-c00e-4c37-a192-43ec50c9ea35", + "uuid": "345a48c3-c00c-45d2-b6c9-b1ac49f46662", "compiledShaders": [ { "glsl1": { "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\n#if SHOW_INNER_GLOW\nuniform vec4 glowColor;\nuniform float glowColorSize;\nuniform float glowThreshold;\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture2D(texture, v_uv0);\n}\nfloat getColorAlpha(float angle, float dist) {\n float radian = radians(angle);\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian)));\n return color.a;\n}\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n}\nfloat getGlowAlpha() {\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n vec4 srcColor = getTextureColor(texture, v_uv0);\n if (srcColor.a <= glowThreshold) {\n return srcColor.a;\n }\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= getTextureColor(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_INNER_GLOW\n vec4 color_dest = o;\n float alpha = getGlowAlpha();\n if (alpha > glowThreshold) {\n alpha = 1.0 - alpha;\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n }\n vec4 color_src = glowColor * alpha;\n gl_FragColor = color_src * color_src.a + color_dest;\n #endif\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;\n#endif\n#if SHOW_INNER_GLOW\nuniform vec4 glowColor;\nuniform float glowColorSize;\nuniform float glowThreshold;\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture2D(texture, v_uv0);\n}\nfloat getColorAlpha(float angle, float dist) {\n float radian = radians(angle);\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian)));\n return color.a;\n}\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n}\nfloat getGlowAlpha() {\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n vec4 srcColor = getTextureColor(texture, v_uv0);\n if (srcColor.a <= glowThreshold) {\n return srcColor.a;\n }\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_INNER_GLOW\n vec4 color_dest = o;\n float alpha = getGlowAlpha();\n if (alpha > glowThreshold) {\n alpha = 1.0 - alpha;\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n }\n vec4 color_src = glowColor * alpha;\n gl_FragColor = color_src * color_src.a + color_dest;\n #endif\n}" }, "glsl3": { "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\n#if SHOW_INNER_GLOW\nuniform glow {\n vec4 glowColor;\n float glowColorSize;\n float glowThreshold;\n};\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture(texture, v_uv0);\n}\nfloat getColorAlpha(float angle, float dist) {\n float radian = radians(angle);\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian)));\n return color.a;\n}\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n}\nfloat getGlowAlpha() {\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n vec4 srcColor = getTextureColor(texture, v_uv0);\n if (srcColor.a <= glowThreshold) {\n return srcColor.a;\n }\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= getTextureColor(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_INNER_GLOW\n vec4 color_dest = o;\n float alpha = getGlowAlpha();\n if (alpha > glowThreshold) {\n alpha = 1.0 - alpha;\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n }\n vec4 color_src = glowColor * alpha;\n gl_FragColor = color_src * color_src.a + color_dest;\n #endif\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;\n#endif\n#if SHOW_INNER_GLOW\nuniform glow {\n vec4 glowColor;\n float glowColorSize;\n float glowThreshold;\n};\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture(texture, v_uv0);\n}\nfloat getColorAlpha(float angle, float dist) {\n float radian = radians(angle);\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian)));\n return color.a;\n}\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n}\nfloat getGlowAlpha() {\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n vec4 srcColor = getTextureColor(texture, v_uv0);\n if (srcColor.a <= glowThreshold) {\n return srcColor.a;\n }\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_INNER_GLOW\n vec4 color_dest = o;\n float alpha = getGlowAlpha();\n if (alpha > glowThreshold) {\n alpha = 1.0 - alpha;\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n }\n vec4 color_src = glowColor * alpha;\n gl_FragColor = color_src * color_src.a + color_dest;\n #endif\n}" } } ], diff --git a/assets/materials/2d-sprite-glow-inner.mtl b/assets/materials/2d-sprite-glow-inner.mtl new file mode 100644 index 0000000..73be926 --- /dev/null +++ b/assets/materials/2d-sprite-glow-inner.mtl @@ -0,0 +1,18 @@ +{ + "__type__": "cc.Material", + "_name": "New Material", + "_objFlags": 0, + "_native": "", + "_effectAsset": { + "__uuid__": "345a48c3-c00c-45d2-b6c9-b1ac49f46662" + }, + "_techniqueIndex": 0, + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true, + "SHOW_INNER_GLOW": true + } + } + } +} \ No newline at end of file diff --git a/assets/materials/sprite-glow-inner.mtl.meta b/assets/materials/2d-sprite-glow-inner.mtl.meta similarity index 56% rename from assets/materials/sprite-glow-inner.mtl.meta rename to assets/materials/2d-sprite-glow-inner.mtl.meta index 6ab4973..4efda98 100644 --- a/assets/materials/sprite-glow-inner.mtl.meta +++ b/assets/materials/2d-sprite-glow-inner.mtl.meta @@ -1,6 +1,6 @@ { "ver": "1.0.3", - "uuid": "2c760728-404d-4553-a1d0-7ab18263845c", + "uuid": "647e873f-e0ed-4ce7-84cb-9e4d4f8a211f", "dataAsSubAsset": null, "subMetas": {} } \ No newline at end of file diff --git a/assets/materials/sprite-glow-inner.mtl b/assets/materials/sprite-glow-inner.mtl deleted file mode 100644 index 49c7500..0000000 --- a/assets/materials/sprite-glow-inner.mtl +++ /dev/null @@ -1,30 +0,0 @@ -{ - "__type__": "cc.Material", - "_name": "sprite-glow-inner", - "_objFlags": 0, - "_native": "", - "_effectAsset": { - "__uuid__": "90211f16-c00e-4c37-a192-43ec50c9ea35" - }, - "_techniqueData": { - "0": { - "props": { - "texture": null, - "glowColor": { - "__type__": "cc.Color", - "r": 255, - "g": 0, - "b": 0, - "a": 255 - }, - "glowColorSize": 0.2, - "glowThreshold": 0.1 - }, - "defines": { - "USE_TEXTURE": true, - "USE_ALPHA_TEST": false, - "SHOW_INNER_GLOW": true - } - } - } -} \ No newline at end of file diff --git a/assets/scenes/GlowInnerEffectScene.fire b/assets/scenes/GlowInnerEffectScene.fire index c8ac911..557f40e 100755 --- a/assets/scenes/GlowInnerEffectScene.fire +++ b/assets/scenes/GlowInnerEffectScene.fire @@ -78,13 +78,13 @@ "_active": true, "_components": [ { - "__id__": 130 + "__id__": 124 }, { - "__id__": 131 + "__id__": 125 }, { - "__id__": 132 + "__id__": 126 } ], "_prefab": null, @@ -174,7 +174,7 @@ "array": [ 0, 0, - 492.17758360225525, + 324.7595264191645, 0, 0, 0, @@ -254,7 +254,7 @@ "_active": true, "_components": [ { - "__id__": 129 + "__id__": 123 } ], "_prefab": null, @@ -673,6 +673,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -1240,6 +1242,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -1434,6 +1438,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -2001,6 +2007,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -2195,6 +2203,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -2762,6 +2772,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -2956,6 +2968,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -3523,6 +3537,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -3717,6 +3733,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -4284,6 +4302,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -4478,6 +4498,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -5045,6 +5067,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -5155,24 +5179,15 @@ }, { "__id__": 119 - }, - { - "__id__": 121 - }, - { - "__id__": 123 - }, - { - "__id__": 125 } ], "_active": true, "_components": [ { - "__id__": 127 + "__id__": 121 }, { - "__id__": 128 + "__id__": 122 } ], "_prefab": null, @@ -5187,7 +5202,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 384, - "height": 435.33 + "height": 442 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -5223,100 +5238,6 @@ "groupIndex": 0, "_id": "feymBChPxA1pr6+/rlPqey" }, - { - "__type__": "cc.Node", - "_name": "ball_0", - "_objFlags": 0, - "_parent": { - "__id__": 114 - }, - "_children": [], - "_active": false, - "_components": [ - { - "__id__": 116 - } - ], - "_prefab": null, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 60, - "height": 60 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - 0, - -30, - 0, - 0, - 0, - 0, - 1, - 2, - 2, - 1 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "49czqIEPBHr6kLJbb+kN8/" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 115 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "2c760728-404d-4553-a1d0-7ab18263845c" - } - ], - "_srcBlendFactor": 770, - "_dstBlendFactor": 771, - "_spriteFrame": { - "__uuid__": "d0b78623-4e79-4de1-b1d2-ea211bf4652c" - }, - "_type": 0, - "_sizeMode": 1, - "_fillType": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_atlas": null, - "_id": "94vIBMHVlAN4EGbkr2wRvX" - }, { "__type__": "cc.Node", "_name": "cocos_logo", @@ -5328,7 +5249,7 @@ "_active": true, "_components": [ { - "__id__": 118 + "__id__": 116 } ], "_prefab": null, @@ -5384,12 +5305,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 117 + "__id__": 115 }, "_enabled": true, "_materials": [ { - "__uuid__": "2c760728-404d-4553-a1d0-7ab18263845c" + "__uuid__": "647e873f-e0ed-4ce7-84cb-9e4d4f8a211f" } ], "_srcBlendFactor": 770, @@ -5422,7 +5343,7 @@ "_active": true, "_components": [ { - "__id__": 120 + "__id__": 118 } ], "_prefab": null, @@ -5478,12 +5399,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 119 + "__id__": 117 }, "_enabled": true, "_materials": [ { - "__uuid__": "2c760728-404d-4553-a1d0-7ab18263845c" + "__uuid__": "647e873f-e0ed-4ce7-84cb-9e4d4f8a211f" } ], "_srcBlendFactor": 770, @@ -5505,192 +5426,6 @@ "_atlas": null, "_id": "4bH5hzKe9LsLQeXjLynIHQ" }, - { - "__type__": "cc.Node", - "_name": "video_btn", - "_objFlags": 0, - "_parent": { - "__id__": 114 - }, - "_children": [], - "_active": false, - "_components": [ - { - "__id__": 122 - } - ], - "_prefab": null, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 50, - "height": 50 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - 0, - -559, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "c73V7fMuVE0aD5fGtmyzmF" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 121 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "2c760728-404d-4553-a1d0-7ab18263845c" - } - ], - "_srcBlendFactor": 770, - "_dstBlendFactor": 771, - "_spriteFrame": { - "__uuid__": "54142b08-a163-426e-a75e-4c7b21046413" - }, - "_type": 0, - "_sizeMode": 1, - "_fillType": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_atlas": null, - "_id": "f43fJCjNdOS5VHAEhp0yDU" - }, - { - "__type__": "cc.Node", - "_name": "SystemFont", - "_objFlags": 0, - "_parent": { - "__id__": 114 - }, - "_children": [], - "_active": false, - "_components": [ - { - "__id__": 124 - } - ], - "_prefab": null, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 97.87, - "height": 50.4 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - 0, - -657.2, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "5dfIaYLgJPQKk50HqrgyHI" - }, - { - "__type__": "cc.Label", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 123 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "2c760728-404d-4553-a1d0-7ab18263845c" - } - ], - "_useOriginalSize": false, - "_string": "System Font", - "_N$string": "System Font", - "_fontSize": 40, - "_lineHeight": 40, - "_enableWrapText": true, - "_N$file": null, - "_isSystemFontUsed": true, - "_spacingX": 0, - "_batchAsBitmap": false, - "_N$horizontalAlign": 1, - "_N$verticalAlign": 1, - "_N$fontFamily": "Arial", - "_N$overflow": 0, - "_N$cacheMode": 0, - "_id": "d1whc7H8RHdrROcYj+2Qh1" - }, { "__type__": "cc.Node", "_name": "BmFont", @@ -5702,7 +5437,7 @@ "_active": true, "_components": [ { - "__id__": 126 + "__id__": 120 } ], "_prefab": null, @@ -5717,7 +5452,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 167.5, - "height": 33.33 + "height": 40 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -5729,7 +5464,7 @@ "ctor": "Float64Array", "array": [ 0, - -418.665, + -422, 0, 0, 0, @@ -5758,12 +5493,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 125 + "__id__": 119 }, "_enabled": true, "_materials": [ { - "__uuid__": "2c760728-404d-4553-a1d0-7ab18263845c" + "__uuid__": "647e873f-e0ed-4ce7-84cb-9e4d4f8a211f" } ], "_useOriginalSize": false, @@ -5778,6 +5513,8 @@ "_isSystemFontUsed": false, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -5823,7 +5560,7 @@ "_layoutSize": { "__type__": "cc.Size", "width": 384, - "height": 435.33 + "height": 442 }, "_resize": 1, "_N$layoutType": 2, @@ -5906,6 +5643,7 @@ "_isAbsHorizontalCenter": true, "_isAbsVerticalCenter": true, "_originalWidth": 0, - "_originalHeight": 0 + "_originalHeight": 0, + "_id": "314F24pJRBBZaYka0OCTsh" } ] \ No newline at end of file diff --git a/assets/scenes/PreviewEffectScene.fire b/assets/scenes/PreviewEffectScene.fire index 337fafe..44ca253 100755 --- a/assets/scenes/PreviewEffectScene.fire +++ b/assets/scenes/PreviewEffectScene.fire @@ -174,7 +174,7 @@ "array": [ 0, 0, - 491.0364039457767, + 324.7595264191645, 0, 0, 0, @@ -990,6 +990,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -1069,7 +1071,7 @@ "_enabled": true, "_materials": [ { - "__uuid__": "2c760728-404d-4553-a1d0-7ab18263845c" + "__uuid__": "647e873f-e0ed-4ce7-84cb-9e4d4f8a211f" } ], "_srcBlendFactor": 770, @@ -1308,6 +1310,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -1626,6 +1630,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -1944,6 +1950,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -2262,6 +2270,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -2580,6 +2590,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -2898,6 +2910,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -3216,6 +3230,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -3584,6 +3600,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -3679,6 +3697,7 @@ "_isAbsHorizontalCenter": true, "_isAbsVerticalCenter": true, "_originalWidth": 0, - "_originalHeight": 0 + "_originalHeight": 0, + "_id": "02nUBbknlA3Jny2yiia5qS" } ] \ No newline at end of file From 6ea6375fdb31d993e7a6fab4bb3d88fabe760ee6 Mon Sep 17 00:00:00 2001 From: caizhitao Date: Mon, 17 Feb 2020 10:05:42 +0800 Subject: [PATCH 4/9] bugfix for 2d sprite glow outter --- ...er.effect => 2d-sprite-glow-outter.effect} | 9 +- ...meta => 2d-sprite-glow-outter.effect.meta} | 6 +- assets/materials/2d-sprite-glow-outter.mtl | 18 ++ ...tl.meta => 2d-sprite-glow-outter.mtl.meta} | 2 +- assets/materials/sprite-glow-outter.mtl | 30 --- assets/scenes/GlowOutterEffectScene.fire | 251 +++--------------- 6 files changed, 67 insertions(+), 249 deletions(-) rename assets/effects/{sprite-glow-outter.effect => 2d-sprite-glow-outter.effect} (94%) rename assets/effects/{sprite-glow-outter.effect.meta => 2d-sprite-glow-outter.effect.meta} (81%) create mode 100644 assets/materials/2d-sprite-glow-outter.mtl rename assets/materials/{sprite-glow-outter.mtl.meta => 2d-sprite-glow-outter.mtl.meta} (56%) delete mode 100644 assets/materials/sprite-glow-outter.mtl diff --git a/assets/effects/sprite-glow-outter.effect b/assets/effects/2d-sprite-glow-outter.effect similarity index 94% rename from assets/effects/sprite-glow-outter.effect rename to assets/effects/2d-sprite-glow-outter.effect index 2051afa..63177e6 100644 --- a/assets/effects/sprite-glow-outter.effect +++ b/assets/effects/2d-sprite-glow-outter.effect @@ -1,6 +1,5 @@ // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -// 外发光特效 -// 原理:采样周边像素alpha取平均值,给外部加发光效果(1-col.a可避免内部发光) + CCEffect %{ techniques: - passes: @@ -14,7 +13,6 @@ CCEffect %{ properties: texture: { value: white } alphaThreshold: { value: 0.5 } - # 自定义参数 # 发光颜色 glowColor: { @@ -50,20 +48,17 @@ CCProgram vs %{ #include #include - // a_position 是笛卡尔坐标右手系,也是OpenGL的坐标系,原点在左下角,X轴正方向往右,Y轴正方向往上,Z轴正方向往外 in vec3 a_position; in vec4 a_color; out vec4 v_color; #if USE_TEXTURE - // a_uv0 是标准屏幕坐标系,即原点在左上角,X轴正方向往右,Y轴正方向往下 in vec2 a_uv0; out vec2 v_uv0; #endif void main () { vec4 pos = vec4(a_position, 1); - // vec4 pos = vec4(a_position * vec3(1.0, 1.0, 1.0), 1); #if CC_USE_MODEL pos = cc_matViewProj * cc_matWorld * pos; @@ -239,7 +234,7 @@ CCProgram fs %{ vec4 o = vec4(1, 1, 1, 1); #if USE_TEXTURE - o *= getTextureColor(texture, v_uv0); + o *= texture(texture, v_uv0); #if CC_USE_ALPHA_ATLAS_TEXTURE o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r; #endif diff --git a/assets/effects/sprite-glow-outter.effect.meta b/assets/effects/2d-sprite-glow-outter.effect.meta similarity index 81% rename from assets/effects/sprite-glow-outter.effect.meta rename to assets/effects/2d-sprite-glow-outter.effect.meta index 533590a..7596856 100644 --- a/assets/effects/sprite-glow-outter.effect.meta +++ b/assets/effects/2d-sprite-glow-outter.effect.meta @@ -1,15 +1,15 @@ { "ver": "1.0.25", - "uuid": "89f30b2e-b75e-49b1-9dfc-cb341cadd30a", + "uuid": "67e9833e-aa43-427a-ba89-d7bdd1ef0aed", "compiledShaders": [ { "glsl1": { "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture2D(texture, v_uv0);\n}\n#if SHOW_OUTTER_GLOW\nuniform vec4 glowColor;\nuniform float glowColorSize;\nuniform float glowThreshold;\nfloat getColorAlpha(float angle, float dist) {\n float radian = angle * 0.01745329252;\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian)));\n return color.a;\n}\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n}\nfloat getGlowAlpha() {\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= getTextureColor(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_OUTTER_GLOW\n float alpha = getGlowAlpha();\n if (alpha <= glowThreshold) {\n alpha = alpha / glowThreshold;\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n } else {\n alpha = 0.0;\n }\n vec4 color_dest = glowColor * alpha;\n vec4 color_src = o;\n gl_FragColor = color_src * color_src.a + color_dest * (1.0 - color_src.a);\n #endif\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;\n#endif\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture2D(texture, v_uv0);\n}\n#if SHOW_OUTTER_GLOW\nuniform vec4 glowColor;\nuniform float glowColorSize;\nuniform float glowThreshold;\nfloat getColorAlpha(float angle, float dist) {\n float radian = angle * 0.01745329252;\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian)));\n return color.a;\n}\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n}\nfloat getGlowAlpha() {\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_OUTTER_GLOW\n float alpha = getGlowAlpha();\n if (alpha <= glowThreshold) {\n alpha = alpha / glowThreshold;\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n } else {\n alpha = 0.0;\n }\n vec4 color_dest = glowColor * alpha;\n vec4 color_src = o;\n gl_FragColor = color_src * color_src.a + color_dest * (1.0 - color_src.a);\n #endif\n}" }, "glsl3": { "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture(texture, v_uv0);\n}\n#if SHOW_OUTTER_GLOW\nuniform glow {\n vec4 glowColor;\n float glowColorSize;\n float glowThreshold;\n};\nfloat getColorAlpha(float angle, float dist) {\n float radian = angle * 0.01745329252;\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian)));\n return color.a;\n}\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n}\nfloat getGlowAlpha() {\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= getTextureColor(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_OUTTER_GLOW\n float alpha = getGlowAlpha();\n if (alpha <= glowThreshold) {\n alpha = alpha / glowThreshold;\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n } else {\n alpha = 0.0;\n }\n vec4 color_dest = glowColor * alpha;\n vec4 color_src = o;\n gl_FragColor = color_src * color_src.a + color_dest * (1.0 - color_src.a);\n #endif\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;\n#endif\nvec4 getTextureColor(sampler2D texture, vec2 v_uv0) {\n if (v_uv0.x > 1.0 || v_uv0.x < 0.0 || v_uv0.y > 1.0 || v_uv0.y < 0.0) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n }\n return texture(texture, v_uv0);\n}\n#if SHOW_OUTTER_GLOW\nuniform glow {\n vec4 glowColor;\n float glowColorSize;\n float glowThreshold;\n};\nfloat getColorAlpha(float angle, float dist) {\n float radian = angle * 0.01745329252;\n vec4 color = getTextureColor(texture, v_uv0 + vec2(dist * cos(radian), dist * sin(radian)));\n return color.a;\n}\nfloat getAverageAlpha(float dist) {\n float totalAlpha = 0.0;\n totalAlpha += getColorAlpha(0.0, dist);\n totalAlpha += getColorAlpha(30.0, dist);\n totalAlpha += getColorAlpha(60.0, dist);\n totalAlpha += getColorAlpha(90.0, dist);\n totalAlpha += getColorAlpha(120.0, dist);\n totalAlpha += getColorAlpha(150.0, dist);\n totalAlpha += getColorAlpha(180.0, dist);\n totalAlpha += getColorAlpha(210.0, dist);\n totalAlpha += getColorAlpha(240.0, dist);\n totalAlpha += getColorAlpha(270.0, dist);\n totalAlpha += getColorAlpha(300.0, dist);\n totalAlpha += getColorAlpha(330.0, dist);\n return totalAlpha * 0.0833;\n}\nfloat getGlowAlpha() {\n if (glowColorSize == 0.0) {\n return 0.0;\n }\n float totalAlpha = 0.0;\n totalAlpha += getAverageAlpha(glowColorSize * 0.1);\n totalAlpha += getAverageAlpha(glowColorSize * 0.2);\n totalAlpha += getAverageAlpha(glowColorSize * 0.3);\n totalAlpha += getAverageAlpha(glowColorSize * 0.4);\n totalAlpha += getAverageAlpha(glowColorSize * 0.5);\n totalAlpha += getAverageAlpha(glowColorSize * 0.6);\n totalAlpha += getAverageAlpha(glowColorSize * 0.7);\n totalAlpha += getAverageAlpha(glowColorSize * 0.8);\n totalAlpha += getAverageAlpha(glowColorSize * 0.9);\n totalAlpha += getAverageAlpha(glowColorSize * 1.0);\n return totalAlpha * 0.1;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if SHOW_OUTTER_GLOW\n float alpha = getGlowAlpha();\n if (alpha <= glowThreshold) {\n alpha = alpha / glowThreshold;\n alpha = -1.0 * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) * (alpha - 1.0) + 1.0;\n } else {\n alpha = 0.0;\n }\n vec4 color_dest = glowColor * alpha;\n vec4 color_src = o;\n gl_FragColor = color_src * color_src.a + color_dest * (1.0 - color_src.a);\n #endif\n}" } } ], diff --git a/assets/materials/2d-sprite-glow-outter.mtl b/assets/materials/2d-sprite-glow-outter.mtl new file mode 100644 index 0000000..9d77214 --- /dev/null +++ b/assets/materials/2d-sprite-glow-outter.mtl @@ -0,0 +1,18 @@ +{ + "__type__": "cc.Material", + "_name": "New Material", + "_objFlags": 0, + "_native": "", + "_effectAsset": { + "__uuid__": "67e9833e-aa43-427a-ba89-d7bdd1ef0aed" + }, + "_techniqueIndex": 0, + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true, + "SHOW_OUTTER_GLOW": true + } + } + } +} \ No newline at end of file diff --git a/assets/materials/sprite-glow-outter.mtl.meta b/assets/materials/2d-sprite-glow-outter.mtl.meta similarity index 56% rename from assets/materials/sprite-glow-outter.mtl.meta rename to assets/materials/2d-sprite-glow-outter.mtl.meta index ee40d49..3f6e724 100644 --- a/assets/materials/sprite-glow-outter.mtl.meta +++ b/assets/materials/2d-sprite-glow-outter.mtl.meta @@ -1,6 +1,6 @@ { "ver": "1.0.3", - "uuid": "16dd0f06-6280-4d74-8483-a50e23c00733", + "uuid": "b82b2ec7-1bf3-4840-b9af-66d2a0250c14", "dataAsSubAsset": null, "subMetas": {} } \ No newline at end of file diff --git a/assets/materials/sprite-glow-outter.mtl b/assets/materials/sprite-glow-outter.mtl deleted file mode 100644 index 8fd1788..0000000 --- a/assets/materials/sprite-glow-outter.mtl +++ /dev/null @@ -1,30 +0,0 @@ -{ - "__type__": "cc.Material", - "_name": "sprite-glow-outter", - "_objFlags": 0, - "_native": "", - "_effectAsset": { - "__uuid__": "89f30b2e-b75e-49b1-9dfc-cb341cadd30a" - }, - "_techniqueData": { - "0": { - "props": { - "texture": null, - "glowColor": { - "__type__": "cc.Color", - "r": 255, - "g": 0, - "b": 0, - "a": 255 - }, - "glowColorSize": 0.15, - "glowThreshold": 1 - }, - "defines": { - "USE_TEXTURE": true, - "USE_ALPHA_TEST": false, - "SHOW_OUTTER_GLOW": true - } - } - } -} \ No newline at end of file diff --git a/assets/scenes/GlowOutterEffectScene.fire b/assets/scenes/GlowOutterEffectScene.fire index 38695bd..1bc9528 100755 --- a/assets/scenes/GlowOutterEffectScene.fire +++ b/assets/scenes/GlowOutterEffectScene.fire @@ -78,13 +78,13 @@ "_active": true, "_components": [ { - "__id__": 130 + "__id__": 126 }, { - "__id__": 131 + "__id__": 127 }, { - "__id__": 132 + "__id__": 128 } ], "_prefab": null, @@ -174,7 +174,7 @@ "array": [ 0, 0, - 407.8979651824706, + 324.7595264191645, 0, 0, 0, @@ -254,7 +254,7 @@ "_active": true, "_components": [ { - "__id__": 129 + "__id__": 125 } ], "_prefab": null, @@ -673,6 +673,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -1240,6 +1242,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -1434,6 +1438,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -2001,6 +2007,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -2195,6 +2203,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -2762,6 +2772,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -2956,6 +2968,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -3523,6 +3537,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -3717,6 +3733,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -4284,6 +4302,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -4478,6 +4498,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -5045,6 +5067,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -5158,21 +5182,15 @@ }, { "__id__": 121 - }, - { - "__id__": 123 - }, - { - "__id__": 125 } ], "_active": true, "_components": [ { - "__id__": 127 + "__id__": 123 }, { - "__id__": 128 + "__id__": 124 } ], "_prefab": null, @@ -5295,7 +5313,7 @@ "_enabled": true, "_materials": [ { - "__uuid__": "16dd0f06-6280-4d74-8483-a50e23c00733" + "__uuid__": "b82b2ec7-1bf3-4840-b9af-66d2a0250c14" } ], "_srcBlendFactor": 770, @@ -5389,7 +5407,7 @@ "_enabled": true, "_materials": [ { - "__uuid__": "16dd0f06-6280-4d74-8483-a50e23c00733" + "__uuid__": "b82b2ec7-1bf3-4840-b9af-66d2a0250c14" } ], "_srcBlendFactor": 770, @@ -5411,100 +5429,6 @@ "_atlas": null, "_id": "74+WCqN01NIbcSpr5gcxmE" }, - { - "__type__": "cc.Node", - "_name": "ball_1", - "_objFlags": 0, - "_parent": { - "__id__": 114 - }, - "_children": [], - "_active": false, - "_components": [ - { - "__id__": 120 - } - ], - "_prefab": null, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 60, - "height": 60 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - 0, - -360, - 0, - 0, - 0, - 0, - 1, - 2, - 2, - 1 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "08wsP0gQdCnrq+UzPWkn0+" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 119 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "16dd0f06-6280-4d74-8483-a50e23c00733" - } - ], - "_srcBlendFactor": 770, - "_dstBlendFactor": 771, - "_spriteFrame": { - "__uuid__": "969fa66a-ae10-4157-b16e-4c1a4665920c" - }, - "_type": 0, - "_sizeMode": 1, - "_fillType": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_atlas": null, - "_id": "4bH5hzKe9LsLQeXjLynIHQ" - }, { "__type__": "cc.Node", "_name": "video_btn", @@ -5516,7 +5440,7 @@ "_active": true, "_components": [ { - "__id__": 122 + "__id__": 120 } ], "_prefab": null, @@ -5572,12 +5496,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 121 + "__id__": 119 }, "_enabled": true, "_materials": [ { - "__uuid__": "16dd0f06-6280-4d74-8483-a50e23c00733" + "__uuid__": "b82b2ec7-1bf3-4840-b9af-66d2a0250c14" } ], "_srcBlendFactor": 770, @@ -5599,98 +5523,6 @@ "_atlas": null, "_id": "f43fJCjNdOS5VHAEhp0yDU" }, - { - "__type__": "cc.Node", - "_name": "SystemFont", - "_objFlags": 0, - "_parent": { - "__id__": 114 - }, - "_children": [], - "_active": false, - "_components": [ - { - "__id__": 124 - } - ], - "_prefab": null, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 97.87, - "height": 50.4 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - 0, - -657.2, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "5dfIaYLgJPQKk50HqrgyHI" - }, - { - "__type__": "cc.Label", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 123 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "16dd0f06-6280-4d74-8483-a50e23c00733" - } - ], - "_useOriginalSize": false, - "_string": "System Font", - "_N$string": "System Font", - "_fontSize": 40, - "_lineHeight": 40, - "_enableWrapText": true, - "_N$file": null, - "_isSystemFontUsed": true, - "_spacingX": 0, - "_batchAsBitmap": false, - "_N$horizontalAlign": 1, - "_N$verticalAlign": 1, - "_N$fontFamily": "Arial", - "_N$overflow": 0, - "_N$cacheMode": 0, - "_id": "d1whc7H8RHdrROcYj+2Qh1" - }, { "__type__": "cc.Node", "_name": "BmFont", @@ -5702,7 +5534,7 @@ "_active": true, "_components": [ { - "__id__": 126 + "__id__": 122 } ], "_prefab": null, @@ -5758,12 +5590,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 125 + "__id__": 121 }, "_enabled": true, "_materials": [ { - "__uuid__": "16dd0f06-6280-4d74-8483-a50e23c00733" + "__uuid__": "b82b2ec7-1bf3-4840-b9af-66d2a0250c14" } ], "_useOriginalSize": false, @@ -5778,6 +5610,8 @@ "_isSystemFontUsed": false, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -5906,6 +5740,7 @@ "_isAbsHorizontalCenter": true, "_isAbsVerticalCenter": true, "_originalWidth": 0, - "_originalHeight": 0 + "_originalHeight": 0, + "_id": "5f1iMtZkxEdIa7zsEtvN72" } ] \ No newline at end of file From 04959cdc13e52a23af4ffde6aadb75ab92feac59 Mon Sep 17 00:00:00 2001 From: caizhitao Date: Mon, 17 Feb 2020 10:23:27 +0800 Subject: [PATCH 5/9] bugfix --- ...-inner.effect => sprite-glow-inner.effect} | 0 ...ect.meta => sprite-glow-inner.effect.meta} | 0 ...utter.effect => sprite-glow-outter.effect} | 0 ...ct.meta => sprite-glow-outter.effect.meta} | 0 assets/effects/sprite-outline.effect | 4 +-- assets/effects/sprite-outline.effect.meta | 2 +- assets/effects/sprite-point-light.effect | 32 +++++++++++++----- assets/effects/sprite-point-light.effect.meta | 4 +-- assets/materials/sprite-flash-light.mtl | 1 + assets/materials/sprite-gaussian-blur-v1.mtl | 1 + ...e-glow-inner.mtl => sprite-glow-inner.mtl} | 0 ...er.mtl.meta => sprite-glow-inner.mtl.meta} | 0 ...glow-outter.mtl => sprite-glow-outter.mtl} | 0 ...r.mtl.meta => sprite-glow-outter.mtl.meta} | 0 assets/materials/sprite-gray.mtl | 1 + assets/materials/sprite-mosaic.mtl | 1 + assets/materials/sprite-old-photo.mtl | 1 + assets/materials/sprite-outline.mtl | 17 ++-------- assets/materials/sprite-outline.mtl.meta | 2 +- assets/materials/sprite-point-light.mtl | 1 + .../materials/sprite-round-corner-crop-v1.mtl | 1 + .../materials/sprite-round-corner-crop-v2.mtl | 1 + assets/scenes/OutlineEffectScene.fire | 33 ++++++++++++------- 23 files changed, 62 insertions(+), 40 deletions(-) rename assets/effects/{2d-sprite-glow-inner.effect => sprite-glow-inner.effect} (100%) rename assets/effects/{2d-sprite-glow-inner.effect.meta => sprite-glow-inner.effect.meta} (100%) rename assets/effects/{2d-sprite-glow-outter.effect => sprite-glow-outter.effect} (100%) rename assets/effects/{2d-sprite-glow-outter.effect.meta => sprite-glow-outter.effect.meta} (100%) rename assets/materials/{2d-sprite-glow-inner.mtl => sprite-glow-inner.mtl} (100%) rename assets/materials/{2d-sprite-glow-inner.mtl.meta => sprite-glow-inner.mtl.meta} (100%) rename assets/materials/{2d-sprite-glow-outter.mtl => sprite-glow-outter.mtl} (100%) rename assets/materials/{2d-sprite-glow-outter.mtl.meta => sprite-glow-outter.mtl.meta} (100%) diff --git a/assets/effects/2d-sprite-glow-inner.effect b/assets/effects/sprite-glow-inner.effect similarity index 100% rename from assets/effects/2d-sprite-glow-inner.effect rename to assets/effects/sprite-glow-inner.effect diff --git a/assets/effects/2d-sprite-glow-inner.effect.meta b/assets/effects/sprite-glow-inner.effect.meta similarity index 100% rename from assets/effects/2d-sprite-glow-inner.effect.meta rename to assets/effects/sprite-glow-inner.effect.meta diff --git a/assets/effects/2d-sprite-glow-outter.effect b/assets/effects/sprite-glow-outter.effect similarity index 100% rename from assets/effects/2d-sprite-glow-outter.effect rename to assets/effects/sprite-glow-outter.effect diff --git a/assets/effects/2d-sprite-glow-outter.effect.meta b/assets/effects/sprite-glow-outter.effect.meta similarity index 100% rename from assets/effects/2d-sprite-glow-outter.effect.meta rename to assets/effects/sprite-glow-outter.effect.meta diff --git a/assets/effects/sprite-outline.effect b/assets/effects/sprite-outline.effect index 5076b6a..85453ef 100644 --- a/assets/effects/sprite-outline.effect +++ b/assets/effects/sprite-outline.effect @@ -1,5 +1,5 @@ // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -// 描边特效 + CCEffect %{ techniques: - passes: @@ -31,6 +31,7 @@ CCEffect %{ range: [0.0, 1.0] } } + }% @@ -109,7 +110,6 @@ CCProgram fs %{ } #endif - void main () { vec4 o = vec4(1, 1, 1, 1); diff --git a/assets/effects/sprite-outline.effect.meta b/assets/effects/sprite-outline.effect.meta index 160aa3f..b7abae0 100644 --- a/assets/effects/sprite-outline.effect.meta +++ b/assets/effects/sprite-outline.effect.meta @@ -1,6 +1,6 @@ { "ver": "1.0.25", - "uuid": "559dcd1e-233b-4e1f-b1da-733c9232f06f", + "uuid": "34c2ed47-4d59-41c4-b91c-157c32e9d0eb", "compiledShaders": [ { "glsl1": { diff --git a/assets/effects/sprite-point-light.effect b/assets/effects/sprite-point-light.effect index 3b6794c..584a56a 100644 --- a/assets/effects/sprite-point-light.effect +++ b/assets/effects/sprite-point-light.effect @@ -43,6 +43,22 @@ CCEffect %{ tooltip: "扩散半径" } } + + # 裁剪掉透明区域上的光 + cropAlpha: { + value: 1.0, + editor: { + tooltip: "是否裁剪透明区域上的光。0:不启用,非0:启用" + } + } + + # 是否启用迷雾效果 + enableFog: { + value: 0.0, + editor: { + tooltip: "是否启用迷雾效果。0:不启用,非0:启用" + } + } }% @@ -104,13 +120,13 @@ CCProgram fs %{ // 扩展半径 float radius; - // 裁剪掉透明区域上的点光 - // ps:编辑器还不支持 bool 类型的样子,因此没在 CCEffect 中定义 - bool cropAlpha; + // 裁剪掉透明区域上的光 + // ps:编辑器还不支持 bool 类型的样子,因此用float来定义 + float cropAlpha; // 是否启用迷雾效果 - // ps:编辑器还不支持 bool 类型的样子,因此没在 CCEffect 中定义 - bool enableFog; + // ps:编辑器还不支持 bool 类型的样子,因此用float来定义 + float enableFog; }; /** @@ -123,12 +139,12 @@ CCProgram fs %{ float a = 1.0 ; // 裁剪掉透明区域上的点光 - if (cropAlpha) { + if (bool(cropAlpha)) { a *= step(0.01, textureColor.a); } - // 裁剪掉圆范围外的uv(迷雾效果) - if (!enableFog) { + // 裁剪掉光束范围外的uv(迷雾效果) + if (!bool(enableFog)) { a *= step(dis, radius); } diff --git a/assets/effects/sprite-point-light.effect.meta b/assets/effects/sprite-point-light.effect.meta index cffa772..bb169fe 100644 --- a/assets/effects/sprite-point-light.effect.meta +++ b/assets/effects/sprite-point-light.effect.meta @@ -5,11 +5,11 @@ { "glsl1": { "vert": "\nprecision highp float;\nuniform mediump 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;\n#endif\n#if ENABLE_DIFFUSION\nuniform vec4 centerColor;\nuniform vec2 centerPoint;\nuniform float radius;\nuniform bool cropAlpha;\nuniform bool enableFog;\nvec4 addLightColor(vec4 textureColor, vec2 centerPoint, float radius, vec4 centerColor) {\n float dis = distance(v_uv0, centerPoint);\n float a = 1.0 ;\n if (cropAlpha) {\n a *= step(0.01, textureColor.a);\n }\n if (!enableFog) {\n a *= step(dis, radius);\n }\n a *= 1.0 - (dis / radius);\n vec4 lightColor = centerColor * a;\n return textureColor * textureColor.a + lightColor;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if ENABLE_DIFFUSION\n gl_FragColor = addLightColor(gl_FragColor, centerPoint, radius, centerColor);\n #endif\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;\n#endif\n#if ENABLE_DIFFUSION\nuniform vec4 centerColor;\nuniform vec2 centerPoint;\nuniform float radius;\nuniform float cropAlpha;\nuniform float enableFog;\nvec4 addLightColor(vec4 textureColor, vec2 centerPoint, float radius, vec4 centerColor) {\n float dis = distance(v_uv0, centerPoint);\n float a = 1.0 ;\n if (bool(cropAlpha)) {\n a *= step(0.01, textureColor.a);\n }\n if (!bool(enableFog)) {\n a *= step(dis, radius);\n }\n a *= 1.0 - (dis / radius);\n vec4 lightColor = centerColor * a;\n return textureColor * textureColor.a + lightColor;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if ENABLE_DIFFUSION\n gl_FragColor = addLightColor(gl_FragColor, centerPoint, radius, centerColor);\n #endif\n}" }, "glsl3": { "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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;\n#endif\n#if ENABLE_DIFFUSION\nuniform Diffusion {\n vec4 centerColor;\n vec2 centerPoint;\n float radius;\n bool cropAlpha;\n bool enableFog;\n};\nvec4 addLightColor(vec4 textureColor, vec2 centerPoint, float radius, vec4 centerColor) {\n float dis = distance(v_uv0, centerPoint);\n float a = 1.0 ;\n if (cropAlpha) {\n a *= step(0.01, textureColor.a);\n }\n if (!enableFog) {\n a *= step(dis, radius);\n }\n a *= 1.0 - (dis / radius);\n vec4 lightColor = centerColor * a;\n return textureColor * textureColor.a + lightColor;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if ENABLE_DIFFUSION\n gl_FragColor = addLightColor(gl_FragColor, centerPoint, radius, centerColor);\n #endif\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;\n#endif\n#if ENABLE_DIFFUSION\nuniform Diffusion {\n vec4 centerColor;\n vec2 centerPoint;\n float radius;\n float cropAlpha;\n float enableFog;\n};\nvec4 addLightColor(vec4 textureColor, vec2 centerPoint, float radius, vec4 centerColor) {\n float dis = distance(v_uv0, centerPoint);\n float a = 1.0 ;\n if (bool(cropAlpha)) {\n a *= step(0.01, textureColor.a);\n }\n if (!bool(enableFog)) {\n a *= step(dis, radius);\n }\n a *= 1.0 - (dis / radius);\n vec4 lightColor = centerColor * a;\n return textureColor * textureColor.a + lightColor;\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n o *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n o.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n #if ENABLE_DIFFUSION\n gl_FragColor = addLightColor(gl_FragColor, centerPoint, radius, centerColor);\n #endif\n}" } } ], diff --git a/assets/materials/sprite-flash-light.mtl b/assets/materials/sprite-flash-light.mtl index 3fe07bb..4f1af40 100644 --- a/assets/materials/sprite-flash-light.mtl +++ b/assets/materials/sprite-flash-light.mtl @@ -6,6 +6,7 @@ "_effectAsset": { "__uuid__": "e9682cd1-a19c-4fcb-ad8c-cf1783b805e6" }, + "_techniqueIndex": 0, "_techniqueData": { "0": { "props": { diff --git a/assets/materials/sprite-gaussian-blur-v1.mtl b/assets/materials/sprite-gaussian-blur-v1.mtl index 438c884..673c60a 100644 --- a/assets/materials/sprite-gaussian-blur-v1.mtl +++ b/assets/materials/sprite-gaussian-blur-v1.mtl @@ -6,6 +6,7 @@ "_effectAsset": { "__uuid__": "41f4d474-d707-45bb-af93-637573f92d54" }, + "_techniqueIndex": 0, "_techniqueData": { "0": { "defines": { diff --git a/assets/materials/2d-sprite-glow-inner.mtl b/assets/materials/sprite-glow-inner.mtl similarity index 100% rename from assets/materials/2d-sprite-glow-inner.mtl rename to assets/materials/sprite-glow-inner.mtl diff --git a/assets/materials/2d-sprite-glow-inner.mtl.meta b/assets/materials/sprite-glow-inner.mtl.meta similarity index 100% rename from assets/materials/2d-sprite-glow-inner.mtl.meta rename to assets/materials/sprite-glow-inner.mtl.meta diff --git a/assets/materials/2d-sprite-glow-outter.mtl b/assets/materials/sprite-glow-outter.mtl similarity index 100% rename from assets/materials/2d-sprite-glow-outter.mtl rename to assets/materials/sprite-glow-outter.mtl diff --git a/assets/materials/2d-sprite-glow-outter.mtl.meta b/assets/materials/sprite-glow-outter.mtl.meta similarity index 100% rename from assets/materials/2d-sprite-glow-outter.mtl.meta rename to assets/materials/sprite-glow-outter.mtl.meta diff --git a/assets/materials/sprite-gray.mtl b/assets/materials/sprite-gray.mtl index f9abe9b..fcc0165 100644 --- a/assets/materials/sprite-gray.mtl +++ b/assets/materials/sprite-gray.mtl @@ -6,6 +6,7 @@ "_effectAsset": { "__uuid__": "2e5b29d9-dd5e-4f3d-92e9-e580745b3bc8" }, + "_techniqueIndex": 0, "_techniqueData": { "0": { "defines": { diff --git a/assets/materials/sprite-mosaic.mtl b/assets/materials/sprite-mosaic.mtl index 8b83907..dd551fa 100644 --- a/assets/materials/sprite-mosaic.mtl +++ b/assets/materials/sprite-mosaic.mtl @@ -6,6 +6,7 @@ "_effectAsset": { "__uuid__": "9638979d-62b3-4e5b-adea-7ad706e66e65" }, + "_techniqueIndex": 0, "_techniqueData": { "0": { "props": { diff --git a/assets/materials/sprite-old-photo.mtl b/assets/materials/sprite-old-photo.mtl index c74ad15..c64a7fa 100644 --- a/assets/materials/sprite-old-photo.mtl +++ b/assets/materials/sprite-old-photo.mtl @@ -6,6 +6,7 @@ "_effectAsset": { "__uuid__": "211eddf3-c53d-46e3-8c09-c1bf38e644e2" }, + "_techniqueIndex": 0, "_techniqueData": { "0": { "defines": { diff --git a/assets/materials/sprite-outline.mtl b/assets/materials/sprite-outline.mtl index 9420314..1dc98d0 100644 --- a/assets/materials/sprite-outline.mtl +++ b/assets/materials/sprite-outline.mtl @@ -1,27 +1,16 @@ { "__type__": "cc.Material", - "_name": "sprite-outline", + "_name": "New Material", "_objFlags": 0, "_native": "", "_effectAsset": { - "__uuid__": "559dcd1e-233b-4e1f-b1da-733c9232f06f" + "__uuid__": "34c2ed47-4d59-41c4-b91c-157c32e9d0eb" }, + "_techniqueIndex": 0, "_techniqueData": { "0": { - "props": { - "texture": null, - "outlineColor": { - "__type__": "cc.Color", - "r": 255, - "g": 0, - "b": 0, - "a": 255 - }, - "outlineWidth": 0.002 - }, "defines": { "USE_TEXTURE": true, - "USE_ALPHA_TEST": false, "SHOW_OUT_LINE": true } } diff --git a/assets/materials/sprite-outline.mtl.meta b/assets/materials/sprite-outline.mtl.meta index f217ec0..35161de 100644 --- a/assets/materials/sprite-outline.mtl.meta +++ b/assets/materials/sprite-outline.mtl.meta @@ -1,6 +1,6 @@ { "ver": "1.0.3", - "uuid": "daf44951-2c80-4778-b99f-52cfc78ab053", + "uuid": "df1eb418-ec89-4e04-a579-03fcfbc315fc", "dataAsSubAsset": null, "subMetas": {} } \ No newline at end of file diff --git a/assets/materials/sprite-point-light.mtl b/assets/materials/sprite-point-light.mtl index b6aad2c..7466452 100644 --- a/assets/materials/sprite-point-light.mtl +++ b/assets/materials/sprite-point-light.mtl @@ -6,6 +6,7 @@ "_effectAsset": { "__uuid__": "72a182fc-08a6-4faa-8e36-8bd84b4a0b53" }, + "_techniqueIndex": 0, "_techniqueData": { "0": { "props": { diff --git a/assets/materials/sprite-round-corner-crop-v1.mtl b/assets/materials/sprite-round-corner-crop-v1.mtl index 5949806..7c185b4 100644 --- a/assets/materials/sprite-round-corner-crop-v1.mtl +++ b/assets/materials/sprite-round-corner-crop-v1.mtl @@ -6,6 +6,7 @@ "_effectAsset": { "__uuid__": "a4afedba-5234-44d7-9031-cba83051d521" }, + "_techniqueIndex": 0, "_techniqueData": { "0": { "defines": { diff --git a/assets/materials/sprite-round-corner-crop-v2.mtl b/assets/materials/sprite-round-corner-crop-v2.mtl index 0f15feb..ac4fd55 100644 --- a/assets/materials/sprite-round-corner-crop-v2.mtl +++ b/assets/materials/sprite-round-corner-crop-v2.mtl @@ -6,6 +6,7 @@ "_effectAsset": { "__uuid__": "7c24b57e-e819-4fc9-a8d2-b06cf61b782d" }, + "_techniqueIndex": 0, "_techniqueData": { "0": { "defines": { diff --git a/assets/scenes/OutlineEffectScene.fire b/assets/scenes/OutlineEffectScene.fire index 18da751..11ce6b3 100755 --- a/assets/scenes/OutlineEffectScene.fire +++ b/assets/scenes/OutlineEffectScene.fire @@ -174,7 +174,7 @@ "array": [ 0, 0, - 492.17758360225525, + 324.7595264191645, 0, 0, 0, @@ -658,6 +658,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 2, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -1225,6 +1227,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 0, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -1367,7 +1371,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 384, - "height": 583.73 + "height": 590.4 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1475,7 +1479,7 @@ "_enabled": true, "_materials": [ { - "__uuid__": "daf44951-2c80-4778-b99f-52cfc78ab053" + "__uuid__": "df1eb418-ec89-4e04-a579-03fcfbc315fc" } ], "_srcBlendFactor": 770, @@ -1569,7 +1573,7 @@ "_enabled": true, "_materials": [ { - "__uuid__": "daf44951-2c80-4778-b99f-52cfc78ab053" + "__uuid__": "df1eb418-ec89-4e04-a579-03fcfbc315fc" } ], "_srcBlendFactor": 770, @@ -1663,7 +1667,7 @@ "_enabled": true, "_materials": [ { - "__uuid__": "daf44951-2c80-4778-b99f-52cfc78ab053" + "__uuid__": "df1eb418-ec89-4e04-a579-03fcfbc315fc" } ], "_srcBlendFactor": 770, @@ -1757,7 +1761,7 @@ "_enabled": true, "_materials": [ { - "__uuid__": "daf44951-2c80-4778-b99f-52cfc78ab053" + "__uuid__": "df1eb418-ec89-4e04-a579-03fcfbc315fc" } ], "_srcBlendFactor": 770, @@ -1851,7 +1855,7 @@ "_enabled": true, "_materials": [ { - "__uuid__": "daf44951-2c80-4778-b99f-52cfc78ab053" + "__uuid__": "df1eb418-ec89-4e04-a579-03fcfbc315fc" } ], "_useOriginalSize": false, @@ -1864,6 +1868,8 @@ "_isSystemFontUsed": true, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -1897,7 +1903,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 167.5, - "height": 33.33 + "height": 40 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1909,7 +1915,7 @@ "ctor": "Float64Array", "array": [ 0, - -567.065, + -570.4000000000001, 0, 0, 0, @@ -1943,7 +1949,7 @@ "_enabled": true, "_materials": [ { - "__uuid__": "daf44951-2c80-4778-b99f-52cfc78ab053" + "__uuid__": "df1eb418-ec89-4e04-a579-03fcfbc315fc" } ], "_useOriginalSize": false, @@ -1958,6 +1964,8 @@ "_isSystemFontUsed": false, "_spacingX": 0, "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, "_N$horizontalAlign": 1, "_N$verticalAlign": 1, "_N$fontFamily": "Arial", @@ -2003,7 +2011,7 @@ "_layoutSize": { "__type__": "cc.Size", "width": 384, - "height": 583.73 + "height": 590.4 }, "_resize": 1, "_N$layoutType": 2, @@ -2086,6 +2094,7 @@ "_isAbsHorizontalCenter": true, "_isAbsVerticalCenter": true, "_originalWidth": 0, - "_originalHeight": 0 + "_originalHeight": 0, + "_id": "f7GTkBg4hJMpPgwjS3Vbiz" } ] \ No newline at end of file From c86c14c972b5a5a799cdc3dccdc93668da81d0e4 Mon Sep 17 00:00:00 2001 From: caizhitao Date: Mon, 17 Feb 2020 10:24:47 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20template-banner.png?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template-banner.png | Bin 26646 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 template-banner.png diff --git a/template-banner.png b/template-banner.png deleted file mode 100755 index 2aa766ffc0eda2f72638594c3a7e801c0a62d373..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26646 zcmeI4bx@qm(&!gS2o^MWaEHa+H9&9;?u%Pk2(G~)!QFx;NN{%x5`qMm;1Jw```zSq z&N1UO=b5MK*0005!NTvSv+!OYgd7Hno~M=T{ON^ECuYhrE%0sx$+ zKE|0UD4*eV&Vl7zGbo6ODMl1vX@(x4y8<4p>ywd3z>0*C2!AS~FPhgxMH2=IV+&(y zBNAH*ikuQAdX*cRVgd)dY_)vV~J()#u`rgE9`kiy2;bxWZ2HeC4sL*n+)ef0@9Naqa=qi3t;sw?m_POn-CJJatA`Ggf^;t2MYW%(nuU~Tq$v}AS6W+x`-o5 zG^MZ@GF8c^KUnS2xdXMIxkk823bOb$hzn%lJQq#;z-;kGPJ&;N0nev1<3JIu4yRA_ z;A@{5uI3v;k>o+}n(86PRA7^s1XIh01VWPlZv8ZMVl4k0ecS|SE&nHmIqK|V-j#-_ z6S9RUZvGx^Xm&^hh^yWQt^Ny(FQLB~exvpY z>O%A$=_R^5R1>D&YeAo8@8&l|9nDmzk6d9nT3@3+lcY38kHg?VJ4VHWxAr4!0~q*8 zlH;Ln2RC(4lcs+l$3k^NLqQurw?%~uCX!N#qUrI+6nRe4Be^M=ll?lIH5)(MG+VI@ zYcga@_AM!5Pj9zY_eIag<;`W`AJpQ>ZMmmPi`0oRl`$;OVOF45NLHT4K4*XLs<^5^ zF~UB=vVpciVIg>gAsc8SftcNwm1mZ04rgXv;a1_~z%!H7pYeV$_OS1e=iKGo=v)Fh zARz0Zyy%Bg%`A~DsilBUOWCsASjrb*ACokbyzk6?n@PnL-I`;XKAP?yRW+YzQdPQE zKC8f;>Yq}anw(0mK(Wvp^DGh_DIJ3!L)%#1+#2RCW^HM~!3q-!@Gea&O@Hab+)d6j zDMQE_t?V>)@d(owkrxdN0it4*;@iudBD`jhN zZ=C+7c`~TJt7`gjCAb`8T6IFFT4H-s$;d z9@Tx{AmCE(M%Nhbdb7SXAH4z|Ts@OH{&JXjVfy$q>Eee+f&0a!x@VrJ;Q7&6^4Y;v z!Bx5)J(q|a@+$6lTyhV8hsV=-%y*Bt(Dq0MdF?>@TBulv^B}@Tt)|!! zZjf!DZQ>VZHP98&X$$Ol*Rj~ql)WxR7hOb&PbnRxr4&R1Ps2__27bM|lfcV0V6EHQ zzG~(7NuQgm{J+p0lWop^TF2xgfD$a7Jd{P%&fP?km(P*D6gSp-xKh z{6v;f&MR&qSutf_dzo&E0T2BmRQgjfxlfdRPx6r|r@^-LWbtWe;1jfvBm#0%Pr1;jycoLTJS&yCymRoCJ)ONE zgOs|xRo=1EdP#il+jwNURZ>Vo)y52 z`xWKsNNXfl9*;Z9ZHA0rRSLZHuxxsHopkB5E7DxRI7qF4d1$jYsc^=>7JatM zt2kpzo+C(KPnFtrtqkGj#PZVcs`6fZChgUHrLi+rw<%p)bNNbKNPNjAYX;xRYl7?> z*oe{8Ry5}&NO5JAh(d7oBf>|E{Hh{`8HtJb`rY+wzpGS1mur<5M(WBc2S?spLVDIR z))J`_Iy1squeCP5x~g6cX1D~_p};-0F}E}OU@>Az&jT%?BB6Vka(F^}Q(H_?o3m?#XDnZiTtKEr*m9RtZUytX*FoQupMZc0aIP~&&;|s zdN}zzrO!prx`72xuGe0(qwJ#~5}EVUdRQISoO4dk;az;YkUN1p(sM(-urBXylvbedj>P<)@Rk1whgUCP)KD z;S-cT4B#U&aS{w_7u3k8>eVGbH*OKblJ1BJz1q#Bc9l~x za=>CDm>B{tD8Q-$(Xu8w9Jk*nt?8Kww)(dn1teE0B!?*}v>TZ_e(^CjVgy-%tRW^~NavaVZ5QnRIOzOo{*P|_ss4|ncQ7~kYjXZ!`&08D z%|OoP|H161<~Ornq43)b@j>E`N7No<;9zU7Vry$9@LQDqbxebt(tbu2F}19Lk-5#! zvl|T`<87nAX8bRIATa|6kibt{AQK0Wg-eB*n}?a5hnb6xiHnDc>2FSct9i?ZEF}7k z4IB*q@WKgXVgoWmyfE{yGx0F9{oTty>fZKaYiw@f@?UxRtL8s_$jb6a*?=7kY>Yrs zVgit{Gnktj^KhAPnJ^g`asxq3oGd^#BUWP|7Y8c~kduX-iQUN1$cV*=_17T(Y5p&+ z#cYine})po^>0hx*wzT*{?7p6;bJr3He`b^1hF$i5HNFc0lAD!41wGxAP!az12zs$ zR+c{+`kS+VX-MAQ9Fmy~to~N#=U9v(jj=Lwn=o^*vH_V`A*q9ni-QGd05ai*@MdRY zW-(!AXJ%#lqltgx=3knUGzUZC$>ncx28p&`xknlF@}H%DD6GtX#i=w|?fjQJSX)Yi(@Ue?waBmmiy{$26EwSwHDRru`= zt$>(0*v`tp?6aCfETg88~`gsM#^9!Xii?pDk!T)!LL*8E#bjlV3pAVhw(_RH{Zir)=?i=@9@m;Xxe zzm-C+`XL7n#y?LS|C0Ov+$8@ezx*|#|4Fa6eBC#43&`E#J+8a?+|u6Tx&`EJ@gCRR zd~Rv)aoqxPw|I~1Za%lP_qc8Wxm&!)bvK_|+Iw8LfZQ$K?{VGD z=a%*!*DWA-i}$$h=5tGXkLwnYyTyB4ck{WWy~lM6$lc;SuDki%(%$2`1>|n=9@pJ` zZfWmv-2!sAc#rFDKDV^@xNZTtTfE10H=kSDdtA4G+%4YYx|`1}?LDqrK<*araox@5 zmi8XkEg*M`_qgunb4z=V>lTo^#d} zY435}0&=%_kLzwex3u@TZUMPlyb~9~U(fJ@Y#VlM*u!{54R;o*k_Nd3I;K_F7 z3&*3Tyvlb^3`m3$Mq5yg@F%$@_KjI|d%{?88TV7*al3-!mw;XSH>@NwKn2LfbjBjVDidy)kde?E8xk+ z#kJ>&07;HFLqnw^6E#guMbjC9yt_$ctB?9wN;;3 z_3;Mia)I(D^gGnnm;~pvwN_Q_M}eDiJ7nSK!GMSLow(a+>Msl*uha5m zfiAo8qp?J%Z^t)f^%PL_s|D&bs%$6Ys$D;eG!i(AFJ6{VU)EMe7QqM9cZQ<1(D#8a zgKcrT(of3~5umrnBsd_=5L7ctBYD-aOfY?Gq`oZI*a)nr#91d~gz_@A+79VZMY`3-t%kc=VnN+Q>iNFku)-+S)s0H8FB`#URTS|TD5_Ivt`qT^^r)#i% zjqsy!ts`C7GzKJY+;yO0G-Bq%2wQACjLTDD+;^zpt2-(Z%05I)i%)AnDrV2$;6*i(ka(u&xa04w4C#r+- zNMpmrpAG?|Xho<>@OZ}RVoXq;GI}HBiBJ_c%?$Ka5WO#-Hf*@`DH&MkBJ|ArOdX$` zY-R~56^9Wo%TA+-8nFv%Y3;bVbh_$VoF`SyRMnerY5-9y1`1j6AvD}7sXOyiK87l= zP#|{)qt8MbWU?s{Jk^7gdee`O$ils}xXY~Zj6Qg}EHN8TV?q8Rtg5D~t>`$%MVw!Z zWh`(H)`xx)I@o%kT_ngH2}@G~{mh)fgz^O=EK>Ch2`sK+?RS4)X!n)5#`fBi&nP^> zspujSm~8#XTz-C$JKXO)6zi<$Y1>=^9x#-|cNr^VNCEhS55D-x&yJ&1&QL}?pcn*n zuw^3-kKNpz> z&nJu_-_3V`5Ji@_RRx^GL^r;Ovkl(L@VZKxsX8iH@ugEQsz+@NC~cCWe7KYiM)R@e z1w8oIJj64)~bED~@!9}H`#t4m5P;4g-;bpfX{J{xiKt&y<{<# z)?L#4IS3B$3>5a~c8JO)mvsTs%3by>gVe(z4G}99P~2Xo)`?p3AsZj^+R)ZySV^8E z;(rUVqg;qrddsRF&`?2H4x0yFKYBSe^8GwF7BNSNDo*32fM5pojwX?h!e`2iFQX|< zOe$&2<2p@BlH?*GtN}dOykcNC0UAc@L9Ii;3bk?^=;U)3N1*fUN4~`h6zum;>bm{$ zGGWC+q=)mx5=&OryF6%I0U#46%3Q6A1Ucwb%kmY6&U_)3m26#7OBZwH;6)^Z=^R2` z+RU)rXx1+k30*uK$#{FQp?^=sxx@1skVBw0uJ$lY3j3};%8X|IRSnDxPY5EeYO;u)l zDArv7p<8;gO2@a^`&|jFZIIG9BdniA19gCiCKL_q@dMr6nZj8%Ji|End>yQ&Wqxl; zvAjJ~2jta!V`)yZ4bJ}S)>4M8D?wVO9hHZPi{hHcLj*m~Ps1T_~$<0av0yc)^pL}aqxnSVipVOWy((|UA zNlL+wNqW6%&r#&bL9(VBv-U$nF#hxN#eKH8j7&=lsnhtr=f3O$W#&@uY{ERT;*sUX z2&)mEMOW>`=u>veJ-derF`u;rWj@Ct2_B)Cg;2vQM%FG@^Le~`ag^q^$DrX4=};$; zCxY?|!~^bv))DO`K9lUHN=De-Fba6CdHK{mKYD-U50|UsMRn;JXP3t=s3)m(=DwQg zV=HWq48CTVO23j~-jI~jmz5b(SrHwNi8{=Q>UDdD2V)jMEPzTCT?U13wa_mWOJ3ne z=iVL8m|SjrQ#Xy!wmVUpsv~$qgmiLJvW}rguB6kYC3v@;S1t>J--EM&#f*%V)8v`(8uIjHL2`2l+xG-~5R>#abn zNkpu&U|>kxzub+vo`*D)MkvHJ*`?GH_XR6f!&Y0vxxcFUh7?yTlh!x&=EAllhuq8@ zRt7meLso0olnt-|Xqp0%uynpWzPW53WM`6^uvK_kwTIYPVO(#8?{SvmjW5eyl z*`;SsD7s_`UC;xLF()gNEK%uZ5!bmo0*Ocbrs}a-`K45^RNuLg2>5NeV{zM?CGkEv zN^ZgTcOc*%4BtuM{@2CQqHD{$*_{A5O8IW{dhTv=#35&(Ejvmu%X5;eL5txfB zxIg(6C>Bqa#1ZMbWDwK8{g$f!2WwESY|iT<9eJL?ux}@To+ZZ2;u)ltN~bI4VEkR7 z?diZRm*C~KmsT{)j!%GfSTB##iTNUBF5YgTJ5l!ZmzNp8cs^T4R<(|(SI=k29S8_~CD8W6$tw-@ z-6`#w=Zd1M-nm|OEU~oh&A^DBC)q~Q3G3`WfzOj_Qph-Q*B90>=5lt$@UKCf<<~`w z@2a(XyT8Uqden2BkGy7U+Qh(#!={^h^!1r~J?_fjD>JVNc+p~ezw}__;e)AH0T*@V zwL3OL7_Yl~kl4MkY={LWWN&7z$yw3qv_pv`LFA$sQX2+$A3?ZQvauKgT1#~N;xKp*9$Y0%iL?q22X zuuCWN_}iP}eE9n7hlZ&rOByTQ6%#_(PpvP^YiHIC^i1iRuU6)k*x6Lr`}g9A6eQ*S!Twr{@;{&)R>p~4Q{KwR#NUeuG%s7GgHk3MU$m>P%-3|intZr!(Wjl|P)O4hV zlL`omE5FN8E@33dkTkqq*>zu&J|y6MB(%9hh1$~Dm;U~tB-Nr-^Da1o0BSzu#DfES za^f(Y5~1Dw;H-=5GV`??j``9XDx$^C@Ei8Dsa`I33-7N@?GGMsIc}lC1g4R!v76-| zMy2jfNn&po#bOibnw={F;)+y#wE#JP$p)sA65bL zkTgb~@fmNkmHIG{$`&M404qwAUynP?%&_Tjwja1F22e$*_|xOTC_C(&;Yz%^ObE$I zc0PIE9BkksC9Y=BRR<4fr<&rLy2c_Y7Pjtqol7G_!HSbKoUss1g@eDI#j%yaVvJTY z0zLTIIJ9E4Co2$Pf^?BHfxx5E4rnlnzUP2d8cq43cuxs`9~C|!p{`D7q@Eter%h*> zAMX1O!6ZB9C_Tkm612`hw4CQ7Tk4S2knoJrVyfhn#l0fyQ~E|!X}GLP6m5V%h ztqJr)N!8X3mL3|m;r7TzUdeEjc}`U})rij%GUR14ot;vhN+V)?^m)e^hj>VGKpZJ6L=k?p{L><^G1)+Q(hT%Awpa^mMAYiDw{9~vH_P{}-9hOdz!cyC7Sp3W1mG_w}cHTFj%I>Ol|xVc4`^j)^=VwVr0igk&@KTkiY{w7|N zi5I?rD%wPM)A%|R{pH){eKw8yHK2?hs*Wm?;{zSl?^o|+7c#3V4OeUw(HJ^=(jbB5 zc}i3BV`eS)^@kI|<_EolK@VlW9k{M^HOZFkGUcy``VmNPSWou~busX4;T#ndWrAi# zPp`MqgB*!Eu=6rpKfXquJzbBlxkPCSvv8jO&X^f?q)&=)B1N^dbu}u8u0qMxbRiX| zeL$$zyxDGCREJE#?5k8u;8uuz(P8;uATJNv5o@RuyU2Kk>IRK_?Da-C*50R#)NnGt zgDVFsoEg2=+Qf@qcSe8e_ z<8^^i_WEMoYe$&UZ8{bH5j*A%>+EoU^od8>mt|D6=AQXb6ubFay{P9MUoW3f$I5-c z+7y)Ib9rT+HzR+Im?uWi=qfIJ8mM>r;+5?gl&5sN>3Z0%Q^Q*Wm;Lc#a!XYvLiy#jsJelo-tOsxMSqWv$wlO&L6^6D5V{{MMXzK$49uTR=Y0ewojDncV5x!7!+Nsn{noJaKI8r|o44MVk`KzpRfC|oR;=|MNZ*BonQ z3=E(wfkRO+m;0){B5~3WRumJMDIjR;U zTO5VIkU^3KI>=)92F;Q4x`yqvl4Y}S=qhLN7=Km5ct@&_)t0-{%HVoT^r=6uK8Mcl zijt)GEh%wgF!SJfGPEYAqyJP;;CEW0Q3I4DTJ;bjS+ta`31Kf<7<3uYPb_Q>vcifn zQKd2ArA!>EB#WGhTb^%PRpMmED7RS6f?Umuek`!3X6fY@;-seX;>eklIK=Ab*vhqB zYNNWe!pO`$tYYdLQQe?xP&t)#kZnz-OHe4fL~6qphkg3u+tqi(2m%s3|{QIi1Bm0%z~ES^e8Q*AyKO_jY+x8nSvqFg|WrU z^QA@Icg0b7jLrYi7v?@!X04NX^7^TVlDXwp>R2Eb9esnK)N)DaSZBb(^F|XZhUf4$ z_RCz2GqyvVJpQ?~BVsa11@5PXi~a2U@#^SprA(?WZX@$abs3eSUB z_IN_VP#;Ot@?i>`DB_hSjhBIyuP2T&DiFO`GrFv^@5kH2=UI`F4+2v{RBifedK zCHjz&YgRAndAx_gf#X3<#4sx#%=w%jPMohsMip41=k@L|6HR1hnIH{BrDeAvh#=&sCPssu1oh?jhmXC z4Ui9UG`8;>23WK8tQqI~Nu;A4z4Q6pZ26G_ZD05vZzq}b+C?AlA`r&~elEcl;BFXm>fy!5^^|i7H>G>+mHY}QHsJwuixvxgWCMUN)*4s=P*Udzv z?oxEs@5L}TUY=N9y9{l|>O;ZGkHRz@_qdgG)mcZQ3Rkfb&wVLf;(CZteKoCwJ+Uk{9wxTD3y?t;$|SdUd3_v!j^P?iyd3)INmPWrU^5Eh_*2nH9PM`Wce>y3*B+2Z+eYKA-$EL_G zxJJRgN1QWK+Z&c^&PT%eA{?4I$^x@)r^pQf&sBS$HSC@t4)PD5C+&Rmhn!8#F^Cw@=WVg5MSQ?VJ@v!`0rJGY zM>4M(WV(upjO|LozdLy(J>m3xWW9ZXyY2jV6RB6pp`Ga6il5-nF*^T6x&-oA>ETqL zdMowDsF%p)i*(UM9!Yz{N35uyhTV~am77IIbf8*F`KP720wt+-KVgSNy(uKK2JNr- z4TJ5dpo-;=tkYp;L@7CBPSUo+4k5ewcS^jmxu98l;1W#NV0{%fiGhSr=L@}yJl{PxC;sPi`)YiVt_<~OWY~TP-SJVDHVdIHd~;iSmb`1OU^oF~ zU@*Pfw{vC@c3C;3jl34^b2$JH$~MJ!t>6_cDX&!$T1H;sn%u;me0+uS_q+0+rnCrJ z9Q3JpuLtxXDf z#cbG=Jy}*DA;m7yvA_Z1W5EMa71h?EC$kGXCrQarT&1fty3VI=6GKw8pE|p0&PCIk z0eJI!ZJK%JSSZ1Ka~uK=A#WSy7g;N#DBi87I$@vB+txJfT{tESvMzZn4z)?95*|8d zz5x(S9nc4>jL~Et;%BooA`v)+h)^C;C*~o|M#Jf^96_$PK_Wa)>Sy3yWzhP5j_}_S z1X$X>GdZH%LW5&Vo47%MoVkN|q(=sWIo=Y^%6FS8VDIajA!KdyE__bjS7jgKA$ZR) zUOk%?Sdx>?v1Uvty%y-5B_lCA;*W$$V?m^mpbrI4ELT?Ed&o6C8o|hW z&#`ErY7`VSN1R#;ucE?R8&E;coG7w8gM2CBzVJL|MGn_lev^SO_t~J)yT?32KHX9)xH6IJ9*3;+b{15gJ3#LbPa%G!Mp~K+a3OKkA4L=DyfEABp2b z4nbvQBw~XF(Pg>m^sW{cdP7tEYLb3^b9hVx#oL z8-*e2uYOZ$eNuW+dg0=@=>bXH+l-eftz)JG1a#HBl`ipf?%0lf1;LP2oBPapNdi%A ztaMc>R|!|lHSDX=1;GGX7&;NY;rv>G*kwSpUPNh|W8YzfTn8@CcWwDsO$sd>JEV$w z75;nYynr>Hn!q08{XY66+D8{iZ30G`n)SOSS&&=oSA<_bE)SR2?|}joX2F_xb$R$KkgvCjI4W32u*$1iIc9-<@VzTn<*vB}XM>w&q}eP+H2Yh=LYZcX66>2+Q9;4%SN*q;dVhv~kK zpIAixqbP~=@1yBn$&j5Rsi-EHVth{ag8@ZeumO+f5kEb*;)Eabl6NQX!jM!2+|;cvTC zaOaLtSh0hTs}9;k^+1`$Z-VAhh9{`r3Jf#>Pk2vQ_}511B9g>!qy>Rz+FQ$>=pKQo zIrD?P9q8s|8ZOt;LbGeET7o32h^J6UZ&wgFJ53qBQ8&+OuNc|U3wQOv`$`w(k}CN~ z%G>?uF329@IC?^u-%cp^xNDt@U08K6lg0S!OZyaK+TNt^OmP`QF0{|4#ziWM9w@(9 zo4K(x3`R<#HOqr9DI<~Wwq#0_93JEEyk5#OwoV>>V=xAU$N2p5YiZu%kxHitNHpRI zh(_ueUFsZioc5CEg7Slg8!w@bfkjQ|b&)6}RAZr{M`cOK_guSBdsO0(dqc&E{TCxt z;#6e~*u?D$ZGGoMrkNat7nilj4Mk--hQs72;awdVY=iZ2X#?FlanqldH*mCUAk?9tvUV2o+rVCGp#}_OA$2rB1YYrr9(87Z>U&5k)oEX!!9yB z4nBR;c73zc{}hR0h&rUj)M7-89$NRQ@{2t!o`53AZ4aEfr8oTrxk8vI!LX=3)+gk# zR-M!yrY*JA4xN;7-IxfRKOTge)-m|C?}v8{cjTsoB^S}c^6`+Q`{X0!Mroku(bwg^ zEAY+J9%GpQ%Ir8=yQ`8EoHs-|$X8=es`^VskIbe zq5)r;3Cn_e=TIuBBYjhvb}209^18=ieb-TzB(@4SSq4oyJ93ETZ7EW$jN12@e&$Sf ztU;p>6j$8XyLyH2BT=LWhmF=UM<2h`2h@(hG7zxC<4#L?Qimj{;jqL*+HmV69XzwC ziZL!jr%4?aS6TU1ZMU);+a-?Z$QDNa;xfA2e)Pq3ZctL?!1r;#tp|bxcCOBgTfxc$ z=JMK2B^`N>)UaeuUDDdSQ*Ga+u3k4@HX_L;I)+ZV8v_uhP<8ejB9x+Le@JN|(EPv` zb9CIl(rvcv>rda0fpHsphF37FTmYa3a$XJdQ9@%+Q%wBmOhq}XjN5FscH-mKb#`$$ z|76Q=ic&R4TI-CXUkcRjt)bPZ2zkY2eG=ja#-{Eb4ekeBC=;*YYz73@Ru>qeB0s6PTw^Lvt7@j+ zT!-zdXI9Aju3s=A?o2wuEPOZ8_FzbZr$)eSOx#J_O@EW5#20BpQReWzL|HG|!xjl3 fMGP}>V+#<)314=lF+TqJyXR8ka$-dy`o8}MjESP# From bc952f3083fe1888863d0fcc047aa91fef82c83e Mon Sep 17 00:00:00 2001 From: caizhitao Date: Mon, 17 Feb 2020 10:33:13 +0800 Subject: [PATCH 7/9] update README.md and CHANGELOG.md --- CHANGELOG.md | 4 ++++ README.md | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4153d2c..947708f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # ChangeLog +## 0.9.0 (2020-02-17) + +- 支持 Cocos Creator v2.3.0 + ## 0.8.0 (2020-02-07) - 支持 Cocos Creator v2.2.2 diff --git a/README.md b/README.md index a4f3eb5..52c71b8 100755 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # Cocos Creator Shader Effect Demo -[![](https://img.shields.io/badge/Release-0.8.0-green.svg)](CHANGELOG.md) +[![](https://img.shields.io/badge/Release-0.9.0-green.svg)](CHANGELOG.md) [![](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) -[![](https://img.shields.io/badge/Support-Cocos%20Creator%20v2.2.1-orange.svg)](http://www.cocos.com/creator) +[![](https://img.shields.io/badge/Support-Cocos%20Creator%20v2.3.0-orange.svg)](http://www.cocos.com/creator) [![](https://img.shields.io/badge/Support-Cocos%20Creator%20v2.2.2-orange.svg)](http://www.cocos.com/creator) +[![](https://img.shields.io/badge/Support-Cocos%20Creator%20v2.2.1-orange.svg)](http://www.cocos.com/creator) ## 一、项目说明 @@ -11,9 +12,9 @@ 1. 此项目为我在学习过程中的一些分享和实现,因此项目名字以 **`Demo`** 为后缀。 2. 项目重点在于 **「渔」**,不在于 **「鱼」** 。 3. 如果你有意将此Demo中的效果加入到你的项目中,**请认真评估是否适合你的项目使用!** -4. 本项目支持 Cocos Creator `v2.2.1` 、 `v2.2.2` - 1. 项目当前正在使用 v2.2.2 开发 - 2. 如果采用 Cocos Creator v2.2.1打开,在打开的时候,Cocos Creator 会提示有降级打开项目的提醒,忽略直接打开即可 +4. 本项目支持 Cocos Creator `v2.3.0` 、 `v2.2.2` 、 `v2.2.1` + 1. 项目当前正在使用 v2.3.0 开发 + 2. 如果在低版本中打开,可能存在降级提醒,目前没测试是否可以正常打开,建议在 2.3.0中打开采用 Cocos Creator v2.2.1打开,在打开的时候,Cocos Creator 会提示有降级打开项目的提醒,忽略直接打开即可 ## 二、系列文章 From 18d699fcf50f4378cbf98a003642d81fe876ae10 Mon Sep 17 00:00:00 2001 From: caizhitao Date: Mon, 17 Feb 2020 10:39:37 +0800 Subject: [PATCH 8/9] update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 52c71b8..9dc2d41 100755 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ 1. 此项目为我在学习过程中的一些分享和实现,因此项目名字以 **`Demo`** 为后缀。 2. 项目重点在于 **「渔」**,不在于 **「鱼」** 。 3. 如果你有意将此Demo中的效果加入到你的项目中,**请认真评估是否适合你的项目使用!** -4. 本项目支持 Cocos Creator `v2.3.0` 、 `v2.2.2` 、 `v2.2.1` +4. 本项目支持 Cocos Creator `v2.3.0` 、 ~~`v2.2.2`~~ 、 ~~`v2.2.1`~~ 1. 项目当前正在使用 v2.3.0 开发 - 2. 如果在低版本中打开,可能存在降级提醒,目前没测试是否可以正常打开,建议在 2.3.0中打开采用 Cocos Creator v2.2.1打开,在打开的时候,Cocos Creator 会提示有降级打开项目的提醒,忽略直接打开即可 + 2. 由于2.3.0和2.2.2,2.2.1差别较大,因此,`master`分支的最新项目已经无法在2.2.1,2.2.2中重新打开,如果确实需要在 2.2.1,2.2.2 中打开,请先切换到旧版本的tag(`0.8.0`),才能用 2.2.1,2.2.2打开 ## 二、系列文章 From f673d8c4a090ea763ac30b94f03439bc8ceb9f55 Mon Sep 17 00:00:00 2001 From: caizhitao Date: Mon, 17 Feb 2020 10:40:32 +0800 Subject: [PATCH 9/9] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 947708f..fac833d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.9.0 (2020-02-17) - 支持 Cocos Creator v2.3.0 + - 由于2.3.0和2.2.2,2.2.1差别较大,因此,此Tag的最新项目已经无法在2.2.1,2.2.2中重新打开,如果确实需要在 2.2.1,2.2.2 中打开,请先切换到旧版本的tag(`0.8.0`),才能用 2.2.1,2.2.2打开 ## 0.8.0 (2020-02-07)