diff --git a/assets/Scene/Filter.meta b/assets/Scene/Filter.meta new file mode 100644 index 0000000..8ac9826 --- /dev/null +++ b/assets/Scene/Filter.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.1", + "uuid": "d4ddaecb-2dc5-417c-ae6c-a7b23adf580e", + "isSubpackage": false, + "subpackageName": "", + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Filter/Filter.fire b/assets/Scene/Filter/Filter.fire new file mode 100644 index 0000000..c4d40b6 --- /dev/null +++ b/assets/Scene/Filter/Filter.fire @@ -0,0 +1,1571 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_native": "", + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_active": true, + "_components": [], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_is3DNode": true, + "_groupIndex": 0, + "groupIndex": 0, + "autoReleaseAssets": false, + "_id": "b23d729e-ccd3-45cc-b478-e555f5c92388" + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 5 + }, + { + "__id__": 8 + }, + { + "__id__": 12 + }, + { + "__id__": 16 + }, + { + "__id__": 20 + }, + { + "__id__": 24 + }, + { + "__id__": 28 + } + ], + "_active": true, + "_components": [ + { + "__id__": 32 + }, + { + "__id__": 33 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1334, + "height": 750 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 667, + 375, + 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": "a5esZu+45LA5mBpvttspPD" + }, + { + "__type__": "cc.Node", + "_name": "Main Camera", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 960, + "height": 640 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 452.93128617926146, + 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": "e1WoFrQ79G7r4ZuQE3HlNb" + }, + { + "__type__": "cc.Camera", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_cullingMask": 4294967295, + "_clearFlags": 7, + "_backgroundColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_depth": -1, + "_zoomRatio": 1, + "_targetTexture": null, + "_fov": 60, + "_orthoSize": 10, + "_nearClip": 1, + "_farClip": 4096, + "_ortho": true, + "_rect": { + "__type__": "cc.Rect", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + "_renderStages": 1, + "_alignWithScreen": true, + "_id": "81GN3uXINKVLeW4+iKSlim" + }, + { + "__type__": "cc.Node", + "_name": "bg", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 6 + }, + { + "__id__": 7 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1334, + "height": 750 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 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": "5akH20vLVILZB3AY+h5czn" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "5640ff1a-66dc-4ba9-b0e5-8be4190a3333" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "23v6CmhqpAuoWjx2sHrHDM" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_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": 2, + "_originalHeight": 2, + "_id": "ceamLjckJC375WoluXvqiT" + }, + { + "__type__": "cc.Node", + "_name": "normal", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 9 + } + ], + "_active": true, + "_components": [ + { + "__id__": 11 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 500, + "height": 375 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -410, + 200, + 0, + 0, + 0, + 0, + 1, + 0.7, + 0.7, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "74S/kEuPhCnoacQ1+Pf3ib" + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 8 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 10 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 80, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -230, + 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": "8cdX6B7ttOTLvr9etci3pA" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 9 + }, + "_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, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 1, + "_id": "6eqiD2gTtKO4oVx2zRA3K0" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 8 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "47667903-c979-4668-b039-50fe9a95c12a" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "01NM2EHhtEAYbpUmhZA24n" + }, + { + "__type__": "cc.Node", + "_name": "brown", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 13 + } + ], + "_active": true, + "_components": [ + { + "__id__": 15 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 500, + "height": 375 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 200, + 0, + 0, + 0, + 0, + 1, + 0.7, + 0.7, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "4c9GI7EnFPqJUXVqmvdYcd" + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 12 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 14 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 226.64, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -230, + 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": "f9ndFxuh5OjrHNLeUsPohV" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 13 + }, + "_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, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 1, + "_id": "3dC0IHbj9EwaMN499wXHEx" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 12 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "e697bd51-81a4-4e3a-9e4c-cdef6af6e7ca" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "47667903-c979-4668-b039-50fe9a95c12a" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "8d5QhJi8ZJNJKD8ru8dei4" + }, + { + "__type__": "cc.Node", + "_name": "gray", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 17 + } + ], + "_active": true, + "_components": [ + { + "__id__": 19 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 500, + "height": 375 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 410, + 200, + 0, + 0, + 0, + 0, + 1, + 0.7, + 0.7, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "fdnNbGqQZIbLepF3cp1SDR" + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 18 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -230, + 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": "32vBnSIGNDJaWfwd/EdlUM" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 17 + }, + "_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, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 1, + "_id": "5cbJ+bbgBIabHIFL6QIkvV" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 16 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "d33b6c67-cde8-433f-91ed-cce8f99db941" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "47667903-c979-4668-b039-50fe9a95c12a" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "a4BjykBp9FI62liMS51CaR" + }, + { + "__type__": "cc.Node", + "_name": "reversal", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 21 + } + ], + "_active": true, + "_components": [ + { + "__id__": 23 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 500, + "height": 375 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -410, + -140, + 0, + 0, + 0, + 0, + 1, + 0.7, + 0.7, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "aebhqiZJlFVaBbA9YHxEan" + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 20 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 22 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 80, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -230, + 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": "c2JyEb/7dHIKEMujvWITSG" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 21 + }, + "_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, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 1, + "_id": "8aw+nrFcpPJ46cUV/k5MYQ" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 20 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "b404cbda-3e82-403a-8202-084b5719345a" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "47667903-c979-4668-b039-50fe9a95c12a" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "8fl2W172pCbqtN9Gbcho/p" + }, + { + "__type__": "cc.Node", + "_name": "frozen", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 25 + } + ], + "_active": true, + "_components": [ + { + "__id__": 27 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 500, + "height": 375 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -140, + 0, + 0, + 0, + 0, + 1, + 0.7, + 0.7, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "6036Lc/FZER7dQGKxlL8gP" + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 24 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 26 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 80, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -230, + 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": "cfgaF4OA1J6KNbsMS5qiXa" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 25 + }, + "_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, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 1, + "_id": "f0gmrGB1RDpKIn/FKtwc3r" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 24 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "82d5bfd4-a190-47f0-a20e-282a0068737b" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "47667903-c979-4668-b039-50fe9a95c12a" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "100yWz2/9Ihpb1UlXO3HcS" + }, + { + "__type__": "cc.Node", + "_name": "cartoon", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 29 + } + ], + "_active": true, + "_components": [ + { + "__id__": 31 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 500, + "height": 375 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 410, + -140, + 0, + 0, + 0, + 0, + 1, + 0.7, + 0.7, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "5cRB1/HgBGyYgExyHic/wJ" + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 28 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 30 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 80, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -230, + 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": "d2rfwfhGVIibPj+sphSqYw" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 29 + }, + "_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, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 1, + "_id": "1ailvRGIBPCLnAEiY+0RcO" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 28 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "33274f30-e75f-40b1-ac3f-cea71b7ba496" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "47667903-c979-4668-b039-50fe9a95c12a" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "99iUVmC9RGSYHbV9CyQwxB" + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1334, + "height": 750 + }, + "_fitWidth": false, + "_fitHeight": true, + "_id": "59Cd0ovbdF4byw5sbjJDx7" + }, + { + "__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, + "_id": "29zXboiXFBKoIV4PQ2liTe" + } +] \ No newline at end of file diff --git a/assets/Scene/Filter/Filter.fire.meta b/assets/Scene/Filter/Filter.fire.meta new file mode 100644 index 0000000..27c29ed --- /dev/null +++ b/assets/Scene/Filter/Filter.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.2.6", + "uuid": "b23d729e-ccd3-45cc-b478-e555f5c92388", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Filter/Texture.meta b/assets/Scene/Filter/Texture.meta new file mode 100644 index 0000000..429b45a --- /dev/null +++ b/assets/Scene/Filter/Texture.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.1", + "uuid": "d1d1b569-80e8-4b7e-9cbe-87b4f79d0e8e", + "isSubpackage": false, + "subpackageName": "", + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Filter/Texture/bg.png b/assets/Scene/Filter/Texture/bg.png new file mode 100644 index 0000000..e624a70 Binary files /dev/null and b/assets/Scene/Filter/Texture/bg.png differ diff --git a/assets/Scene/Filter/Texture/bg.png.meta b/assets/Scene/Filter/Texture/bg.png.meta new file mode 100644 index 0000000..61fd657 --- /dev/null +++ b/assets/Scene/Filter/Texture/bg.png.meta @@ -0,0 +1,36 @@ +{ + "ver": "2.3.4", + "uuid": "b09cc4b6-a8f3-4236-9c6b-0686fc3d765e", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": false, + "width": 2, + "height": 2, + "platformSettings": {}, + "subMetas": { + "bg": { + "ver": "1.0.4", + "uuid": "5640ff1a-66dc-4ba9-b0e5-8be4190a3333", + "rawTextureUuid": "b09cc4b6-a8f3-4236-9c6b-0686fc3d765e", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 2, + "height": 2, + "rawWidth": 2, + "rawHeight": 2, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/Scene/Filter/Texture/img.jpg b/assets/Scene/Filter/Texture/img.jpg new file mode 100644 index 0000000..079e7ad Binary files /dev/null and b/assets/Scene/Filter/Texture/img.jpg differ diff --git a/assets/Scene/Filter/Texture/img.jpg.meta b/assets/Scene/Filter/Texture/img.jpg.meta new file mode 100644 index 0000000..a422154 --- /dev/null +++ b/assets/Scene/Filter/Texture/img.jpg.meta @@ -0,0 +1,36 @@ +{ + "ver": "2.3.4", + "uuid": "07eb0dc1-20cb-4ea6-aff1-1eda4bc174fd", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 500, + "height": 375, + "platformSettings": {}, + "subMetas": { + "img": { + "ver": "1.0.4", + "uuid": "47667903-c979-4668-b039-50fe9a95c12a", + "rawTextureUuid": "07eb0dc1-20cb-4ea6-aff1-1eda4bc174fd", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 500, + "height": 375, + "rawWidth": 500, + "rawHeight": 375, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/Scene/Filter/brown.effect b/assets/Scene/Filter/brown.effect new file mode 100644 index 0000000..e5f9489 --- /dev/null +++ b/assets/Scene/Filter/brown.effect @@ -0,0 +1,73 @@ +// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + +CCEffect %{ + techniques: + - passes: + - vert: vs + frag: fs + blendState: + targets: + - blend: true + rasterizerState: + cullMode: none + properties: + texture: { value: white } +}% + + +CCProgram vs %{ + precision highp float; + + #include + #include + + in vec3 a_position; + in vec4 a_color; + out vec4 v_color; + + #if USE_TEXTURE + in vec2 a_uv0; + out vec2 v_uv0; + #endif + + void main () { + vec4 pos = vec4(a_position, 1); + + #if CC_USE_MODEL + pos = cc_matViewProj * cc_matWorld * pos; + #else + pos = cc_matViewProj * pos; + #endif + + #if USE_TEXTURE + v_uv0 = a_uv0; + #endif + + v_color = a_color; + + gl_Position = pos; + } +}% + + +CCProgram fs %{ + precision highp float; + + #include + + in vec4 v_color; + + #if USE_TEXTURE + in vec2 v_uv0; + uniform sampler2D texture; + #endif + + void main () { + vec4 color = texture(texture, v_uv0); + float _r = color.r * 0.393 + color.g * 0.769 + color.b * 0.189; + float _g = color.r * 0.349 + color.g * 0.686 + color.b * 0.168; + float _b = color.r * 0.272 + color.g * 0.534 + color.b * 0.131; + color = vec4(_r, _g, _b, color.a); + gl_FragColor = color; + } +}% diff --git a/assets/Scene/Filter/brown.effect.meta b/assets/Scene/Filter/brown.effect.meta new file mode 100644 index 0000000..ccf3b1f --- /dev/null +++ b/assets/Scene/Filter/brown.effect.meta @@ -0,0 +1,17 @@ +{ + "ver": "1.0.25", + "uuid": "dd3a8417-d752-4cf1-9c45-f9ee3c0bf858", + "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#endif\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture2D(texture, v_uv0);\n float _r = color.r * 0.393 + color.g * 0.769 + color.b * 0.189;\n float _g = color.r * 0.349 + color.g * 0.686 + color.b * 0.168;\n float _b = color.r * 0.272 + color.g * 0.534 + color.b * 0.131;\n color = vec4(_r, _g, _b, color.a);\n gl_FragColor = color;\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\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture(texture, v_uv0);\n float _r = color.r * 0.393 + color.g * 0.769 + color.b * 0.189;\n float _g = color.r * 0.349 + color.g * 0.686 + color.b * 0.168;\n float _b = color.r * 0.272 + color.g * 0.534 + color.b * 0.131;\n color = vec4(_r, _g, _b, color.a);\n gl_FragColor = color;\n}" + } + } + ], + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Filter/brown.mtl b/assets/Scene/Filter/brown.mtl new file mode 100644 index 0000000..62a89c3 --- /dev/null +++ b/assets/Scene/Filter/brown.mtl @@ -0,0 +1,19 @@ +{ + "__type__": "cc.Material", + "_name": "New Material", + "_objFlags": 0, + "_native": "", + "_effectAsset": { + "__uuid__": "dd3a8417-d752-4cf1-9c45-f9ee3c0bf858" + }, + "_techniqueIndex": 0, + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true, + "USE_ALPHA_TEST": false + }, + "props": {} + } + } +} \ No newline at end of file diff --git a/assets/Scene/Filter/brown.mtl.meta b/assets/Scene/Filter/brown.mtl.meta new file mode 100644 index 0000000..438890e --- /dev/null +++ b/assets/Scene/Filter/brown.mtl.meta @@ -0,0 +1,6 @@ +{ + "ver": "1.0.3", + "uuid": "e697bd51-81a4-4e3a-9e4c-cdef6af6e7ca", + "dataAsSubAsset": null, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Filter/cartoon.effect b/assets/Scene/Filter/cartoon.effect new file mode 100644 index 0000000..649751f --- /dev/null +++ b/assets/Scene/Filter/cartoon.effect @@ -0,0 +1,73 @@ +// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + +CCEffect %{ + techniques: + - passes: + - vert: vs + frag: fs + blendState: + targets: + - blend: true + rasterizerState: + cullMode: none + properties: + texture: { value: white } + alphaThreshold: { value: 0.5 } +}% + + +CCProgram vs %{ + precision highp float; + + #include + #include + + in vec3 a_position; + in vec4 a_color; + out vec4 v_color; + + #if USE_TEXTURE + in vec2 a_uv0; + out vec2 v_uv0; + #endif + + void main () { + vec4 pos = vec4(a_position, 1); + + #if CC_USE_MODEL + pos = cc_matViewProj * cc_matWorld * pos; + #else + pos = cc_matViewProj * pos; + #endif + + #if USE_TEXTURE + v_uv0 = a_uv0; + #endif + + v_color = a_color; + + gl_Position = pos; + } +}% + + +CCProgram fs %{ + precision highp float; + + #include + in vec4 v_color; + + #if USE_TEXTURE + in vec2 v_uv0; + uniform sampler2D texture; + #endif + + void main () { + vec4 color = texture(texture, v_uv0); + float _r = abs(color.g - color.b + color.g + color.r) * color.r; + float _g = abs(color.b - color.g + color.b + color.r) * color.r; + float _b = abs(color.b - color.g + color.b + color.r) * color.g; + color = vec4(_r, _g, _b, color.a); + gl_FragColor = color; + } +}% diff --git a/assets/Scene/Filter/cartoon.effect.meta b/assets/Scene/Filter/cartoon.effect.meta new file mode 100644 index 0000000..c1f5f04 --- /dev/null +++ b/assets/Scene/Filter/cartoon.effect.meta @@ -0,0 +1,17 @@ +{ + "ver": "1.0.25", + "uuid": "1410dc1a-1903-435f-bf7a-35e48ca53fd6", + "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#endif\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture2D(texture, v_uv0);\n float _r = abs(color.g - color.b + color.g + color.r) * color.r;\n float _g = abs(color.b - color.g + color.b + color.r) * color.r;\n float _b = abs(color.b - color.g + color.b + color.r) * color.g;\n color = vec4(_r, _g, _b, color.a);\n gl_FragColor = color;\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\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture(texture, v_uv0);\n float _r = abs(color.g - color.b + color.g + color.r) * color.r;\n float _g = abs(color.b - color.g + color.b + color.r) * color.r;\n float _b = abs(color.b - color.g + color.b + color.r) * color.g;\n color = vec4(_r, _g, _b, color.a);\n gl_FragColor = color;\n}" + } + } + ], + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Filter/cartoon.mtl b/assets/Scene/Filter/cartoon.mtl new file mode 100644 index 0000000..a62d42b --- /dev/null +++ b/assets/Scene/Filter/cartoon.mtl @@ -0,0 +1,17 @@ +{ + "__type__": "cc.Material", + "_name": "cartoon", + "_objFlags": 0, + "_native": "", + "_effectAsset": { + "__uuid__": "1410dc1a-1903-435f-bf7a-35e48ca53fd6" + }, + "_techniqueIndex": 0, + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true + } + } + } +} \ No newline at end of file diff --git a/assets/Scene/Filter/cartoon.mtl.meta b/assets/Scene/Filter/cartoon.mtl.meta new file mode 100644 index 0000000..324aced --- /dev/null +++ b/assets/Scene/Filter/cartoon.mtl.meta @@ -0,0 +1,6 @@ +{ + "ver": "1.0.3", + "uuid": "33274f30-e75f-40b1-ac3f-cea71b7ba496", + "dataAsSubAsset": null, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Filter/frozen.effect b/assets/Scene/Filter/frozen.effect new file mode 100644 index 0000000..cc917a6 --- /dev/null +++ b/assets/Scene/Filter/frozen.effect @@ -0,0 +1,75 @@ +// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + +CCEffect %{ + techniques: + - passes: + - vert: vs + frag: fs + blendState: + targets: + - blend: true + rasterizerState: + cullMode: none + properties: + texture: { value: white } + alphaThreshold: { value: 0.5 } +}% + + +CCProgram vs %{ + precision highp float; + + #include + #include + + in vec3 a_position; + in vec4 a_color; + out vec4 v_color; + + #if USE_TEXTURE + in vec2 a_uv0; + out vec2 v_uv0; + #endif + + void main () { + vec4 pos = vec4(a_position, 1); + + #if CC_USE_MODEL + pos = cc_matViewProj * cc_matWorld * pos; + #else + pos = cc_matViewProj * pos; + #endif + + #if USE_TEXTURE + v_uv0 = a_uv0; + #endif + + v_color = a_color; + + gl_Position = pos; + } +}% + + +CCProgram fs %{ + precision highp float; + + #include + + in vec4 v_color; + + #if USE_TEXTURE + in vec2 v_uv0; + uniform sampler2D texture; + #endif + + void main () { + // 冰冻 + vec4 color = texture(texture, v_uv0); + float r = abs(color.r - color.g - color.b) * 1.5; + float g = abs(color.g - color.b - color.r) * 1.5; + float b = abs(color.b - color.r - color.g) * 1.5; + color = vec4(r, g, b, color.a); + gl_FragColor = color; + } +}% diff --git a/assets/Scene/Filter/frozen.effect.meta b/assets/Scene/Filter/frozen.effect.meta new file mode 100644 index 0000000..935fddf --- /dev/null +++ b/assets/Scene/Filter/frozen.effect.meta @@ -0,0 +1,17 @@ +{ + "ver": "1.0.25", + "uuid": "5953f127-122f-48e3-8906-b4dbb9bb9ec6", + "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#endif\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture2D(texture, v_uv0);\n float r = abs(color.r - color.g - color.b) * 1.5;\n float g = abs(color.g - color.b - color.r) * 1.5;\n float b = abs(color.b - color.r - color.g) * 1.5;\n color = vec4(r, g, b, color.a);\n gl_FragColor = color;\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\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture(texture, v_uv0);\n float r = abs(color.r - color.g - color.b) * 1.5;\n float g = abs(color.g - color.b - color.r) * 1.5;\n float b = abs(color.b - color.r - color.g) * 1.5;\n color = vec4(r, g, b, color.a);\n gl_FragColor = color;\n}" + } + } + ], + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Filter/frozen.mtl b/assets/Scene/Filter/frozen.mtl new file mode 100644 index 0000000..1590417 --- /dev/null +++ b/assets/Scene/Filter/frozen.mtl @@ -0,0 +1,17 @@ +{ + "__type__": "cc.Material", + "_name": "desaturate", + "_objFlags": 0, + "_native": "", + "_effectAsset": { + "__uuid__": "5953f127-122f-48e3-8906-b4dbb9bb9ec6" + }, + "_techniqueIndex": 0, + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true + } + } + } +} \ No newline at end of file diff --git a/assets/Scene/Filter/frozen.mtl.meta b/assets/Scene/Filter/frozen.mtl.meta new file mode 100644 index 0000000..cbb96a2 --- /dev/null +++ b/assets/Scene/Filter/frozen.mtl.meta @@ -0,0 +1,6 @@ +{ + "ver": "1.0.3", + "uuid": "82d5bfd4-a190-47f0-a20e-282a0068737b", + "dataAsSubAsset": null, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Filter/gray.effect b/assets/Scene/Filter/gray.effect new file mode 100644 index 0000000..e404b04 --- /dev/null +++ b/assets/Scene/Filter/gray.effect @@ -0,0 +1,76 @@ +// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + +CCEffect %{ + techniques: + - passes: + - vert: vs + frag: fs + blendState: + targets: + - blend: true + rasterizerState: + cullMode: none + properties: + texture: { value: white } + alphaThreshold: { value: 0.5 } +}% + + +CCProgram vs %{ + precision highp float; + + #include + #include + + in vec3 a_position; + in vec4 a_color; + out vec4 v_color; + + #if USE_TEXTURE + in vec2 a_uv0; + out vec2 v_uv0; + #endif + + void main () { + vec4 pos = vec4(a_position, 1); + + #if CC_USE_MODEL + pos = cc_matViewProj * cc_matWorld * pos; + #else + pos = cc_matViewProj * pos; + #endif + + #if USE_TEXTURE + v_uv0 = a_uv0; + #endif + + v_color = a_color; + + gl_Position = pos; + } +}% + + +CCProgram fs %{ + precision highp float; + + #include + + in vec4 v_color; + + #if USE_TEXTURE + in vec2 v_uv0; + uniform sampler2D texture; + #endif + + void main () { + // 灰度:将颜色的RGB设置为相同的值即可使得图片为灰色,一般处理方法有: + // 1、取三种颜色的平均值 + // 2、取三种颜色的最大值(最小值) + // 3、加权平均值:0.3R + 0.59G + 0.11*B + vec4 color = texture(texture, v_uv0); + float gray = (color.r + color.g + color.b)/3.0; + color = vec4(gray, gray, gray, color.a); + gl_FragColor = color; + } +}% diff --git a/assets/Scene/Filter/gray.effect.meta b/assets/Scene/Filter/gray.effect.meta new file mode 100644 index 0000000..017a896 --- /dev/null +++ b/assets/Scene/Filter/gray.effect.meta @@ -0,0 +1,17 @@ +{ + "ver": "1.0.25", + "uuid": "69550ca6-c885-4706-b41c-c048fae5051b", + "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#endif\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture2D(texture, v_uv0);\n float gray = (color.r + color.g + color.b)/3.0;\n color = vec4(gray, gray, gray, color.a);\n gl_FragColor = color;\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\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture(texture, v_uv0);\n float gray = (color.r + color.g + color.b)/3.0;\n color = vec4(gray, gray, gray, color.a);\n gl_FragColor = color;\n}" + } + } + ], + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Filter/gray.mtl b/assets/Scene/Filter/gray.mtl new file mode 100644 index 0000000..d0a3f17 --- /dev/null +++ b/assets/Scene/Filter/gray.mtl @@ -0,0 +1,17 @@ +{ + "__type__": "cc.Material", + "_name": "gray", + "_objFlags": 0, + "_native": "", + "_effectAsset": { + "__uuid__": "69550ca6-c885-4706-b41c-c048fae5051b" + }, + "_techniqueIndex": 0, + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true + } + } + } +} \ No newline at end of file diff --git a/assets/Scene/Filter/gray.mtl.meta b/assets/Scene/Filter/gray.mtl.meta new file mode 100644 index 0000000..6e124f1 --- /dev/null +++ b/assets/Scene/Filter/gray.mtl.meta @@ -0,0 +1,6 @@ +{ + "ver": "1.0.3", + "uuid": "d33b6c67-cde8-433f-91ed-cce8f99db941", + "dataAsSubAsset": null, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Filter/img.jpg b/assets/Scene/Filter/img.jpg new file mode 100644 index 0000000..079e7ad Binary files /dev/null and b/assets/Scene/Filter/img.jpg differ diff --git a/assets/Scene/Filter/img.jpg.meta b/assets/Scene/Filter/img.jpg.meta new file mode 100644 index 0000000..d862b69 --- /dev/null +++ b/assets/Scene/Filter/img.jpg.meta @@ -0,0 +1,36 @@ +{ + "ver": "2.3.4", + "uuid": "07942f94-3a77-4fe7-98d3-78d5b11e1b9e", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 500, + "height": 375, + "platformSettings": {}, + "subMetas": { + "img": { + "ver": "1.0.4", + "uuid": "aed08844-9343-4ecd-83f0-125c0f2c31ff", + "rawTextureUuid": "07942f94-3a77-4fe7-98d3-78d5b11e1b9e", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 500, + "height": 375, + "rawWidth": 500, + "rawHeight": 375, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/Scene/Filter/reversal.effect b/assets/Scene/Filter/reversal.effect new file mode 100644 index 0000000..4619fe9 --- /dev/null +++ b/assets/Scene/Filter/reversal.effect @@ -0,0 +1,75 @@ +// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + +CCEffect %{ + techniques: + - passes: + - vert: vs + frag: fs + blendState: + targets: + - blend: true + rasterizerState: + cullMode: none + properties: + texture: { value: white } + alphaThreshold: { value: 0.5 } +}% + + +CCProgram vs %{ + precision highp float; + + #include + #include + + in vec3 a_position; + in vec4 a_color; + out vec4 v_color; + + #if USE_TEXTURE + in vec2 a_uv0; + out vec2 v_uv0; + #endif + + void main () { + vec4 pos = vec4(a_position, 1); + + #if CC_USE_MODEL + pos = cc_matViewProj * cc_matWorld * pos; + #else + pos = cc_matViewProj * pos; + #endif + + #if USE_TEXTURE + v_uv0 = a_uv0; + #endif + + v_color = a_color; + + gl_Position = pos; + } +}% + + +CCProgram fs %{ + precision highp float; + + #include + + in vec4 v_color; + + #if USE_TEXTURE + in vec2 v_uv0; + uniform sampler2D texture; + #endif + + void main () { + // 反相:RGB三种颜色分别取255的差值 + vec4 color = texture(texture, v_uv0); + float _r = 255.0 / 256.0 - color.r; + float _g = 255.0 / 256.0 - color.g; + float _b = 255.0 / 256.0 - color.b; + color = vec4(_r, _g, _b, color.a); + gl_FragColor = color; + } +}% diff --git a/assets/Scene/Filter/reversal.effect.meta b/assets/Scene/Filter/reversal.effect.meta new file mode 100644 index 0000000..8391071 --- /dev/null +++ b/assets/Scene/Filter/reversal.effect.meta @@ -0,0 +1,17 @@ +{ + "ver": "1.0.25", + "uuid": "53def89f-dc59-4c81-8c1f-f0966b17f00a", + "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#endif\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture2D(texture, v_uv0);\n float _r = 255.0 / 256.0 - color.r;\n float _g = 255.0 / 256.0 - color.g;\n float _b = 255.0 / 256.0 - color.b;\n color = vec4(_r, _g, _b, color.a);\n gl_FragColor = color;\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\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture(texture, v_uv0);\n float _r = 255.0 / 256.0 - color.r;\n float _g = 255.0 / 256.0 - color.g;\n float _b = 255.0 / 256.0 - color.b;\n color = vec4(_r, _g, _b, color.a);\n gl_FragColor = color;\n}" + } + } + ], + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Filter/reversal.mtl b/assets/Scene/Filter/reversal.mtl new file mode 100644 index 0000000..2e52c58 --- /dev/null +++ b/assets/Scene/Filter/reversal.mtl @@ -0,0 +1,17 @@ +{ + "__type__": "cc.Material", + "_name": "New Material", + "_objFlags": 0, + "_native": "", + "_effectAsset": { + "__uuid__": "53def89f-dc59-4c81-8c1f-f0966b17f00a" + }, + "_techniqueIndex": 0, + "_techniqueData": { + "0": { + "defines": { + "USE_TEXTURE": true + } + } + } +} \ No newline at end of file diff --git a/assets/Scene/Filter/reversal.mtl.meta b/assets/Scene/Filter/reversal.mtl.meta new file mode 100644 index 0000000..69cecaf --- /dev/null +++ b/assets/Scene/Filter/reversal.mtl.meta @@ -0,0 +1,6 @@ +{ + "ver": "1.0.3", + "uuid": "b404cbda-3e82-403a-8202-084b5719345a", + "dataAsSubAsset": null, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Home/Home.ts b/assets/Scene/Home/Home.ts index 4925dc5..515a1e8 100644 --- a/assets/Scene/Home/Home.ts +++ b/assets/Scene/Home/Home.ts @@ -16,7 +16,8 @@ enum sceneList { 'Infinite_bg_scroll' = '背景无限滚动', 'Change_clothes' = '换装', 'Screen_vibrating' = '震屏效果+动画恢复第一帧', - 'Joystick' = '遥控杆' + 'Joystick' = '遥控杆', + 'Filter' = '颜色滤镜' } @ccclass diff --git a/doc/Filter/resources/demo.png b/doc/Filter/resources/demo.png new file mode 100644 index 0000000..a62c64d Binary files /dev/null and b/doc/Filter/resources/demo.png differ diff --git a/doc/Filter/resources/ewm.png b/doc/Filter/resources/ewm.png new file mode 100644 index 0000000..3d55b11 Binary files /dev/null and b/doc/Filter/resources/ewm.png differ diff --git a/doc/Filter/常见滤镜.md b/doc/Filter/常见滤镜.md new file mode 100644 index 0000000..3e4bf8a --- /dev/null +++ b/doc/Filter/常见滤镜.md @@ -0,0 +1,96 @@ +# 效果演示 + +我们手机上有很多照片处理软件,图片滤镜是里面不可或缺的一部分,我们可以先尝试一些很简单的滤镜的算法,管中窥豹地去认识一下色彩的处理。 + + +![demo](/resources/demo.png) + +# 实现思路 + +先来看一下比较常用的褐色、老照片效果,它的算法是: +> r = r * 0.393 + g * 0.769 + b * 0.189; +> g = r * 0.349 + g * 0.686 + b * 0.168; +> b = r * 0.272 + g * 0.534 + b * 0.131; + +```js +void main () { + vec4 color = texture(texture, v_uv0); + float _r = color.r * 0.393 + color.g * 0.769 + color.b * 0.189; + float _g = color.r * 0.349 + color.g * 0.686 + color.b * 0.168; + float _b = color.r * 0.272 + color.g * 0.534 + color.b * 0.131; + color = vec4(_r, _g, _b, color.a); + gl_FragColor = color; +} +``` + +灰度或者去色的核心是让RGB三种色值相等即可得到不同的灰度,根据需求的不同,我们可以通过取三个色值的平均值,三个色值的最大值,最小值,加权平均值等方式来处理 + +```js +void main () { + vec4 color = texture(texture, v_uv0); + float gray = (color.r + color.g + color.b)/3.0; + color = vec4(gray, gray, gray, color.a); + gl_FragColor = color; +} +``` + +反相的算法是让RGB三种颜色分别取255的差值 + +```js +void main () { + vec4 color = texture(texture, v_uv0); + float r = (255.0 - color.r * 256.0) / 256.0; + float g = (255.0 - color.g * 256.0) / 256.0; + float b = (255.0 - color.b * 256.0) / 256.0; + color = vec4(r, g, b, color.a); + gl_FragColor = color; +} +``` + +让图像呈现淡蓝色,也可以形象叫做冰冻,它的算法是 + +```js +void main () { + vec4 color = texture(texture, v_uv0); + float _r = (255.0 - color.r * 256.0) / 256.0; + float _g = (255.0 - color.g * 256.0) / 256.0; + float _b = (255.0 - color.b * 256.0) / 256.0; + color = vec4(_r, _g, _b, color.a); + gl_FragColor = color; +} + +``` + +连环画滤镜是: +> R = |g – b + g + r| * r; +> G = |b – g + b + r| * r; +> B = |b – g + b + r| * g; + +```js +void main () { + vec4 color = texture(texture, v_uv0); + float _r = abs(color.g - color.b + color.g + color.r) * color.r; + float _g = abs(color.b - color.g + color.b + color.r) * color.r; + float _b = abs(color.b - color.g + color.b + color.r) * color.g; + color = vec4(_r, _g, _b, color.a); + gl_FragColor = color; +} +``` + +滤镜是用来实现图片的各种特殊效果的,简单的颜色滤镜我们就通过简单的颜色叠加公式可以得出,但是复杂的滤镜效果就可能需要使用更高阶的数学处理甚至叠加多次处理才能得到,我们在图像处理APP里面看到的各种各样的滤镜其实就是人家专门针对某种效果提炼出来的公式,有兴趣的同学用前端的知识也能够打造一个专门的图像处理App + +# 效果预览 + +源码获取请点击**查看原文**,长按二维码查看效果👇 + +![ewm](/resources/ewm.png) + +我是异名,你的阅读是我的动力 + + + + + + + + diff --git a/settings/project.json b/settings/project.json index 62622d6..465f29a 100755 --- a/settings/project.json +++ b/settings/project.json @@ -34,7 +34,7 @@ "height": 640, "width": 960 }, - "last-module-event-record-time": 1588409548473, + "last-module-event-record-time": 1589255814190, "assets-sort-type": "name", "facebook": { "appID": "",