diff --git a/CHANGELOG.md b/CHANGELOG.md index ce2b3d5..105aec7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # ChangeLog +## 0.4.0 (2020-01-12) + +- 加入点光特效 + ## 0.3.0 (2020-01-09) - 加入圆角裁剪特效 diff --git a/README.md b/README.md index e542eff..0e3a710 100755 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ [![](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) -## 项目说明 +## 一、项目说明 1. 此项目为我在学习过程中的一些分享和实现,因此项目名字以 **`Demo`** 为后缀。 2. 项目重点在于 **「渔」**,不在于 **「鱼」** 。 3. 如果你有意将此Demo中的效果加入到你的项目中,**请认真评估是否适合你的项目使用!** -## 系列文章 +## 二、系列文章 * [Cocos Creator Shader Effect 系列 - 0 - 前言](https://www.jianshu.com/p/20b906d7269c) * [Cocos Creator Shader Effect 系列 - 1 - 材质,Effect,Inspector,纹理之间的关系](https://www.jianshu.com/p/ca28666d25d2) @@ -22,11 +22,15 @@ * 编写中... - -## 特效预览 - 那么现在,我们先来轻松地看下有哪些特效效果吧~ +## 三、特效预览 + + +### 点光(实现原理,可能在编写中,催更可到底部扫码,支持急件~🤣)(2020.01.12更新) + +![](static/effects/2d-sprite-point-light.gif) + ### 内发光([实现原理](https://www.jianshu.com/p/326b73f86ecc)) ![](static/effects/2d-sprite-glow-inner.gif) @@ -56,16 +60,15 @@ ### 外描边(完善中...) -## TODO +## 四、TODO -* [ ] 图像裁剪 * [ ] 图像模糊 * [ ] 闪光 * [ ] 波浪 * [ ] 雨滴 * [ ] ... -## 支持一下作者吧 +## 五、支持一下作者吧 如果此项目对你学习和理解Shader有帮助,不妨支持一下我吧~ diff --git a/assets/scenes/PreviewEffectScene.fire b/assets/scenes/PreviewEffectScene.fire index 647e1bf..06faed2 100755 --- a/assets/scenes/PreviewEffectScene.fire +++ b/assets/scenes/PreviewEffectScene.fire @@ -78,10 +78,10 @@ "_active": true, "_components": [ { - "__id__": 60 + "__id__": 67 }, { - "__id__": 61 + "__id__": 68 } ], "_prefab": null, @@ -171,7 +171,7 @@ "array": [ 0, 0, - 418.2902700278839, + 491.0364039457767, 0, 0, 0, @@ -245,13 +245,13 @@ "__id__": 9 }, { - "__id__": 56 + "__id__": 63 } ], "_active": true, "_components": [ { - "__id__": 59 + "__id__": 66 } ], "_prefab": null, @@ -444,7 +444,7 @@ "_active": true, "_components": [ { - "__id__": 55 + "__id__": 62 }, { "__id__": 14 @@ -516,10 +516,10 @@ "__id__": 13 }, { - "__id__": 53 + "__id__": 60 }, { - "__id__": 54 + "__id__": 61 } ], "_prefab": null, @@ -735,15 +735,18 @@ }, { "__id__": 44 + }, + { + "__id__": 51 } ], "_active": true, "_components": [ { - "__id__": 51 + "__id__": 58 }, { - "__id__": 52 + "__id__": 59 } ], "_prefab": null, @@ -2384,6 +2387,324 @@ "_N$affectedByScale": false, "_id": "9d2gAh+o1KZ4USUhuVUsCm" }, + { + "__type__": "cc.Node", + "_name": "PointLight", + "_objFlags": 0, + "_parent": { + "__id__": 15 + }, + "_children": [ + { + "__id__": 52 + }, + { + "__id__": 55 + } + ], + "_active": true, + "_components": [ + { + "__id__": 57 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 260, + "height": 320.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 218, + -512.5999999999999, + 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": "60x1EOPINMuJ5xqPn+AgU5" + }, + { + "__type__": "cc.Node", + "_name": "Desc", + "_objFlags": 0, + "_parent": { + "__id__": 51 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 53 + }, + { + "__id__": 54 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 260, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 135, + 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": "58AdOvxJ9EKYM3yHqisHUF" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 52 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 40, + "_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": 120, + "_originalHeight": 0, + "_id": "ccMi2kSldI4IzJzG4/RyT2" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 52 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_useOriginalSize": false, + "_string": "点光", + "_N$string": "点光", + "_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": 2, + "_N$cacheMode": 0, + "_id": "e2MJykEBlF9ZsiZ6vzfV6Q" + }, + { + "__type__": "cc.Node", + "_name": "Sprite", + "_objFlags": 0, + "_parent": { + "__id__": 51 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 56 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 195, + "height": 270 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -25.200000000000003, + 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": "70dC+CnmpL2ah71VbAY11G" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 55 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "d88d982e-4ed7-4f90-9566-2ac2fef4bcb3" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "31bc895a-c003-4566-a9f3-2e54ae1c17dc" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "74TX/9jtpCxIoI+3LrKOr0" + }, + { + "__type__": "cc.Layout", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 51 + }, + "_enabled": true, + "_layoutSize": { + "__type__": "cc.Size", + "width": 260, + "height": 320.4 + }, + "_resize": 1, + "_N$layoutType": 2, + "_N$padding": 0, + "_N$cellSize": { + "__type__": "cc.Size", + "width": 40, + "height": 40 + }, + "_N$startAxis": 0, + "_N$paddingLeft": 0, + "_N$paddingRight": 0, + "_N$paddingTop": 0, + "_N$paddingBottom": 0, + "_N$spacingX": 0, + "_N$spacingY": 0, + "_N$verticalDirection": 1, + "_N$horizontalDirection": 0, + "_N$affectedByScale": false, + "_id": "87SQn11LJK8LSoPIN0g/TI" + }, { "__type__": "cc.Widget", "_name": "", @@ -2541,10 +2862,10 @@ "_active": true, "_components": [ { - "__id__": 57 + "__id__": 64 }, { - "__id__": 58 + "__id__": 65 } ], "_prefab": null, @@ -2600,7 +2921,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 56 + "__id__": 63 }, "_enabled": true, "_materials": [ @@ -2630,7 +2951,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 56 + "__id__": 63 }, "_enabled": true, "alignMode": 1, diff --git a/static/effects/2d-sprite-point-light.gif b/static/effects/2d-sprite-point-light.gif index ad3a787..01ffe53 100644 Binary files a/static/effects/2d-sprite-point-light.gif and b/static/effects/2d-sprite-point-light.gif differ diff --git a/static/effects/2d-sprite-round-corner-crop.gif b/static/effects/2d-sprite-round-corner-crop.gif index ffd7537..0451f24 100644 Binary files a/static/effects/2d-sprite-round-corner-crop.gif and b/static/effects/2d-sprite-round-corner-crop.gif differ