├── .gitignore ├── README.md ├── assets ├── TestList.fire ├── TestList.fire.meta ├── cases.meta ├── cases │ ├── scene1.fire │ ├── scene1.fire.meta │ ├── scene2.fire │ └── scene2.fire.meta ├── i18n.meta ├── i18n │ ├── data.meta │ ├── data │ │ ├── en.js │ │ ├── en.js.meta │ │ ├── zh.js │ │ └── zh.js.meta │ ├── i18n.js │ ├── i18n.js.meta │ ├── polyglot.js │ └── polyglot.js.meta ├── main menu.meta ├── main menu │ ├── Menu.js │ ├── Menu.js.meta │ ├── ShowSubMenu.js │ ├── ShowSubMenu.js.meta │ ├── StorageUtil.js │ ├── StorageUtil.js.meta │ ├── back icon.png │ ├── back icon.png.meta │ ├── eject_btn.png │ ├── eject_btn.png.meta │ ├── help_btn.png │ ├── help_btn.png.meta │ ├── hide menu.anim │ ├── hide menu.anim.meta │ ├── next_scene.png │ ├── next_scene.png.meta │ ├── prev_scene.png │ ├── prev_scene.png.meta │ ├── search_btn.png │ ├── search_btn.png.meta │ ├── show menu.anim │ └── show menu.anim.meta ├── res.meta ├── res │ ├── prefabs.meta │ ├── prefabs │ │ ├── Background.prefab │ │ ├── Background.prefab.meta │ │ ├── Center Menu.prefab │ │ ├── Center Menu.prefab.meta │ │ ├── Left Menu.prefab │ │ ├── Left Menu.prefab.meta │ │ ├── ListItem.prefab │ │ └── ListItem.prefab.meta │ ├── textures.meta │ └── textures │ │ ├── new ui.meta │ │ ├── new ui │ │ ├── btn_disabled.png │ │ ├── btn_disabled.png.meta │ │ ├── btn_normal.png │ │ ├── btn_normal.png.meta │ │ ├── btn_pressed.png │ │ ├── btn_pressed.png.meta │ │ ├── editbox_bg.png │ │ └── editbox_bg.png.meta │ │ ├── singleColor.png │ │ ├── singleColor.png.meta │ │ ├── sliced.meta │ │ ├── sliced │ │ ├── panel_bg.png │ │ └── panel_bg.png.meta │ │ ├── test.meta │ │ ├── test │ │ ├── 1.jpeg │ │ ├── 1.jpeg.meta │ │ ├── 2.jpg │ │ ├── 2.jpg.meta │ │ ├── 3.png │ │ ├── 3.png.meta │ │ ├── 4.png │ │ └── 4.png.meta │ │ ├── ui.meta │ │ └── ui │ │ ├── style1.meta │ │ └── style1 │ │ ├── panelBG.png │ │ └── panelBG.png.meta ├── resources.meta ├── resources │ ├── transitions.meta │ └── transitions │ │ ├── editor.meta │ │ ├── editor │ │ ├── transitions-inspector.js │ │ └── transitions-inspector.js.meta │ │ ├── shaders.meta │ │ ├── shaders │ │ ├── brighten.effect │ │ ├── brighten.effect.meta │ │ ├── brighten.mtl │ │ ├── brighten.mtl.meta │ │ ├── crop.meta │ │ ├── crop │ │ │ ├── crop-circle.mtl │ │ │ ├── crop-circle.mtl.meta │ │ │ ├── crop-diamond.mtl │ │ │ ├── crop-diamond.mtl.meta │ │ │ ├── crop-rect.mtl │ │ │ ├── crop-rect.mtl.meta │ │ │ ├── crop-shape.effect │ │ │ ├── crop-shape.effect.meta │ │ │ ├── crop-square.mtl │ │ │ └── crop-square.mtl.meta │ │ ├── cross-zoom.effect │ │ ├── cross-zoom.effect.meta │ │ ├── cross-zoom.mtl │ │ ├── cross-zoom.mtl.meta │ │ ├── cube.effect │ │ ├── cube.effect.meta │ │ ├── cube.mtl │ │ ├── cube.mtl.meta │ │ ├── directional-wipe.meta │ │ ├── directional-wipe │ │ │ ├── directional-wipe-lb.mtl │ │ │ ├── directional-wipe-lb.mtl.meta │ │ │ ├── directional-wipe-lt.mtl │ │ │ ├── directional-wipe-lt.mtl.meta │ │ │ ├── directional-wipe-rb.mtl │ │ │ ├── directional-wipe-rb.mtl.meta │ │ │ ├── directional-wipe-rt.mtl │ │ │ ├── directional-wipe-rt.mtl.meta │ │ │ ├── directional-wipe.effect │ │ │ └── directional-wipe.effect.meta │ │ ├── doom-screen.effect │ │ ├── doom-screen.effect.meta │ │ ├── doom-screen.mtl │ │ ├── doom-screen.mtl.meta │ │ ├── doorway.meta │ │ ├── doorway │ │ │ ├── doorway-horizontal.mtl │ │ │ ├── doorway-horizontal.mtl.meta │ │ │ ├── doorway-vertical.mtl │ │ │ ├── doorway-vertical.mtl.meta │ │ │ ├── doorway.effect │ │ │ └── doorway.effect.meta │ │ ├── grid-flip.effect │ │ ├── grid-flip.effect.meta │ │ ├── grid-flip.mtl │ │ ├── grid-flip.mtl.meta │ │ ├── hexo.effect │ │ ├── hexo.effect.meta │ │ ├── hexo.mtl │ │ ├── hexo.mtl.meta │ │ ├── inverted-page-curl.effect │ │ ├── inverted-page-curl.effect.meta │ │ ├── inverted-page-curl.mtl │ │ ├── inverted-page-curl.mtl.meta │ │ ├── linear-blur.effect │ │ ├── linear-blur.effect.meta │ │ ├── linear-blur.mtl │ │ ├── linear-blur.mtl.meta │ │ ├── luminance_melt.effect │ │ ├── luminance_melt.effect.meta │ │ ├── luminance_melt.mtl │ │ ├── luminance_melt.mtl.meta │ │ ├── morph.effect │ │ ├── morph.effect.meta │ │ ├── morph.mtl │ │ ├── morph.mtl.meta │ │ ├── pixelize.effect │ │ ├── pixelize.effect.meta │ │ ├── pixelize.mtl │ │ ├── pixelize.mtl.meta │ │ ├── polka-dots-curtain.effect │ │ ├── polka-dots-curtain.effect.meta │ │ ├── polka-dots-curtain.mtl │ │ ├── polka-dots-curtain.mtl.meta │ │ ├── ripple.meta │ │ ├── ripple │ │ │ ├── ripple-glass-lb.mtl │ │ │ ├── ripple-glass-lb.mtl.meta │ │ │ ├── ripple-glass-lt.mtl │ │ │ ├── ripple-glass-lt.mtl.meta │ │ │ ├── ripple-glass-rb.mtl │ │ │ ├── ripple-glass-rb.mtl.meta │ │ │ ├── ripple-glass-rt.mtl │ │ │ ├── ripple-glass-rt.mtl.meta │ │ │ ├── ripple-glass.mtl │ │ │ ├── ripple-glass.mtl.meta │ │ │ ├── ripple.effect │ │ │ └── ripple.effect.meta │ │ ├── simple-zoom.effect │ │ ├── simple-zoom.effect.meta │ │ ├── simple-zoom.mtl │ │ ├── simple-zoom.mtl.meta │ │ ├── stereo-viewe.effect │ │ ├── stereo-viewe.effect.meta │ │ ├── stereo-viewe.mtl │ │ ├── stereo-viewe.mtl.meta │ │ ├── strip.meta │ │ ├── strip │ │ │ ├── strip-lb.mtl │ │ │ ├── strip-lb.mtl.meta │ │ │ ├── strip-lt.mtl │ │ │ ├── strip-lt.mtl.meta │ │ │ ├── strip-rb.mtl │ │ │ ├── strip-rb.mtl.meta │ │ │ ├── strip-rt.mtl │ │ │ ├── strip-rt.mtl.meta │ │ │ ├── strip.effect │ │ │ └── strip.effect.meta │ │ ├── swap.effect │ │ ├── swap.effect.meta │ │ ├── swap.mtl │ │ ├── swap.mtl.meta │ │ ├── swirl.effect │ │ ├── swirl.effect.meta │ │ ├── swirl.mtl │ │ ├── swirl.mtl.meta │ │ ├── water-drop.effect │ │ ├── water-drop.effect.meta │ │ ├── water-drop.mtl │ │ ├── water-drop.mtl.meta │ │ ├── window-blinds.effect │ │ ├── window-blinds.effect.meta │ │ ├── window-blinds.mtl │ │ ├── window-blinds.mtl.meta │ │ ├── window-slice.effect │ │ ├── window-slice.effect.meta │ │ ├── window-slice.mtl │ │ └── window-slice.mtl.meta │ │ ├── transition-materials.js │ │ ├── transition-materials.js.meta │ │ ├── transitions.js │ │ └── transitions.js.meta ├── scripts.meta ├── scripts │ ├── Global.meta │ ├── Global │ │ ├── ListItem.js │ │ ├── ListItem.js.meta │ │ ├── SceneList.js │ │ └── SceneList.js.meta │ ├── Tips.meta │ ├── Tips │ │ ├── TipsManager.js │ │ └── TipsManager.js.meta │ ├── settings.js │ └── settings.js.meta ├── tests.meta └── tests │ ├── loadNode.fire │ ├── loadNode.fire.meta │ ├── test-loadNode.js │ └── test-loadNode.js.meta ├── creator.d.ts ├── jsconfig.json ├── package.json ├── project.json └── settings ├── project.json └── services.json /.gitignore: -------------------------------------------------------------------------------- 1 | #///////////////////////////////////////////////////////////////////////////// 2 | # Fireball Projects 3 | #///////////////////////////////////////////////////////////////////////////// 4 | 5 | library/ 6 | temp/ 7 | local/ 8 | build/ 9 | 10 | #///////////////////////////////////////////////////////////////////////////// 11 | # Logs and databases 12 | #///////////////////////////////////////////////////////////////////////////// 13 | 14 | *.log 15 | *.sql 16 | *.sqlite 17 | 18 | #///////////////////////////////////////////////////////////////////////////// 19 | # files for debugger 20 | #///////////////////////////////////////////////////////////////////////////// 21 | 22 | *.sln 23 | *.csproj 24 | *.pidb 25 | *.unityproj 26 | *.suo 27 | 28 | #///////////////////////////////////////////////////////////////////////////// 29 | # OS generated files 30 | #///////////////////////////////////////////////////////////////////////////// 31 | 32 | .DS_Store 33 | ehthumbs.db 34 | Thumbs.db 35 | 36 | #///////////////////////////////////////////////////////////////////////////// 37 | # exvim files 38 | #///////////////////////////////////////////////////////////////////////////// 39 | 40 | *UnityVS.meta 41 | *.err 42 | *.err.meta 43 | *.exvim 44 | *.exvim.meta 45 | *.vimentry 46 | *.vimentry.meta 47 | *.vimproject 48 | *.vimproject.meta 49 | .vimfiles.*/ 50 | .exvim.*/ 51 | quick_gen_project_*_autogen.bat 52 | quick_gen_project_*_autogen.bat.meta 53 | quick_gen_project_*_autogen.sh 54 | quick_gen_project_*_autogen.sh.meta 55 | .exvim.app 56 | 57 | #///////////////////////////////////////////////////////////////////////////// 58 | # webstorm files 59 | #///////////////////////////////////////////////////////////////////////////// 60 | 61 | .idea/ 62 | 63 | #////////////////////////// 64 | # VS Code 65 | #////////////////////////// 66 | 67 | .vscode/ 68 | 69 | 70 | #////////////////////////// 71 | # node modules 72 | #////////////////////////// 73 | node_modules/ 74 | 75 | .deploy_git 76 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Transitions 2 | 3 | This project is based on Cocos Creator 2.3.0. 4 | 5 | Online Demo : http://2youyou2.com/transitions 6 | 7 | ![image](https://user-images.githubusercontent.com/1862402/74397039-b9369880-4e4e-11ea-9fad-e3cbdaf334fc.png) 8 | 9 | # Usage 10 | 11 | ![image](https://user-images.githubusercontent.com/1862402/74312784-49240600-4dad-11ea-9fd4-a6d560d1ed43.png) 12 | 13 | 1. Add transitions node to the scene, the transitions node will make itself as a persist node. 14 | 2. Select a transition in the Properties Panel. 15 | 3. 16 | 17 | - Transitions from scene to other scene : 18 | ```js 19 | // Use **transitions.loadScene** instead of **cc.director.loadScene** 20 | // cc.director.loadScene(url, this.onLoadSceneFinish.bind(this)); 21 | this.transitions.loadScene(url, 'Canvas/Main Camera', 'Canvas/Main Camera', this.onLoadSceneFinish.bind(this)); 22 | ``` 23 | 24 | - Transition from node to other node : 25 | ```js 26 | this.transitions.loadNode (fromCamera, fromRootNode, toCamera, toRootNode, onTransitionFinished) 27 | ``` 28 | 29 | # Shaders 30 | 31 | All shaders can be found in the folder: [assets/resources/transitions/shaders](https://github.com/2youyou2/transitions/tree/master/assets/resources/transitions/shaders) 32 | 33 | Builtin uniforms: 34 | ```js 35 | { 36 | texture: { value: white } 37 | texture2: { value: white } 38 | time: { value: 0 } 39 | ratio: { value: 1 } 40 | } 41 | ``` 42 | # Sources 43 | 44 | - https://gl-transitions.com/ 45 | -------------------------------------------------------------------------------- /assets/TestList.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "d13475c7-b37e-45d6-b6c5-25929e8a0925", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": true, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/cases.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "bf3ccad0-bfc8-4b53-a133-3d301a2201a6", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/cases/scene1.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "d5c4b608-edd4-422e-bac6-3d9ce244ab5a", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/cases/scene2.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "abf0865c-a860-42ba-a185-cd7468945bbf", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/i18n.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "0d3130d0-5c26-4cb4-89a4-9d2b0518e8ce", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/i18n/data.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "d90c3d05-d0c8-45e0-b573-9db5ee63955e", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/i18n/data/en.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "920c554b-cc9c-4a8d-8080-a08530507ca6", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/i18n/data/zh.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "87f1fb34-8288-470c-87cd-83869e3d76ed", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/i18n/i18n.js: -------------------------------------------------------------------------------- 1 | const Polyglot = require('polyglot'); 2 | 3 | let data = cc.sys.language === 'zh' ? require('zh') : require('en'); 4 | // let polyglot = null; 5 | let polyglot = new Polyglot({phrases: data, allowMissing: true}); 6 | 7 | 8 | module.exports = { 9 | /** 10 | * This method allow you to switch language during runtime, language argument should be the same as your data file name 11 | * such as when language is 'zh', it will load your 'zh.js' data source. 12 | * @method init 13 | * @param language - the language specific data file name, such as 'zh' to load 'zh.js' 14 | */ 15 | init (language) { 16 | lang = language; 17 | data = language === 'zh' ? require('zh') : require('en'); 18 | polyglot.replace(data); 19 | }, 20 | /** 21 | * this method takes a text key as input, and return the localized string 22 | * Please read https://github.com/airbnb/polyglot.js for details 23 | * @method t 24 | * @return {String} localized string 25 | * @example 26 | * 27 | * var myText = i18n.t('MY_TEXT_KEY'); 28 | * 29 | * // if your data source is defined as 30 | * // {"hello_name": "Hello, %{name}"} 31 | * // you can use the following to interpolate the text 32 | * var greetingText = i18n.t('hello_name', {name: 'nantas'}); // Hello, nantas 33 | */ 34 | t (key, opt) { 35 | return polyglot.t(key, opt); 36 | } 37 | }; -------------------------------------------------------------------------------- /assets/i18n/i18n.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "937890bf-b21b-482f-a7a7-b58b193e379e", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/i18n/polyglot.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "69dec4a0-a519-44d6-bcc4-2a9d11cc6dd5", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/main menu.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "d7a9ae1b-9249-4186-bdf0-2bcdf4dc23ec", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/main menu/Menu.js: -------------------------------------------------------------------------------- 1 | const i18n = require('i18n'); 2 | const SceneList = require('SceneList'); 3 | const TipsManager = require('TipsManager'); 4 | 5 | const Transitions = require('transitions'); 6 | const TransitionMaterials = require('transition-materials'); 7 | 8 | const MainScene = 'TestList.fire'; 9 | 10 | const scenes = [ 11 | 'cases/scene1', 12 | 'cases/scene2', 13 | MainScene 14 | ] 15 | 16 | cc.Class({ 17 | extends: cc.Component, 18 | 19 | properties: { 20 | btnBack: cc.Button, 21 | testList: cc.ScrollView, 22 | uiCamera: cc.Camera, 23 | sceneTitle: cc.Label, 24 | 25 | transitions: Transitions 26 | }, 27 | 28 | onLoad: function () { 29 | this._isLoadingScene = false; 30 | this.showDebugDraw = false; 31 | cc.game.addPersistRootNode(this.node); 32 | this.contentPos = null; 33 | this.btnBack.node.active = false; 34 | 35 | // keep the search scene list res 36 | cc.game.addPersistRootNode(this.testList.node); 37 | if (this.testList && this.testList.content) { 38 | // in main scene 39 | this.sceneList = this.testList.content.getComponent(SceneList); 40 | this.sceneList.init(this); 41 | } 42 | 43 | cc.director.on(cc.Director.EVENT_AFTER_SCENE_LAUNCH, this._onSceneLaunched, this); 44 | 45 | this.sceneIndex = 0; 46 | this.materialIndex = 0; 47 | }, 48 | 49 | _onSceneLaunched () { 50 | let cameras = cc.Camera.cameras; 51 | for (let i = 0, l = cameras.length; i < l; i++) { 52 | let camera = cameras[i]; 53 | if (camera === this.uiCamera) { 54 | camera.cullingMask = 1 << this.node.groupIndex; 55 | } 56 | else { 57 | camera.cullingMask = camera.cullingMask & (~(1 << this.node.groupIndex)); 58 | } 59 | } 60 | }, 61 | 62 | backToList: function () { 63 | this.loadScene(scenes.length - 1); 64 | }, 65 | 66 | loadScene: function (sceneIndex, materialIndex) { 67 | if (this._isLoadingScene) { 68 | return; 69 | } 70 | 71 | this.currentSceneIndex = sceneIndex; 72 | 73 | if (typeof materialIndex === 'number') { 74 | let material = TransitionMaterials[materialIndex]; 75 | if (material) { 76 | this.transitions.material = material; 77 | } 78 | } 79 | 80 | let url = scenes[sceneIndex]; 81 | // let result = cc.director.loadScene(url, this.onLoadSceneFinish.bind(this)); 82 | let result = this.transitions.loadScene(url, 'Canvas/Main Camera', 'Canvas/Main Camera', this.onLoadSceneFinish.bind(this)); 83 | if (!result) { 84 | return; 85 | } 86 | 87 | this._isLoadingScene = true; 88 | 89 | this.contentPos = this.testList.getContentPosition(); 90 | }, 91 | 92 | onLoadSceneFinish: function () { 93 | let isMainScene = this.currentSceneIndex === (scenes.length - 1); 94 | this.testList.node.active = isMainScene; 95 | this.btnBack.node.active = !isMainScene; 96 | this._isLoadingScene = false; 97 | }, 98 | 99 | nextScene () { 100 | ++this.currentSceneIndex; 101 | if (this.currentSceneIndex >= scenes.length) { 102 | this.currentSceneIndex = 0; 103 | } 104 | this.loadScene(this.currentSceneIndex); 105 | }, 106 | 107 | prevScene () { 108 | --this.currentSceneIndex; 109 | if (this.currentSceneIndex < 0) { 110 | this.currentSceneIndex = scenes.length - 1; 111 | } 112 | this.loadScene(this.currentSceneIndex); 113 | }, 114 | }); 115 | -------------------------------------------------------------------------------- /assets/main menu/Menu.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "04525a72-6019-4ddb-a496-6b0694177740", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/main menu/ShowSubMenu.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | toggle () { 5 | let shown = this.node.y < 0; 6 | let animation = this.getComponent(cc.Animation); 7 | animation.play(shown ? 'hide menu' : 'show menu'); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /assets/main menu/ShowSubMenu.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "192244e2-2838-4f6d-9f3f-85391003b7b2", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/main menu/StorageUtil.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | // record example-case state 5 | setCurrentScene (sceneName) { 6 | if (!CC_PREVIEW) { 7 | return; 8 | } 9 | cc.sys.localStorage.setItem('current-scene', sceneName); 10 | }, 11 | 12 | getCurrentScene () { 13 | if (!CC_PREVIEW) { 14 | return; 15 | } 16 | let scene = cc.sys.localStorage.getItem('current-scene'); 17 | if (scene) { 18 | return scene; 19 | } 20 | return null; 21 | }, 22 | // if you want to init the example-case state 23 | clearStorage () { 24 | cc.sys.localStorage.clear(); 25 | } 26 | }); -------------------------------------------------------------------------------- /assets/main menu/StorageUtil.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "9bf9c5a0-4e63-406a-9016-8904f4f18749", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/main menu/back icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/main menu/back icon.png -------------------------------------------------------------------------------- /assets/main menu/back icon.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "ae8e3d60-767e-493b-8a4d-6b564e7ecab0", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": true, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 24, 11 | "height": 24, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "back icon": { 15 | "ver": "1.0.4", 16 | "uuid": "021a3217-44d7-438f-a89f-f87bfebe89d9", 17 | "rawTextureUuid": "ae8e3d60-767e-493b-8a4d-6b564e7ecab0", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 24, 26 | "height": 24, 27 | "rawWidth": 24, 28 | "rawHeight": 24, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/main menu/eject_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/main menu/eject_btn.png -------------------------------------------------------------------------------- /assets/main menu/eject_btn.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "5de7dc2b-df4c-404d-9f68-d799da224356", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": true, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 24, 11 | "height": 24, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "eject_btn": { 15 | "ver": "1.0.4", 16 | "uuid": "ec96fb40-3da6-4d52-aa0c-d985e8d1251b", 17 | "rawTextureUuid": "5de7dc2b-df4c-404d-9f68-d799da224356", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": -2, 22 | "offsetY": -0.5, 23 | "trimX": 6, 24 | "trimY": 5, 25 | "width": 8, 26 | "height": 15, 27 | "rawWidth": 24, 28 | "rawHeight": 24, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/main menu/help_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/main menu/help_btn.png -------------------------------------------------------------------------------- /assets/main menu/help_btn.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "038a47ce-d322-4654-a80d-0419c739168f", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": true, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 24, 11 | "height": 24, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "help_btn": { 15 | "ver": "1.0.4", 16 | "uuid": "e4745854-7ba9-420b-87a8-dbb9b169e59f", 17 | "rawTextureUuid": "038a47ce-d322-4654-a80d-0419c739168f", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 24, 26 | "height": 24, 27 | "rawWidth": 24, 28 | "rawHeight": 24, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/main menu/hide menu.anim: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.AnimationClip", 3 | "_name": "hide menu", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_duration": 1, 7 | "sample": 1, 8 | "speed": 3, 9 | "wrapMode": "0", 10 | "curveData": { 11 | "props": { 12 | "y": [ 13 | { 14 | "frame": 0, 15 | "value": -138, 16 | "curve": "quadOut" 17 | }, 18 | { 19 | "frame": 1, 20 | "value": 0 21 | } 22 | ] 23 | }, 24 | "paths": { 25 | "eject btn": { 26 | "props": { 27 | "angle": [ 28 | { 29 | "frame": 0, 30 | "value": -90 31 | }, 32 | { 33 | "frame": 1, 34 | "value": 90 35 | } 36 | ] 37 | } 38 | } 39 | } 40 | }, 41 | "events": [] 42 | } -------------------------------------------------------------------------------- /assets/main menu/hide menu.anim.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.1.0", 3 | "uuid": "85da162e-cd4b-4971-a276-9f171ecb47ba", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/main menu/next_scene.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/main menu/next_scene.png -------------------------------------------------------------------------------- /assets/main menu/next_scene.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "a91e438f-38c3-4cc9-9f86-3138b2afdafa", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": true, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 24, 11 | "height": 24, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "next_scene": { 15 | "ver": "1.0.4", 16 | "uuid": "28b6c261-6a45-4fad-8592-cf68382a6bf9", 17 | "rawTextureUuid": "a91e438f-38c3-4cc9-9f86-3138b2afdafa", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 24, 26 | "height": 24, 27 | "rawWidth": 24, 28 | "rawHeight": 24, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/main menu/prev_scene.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/main menu/prev_scene.png -------------------------------------------------------------------------------- /assets/main menu/prev_scene.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "68a612ed-3e86-43c2-8883-535bc7711af4", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": true, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 24, 11 | "height": 24, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "prev_scene": { 15 | "ver": "1.0.4", 16 | "uuid": "f1a40bec-1652-49b6-9026-d1a946674f7e", 17 | "rawTextureUuid": "68a612ed-3e86-43c2-8883-535bc7711af4", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 24, 26 | "height": 24, 27 | "rawWidth": 24, 28 | "rawHeight": 24, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/main menu/search_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/main menu/search_btn.png -------------------------------------------------------------------------------- /assets/main menu/search_btn.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "46533172-baae-475f-af98-2eec76ef9acd", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": true, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 24, 11 | "height": 24, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "search_btn": { 15 | "ver": "1.0.4", 16 | "uuid": "dc569285-45ff-44c8-8b84-6620f379cf37", 17 | "rawTextureUuid": "46533172-baae-475f-af98-2eec76ef9acd", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 24, 26 | "height": 24, 27 | "rawWidth": 24, 28 | "rawHeight": 24, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/main menu/show menu.anim: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.AnimationClip", 3 | "_name": "show menu", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_duration": 1, 7 | "sample": 1, 8 | "speed": 3, 9 | "wrapMode": "0", 10 | "curveData": { 11 | "props": { 12 | "y": [ 13 | { 14 | "frame": 0, 15 | "value": 8 16 | }, 17 | { 18 | "frame": 1, 19 | "value": -116 20 | } 21 | ] 22 | }, 23 | "paths": { 24 | "eject btn": { 25 | "props": { 26 | "angle": [ 27 | { 28 | "frame": 0, 29 | "value": 90 30 | }, 31 | { 32 | "frame": 1, 33 | "value": -90 34 | } 35 | ] 36 | } 37 | } 38 | } 39 | }, 40 | "events": [] 41 | } -------------------------------------------------------------------------------- /assets/main menu/show menu.anim.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.1.0", 3 | "uuid": "87ae578d-45ed-454c-a18e-5c6441862baa", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/res.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "41ab25f2-bf0a-4c4b-b238-2603528133d3", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/res/prefabs.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "e3b94735-90fa-42ae-88b5-b5274386e406", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/res/prefabs/Background.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_native": "", 7 | "data": { 8 | "__id__": 1 9 | }, 10 | "optimizationPolicy": 0, 11 | "asyncLoadAssets": false 12 | }, 13 | { 14 | "__type__": "cc.Node", 15 | "_name": "Background", 16 | "_objFlags": 0, 17 | "_parent": null, 18 | "_children": [], 19 | "_active": true, 20 | "_level": 1, 21 | "_components": [ 22 | { 23 | "__id__": 2 24 | }, 25 | { 26 | "__id__": 3 27 | } 28 | ], 29 | "_prefab": { 30 | "__id__": 4 31 | }, 32 | "_opacity": 255, 33 | "_color": { 34 | "__type__": "cc.Color", 35 | "r": 56, 36 | "g": 59, 37 | "b": 65, 38 | "a": 255 39 | }, 40 | "_contentSize": { 41 | "__type__": "cc.Size", 42 | "width": 960, 43 | "height": 640 44 | }, 45 | "_anchorPoint": { 46 | "__type__": "cc.Vec2", 47 | "x": 0.5, 48 | "y": 0.5 49 | }, 50 | "_skewX": 0, 51 | "_skewY": 0, 52 | "_zIndex": 0, 53 | "groupIndex": 0, 54 | "_id": "", 55 | "_eulerAngles": { 56 | "__type__": "cc.Vec3", 57 | "x": 0, 58 | "y": 0, 59 | "z": 0 60 | }, 61 | "_trs": { 62 | "__type__": "TypedArray", 63 | "ctor": "Float64Array", 64 | "array": [ 65 | 0, 66 | 0, 67 | 0, 68 | 0, 69 | 0, 70 | 0, 71 | 0, 72 | 1, 73 | 1, 74 | 1 75 | ] 76 | } 77 | }, 78 | { 79 | "__type__": "cc.Sprite", 80 | "_name": "", 81 | "_objFlags": 0, 82 | "node": { 83 | "__id__": 1 84 | }, 85 | "_enabled": true, 86 | "_srcBlendFactor": 770, 87 | "_dstBlendFactor": 771, 88 | "_spriteFrame": { 89 | "__uuid__": "0aa0b36c-c4a9-4ce2-ab3b-efede708e6d4" 90 | }, 91 | "_type": 0, 92 | "_sizeMode": 0, 93 | "_fillType": 0, 94 | "_fillCenter": { 95 | "__type__": "cc.Vec2", 96 | "x": 0, 97 | "y": 0 98 | }, 99 | "_fillStart": 0, 100 | "_fillRange": 0, 101 | "_isTrimmedMode": true, 102 | "_state": 0, 103 | "_atlas": null, 104 | "_id": "" 105 | }, 106 | { 107 | "__type__": "cc.Widget", 108 | "_name": "", 109 | "_objFlags": 0, 110 | "node": { 111 | "__id__": 1 112 | }, 113 | "_enabled": true, 114 | "alignMode": 2, 115 | "_target": null, 116 | "_alignFlags": 45, 117 | "_left": 0, 118 | "_right": 0, 119 | "_top": 0, 120 | "_bottom": 0, 121 | "_verticalCenter": 0, 122 | "_horizontalCenter": 0, 123 | "_isAbsLeft": true, 124 | "_isAbsRight": true, 125 | "_isAbsTop": true, 126 | "_isAbsBottom": true, 127 | "_isAbsHorizontalCenter": true, 128 | "_isAbsVerticalCenter": true, 129 | "_originalWidth": 960, 130 | "_originalHeight": 640, 131 | "_id": "" 132 | }, 133 | { 134 | "__type__": "cc.PrefabInfo", 135 | "root": { 136 | "__id__": 1 137 | }, 138 | "asset": { 139 | "__uuid__": "b8392351-be97-4f01-985e-3e7d2118f3c9" 140 | }, 141 | "fileId": "78fd70+ls5GgJcFkzvLSRk8", 142 | "sync": false 143 | } 144 | ] -------------------------------------------------------------------------------- /assets/res/prefabs/Background.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "b8392351-be97-4f01-985e-3e7d2118f3c9", 4 | "optimizationPolicy": "SINGLE_INSTANCE", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/res/prefabs/Center Menu.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "9819eaa9-8394-43c2-b22c-8ee47df3962a", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/res/prefabs/Left Menu.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "6c8b509b-c51f-4770-9bb0-9c444abf9c83", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/res/prefabs/ListItem.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "1ea21a34-ca68-4880-8df6-05abb19079fd", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/res/textures.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "41f1cebf-34e8-4dbb-9415-2e97dd2d7720", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/res/textures/new ui.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "c6e39510-b5c7-4bf5-959a-c513dfbe28f4", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/res/textures/new ui/btn_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/res/textures/new ui/btn_disabled.png -------------------------------------------------------------------------------- /assets/res/textures/new ui/btn_disabled.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "8a60351e-d9cc-46f4-b1d6-6cde36a5b9ad", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 194, 11 | "height": 68, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "btn_disabled": { 15 | "ver": "1.0.4", 16 | "uuid": "be9d52d3-0862-4002-9f59-06cf5803a53d", 17 | "rawTextureUuid": "8a60351e-d9cc-46f4-b1d6-6cde36a5b9ad", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 194, 26 | "height": 68, 27 | "rawWidth": 194, 28 | "rawHeight": 68, 29 | "borderTop": 5, 30 | "borderBottom": 5, 31 | "borderLeft": 5, 32 | "borderRight": 5, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/res/textures/new ui/btn_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/res/textures/new ui/btn_normal.png -------------------------------------------------------------------------------- /assets/res/textures/new ui/btn_normal.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "eb06a97a-5161-4d70-bac7-8a8f885f8399", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 194, 11 | "height": 68, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "btn_normal": { 15 | "ver": "1.0.4", 16 | "uuid": "623fe0d3-a68c-46bf-bde7-75fad00627c6", 17 | "rawTextureUuid": "eb06a97a-5161-4d70-bac7-8a8f885f8399", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 194, 26 | "height": 68, 27 | "rawWidth": 194, 28 | "rawHeight": 68, 29 | "borderTop": 5, 30 | "borderBottom": 5, 31 | "borderLeft": 5, 32 | "borderRight": 5, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/res/textures/new ui/btn_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/res/textures/new ui/btn_pressed.png -------------------------------------------------------------------------------- /assets/res/textures/new ui/btn_pressed.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "4e02ec2c-860e-43cc-9910-8ff2aa151884", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 194, 11 | "height": 68, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "btn_pressed": { 15 | "ver": "1.0.4", 16 | "uuid": "10541720-ba55-403f-b0c4-9decb7ed875e", 17 | "rawTextureUuid": "4e02ec2c-860e-43cc-9910-8ff2aa151884", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 194, 26 | "height": 68, 27 | "rawWidth": 194, 28 | "rawHeight": 68, 29 | "borderTop": 5, 30 | "borderBottom": 5, 31 | "borderLeft": 5, 32 | "borderRight": 5, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/res/textures/new ui/editbox_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/res/textures/new ui/editbox_bg.png -------------------------------------------------------------------------------- /assets/res/textures/new ui/editbox_bg.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "0439ddbc-5893-4fd0-a233-d0f5e51ba5cd", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 40, 11 | "height": 40, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "editbox_bg": { 15 | "ver": "1.0.4", 16 | "uuid": "9ce82ea8-5159-4ef9-bebf-736f3d6b01fe", 17 | "rawTextureUuid": "0439ddbc-5893-4fd0-a233-d0f5e51ba5cd", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 40, 26 | "height": 40, 27 | "rawWidth": 40, 28 | "rawHeight": 40, 29 | "borderTop": 2, 30 | "borderBottom": 2, 31 | "borderLeft": 2, 32 | "borderRight": 2, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/res/textures/singleColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/res/textures/singleColor.png -------------------------------------------------------------------------------- /assets/res/textures/singleColor.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "1b6a0b3c-2a0e-410a-95ab-53dc9a03a360", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 2, 11 | "height": 2, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "singleColor": { 15 | "ver": "1.0.4", 16 | "uuid": "0aa0b36c-c4a9-4ce2-ab3b-efede708e6d4", 17 | "rawTextureUuid": "1b6a0b3c-2a0e-410a-95ab-53dc9a03a360", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 2, 26 | "height": 2, 27 | "rawWidth": 2, 28 | "rawHeight": 2, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/res/textures/sliced.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "28dd06c0-48e2-4e55-942a-cc83f6859d46", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/res/textures/sliced/panel_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/res/textures/sliced/panel_bg.png -------------------------------------------------------------------------------- /assets/res/textures/sliced/panel_bg.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "6fd1ec90-efab-41ec-ab6b-4cd6a085951d", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 20, 11 | "height": 20, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "panel_bg": { 15 | "ver": "1.0.4", 16 | "uuid": "008611f6-7f64-4f7b-aef3-440e0e0b32db", 17 | "rawTextureUuid": "6fd1ec90-efab-41ec-ab6b-4cd6a085951d", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 20, 26 | "height": 20, 27 | "rawWidth": 20, 28 | "rawHeight": 20, 29 | "borderTop": 4, 30 | "borderBottom": 6, 31 | "borderLeft": 5, 32 | "borderRight": 5, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/res/textures/test.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "020ee647-f1c3-4020-9d82-e12bb3fb6112", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/res/textures/test/1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/res/textures/test/1.jpeg -------------------------------------------------------------------------------- /assets/res/textures/test/1.jpeg.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "aa0f7231-750f-4114-9598-33d51c5a433f", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 1280, 11 | "height": 853, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "1": { 15 | "ver": "1.0.4", 16 | "uuid": "3f266082-a057-4c6f-972a-583f87f6ccb1", 17 | "rawTextureUuid": "aa0f7231-750f-4114-9598-33d51c5a433f", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 1280, 26 | "height": 853, 27 | "rawWidth": 1280, 28 | "rawHeight": 853, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/res/textures/test/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/res/textures/test/2.jpg -------------------------------------------------------------------------------- /assets/res/textures/test/2.jpg.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "7b2683f6-5ee3-497f-9eae-4a98e2b9ecb6", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 533, 11 | "height": 300, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "2": { 15 | "ver": "1.0.4", 16 | "uuid": "7e2795e4-a987-4df3-bc34-d2b660d29f47", 17 | "rawTextureUuid": "7b2683f6-5ee3-497f-9eae-4a98e2b9ecb6", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 533, 26 | "height": 300, 27 | "rawWidth": 533, 28 | "rawHeight": 300, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/res/textures/test/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/res/textures/test/3.png -------------------------------------------------------------------------------- /assets/res/textures/test/3.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "a4f105e4-f620-4179-92b8-b4b665546f75", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 1470, 11 | "height": 824, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "3": { 15 | "ver": "1.0.4", 16 | "uuid": "b90e5ae5-fa65-4e46-b130-4b47d771891d", 17 | "rawTextureUuid": "a4f105e4-f620-4179-92b8-b4b665546f75", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": -3, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 1464, 26 | "height": 824, 27 | "rawWidth": 1470, 28 | "rawHeight": 824, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/res/textures/test/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/res/textures/test/4.png -------------------------------------------------------------------------------- /assets/res/textures/test/4.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "2086f40b-c273-498d-ba0c-8cadd3476773", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 1470, 11 | "height": 828, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "4": { 15 | "ver": "1.0.4", 16 | "uuid": "43bbce4b-401e-4614-b27a-63904e2b83ca", 17 | "rawTextureUuid": "2086f40b-c273-498d-ba0c-8cadd3476773", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 1470, 26 | "height": 828, 27 | "rawWidth": 1470, 28 | "rawHeight": 828, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/res/textures/ui.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "c7c5f1e6-c626-4405-95d6-2293c768b38b", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/res/textures/ui/style1.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "9639523c-8f3f-46d6-b5ea-a8927968ad5e", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/res/textures/ui/style1/panelBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2youyou2/transitions/eb9da0bb10a7c4caf76e4bae53812ced32770c0a/assets/res/textures/ui/style1/panelBG.png -------------------------------------------------------------------------------- /assets/res/textures/ui/style1/panelBG.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "3229feab-b062-4c75-ad91-b962602def21", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 27, 11 | "height": 30, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "panelBG": { 15 | "ver": "1.0.4", 16 | "uuid": "9320f0a4-5719-47a8-8f67-624a72c356f0", 17 | "rawTextureUuid": "3229feab-b062-4c75-ad91-b962602def21", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 27, 26 | "height": 30, 27 | "rawWidth": 27, 28 | "rawHeight": 30, 29 | "borderTop": 12, 30 | "borderBottom": 15, 31 | "borderLeft": 11, 32 | "borderRight": 11, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/resources.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "fbb67471-55be-4002-b63a-83bc66cd5bff", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/transitions.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "756e11ba-138f-48df-98e0-37743718ab79", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/transitions/editor.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "0993a21b-4ce8-4593-921f-187ec64fe893", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/transitions/editor/transitions-inspector.js: -------------------------------------------------------------------------------- 1 | if (CC_EDITOR && window.Vue) { 2 | 3 | Vue.component('transitions', { 4 | 5 | template: ` 6 | 7 | 8 | 12 | 16 | 22 | 23 | 24 | 25 | 34 | 35 | 36 | `, 37 | 38 | props: { 39 | target: { 40 | twoWay: true, 41 | type: Object, 42 | }, 43 | 44 | multi: { 45 | twoWay: true, 46 | type: Boolean, 47 | }, 48 | }, 49 | 50 | data () { 51 | return { 52 | materialName: '', 53 | materialTypes: [] 54 | } 55 | }, 56 | 57 | compiled () { 58 | this.materials = {}; 59 | 60 | let Path = Editor.require('fire-path'); 61 | Editor.assetdb.queryAssets('db://assets/**/transitions/**', 'material', (err, results) => { 62 | if (err) { 63 | Editor.error(err); 64 | return; 65 | } 66 | if (results) { 67 | this.materialTypes = results.map(ret => { 68 | let name = Path.basenameNoExt(ret.path); 69 | if (ret.uuid === this.target.material.value.uuid) { 70 | this.materialName = name; 71 | } 72 | this.materials[name] = ret; 73 | return name; 74 | }) 75 | } 76 | }); 77 | }, 78 | 79 | watch: { 80 | materialName () { 81 | let uuid = this.materials[this.materialName].uuid; 82 | let prop = this.target.material; 83 | if (uuid === prop.value.uuid) { 84 | return; 85 | } 86 | 87 | Editor.UI.fire(this.$el, 'target-change', { 88 | bubbles: true, 89 | detail: { 90 | type: prop.type, 91 | path: prop.path, 92 | value: { uuid }, 93 | } 94 | }); 95 | } 96 | }, 97 | 98 | methods: { 99 | _onMaterialChanged (event) { 100 | this.materialName = event.target.value; 101 | }, 102 | } 103 | }); 104 | } -------------------------------------------------------------------------------- /assets/resources/transitions/editor/transitions-inspector.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "71a0bc4a-eb5e-4a52-91b7-178cb801683b", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "df844021-12b4-4005-8c63-758ca7ed81e8", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/brighten.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | fromTime: { value: 0.2 } 23 | }% 24 | 25 | CCProgram transition %{ 26 | 27 | uniform Transition { 28 | float fromTime; 29 | }; 30 | 31 | vec4 transition(vec2 uv) { 32 | vec4 c; 33 | if (time < fromTime) { 34 | c = getFromColor(uv); 35 | c.rgb *= (time / fromTime) * 5.0 + 1.0; 36 | } 37 | else { 38 | c = getToColor(uv); 39 | c.rgb *= ((1.0-time) / (1.0-fromTime)) * 5.0 + 1.0; 40 | } 41 | return c; 42 | } 43 | 44 | }% 45 | 46 | CCProgram vs %{ 47 | 48 | precision highp float; 49 | 50 | #include 51 | #include 52 | 53 | in vec3 a_position; 54 | in lowp vec4 a_color; 55 | 56 | in mediump vec2 a_uv0; 57 | out mediump vec2 v_uv0; 58 | 59 | out lowp vec4 v_color; 60 | 61 | void main () { 62 | mat4 mvp; 63 | 64 | mvp = cc_matViewProj; 65 | 66 | v_uv0 = a_uv0; 67 | v_color = a_color; 68 | 69 | gl_Position = mvp * vec4(a_position, 1); 70 | } 71 | 72 | }% 73 | 74 | CCProgram fs %{ 75 | 76 | precision highp float; 77 | 78 | uniform sampler2D texture; 79 | uniform sampler2D texture2; 80 | in mediump vec2 v_uv0; 81 | 82 | uniform Time { 83 | float time; 84 | }; 85 | 86 | in lowp vec4 v_color; 87 | 88 | vec4 getFromColor(vec2 uv) { 89 | return texture2D(texture, uv); 90 | } 91 | 92 | vec4 getToColor(vec2 uv) { 93 | return texture2D(texture2, uv); 94 | } 95 | 96 | #include 97 | 98 | void main () { 99 | gl_FragColor = v_color * transition(v_uv0); 100 | } 101 | 102 | }% 103 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/brighten.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "f0d91c90-24a6-4f8d-b469-aa8b9167d31f", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nuniform float fromTime;\nvec4 transition(vec2 uv) {\n vec4 c;\n if (time < fromTime) {\n c = getFromColor(uv);\n c.rgb *= (time / fromTime) * 5.0 + 1.0;\n }\n else {\n c = getToColor(uv);\n c.rgb *= ((1.0-time) / (1.0-fromTime)) * 5.0 + 1.0;\n }\n return c;\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nuniform Transition {\n float fromTime;\n};\nvec4 transition(vec2 uv) {\n vec4 c;\n if (time < fromTime) {\n c = getFromColor(uv);\n c.rgb *= (time / fromTime) * 5.0 + 1.0;\n }\n else {\n c = getToColor(uv);\n c.rgb *= ((1.0-time) / (1.0-fromTime)) * 5.0 + 1.0;\n }\n return c;\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/brighten.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "New Material", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "f0d91c90-24a6-4f8d-b469-aa8b9167d31f" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/brighten.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "b741dc8e-139d-44e7-9c93-fc25f8913b40", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/crop.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "138cd5af-0032-45af-92ab-6aa5890b0201", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/crop/crop-circle.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "New Material", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "cde5f67c-14e6-44f0-9de5-d8f1592e8c4f" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/crop/crop-circle.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "8fd50615-f012-4dda-a266-05143c28e2b2", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/crop/crop-diamond.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "crop-diamond", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "cde5f67c-14e6-44f0-9de5-d8f1592e8c4f" 8 | }, 9 | "_techniqueIndex": 3, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/crop/crop-diamond.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "84025be5-a3c4-4432-9eb2-d9320dc1f3c7", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/crop/crop-rect.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "rect-crop", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "cde5f67c-14e6-44f0-9de5-d8f1592e8c4f" 8 | }, 9 | "_techniqueIndex": 1, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/crop/crop-rect.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "ef0a8063-9dfc-477f-b802-0b54bfe2cb65", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/crop/crop-shape.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | commonPass: &commonPass 10 | vert: vs 11 | blendState: 12 | targets: 13 | - blend: true 14 | rasterizerState: 15 | cullMode: none 16 | properties: 17 | texture: { value: white } 18 | texture2: { value: white } 19 | time: { value: 0 } 20 | ratio: { value: 0 } 21 | 22 | bgcolor: { value: [0.0, 0.0, 0.0, 1.0], editor: { type: color } } 23 | center: { value: [0.5, 0.5] } 24 | techniques: 25 | - name: circle 26 | passes: 27 | - <<: *commonPass 28 | frag: circle-fs 29 | - name: rect 30 | passes: 31 | - <<: *commonPass 32 | frag: rect-fs 33 | - name: square 34 | passes: 35 | - <<: *commonPass 36 | frag: square-fs 37 | - name: diamond 38 | passes: 39 | - <<: *commonPass 40 | frag: diamond-fs 41 | }% 42 | 43 | CCProgram transition %{ 44 | 45 | float progress = time; 46 | 47 | uniform Transition { 48 | vec4 bgcolor; // = 0.1 49 | vec2 center; 50 | }; 51 | 52 | // License: MIT 53 | // Author: fkuteken 54 | // ported by gre from https://gist.github.com/fkuteken/f63e3009c1143950dee9063c3b83fb88 55 | 56 | vec2 ratio2 = vec2(1.0, 1.0 / ratio); 57 | float s = pow(2.0 * abs(progress - 0.5), 3.0); 58 | 59 | vec4 transition(vec2 p) { 60 | float dist = getDist(p, center, ratio2); 61 | return mix( 62 | progress < 0.5 ? getFromColor(p) : getToColor(p), // branching is ok here as we statically depend on progress uniform (branching won't change over pixels) 63 | bgcolor, 64 | step(s, dist) 65 | ); 66 | } 67 | 68 | void main () { 69 | gl_FragColor = v_color * transition(v_uv0); 70 | } 71 | 72 | }% 73 | 74 | CCProgram vs %{ 75 | 76 | precision highp float; 77 | 78 | #include 79 | #include 80 | 81 | in vec3 a_position; 82 | in lowp vec4 a_color; 83 | 84 | in mediump vec2 a_uv0; 85 | out mediump vec2 v_uv0; 86 | 87 | out lowp vec4 v_color; 88 | 89 | void main () { 90 | mat4 mvp; 91 | 92 | mvp = cc_matViewProj; 93 | 94 | v_uv0 = a_uv0; 95 | v_color = a_color; 96 | 97 | gl_Position = mvp * vec4(a_position, 1); 98 | } 99 | 100 | }% 101 | 102 | CCProgram common-fs %{ 103 | 104 | uniform sampler2D texture; 105 | uniform sampler2D texture2; 106 | in mediump vec2 v_uv0; 107 | 108 | uniform Time { 109 | float time; 110 | float ratio; 111 | }; 112 | 113 | in lowp vec4 v_color; 114 | 115 | vec4 getFromColor(vec2 uv) { 116 | return texture(texture, uv); 117 | } 118 | 119 | vec4 getToColor(vec2 uv) { 120 | return texture(texture2, uv); 121 | } 122 | 123 | #include 124 | 125 | }% 126 | 127 | CCProgram circle-fs %{ 128 | 129 | precision highp float; 130 | 131 | float getDist (vec2 p, vec2 center, vec2 ratio) { 132 | return length((vec2(p) - center) * ratio); 133 | } 134 | 135 | #include 136 | 137 | }% 138 | 139 | 140 | CCProgram rect-fs %{ 141 | 142 | precision highp float; 143 | 144 | float getDist (vec2 p, vec2 center, vec2 ratio) { 145 | vec2 dif = abs(p - center); 146 | return max(dif.x, dif.y); 147 | } 148 | 149 | #include 150 | 151 | }% 152 | 153 | 154 | CCProgram square-fs %{ 155 | 156 | precision highp float; 157 | 158 | float getDist (vec2 p, vec2 center, vec2 ratio) { 159 | vec2 dif = abs((vec2(p) - center) * ratio); 160 | return max(dif.x, dif.y); 161 | } 162 | 163 | #include 164 | 165 | }% 166 | 167 | CCProgram diamond-fs %{ 168 | 169 | precision highp float; 170 | 171 | const float PI = 3.141592653589793; 172 | float deg = 45.0 / 180. * PI; 173 | mat2 rotation = mat2( 174 | cos(deg), sin(deg), 175 | -sin(deg), cos(deg) 176 | ); 177 | 178 | float getDist (vec2 p, vec2 center, vec2 ratio) { 179 | vec2 dif = abs(rotation * ((p - center) * ratio)); 180 | return max(dif.x, dif.y); 181 | } 182 | 183 | #include 184 | 185 | }% 186 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/crop/crop-square.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "New Material", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "cde5f67c-14e6-44f0-9de5-d8f1592e8c4f" 8 | }, 9 | "_techniqueIndex": 2, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/crop/crop-square.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "bf4563d8-40af-4452-8471-be08d5ec64ea", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/cross-zoom.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | strength: { value: 0.4 } 24 | }% 25 | 26 | CCProgram transition %{ 27 | 28 | float progress = time; 29 | 30 | uniform Transition { 31 | float strength; 32 | }; 33 | // License: MIT 34 | // Author: rectalogic 35 | // ported by gre from https://gist.github.com/rectalogic/b86b90161503a0023231 36 | 37 | // Converted from https://github.com/rectalogic/rendermix-basic-effects/blob/master/assets/com/rendermix/CrossZoom/CrossZoom.frag 38 | // Which is based on https://github.com/evanw/glfx.js/blob/master/src/filters/blur/zoomblur.js 39 | // With additional easing functions from https://github.com/rectalogic/rendermix-basic-effects/blob/master/assets/com/rendermix/Easing/Easing.glsllib 40 | 41 | const float PI = 3.141592653589793; 42 | 43 | float Linear_ease(in float begin, in float change, in float duration, in float time) { 44 | return change * time / duration + begin; 45 | } 46 | 47 | float Exponential_easeInOut(in float begin, in float change, in float duration, in float time) { 48 | if (time == 0.0) 49 | return begin; 50 | else if (time == duration) 51 | return begin + change; 52 | time = time / (duration / 2.0); 53 | if (time < 1.0) 54 | return change / 2.0 * pow(2.0, 10.0 * (time - 1.0)) + begin; 55 | return change / 2.0 * (-pow(2.0, -10.0 * (time - 1.0)) + 2.0) + begin; 56 | } 57 | 58 | float Sinusoidal_easeInOut(in float begin, in float change, in float duration, in float time) { 59 | return -change / 2.0 * (cos(PI * time / duration) - 1.0) + begin; 60 | } 61 | 62 | float rand (vec2 co) { 63 | return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); 64 | } 65 | 66 | vec3 crossFade(in vec2 uv, in float dissolve) { 67 | return mix(getFromColor(uv).rgb, getToColor(uv).rgb, dissolve); 68 | } 69 | 70 | vec4 transition(vec2 uv) { 71 | vec2 texCoord = uv.xy / vec2(1.0).xy; 72 | 73 | // Linear interpolate center across center half of the image 74 | vec2 center = vec2(Linear_ease(0.25, 0.5, 1.0, progress), 0.5); 75 | float dissolve = Exponential_easeInOut(0.0, 1.0, 1.0, progress); 76 | 77 | // Mirrored sinusoidal loop. 0->strength then strength->0 78 | float strength = Sinusoidal_easeInOut(0.0, strength, 0.5, progress); 79 | 80 | vec3 color = vec3(0.0); 81 | float total = 0.0; 82 | vec2 toCenter = center - texCoord; 83 | 84 | /* randomize the lookup values to hide the fixed number of samples */ 85 | float offset = rand(uv); 86 | 87 | for (float t = 0.0; t <= 40.0; t++) { 88 | float percent = (t + offset) / 40.0; 89 | float weight = 4.0 * (percent - percent * percent); 90 | color += crossFade(texCoord + toCenter * percent * strength, dissolve) * weight; 91 | total += weight; 92 | } 93 | return vec4(color / total, 1.0); 94 | } 95 | 96 | 97 | }% 98 | 99 | CCProgram vs %{ 100 | 101 | precision highp float; 102 | 103 | #include 104 | #include 105 | 106 | in vec3 a_position; 107 | in lowp vec4 a_color; 108 | 109 | in mediump vec2 a_uv0; 110 | out mediump vec2 v_uv0; 111 | 112 | out lowp vec4 v_color; 113 | 114 | void main () { 115 | mat4 mvp; 116 | 117 | mvp = cc_matViewProj; 118 | 119 | v_uv0 = a_uv0; 120 | v_color = a_color; 121 | 122 | gl_Position = mvp * vec4(a_position, 1); 123 | } 124 | 125 | }% 126 | 127 | CCProgram fs %{ 128 | 129 | precision highp float; 130 | 131 | uniform sampler2D texture; 132 | uniform sampler2D texture2; 133 | in mediump vec2 v_uv0; 134 | 135 | uniform Time { 136 | float time; 137 | float ratio; 138 | }; 139 | 140 | in lowp vec4 v_color; 141 | 142 | vec4 getFromColor(vec2 uv) { 143 | return texture(texture, uv); 144 | } 145 | 146 | vec4 getToColor(vec2 uv) { 147 | return texture(texture2, uv); 148 | } 149 | 150 | #include 151 | 152 | void main () { 153 | gl_FragColor = v_color * transition(v_uv0); 154 | } 155 | 156 | }% 157 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/cross-zoom.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "cross-zoom", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "544a5a79-7f4b-402c-bd62-e75c661592be" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/cross-zoom.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "f4d54da3-e9f6-4996-b615-6a3b71f26b33", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/cube.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | persp: { value: 0.7 } 24 | unzoom: { value: 0.3 } 25 | reflection: { value: 0.4 } 26 | floating: { value: 3.0 } 27 | }% 28 | 29 | CCProgram transition %{ 30 | 31 | float progress = time; 32 | 33 | uniform Transition { 34 | float persp; // = 0.7 35 | float unzoom; // = 0.3 36 | float reflection; // = 0.4 37 | float floating; // = 3.0 38 | }; 39 | // Author: gre 40 | // License: MIT 41 | 42 | vec2 project (vec2 p) { 43 | return p * vec2(1.0, -1.2) + vec2(0.0, -floating/100.); 44 | } 45 | 46 | bool inBounds (vec2 p) { 47 | return all(lessThan(vec2(0.0), p)) && all(lessThan(p, vec2(1.0))); 48 | } 49 | 50 | vec4 bgColor (vec2 p, vec2 pfr, vec2 pto) { 51 | vec4 c = vec4(0.0, 0.0, 0.0, 1.0); 52 | pfr = project(pfr); 53 | // FIXME avoid branching might help perf! 54 | if (inBounds(pfr)) { 55 | c += mix(vec4(0.0), getFromColor(pfr), reflection * mix(1.0, 0.0, pfr.y)); 56 | } 57 | pto = project(pto); 58 | if (inBounds(pto)) { 59 | c += mix(vec4(0.0), getToColor(pto), reflection * mix(1.0, 0.0, pto.y)); 60 | } 61 | return c; 62 | } 63 | 64 | // p : the position 65 | // persp : the perspective in [ 0, 1 ] 66 | // center : the xcenter in [0, 1] \ 0.5 excluded 67 | vec2 xskew (vec2 p, float persp, float center) { 68 | float x = mix(p.x, 1.0-p.x, center); 69 | return ( 70 | ( 71 | vec2( x, (p.y - 0.5*(1.0-persp) * x) / (1.0+(persp-1.0)*x) ) 72 | - vec2(0.5-distance(center, 0.5), 0.0) 73 | ) 74 | * vec2(0.5 / distance(center, 0.5) * (center<0.5 ? 1.0 : -1.0), 1.0) 75 | + vec2(center<0.5 ? 0.0 : 1.0, 0.0) 76 | ); 77 | } 78 | 79 | vec4 transition(vec2 op) { 80 | float uz = unzoom * 2.0*(0.5-distance(0.5, progress)); 81 | vec2 p = -uz*0.5+(1.0+uz) * op; 82 | vec2 fromP = xskew( 83 | (p - vec2(progress, 0.0)) / vec2(1.0-progress, 1.0), 84 | 1.0-mix(progress, 0.0, persp), 85 | 0.0 86 | ); 87 | vec2 toP = xskew( 88 | p / vec2(progress, 1.0), 89 | mix(pow(progress, 2.0), 1.0, persp), 90 | 1.0 91 | ); 92 | // FIXME avoid branching might help perf! 93 | if (inBounds(fromP)) { 94 | return getFromColor(fromP); 95 | } 96 | else if (inBounds(toP)) { 97 | return getToColor(toP); 98 | } 99 | return bgColor(op, fromP, toP); 100 | } 101 | 102 | }% 103 | 104 | CCProgram vs %{ 105 | 106 | precision highp float; 107 | 108 | #include 109 | #include 110 | 111 | in vec3 a_position; 112 | in lowp vec4 a_color; 113 | 114 | in mediump vec2 a_uv0; 115 | out mediump vec2 v_uv0; 116 | 117 | out lowp vec4 v_color; 118 | 119 | void main () { 120 | mat4 mvp; 121 | 122 | mvp = cc_matViewProj; 123 | 124 | v_uv0 = a_uv0; 125 | v_color = a_color; 126 | 127 | gl_Position = mvp * vec4(a_position, 1); 128 | } 129 | 130 | }% 131 | 132 | CCProgram fs %{ 133 | 134 | precision highp float; 135 | 136 | uniform sampler2D texture; 137 | uniform sampler2D texture2; 138 | in mediump vec2 v_uv0; 139 | 140 | uniform Time { 141 | float time; 142 | float ratio; 143 | }; 144 | 145 | in lowp vec4 v_color; 146 | 147 | vec4 getFromColor(vec2 uv) { 148 | return texture(texture, uv); 149 | } 150 | 151 | vec4 getToColor(vec2 uv) { 152 | return texture(texture2, uv); 153 | } 154 | 155 | #include 156 | 157 | void main () { 158 | gl_FragColor = v_color * transition(v_uv0); 159 | } 160 | 161 | }% 162 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/cube.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "cube", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "be75d64a-89b2-4c5b-8a46-fc1b6685639c" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/cube.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "c2a83ee2-6650-415a-980b-ed3a5755c6ea", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/directional-wipe.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "82229520-479a-497d-8cf3-24f810908459", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/directional-wipe/directional-wipe-lb.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "directional-wipe-rb - 001", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "626f665d-a1c6-4a9a-8325-2d521d14d77a" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "direction": { 15 | "__type__": "cc.Vec2", 16 | "x": -1, 17 | "y": -1 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/directional-wipe/directional-wipe-lb.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "9e49cf21-c1a1-4448-9ee8-b0a10dd28bcd", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/directional-wipe/directional-wipe-lt.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "directional-wipe-lb - 001", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "626f665d-a1c6-4a9a-8325-2d521d14d77a" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "direction": { 15 | "__type__": "cc.Vec2", 16 | "x": -1, 17 | "y": 1 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/directional-wipe/directional-wipe-lt.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "2c760926-ed0d-45e6-81dd-7fa4d0b34243", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/directional-wipe/directional-wipe-rb.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "directional-wipe-rt - 001", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "626f665d-a1c6-4a9a-8325-2d521d14d77a" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "direction": { 15 | "__type__": "cc.Vec2", 16 | "x": 1, 17 | "y": -1 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/directional-wipe/directional-wipe-rb.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "e80d8b3e-0106-4727-a6e2-080c59f42c63", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/directional-wipe/directional-wipe-rt.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "directional-wipe", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "626f665d-a1c6-4a9a-8325-2d521d14d77a" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "direction": { 15 | "__type__": "cc.Vec2", 16 | "x": 1, 17 | "y": 1 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/directional-wipe/directional-wipe-rt.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "4199376b-a8d5-47da-9ca2-b73532ce3b4b", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/directional-wipe/directional-wipe.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | direction: { value: [1.0, -1.0] } 24 | smoothness: { value: 0.5 } 25 | }% 26 | 27 | CCProgram transition %{ 28 | 29 | float progress = time; 30 | 31 | uniform Transition { 32 | vec2 direction; // = vec2(1.0, -1.0) 33 | float smoothness; // = 0.5 34 | }; 35 | // Author: gre 36 | // License: MIT 37 | 38 | const vec2 center = vec2(0.5, 0.5); 39 | 40 | vec4 transition (vec2 uv) { 41 | vec2 v = normalize(direction); 42 | v /= abs(v.x)+abs(v.y); 43 | float d = v.x * center.x + v.y * center.y; 44 | float m = 45 | (1.0-step(progress, 0.0)) * // there is something wrong with our formula that makes m not equals 0.0 with progress is 0.0 46 | (1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d-0.5+progress*(1.+smoothness)))); 47 | return mix(getFromColor(uv), getToColor(uv), m); 48 | } 49 | 50 | }% 51 | 52 | CCProgram vs %{ 53 | 54 | precision highp float; 55 | 56 | #include 57 | #include 58 | 59 | in vec3 a_position; 60 | in lowp vec4 a_color; 61 | 62 | in mediump vec2 a_uv0; 63 | out mediump vec2 v_uv0; 64 | 65 | out lowp vec4 v_color; 66 | 67 | void main () { 68 | mat4 mvp; 69 | 70 | mvp = cc_matViewProj; 71 | 72 | v_uv0 = a_uv0; 73 | v_color = a_color; 74 | 75 | gl_Position = mvp * vec4(a_position, 1); 76 | } 77 | 78 | }% 79 | 80 | CCProgram fs %{ 81 | 82 | precision highp float; 83 | 84 | uniform sampler2D texture; 85 | uniform sampler2D texture2; 86 | in mediump vec2 v_uv0; 87 | 88 | uniform Time { 89 | float time; 90 | float ratio; 91 | }; 92 | 93 | in lowp vec4 v_color; 94 | 95 | vec4 getFromColor(vec2 uv) { 96 | return texture(texture, uv); 97 | } 98 | 99 | vec4 getToColor(vec2 uv) { 100 | return texture(texture2, uv); 101 | } 102 | 103 | #include 104 | 105 | void main () { 106 | gl_FragColor = v_color * transition(v_uv0); 107 | } 108 | 109 | }% 110 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/directional-wipe/directional-wipe.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "626f665d-a1c6-4a9a-8325-2d521d14d77a", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nfloat progress = time;\nuniform vec2 direction;\nuniform float smoothness;\nconst vec2 center = vec2(0.5, 0.5);\nvec4 transition (vec2 uv) {\n vec2 v = normalize(direction);\n v /= abs(v.x)+abs(v.y);\n float d = v.x * center.x + v.y * center.y;\n float m =\n (1.0-step(progress, 0.0)) *\n (1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d-0.5+progress*(1.+smoothness))));\n return mix(getFromColor(uv), getToColor(uv), m);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n float ratio;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nfloat progress = time;\nuniform Transition {\n vec2 direction;\n float smoothness;\n};\nconst vec2 center = vec2(0.5, 0.5);\nvec4 transition (vec2 uv) {\n vec2 v = normalize(direction);\n v /= abs(v.x)+abs(v.y);\n float d = v.x * center.x + v.y * center.y;\n float m =\n (1.0-step(progress, 0.0)) *\n (1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d-0.5+progress*(1.+smoothness))));\n return mix(getFromColor(uv), getToColor(uv), m);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/doom-screen.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | bars: { value: 30 } 24 | amplitude: { value: 2 } 25 | noise: { value: 0.1 } 26 | frequency: { value: 0.5 } 27 | dripScale: { value: 0.5 } 28 | }% 29 | 30 | CCProgram transition %{ 31 | 32 | float progress = time; 33 | 34 | uniform Transition { 35 | // Number of total bars/columns 36 | float bars; // = 30 37 | 38 | // Multiplier for speed ratio. 0 = no variation when going down, higher = some elements go much faster 39 | float amplitude; // = 2 40 | 41 | // Further variations in speed. 0 = no noise, 1 = super noisy (ignore frequency) 42 | float noise; // = 0.1 43 | 44 | // Speed variation horizontally. the bigger the value, the shorter the waves 45 | float frequency; // = 0.5 46 | 47 | // How much the bars seem to "run" from the middle of the screen first (sticking to the sides). 0 = no drip, 1 = curved drip 48 | float dripScale; // = 0.5 49 | }; 50 | // Author: Zeh Fernando 51 | // License: MIT 52 | 53 | 54 | // The code proper -------- 55 | 56 | float rand(int num) { 57 | return fract(mod(float(num) * 67123.313, 12.0) * sin(float(num) * 10.3) * cos(float(num))); 58 | } 59 | 60 | float wave(int num) { 61 | float fn = float(num) * frequency * 0.1 * float(bars); 62 | return cos(fn * 0.5) * cos(fn * 0.13) * sin((fn+10.0) * 0.3) / 2.0 + 0.5; 63 | } 64 | 65 | float drip(int num) { 66 | return sin(float(num) / float(bars - 1.0) * 3.141592) * dripScale; 67 | } 68 | 69 | float pos(int num) { 70 | return (noise == 0.0 ? wave(num) : mix(wave(num), rand(num), noise)) + (dripScale == 0.0 ? 0.0 : drip(num)); 71 | } 72 | 73 | vec4 transition(vec2 uv) { 74 | int bar = int(uv.x * (float(bars))); 75 | float scale = 1.0 + pos(bar) * amplitude; 76 | float phase = progress * scale; 77 | float posY = uv.y / vec2(1.0).y; 78 | vec2 p; 79 | vec4 c; 80 | if (phase + posY < 1.0) { 81 | p = vec2(uv.x, uv.y + mix(0.0, vec2(1.0).y, phase)) / vec2(1.0).xy; 82 | c = getFromColor(p); 83 | } else { 84 | p = uv.xy / vec2(1.0).xy; 85 | c = getToColor(p); 86 | } 87 | 88 | // Finally, apply the color 89 | return c; 90 | } 91 | 92 | }% 93 | 94 | CCProgram vs %{ 95 | 96 | precision highp float; 97 | 98 | #include 99 | #include 100 | 101 | in vec3 a_position; 102 | in lowp vec4 a_color; 103 | 104 | in mediump vec2 a_uv0; 105 | out mediump vec2 v_uv0; 106 | 107 | out lowp vec4 v_color; 108 | 109 | void main () { 110 | mat4 mvp; 111 | 112 | mvp = cc_matViewProj; 113 | 114 | v_uv0 = a_uv0; 115 | v_color = a_color; 116 | 117 | gl_Position = mvp * vec4(a_position, 1); 118 | } 119 | 120 | }% 121 | 122 | CCProgram fs %{ 123 | 124 | precision highp float; 125 | 126 | uniform sampler2D texture; 127 | uniform sampler2D texture2; 128 | in mediump vec2 v_uv0; 129 | 130 | uniform Time { 131 | float time; 132 | float ratio; 133 | }; 134 | 135 | in lowp vec4 v_color; 136 | 137 | vec4 getFromColor(vec2 uv) { 138 | return texture(texture, uv); 139 | } 140 | 141 | vec4 getToColor(vec2 uv) { 142 | return texture(texture2, uv); 143 | } 144 | 145 | #include 146 | 147 | void main () { 148 | gl_FragColor = v_color * transition(v_uv0); 149 | } 150 | 151 | }% 152 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/doom-screen.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "f914e838-cd46-4be8-b47a-e3e12ffd7c9c", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nfloat progress = time;\nuniform float bars;\nuniform float amplitude;\nuniform float noise;\nuniform float frequency;\nuniform float dripScale;\nfloat rand(int num) {\n return fract(mod(float(num) * 67123.313, 12.0) * sin(float(num) * 10.3) * cos(float(num)));\n}\nfloat wave(int num) {\n float fn = float(num) * frequency * 0.1 * float(bars);\n return cos(fn * 0.5) * cos(fn * 0.13) * sin((fn+10.0) * 0.3) / 2.0 + 0.5;\n}\nfloat drip(int num) {\n return sin(float(num) / float(bars - 1.0) * 3.141592) * dripScale;\n}\nfloat pos(int num) {\n return (noise == 0.0 ? wave(num) : mix(wave(num), rand(num), noise)) + (dripScale == 0.0 ? 0.0 : drip(num));\n}\nvec4 transition(vec2 uv) {\n int bar = int(uv.x * (float(bars)));\n float scale = 1.0 + pos(bar) * amplitude;\n float phase = progress * scale;\n float posY = uv.y / vec2(1.0).y;\n vec2 p;\n vec4 c;\n if (phase + posY < 1.0) {\n p = vec2(uv.x, uv.y + mix(0.0, vec2(1.0).y, phase)) / vec2(1.0).xy;\n c = getFromColor(p);\n } else {\n p = uv.xy / vec2(1.0).xy;\n c = getToColor(p);\n }\n return c;\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n float ratio;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nfloat progress = time;\nuniform Transition {\n float bars;\n float amplitude;\n float noise;\n float frequency;\n float dripScale;\n};\nfloat rand(int num) {\n return fract(mod(float(num) * 67123.313, 12.0) * sin(float(num) * 10.3) * cos(float(num)));\n}\nfloat wave(int num) {\n float fn = float(num) * frequency * 0.1 * float(bars);\n return cos(fn * 0.5) * cos(fn * 0.13) * sin((fn+10.0) * 0.3) / 2.0 + 0.5;\n}\nfloat drip(int num) {\n return sin(float(num) / float(bars - 1.0) * 3.141592) * dripScale;\n}\nfloat pos(int num) {\n return (noise == 0.0 ? wave(num) : mix(wave(num), rand(num), noise)) + (dripScale == 0.0 ? 0.0 : drip(num));\n}\nvec4 transition(vec2 uv) {\n int bar = int(uv.x * (float(bars)));\n float scale = 1.0 + pos(bar) * amplitude;\n float phase = progress * scale;\n float posY = uv.y / vec2(1.0).y;\n vec2 p;\n vec4 c;\n if (phase + posY < 1.0) {\n p = vec2(uv.x, uv.y + mix(0.0, vec2(1.0).y, phase)) / vec2(1.0).xy;\n c = getFromColor(p);\n } else {\n p = uv.xy / vec2(1.0).xy;\n c = getToColor(p);\n }\n return c;\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/doom-screen.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "doom-screen", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "f914e838-cd46-4be8-b47a-e3e12ffd7c9c" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/doom-screen.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "bcdb934a-5eb6-444d-8c7b-249fa6072e0e", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/doorway.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "ba779658-bff8-451d-85c5-d5508c0740e7", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/doorway/doorway-horizontal.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "doorway", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "08a2055a-7cea-42e4-b7e2-38e8cfef31aa" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/doorway/doorway-horizontal.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "0bea06a3-ee7c-4bfa-bebc-baf1c5096d5c", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/doorway/doorway-vertical.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "doorway-vertical", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "08a2055a-7cea-42e4-b7e2-38e8cfef31aa" 8 | }, 9 | "_techniqueIndex": 1, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "depth": 6 15 | } 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/doorway/doorway-vertical.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "75a57bbe-1c86-4fa4-a608-871e87996e5a", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/doorway/doorway.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | commonPass: &commonPass 10 | vert: vs 11 | blendState: 12 | targets: 13 | - blend: true 14 | rasterizerState: 15 | cullMode: none 16 | properties: 17 | texture: { value: white } 18 | texture2: { value: white } 19 | time: { value: 0 } 20 | ratio: { value: 0 } 21 | 22 | reflection: { value: 0.4 } 23 | perspective: { value: 0.4 } 24 | depth: { value: 3 } 25 | techniques: 26 | - name: horizontal 27 | passes: 28 | - <<: *commonPass 29 | frag: horizontal-fs 30 | - name: vertical 31 | passes: 32 | - <<: *commonPass 33 | frag: vertical-fs 34 | }% 35 | 36 | CCProgram transition %{ 37 | 38 | float progress = time; 39 | 40 | uniform Transition { 41 | float reflection; // = 0.4 42 | float perspective; // = 0.4 43 | float depth; // = 3 44 | }; 45 | // author: gre 46 | // License: MIT 47 | 48 | const vec4 black = vec4(0.0, 0.0, 0.0, 1.0); 49 | const vec2 boundMin = vec2(0.0, 0.0); 50 | const vec2 boundMax = vec2(1.0, 1.0); 51 | 52 | bool inBounds (vec2 p) { 53 | return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax)); 54 | } 55 | 56 | vec2 project (vec2 p) { 57 | return p * vec2(1.0, -1.2) + vec2(0.0, -0.02); 58 | } 59 | 60 | vec4 bgColor (vec2 p, vec2 pto) { 61 | vec4 c = black; 62 | pto = project(pto); 63 | if (inBounds(pto)) { 64 | c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0, pto.y)); 65 | } 66 | return c; 67 | } 68 | 69 | vec4 transition (vec2 p) { 70 | vec2 pfr = vec2(-1.), pto = vec2(-1.); 71 | door(pfr, pto, p, progress, perspective, depth); 72 | if (inBounds(pfr)) { 73 | return getFromColor(pfr); 74 | } 75 | else if (inBounds(pto)) { 76 | return getToColor(pto); 77 | } 78 | else { 79 | return bgColor(p, pto); 80 | } 81 | } 82 | 83 | }% 84 | 85 | CCProgram vs %{ 86 | 87 | precision highp float; 88 | 89 | #include 90 | #include 91 | 92 | in vec3 a_position; 93 | in lowp vec4 a_color; 94 | 95 | in mediump vec2 a_uv0; 96 | out mediump vec2 v_uv0; 97 | 98 | out lowp vec4 v_color; 99 | 100 | void main () { 101 | mat4 mvp; 102 | 103 | mvp = cc_matViewProj; 104 | 105 | v_uv0 = a_uv0; 106 | v_color = a_color; 107 | 108 | gl_Position = mvp * vec4(a_position, 1); 109 | } 110 | 111 | }% 112 | 113 | CCProgram common-fs %{ 114 | 115 | uniform sampler2D texture; 116 | uniform sampler2D texture2; 117 | in mediump vec2 v_uv0; 118 | 119 | uniform Time { 120 | float time; 121 | float ratio; 122 | }; 123 | 124 | in lowp vec4 v_color; 125 | 126 | vec4 getFromColor(vec2 uv) { 127 | return texture(texture, uv); 128 | } 129 | 130 | vec4 getToColor(vec2 uv) { 131 | return texture(texture2, uv); 132 | } 133 | 134 | #include 135 | 136 | void main () { 137 | gl_FragColor = v_color * transition(v_uv0); 138 | } 139 | 140 | }% 141 | 142 | CCProgram horizontal-fs %{ 143 | precision highp float; 144 | 145 | void door (inout vec2 pfr, inout vec2 pto, vec2 p, float progress, float perspective, float depth) { 146 | float middleSlit = 2.0 * abs(p.x-0.5) - progress; 147 | if (middleSlit > 0.0) { 148 | pfr = p + (p.x > 0.5 ? -1.0 : 1.0) * vec2(0.5*progress, 0.0); 149 | float d = 1.0/(1.0+perspective*progress*(1.0-middleSlit)); 150 | pfr.y -= d/2.; 151 | pfr.y *= d; 152 | pfr.y += d/2.; 153 | } 154 | float size = mix(1.0, depth, 1.-progress); 155 | pto = (p + vec2(-0.5, -0.5)) * vec2(size, size) + vec2(0.5, 0.5); 156 | } 157 | 158 | #include 159 | }% 160 | 161 | CCProgram vertical-fs %{ 162 | precision highp float; 163 | 164 | void door (inout vec2 pfr, inout vec2 pto, vec2 p, float progress, float perspective, float depth) { 165 | float middleSlit = 2.0 * abs(p.y-0.5) - progress; 166 | if (middleSlit > 0.0) { 167 | pfr = p + (p.y > 0.5 ? -1.0 : 1.0) * vec2(0.0, 0.5*progress); 168 | float d = 1.0/(1.0+perspective*progress*(1.0-middleSlit)); 169 | pfr.x -= d/2.; 170 | pfr.x *= d; 171 | pfr.x += d/2.; 172 | } 173 | float size = mix(1.0, depth, 1.-progress); 174 | pto = (p + vec2(-0.5, -0.5)) * vec2(size, size) + vec2(0.5, 0.5); 175 | } 176 | 177 | #include 178 | }% 179 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/grid-flip.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | 24 | bgcolor: { value: [0.0, 0.0, 0.0, 1.0], editor: { type: color } } 25 | size: { value: [4, 4] } 26 | pause: { value: 0.1 } 27 | dividerWidth: { value: 0.05 } 28 | randomness: { value: 0.1 } 29 | }% 30 | 31 | CCProgram transition %{ 32 | 33 | float progress = time; 34 | 35 | uniform Transition { 36 | vec4 bgcolor; // = vec4(0.0, 0.0, 0.0, 1.0) 37 | vec2 size; // = ivec2(4) 38 | float pause; // = 0.1 39 | float dividerWidth; // = 0.05 40 | float randomness; // = 0.1 41 | }; 42 | // License: MIT 43 | // Author: TimDonselaar 44 | // ported by gre from https://gist.github.com/TimDonselaar/9bcd1c4b5934ba60087bdb55c2ea92e5 45 | 46 | 47 | float rand (vec2 co) { 48 | return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); 49 | } 50 | 51 | float getDelta(vec2 p) { 52 | vec2 rectanglePos = floor(vec2(size) * p); 53 | vec2 rectangleSize = vec2(1.0 / vec2(size).x, 1.0 / vec2(size).y); 54 | float top = rectangleSize.y * (rectanglePos.y + 1.0); 55 | float bottom = rectangleSize.y * rectanglePos.y; 56 | float left = rectangleSize.x * rectanglePos.x; 57 | float right = rectangleSize.x * (rectanglePos.x + 1.0); 58 | float minX = min(abs(p.x - left), abs(p.x - right)); 59 | float minY = min(abs(p.y - top), abs(p.y - bottom)); 60 | return min(minX, minY); 61 | } 62 | 63 | float getDividerSize() { 64 | vec2 rectangleSize = vec2(1.0 / vec2(size).x, 1.0 / vec2(size).y); 65 | return min(rectangleSize.x, rectangleSize.y) * dividerWidth; 66 | } 67 | 68 | vec4 transition(vec2 p) { 69 | if(progress < pause) { 70 | float currentProg = progress / pause; 71 | float a = 1.0; 72 | if(getDelta(p) < getDividerSize()) { 73 | a = 1.0 - currentProg; 74 | } 75 | return mix(bgcolor, getFromColor(p), a); 76 | } 77 | else if(progress < 1.0 - pause){ 78 | if(getDelta(p) < getDividerSize()) { 79 | return bgcolor; 80 | } else { 81 | float currentProg = (progress - pause) / (1.0 - pause * 2.0); 82 | vec2 q = p; 83 | vec2 rectanglePos = floor(vec2(size) * q); 84 | 85 | float r = rand(rectanglePos) - randomness; 86 | float cp = smoothstep(0.0, 1.0 - r, currentProg); 87 | 88 | float rectangleSize = 1.0 / vec2(size).x; 89 | float delta = rectanglePos.x * rectangleSize; 90 | float offset = rectangleSize / 2.0 + delta; 91 | 92 | p.x = (p.x - offset)/abs(cp - 0.5)*0.5 + offset; 93 | vec4 a = getFromColor(p); 94 | vec4 b = getToColor(p); 95 | 96 | float s = step(abs(vec2(size).x * (q.x - delta) - 0.5), abs(cp - 0.5)); 97 | return mix(bgcolor, mix(b, a, step(cp, 0.5)), s); 98 | } 99 | } 100 | else { 101 | float currentProg = (progress - 1.0 + pause) / pause; 102 | float a = 1.0; 103 | if(getDelta(p) < getDividerSize()) { 104 | a = currentProg; 105 | } 106 | return mix(bgcolor, getToColor(p), a); 107 | } 108 | } 109 | 110 | 111 | 112 | }% 113 | 114 | CCProgram vs %{ 115 | 116 | precision highp float; 117 | 118 | #include 119 | #include 120 | 121 | in vec3 a_position; 122 | in lowp vec4 a_color; 123 | 124 | in mediump vec2 a_uv0; 125 | out mediump vec2 v_uv0; 126 | 127 | out lowp vec4 v_color; 128 | 129 | void main () { 130 | mat4 mvp; 131 | 132 | mvp = cc_matViewProj; 133 | 134 | v_uv0 = a_uv0; 135 | v_color = a_color; 136 | 137 | gl_Position = mvp * vec4(a_position, 1); 138 | } 139 | 140 | }% 141 | 142 | CCProgram fs %{ 143 | 144 | precision highp float; 145 | 146 | uniform sampler2D texture; 147 | uniform sampler2D texture2; 148 | in mediump vec2 v_uv0; 149 | 150 | uniform Time { 151 | float time; 152 | float ratio; 153 | }; 154 | 155 | in lowp vec4 v_color; 156 | 157 | vec4 getFromColor(vec2 uv) { 158 | return texture(texture, uv); 159 | } 160 | 161 | vec4 getToColor(vec2 uv) { 162 | return texture(texture2, uv); 163 | } 164 | 165 | #include 166 | 167 | void main () { 168 | gl_FragColor = v_color * transition(v_uv0); 169 | } 170 | 171 | }% 172 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/grid-flip.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "grid-flip", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "216463c8-132d-45e2-9ed4-8185325c9b9d" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/grid-flip.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "30621a87-1403-493e-9b0e-0e2b3d10bfcc", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/hexo.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 1 } 23 | steps: { value: 50.0 } 24 | horizontalHexagons: { value: 20.0 } 25 | }% 26 | 27 | CCProgram transition %{ 28 | 29 | // Author: Fernando Kuteken 30 | // License: MIT 31 | // Hexagonal math from: http://www.redblobgames.com/grids/hexagons/ 32 | 33 | 34 | uniform Transition { 35 | float steps; // = 50; 36 | float horizontalHexagons; //= 20; 37 | }; 38 | 39 | struct Hexagon { 40 | float q; 41 | float r; 42 | float s; 43 | }; 44 | 45 | Hexagon createHexagon(float q, float r){ 46 | Hexagon hex; 47 | hex.q = q; 48 | hex.r = r; 49 | hex.s = -q - r; 50 | return hex; 51 | } 52 | 53 | Hexagon roundHexagon(Hexagon hex){ 54 | 55 | float q = floor(hex.q + 0.5); 56 | float r = floor(hex.r + 0.5); 57 | float s = floor(hex.s + 0.5); 58 | 59 | float deltaQ = abs(q - hex.q); 60 | float deltaR = abs(r - hex.r); 61 | float deltaS = abs(s - hex.s); 62 | 63 | if (deltaQ > deltaR && deltaQ > deltaS) 64 | q = -r - s; 65 | else if (deltaR > deltaS) 66 | r = -q - s; 67 | else 68 | s = -q - r; 69 | 70 | return createHexagon(q, r); 71 | } 72 | 73 | Hexagon hexagonFromPoint(vec2 point, float size) { 74 | 75 | point.y /= ratio; 76 | point = (point - 0.5) / size; 77 | 78 | float q = (sqrt(3.0) / 3.0) * point.x + (-1.0 / 3.0) * point.y; 79 | float r = 0.0 * point.x + 2.0 / 3.0 * point.y; 80 | 81 | Hexagon hex = createHexagon(q, r); 82 | return roundHexagon(hex); 83 | 84 | } 85 | 86 | vec2 pointFromHexagon(Hexagon hex, float size) { 87 | 88 | float x = (sqrt(3.0) * hex.q + (sqrt(3.0) / 2.0) * hex.r) * size + 0.5; 89 | float y = (0.0 * hex.q + (3.0 / 2.0) * hex.r) * size + 0.5; 90 | 91 | return vec2(x, y * ratio); 92 | } 93 | 94 | vec4 transition (vec2 uv) { 95 | 96 | float dist = 2.0 * min(time, 1.0 - time); 97 | dist = steps > 0.0 ? ceil(dist * steps) / steps : dist; 98 | 99 | float size = (sqrt(3.0) / 3.0) * dist / horizontalHexagons; 100 | 101 | vec2 point = dist > 0.0 ? pointFromHexagon(hexagonFromPoint(uv, size), size) : uv; 102 | 103 | return mix(getFromColor(point), getToColor(point), time); 104 | 105 | } 106 | 107 | 108 | }% 109 | 110 | CCProgram vs %{ 111 | 112 | precision highp float; 113 | 114 | #include 115 | #include 116 | 117 | in vec3 a_position; 118 | in lowp vec4 a_color; 119 | 120 | in mediump vec2 a_uv0; 121 | out mediump vec2 v_uv0; 122 | 123 | out lowp vec4 v_color; 124 | 125 | void main () { 126 | mat4 mvp; 127 | 128 | mvp = cc_matViewProj; 129 | 130 | v_uv0 = a_uv0; 131 | v_color = a_color; 132 | 133 | gl_Position = mvp * vec4(a_position, 1); 134 | } 135 | 136 | }% 137 | 138 | CCProgram fs %{ 139 | 140 | precision highp float; 141 | 142 | uniform sampler2D texture; 143 | uniform sampler2D texture2; 144 | in mediump vec2 v_uv0; 145 | 146 | uniform Time { 147 | float time; 148 | float ratio; 149 | }; 150 | 151 | in lowp vec4 v_color; 152 | 153 | vec4 getFromColor(vec2 uv) { 154 | return texture2D(texture, uv); 155 | } 156 | 157 | vec4 getToColor(vec2 uv) { 158 | return texture2D(texture2, uv); 159 | } 160 | 161 | #include 162 | 163 | void main () { 164 | gl_FragColor = v_color * transition(v_uv0); 165 | } 166 | 167 | }% 168 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/hexo.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "New Material", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "d4472723-0550-409e-bdef-862304faa210" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": { 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/hexo.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "e16e380a-8775-4688-a4d4-32c91e7fc3a9", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/inverted-page-curl.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "inverted-page-curl", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "51f8b55c-75ab-4e08-9a0a-3eaeab501c42" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/inverted-page-curl.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "6d1e869d-f942-4c01-b56e-c3787513440f", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/linear-blur.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | intensity: { value: 0.1 } 24 | }% 25 | 26 | CCProgram transition %{ 27 | 28 | float progress = time; 29 | 30 | uniform Transition { 31 | float intensity; 32 | }; 33 | #define passes 6 34 | 35 | vec4 transition(vec2 uv) { 36 | vec4 c1 = vec4(0.0); 37 | vec4 c2 = vec4(0.0); 38 | 39 | float disp = intensity*(0.5-distance(0.5, progress)); 40 | for (int xi=0; xi 64 | #include 65 | 66 | in vec3 a_position; 67 | in lowp vec4 a_color; 68 | 69 | in mediump vec2 a_uv0; 70 | out mediump vec2 v_uv0; 71 | 72 | out lowp vec4 v_color; 73 | 74 | void main () { 75 | mat4 mvp; 76 | 77 | mvp = cc_matViewProj; 78 | 79 | v_uv0 = a_uv0; 80 | v_color = a_color; 81 | 82 | gl_Position = mvp * vec4(a_position, 1); 83 | } 84 | 85 | }% 86 | 87 | CCProgram fs %{ 88 | 89 | precision highp float; 90 | 91 | uniform sampler2D texture; 92 | uniform sampler2D texture2; 93 | in mediump vec2 v_uv0; 94 | 95 | uniform Time { 96 | float time; 97 | float ratio; 98 | }; 99 | 100 | in lowp vec4 v_color; 101 | 102 | vec4 getFromColor(vec2 uv) { 103 | return texture(texture, uv); 104 | } 105 | 106 | vec4 getToColor(vec2 uv) { 107 | return texture(texture2, uv); 108 | } 109 | 110 | #include 111 | 112 | void main () { 113 | gl_FragColor = v_color * transition(v_uv0); 114 | } 115 | 116 | }% 117 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/linear-blur.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "3b4f3ad9-9c8f-4509-8d99-e11d011414f0", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nfloat progress = time;\nuniform float intensity;\nvec4 transition(vec2 uv) {\n vec4 c1 = vec4(0.0);\n vec4 c2 = vec4(0.0);\n float disp = intensity*(0.5-distance(0.5, progress));\n for (int xi=0; xi<6; xi++)\n {\n float x = float(xi) / float(6) - 0.5;\n for (int yi=0; yi<6; yi++)\n {\n float y = float(yi) / float(6) - 0.5;\n vec2 v = vec2(x,y);\n float d = disp;\n c1 += getFromColor( uv + d*v);\n c2 += getToColor( uv + d*v);\n }\n }\n c1 /= float(6*6);\n c2 /= float(6*6);\n return mix(c1, c2, progress);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n float ratio;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nfloat progress = time;\nuniform Transition {\n float intensity;\n};\nvec4 transition(vec2 uv) {\n vec4 c1 = vec4(0.0);\n vec4 c2 = vec4(0.0);\n float disp = intensity*(0.5-distance(0.5, progress));\n for (int xi=0; xi<6; xi++)\n {\n float x = float(xi) / float(6) - 0.5;\n for (int yi=0; yi<6; yi++)\n {\n float y = float(yi) / float(6) - 0.5;\n vec2 v = vec2(x,y);\n float d = disp;\n c1 += getFromColor( uv + d*v);\n c2 += getToColor( uv + d*v);\n }\n }\n c1 /= float(6*6);\n c2 /= float(6*6);\n return mix(c1, c2, progress);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/linear-blur.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "linear-blur", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "3b4f3ad9-9c8f-4509-8d99-e11d011414f0" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/linear-blur.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "c9575817-cf94-4cc8-b1a2-da819dbea4a6", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/luminance_melt.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "luminance_melt", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "ae0ed25e-5232-48da-95c7-7005f86d3fa8" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/luminance_melt.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "0611de39-bd41-40a6-9fee-73370da264bf", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/morph.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | strength: { value: 0.1 } 24 | }% 25 | 26 | CCProgram transition %{ 27 | 28 | float progress = time; 29 | 30 | uniform Transition { 31 | float strength; // = 0.1 32 | }; 33 | 34 | // Author: paniq 35 | // License: MIT 36 | 37 | vec4 transition(vec2 p) { 38 | vec4 ca = getFromColor(p); 39 | vec4 cb = getToColor(p); 40 | 41 | vec2 oa = (((ca.rg+ca.b)*0.5)*2.0-1.0); 42 | vec2 ob = (((cb.rg+cb.b)*0.5)*2.0-1.0); 43 | vec2 oc = mix(oa,ob,0.5)*strength; 44 | 45 | float w0 = progress; 46 | float w1 = 1.0-w0; 47 | return mix(getFromColor(p+oc*w0), getToColor(p-oc*w1), progress); 48 | } 49 | 50 | 51 | 52 | 53 | }% 54 | 55 | CCProgram vs %{ 56 | 57 | precision highp float; 58 | 59 | #include 60 | #include 61 | 62 | in vec3 a_position; 63 | in lowp vec4 a_color; 64 | 65 | in mediump vec2 a_uv0; 66 | out mediump vec2 v_uv0; 67 | 68 | out lowp vec4 v_color; 69 | 70 | void main () { 71 | mat4 mvp; 72 | 73 | mvp = cc_matViewProj; 74 | 75 | v_uv0 = a_uv0; 76 | v_color = a_color; 77 | 78 | gl_Position = mvp * vec4(a_position, 1); 79 | } 80 | 81 | }% 82 | 83 | CCProgram fs %{ 84 | 85 | precision highp float; 86 | 87 | uniform sampler2D texture; 88 | uniform sampler2D texture2; 89 | in mediump vec2 v_uv0; 90 | 91 | uniform Time { 92 | float time; 93 | float ratio; 94 | }; 95 | 96 | in lowp vec4 v_color; 97 | 98 | vec4 getFromColor(vec2 uv) { 99 | return texture(texture, uv); 100 | } 101 | 102 | vec4 getToColor(vec2 uv) { 103 | return texture(texture2, uv); 104 | } 105 | 106 | #include 107 | 108 | void main () { 109 | gl_FragColor = v_color * transition(v_uv0); 110 | } 111 | 112 | }% 113 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/morph.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "61628282-416f-47d2-a7b5-890eef7866e3", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nfloat progress = time;\nuniform float strength;\nvec4 transition(vec2 p) {\n vec4 ca = getFromColor(p);\n vec4 cb = getToColor(p);\n vec2 oa = (((ca.rg+ca.b)*0.5)*2.0-1.0);\n vec2 ob = (((cb.rg+cb.b)*0.5)*2.0-1.0);\n vec2 oc = mix(oa,ob,0.5)*strength;\n float w0 = progress;\n float w1 = 1.0-w0;\n return mix(getFromColor(p+oc*w0), getToColor(p-oc*w1), progress);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n float ratio;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nfloat progress = time;\nuniform Transition {\n float strength;\n};\nvec4 transition(vec2 p) {\n vec4 ca = getFromColor(p);\n vec4 cb = getToColor(p);\n vec2 oa = (((ca.rg+ca.b)*0.5)*2.0-1.0);\n vec2 ob = (((cb.rg+cb.b)*0.5)*2.0-1.0);\n vec2 oc = mix(oa,ob,0.5)*strength;\n float w0 = progress;\n float w1 = 1.0-w0;\n return mix(getFromColor(p+oc*w0), getToColor(p-oc*w1), progress);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/morph.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "morph", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "61628282-416f-47d2-a7b5-890eef7866e3" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/morph.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "b2d7c7f2-44c4-45bc-b74e-12d3f292edff", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/pixelize.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | squaresMin: { value: [20, 20] } 24 | steps: { value: 50 } 25 | }% 26 | 27 | CCProgram transition %{ 28 | 29 | float progress = time; 30 | 31 | uniform Transition { 32 | vec2 squaresMin/* = ivec2(20) */; // minimum number of squares (when the effect is at its higher level) 33 | float steps /* = 50 */; // zero disable the stepping 34 | }; 35 | // Author: gre 36 | // License: MIT 37 | // forked from https://gist.github.com/benraziel/c528607361d90a072e98 38 | 39 | float d = min(progress, 1.0 - progress); 40 | float dist = steps>0.0 ? ceil(d * float(steps)) / float(steps) : d; 41 | vec2 squareSize = 2.0 * dist / vec2(squaresMin); 42 | 43 | vec4 transition(vec2 uv) { 44 | vec2 p = dist>0.0 ? (floor(uv / squareSize) + 0.5) * squareSize : uv; 45 | return mix(getFromColor(p), getToColor(p), progress); 46 | } 47 | 48 | }% 49 | 50 | CCProgram vs %{ 51 | 52 | precision highp float; 53 | 54 | #include 55 | #include 56 | 57 | in vec3 a_position; 58 | in lowp vec4 a_color; 59 | 60 | in mediump vec2 a_uv0; 61 | out mediump vec2 v_uv0; 62 | 63 | out lowp vec4 v_color; 64 | 65 | void main () { 66 | mat4 mvp; 67 | 68 | mvp = cc_matViewProj; 69 | 70 | v_uv0 = a_uv0; 71 | v_color = a_color; 72 | 73 | gl_Position = mvp * vec4(a_position, 1); 74 | } 75 | 76 | }% 77 | 78 | CCProgram fs %{ 79 | 80 | precision highp float; 81 | 82 | uniform sampler2D texture; 83 | uniform sampler2D texture2; 84 | in mediump vec2 v_uv0; 85 | 86 | uniform Time { 87 | float time; 88 | float ratio; 89 | }; 90 | 91 | in lowp vec4 v_color; 92 | 93 | vec4 getFromColor(vec2 uv) { 94 | return texture(texture, uv); 95 | } 96 | 97 | vec4 getToColor(vec2 uv) { 98 | return texture(texture2, uv); 99 | } 100 | 101 | #include 102 | 103 | void main () { 104 | gl_FragColor = v_color * transition(v_uv0); 105 | } 106 | 107 | }% 108 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/pixelize.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "4628c8d8-7d1a-4fa3-9afe-801eb2c1313d", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nfloat progress = time;\nuniform vec2 squaresMin;\nuniform float steps;\nfloat d = min(progress, 1.0 - progress);\nfloat dist = steps>0.0 ? ceil(d * float(steps)) / float(steps) : d;\nvec2 squareSize = 2.0 * dist / vec2(squaresMin);\nvec4 transition(vec2 uv) {\n vec2 p = dist>0.0 ? (floor(uv / squareSize) + 0.5) * squareSize : uv;\n return mix(getFromColor(p), getToColor(p), progress);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n float ratio;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nfloat progress = time;\nuniform Transition {\n vec2 squaresMin;\n float steps ;\n};\nfloat d = min(progress, 1.0 - progress);\nfloat dist = steps>0.0 ? ceil(d * float(steps)) / float(steps) : d;\nvec2 squareSize = 2.0 * dist / vec2(squaresMin);\nvec4 transition(vec2 uv) {\n vec2 p = dist>0.0 ? (floor(uv / squareSize) + 0.5) * squareSize : uv;\n return mix(getFromColor(p), getToColor(p), progress);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/pixelize.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "pixelize", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "4628c8d8-7d1a-4fa3-9afe-801eb2c1313d" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/pixelize.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "cac42bc1-20d3-4eaf-9142-74311667c1f6", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/polka-dots-curtain.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | dots: { value: 30 } 24 | center: { value: [0, 0] } 25 | }% 26 | 27 | CCProgram transition %{ 28 | 29 | float progress = time; 30 | 31 | uniform Transition { 32 | vec2 center;// = vec2(0, 0); 33 | float dots;// = 20.0; 34 | }; 35 | 36 | const float SQRT_2 = 1.414213562373; 37 | 38 | vec4 transition(vec2 uv) { 39 | bool nextImage = distance(fract(uv * dots), vec2(0.5, 0.5)) < ( progress / distance(uv, center)); 40 | return nextImage ? getToColor(uv) : getFromColor(uv); 41 | } 42 | 43 | 44 | }% 45 | 46 | CCProgram vs %{ 47 | 48 | precision highp float; 49 | 50 | #include 51 | #include 52 | 53 | in vec3 a_position; 54 | in lowp vec4 a_color; 55 | 56 | in mediump vec2 a_uv0; 57 | out mediump vec2 v_uv0; 58 | 59 | out lowp vec4 v_color; 60 | 61 | void main () { 62 | mat4 mvp; 63 | 64 | mvp = cc_matViewProj; 65 | 66 | v_uv0 = a_uv0; 67 | v_color = a_color; 68 | 69 | gl_Position = mvp * vec4(a_position, 1); 70 | } 71 | 72 | }% 73 | 74 | CCProgram fs %{ 75 | 76 | precision highp float; 77 | 78 | uniform sampler2D texture; 79 | uniform sampler2D texture2; 80 | in mediump vec2 v_uv0; 81 | 82 | uniform Time { 83 | float time; 84 | float ratio; 85 | }; 86 | 87 | in lowp vec4 v_color; 88 | 89 | vec4 getFromColor(vec2 uv) { 90 | return texture(texture, uv); 91 | } 92 | 93 | vec4 getToColor(vec2 uv) { 94 | return texture(texture2, uv); 95 | } 96 | 97 | #include 98 | 99 | void main () { 100 | gl_FragColor = v_color * transition(v_uv0); 101 | } 102 | 103 | }% 104 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/polka-dots-curtain.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "7dbf3e2d-48dc-4b76-b7b9-b70960ec43c9", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nfloat progress = time;\nuniform vec2 center;\nuniform float dots;\nconst float SQRT_2 = 1.414213562373;\nvec4 transition(vec2 uv) {\n bool nextImage = distance(fract(uv * dots), vec2(0.5, 0.5)) < ( progress / distance(uv, center));\n return nextImage ? getToColor(uv) : getFromColor(uv);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n float ratio;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nfloat progress = time;\nuniform Transition {\n vec2 center;\n float dots;\n};\nconst float SQRT_2 = 1.414213562373;\nvec4 transition(vec2 uv) {\n bool nextImage = distance(fract(uv * dots), vec2(0.5, 0.5)) < ( progress / distance(uv, center));\n return nextImage ? getToColor(uv) : getFromColor(uv);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/polka-dots-curtain.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "polka-dots-curtain", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "7dbf3e2d-48dc-4b76-b7b9-b70960ec43c9" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/polka-dots-curtain.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "5a0658b0-4f3e-4d7e-b295-9c754b007fa7", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "c76210d8-e6c2-4be1-b434-c82370c1c16f", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple/ripple-glass-lb.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "ripple-glass - 001", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "b238f1e5-8d61-46f3-a79f-f98193bf3ff3" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "center": { 15 | "__type__": "cc.Vec2", 16 | "x": 0, 17 | "y": 0 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple/ripple-glass-lb.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "22f6cf7d-ca5c-450d-87b0-f6182ff727c2", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple/ripple-glass-lt.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "ripple-glass-rt - 001", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "b238f1e5-8d61-46f3-a79f-f98193bf3ff3" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "center": { 15 | "__type__": "cc.Vec2", 16 | "x": 0, 17 | "y": 1 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple/ripple-glass-lt.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "ce8f3031-125f-4c9a-b65a-20f777040e63", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple/ripple-glass-rb.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "ripple-glass - 001", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "b238f1e5-8d61-46f3-a79f-f98193bf3ff3" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "center": { 15 | "__type__": "cc.Vec2", 16 | "x": 1, 17 | "y": 0 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple/ripple-glass-rb.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "05337bf0-33ba-4189-ab80-df47fa461cc7", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple/ripple-glass-rt.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "ripple-glass-rb - 001", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "b238f1e5-8d61-46f3-a79f-f98193bf3ff3" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "center": { 15 | "__type__": "cc.Vec2", 16 | "x": 1, 17 | "y": 1 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple/ripple-glass-rt.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "6a1cc67d-5c62-4ef7-ba64-0ecb9de1c486", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple/ripple-glass.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "ripple", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "b238f1e5-8d61-46f3-a79f-f98193bf3ff3" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "center": { 15 | "__type__": "cc.Vec2", 16 | "x": 0.5, 17 | "y": 0.5 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple/ripple-glass.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "9723bf66-6d30-40dc-b37b-23846ff6bc16", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple/ripple.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | commonPass: &commonPass 10 | vert: vs 11 | blendState: 12 | targets: 13 | - blend: true 14 | rasterizerState: 15 | cullMode: none 16 | properties: 17 | texture: { value: white } 18 | texture2: { value: white } 19 | time: { value: 0 } 20 | ratio: { value: 0 } 21 | 22 | center: { value: [0.5, 0.5] } 23 | techniques: 24 | - name: glass 25 | passes: 26 | - <<: *commonPass 27 | frag: glass-fs 28 | }% 29 | 30 | CCProgram transition %{ 31 | 32 | uniform Transition { 33 | vec2 center; 34 | }; 35 | // Author: gre 36 | // License: MIT 37 | 38 | const float smoothness = 0.15; 39 | const float PI = 3.141592653589793; 40 | const float PI_2 = PI * 2.0; 41 | 42 | float maxDistance = max( 43 | max(distance(center, vec2(0., 0.)), distance(center, vec2(1., 1.))), 44 | max(distance(center, vec2(0., 1.)), distance(center, vec2(1., 0.))) 45 | ); 46 | 47 | vec2 ratio2 = vec2(1.0, 1.0 / ratio); 48 | 49 | vec4 transition (vec2 uv) { 50 | vec2 dif = (uv - center) * ratio2; 51 | float r = length(dif); 52 | float m = 1. - smoothstep(-smoothness, 0.0, r - time*(maxDistance+smoothness)); 53 | uv = ripple(uv, dif, m, PI_2); 54 | return mix(getFromColor(uv), getToColor(uv), m); 55 | } 56 | 57 | 58 | }% 59 | 60 | CCProgram vs %{ 61 | 62 | precision highp float; 63 | 64 | #include 65 | #include 66 | 67 | in vec3 a_position; 68 | in lowp vec4 a_color; 69 | 70 | in mediump vec2 a_uv0; 71 | out mediump vec2 v_uv0; 72 | 73 | out lowp vec4 v_color; 74 | 75 | void main () { 76 | mat4 mvp; 77 | 78 | mvp = cc_matViewProj; 79 | 80 | v_uv0 = a_uv0; 81 | v_color = a_color; 82 | 83 | gl_Position = mvp * vec4(a_position, 1); 84 | } 85 | 86 | }% 87 | 88 | CCProgram common-fs %{ 89 | 90 | uniform sampler2D texture; 91 | uniform sampler2D texture2; 92 | in mediump vec2 v_uv0; 93 | 94 | uniform Time { 95 | float time; 96 | float ratio; 97 | }; 98 | 99 | in lowp vec4 v_color; 100 | 101 | vec4 getFromColor(vec2 uv) { 102 | return texture(texture, uv); 103 | } 104 | 105 | vec4 getToColor(vec2 uv) { 106 | return texture(texture2, uv); 107 | } 108 | 109 | #include 110 | 111 | void main () { 112 | gl_FragColor = v_color * transition(v_uv0); 113 | } 114 | 115 | }% 116 | 117 | 118 | CCProgram glass-fs %{ 119 | precision highp float; 120 | 121 | vec2 ripple (vec2 uv, vec2 dif, float m, float PI_2) { 122 | //Polar coordinates 123 | float theta = atan(dif.y, dif.x); 124 | 125 | //Make a pulse down the radius 126 | float pulse = sin(m*PI_2); 127 | 128 | //Convert Polar -> Rectangular 129 | vec2 pulse_rect = vec2(pulse * cos(theta), pulse * sin(theta)); 130 | 131 | //use the pulse to distort the texture. 132 | uv += 0.1 * pulse_rect; 133 | 134 | return uv; 135 | } 136 | 137 | #include 138 | }% 139 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/ripple/ripple.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "b238f1e5-8d61-46f3-a79f-f98193bf3ff3", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nvec2 ripple (vec2 uv, vec2 dif, float m, float PI_2) {\n float theta = atan(dif.y, dif.x);\n float pulse = sin(m*PI_2);\n vec2 pulse_rect = vec2(pulse * cos(theta), pulse * sin(theta));\n uv += 0.1 * pulse_rect;\n return uv;\n}\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nuniform float ratio;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nuniform vec2 center;\nconst float smoothness = 0.15;\nconst float PI = 3.141592653589793;\nconst float PI_2 = PI * 2.0;\nfloat maxDistance = max(\n max(distance(center, vec2(0., 0.)), distance(center, vec2(1., 1.))),\n max(distance(center, vec2(0., 1.)), distance(center, vec2(1., 0.)))\n);\nvec2 ratio2 = vec2(1.0, 1.0 / ratio);\nvec4 transition (vec2 uv) {\n vec2 dif = (uv - center) * ratio2;\n float r = length(dif);\n float m = 1. - smoothstep(-smoothness, 0.0, r - time*(maxDistance+smoothness));\n uv = ripple(uv, dif, m, PI_2);\n return mix(getFromColor(uv), getToColor(uv), m);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "vert": "\nprecision highp float;\nuniform CCGlobal {\n mat4 cc_matView;\n mat4 cc_matViewInv;\n mat4 cc_matProj;\n mat4 cc_matProjInv;\n mat4 cc_matViewProj;\n mat4 cc_matViewProjInv;\n vec4 cc_cameraPos;\n vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nvec2 ripple (vec2 uv, vec2 dif, float m, float PI_2) {\n float theta = atan(dif.y, dif.x);\n float pulse = sin(m*PI_2);\n vec2 pulse_rect = vec2(pulse * cos(theta), pulse * sin(theta));\n uv += 0.1 * pulse_rect;\n return uv;\n}\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n float ratio;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nuniform Transition {\n vec2 center;\n};\nconst float smoothness = 0.15;\nconst float PI = 3.141592653589793;\nconst float PI_2 = PI * 2.0;\nfloat maxDistance = max(\n max(distance(center, vec2(0., 0.)), distance(center, vec2(1., 1.))),\n max(distance(center, vec2(0., 1.)), distance(center, vec2(1., 0.)))\n);\nvec2 ratio2 = vec2(1.0, 1.0 / ratio);\nvec4 transition (vec2 uv) {\n vec2 dif = (uv - center) * ratio2;\n float r = length(dif);\n float m = 1. - smoothstep(-smoothness, 0.0, r - time*(maxDistance+smoothness));\n uv = ripple(uv, dif, m, PI_2);\n return mix(getFromColor(uv), getToColor(uv), m);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/simple-zoom.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | zoom_quickness: { value: 0.8 } 24 | }% 25 | 26 | CCProgram transition %{ 27 | 28 | float progress = time; 29 | 30 | uniform Transition { 31 | float zoom_quickness; 32 | }; 33 | float nQuick = clamp(zoom_quickness,0.2,1.0); 34 | 35 | vec2 zoom(vec2 uv, float amount) { 36 | return 0.5 + ((uv - 0.5) * (1.0-amount)); 37 | } 38 | 39 | vec4 transition (vec2 uv) { 40 | return mix( 41 | getFromColor(zoom(uv, smoothstep(0.0, nQuick, progress))), 42 | getToColor(uv), 43 | smoothstep(nQuick-0.2, 1.0, progress) 44 | ); 45 | } 46 | 47 | }% 48 | 49 | CCProgram vs %{ 50 | 51 | precision highp float; 52 | 53 | #include 54 | #include 55 | 56 | in vec3 a_position; 57 | in lowp vec4 a_color; 58 | 59 | in mediump vec2 a_uv0; 60 | out mediump vec2 v_uv0; 61 | 62 | out lowp vec4 v_color; 63 | 64 | void main () { 65 | mat4 mvp; 66 | 67 | mvp = cc_matViewProj; 68 | 69 | v_uv0 = a_uv0; 70 | v_color = a_color; 71 | 72 | gl_Position = mvp * vec4(a_position, 1); 73 | } 74 | 75 | }% 76 | 77 | CCProgram fs %{ 78 | 79 | precision highp float; 80 | 81 | uniform sampler2D texture; 82 | uniform sampler2D texture2; 83 | in mediump vec2 v_uv0; 84 | 85 | uniform Time { 86 | float time; 87 | float ratio; 88 | }; 89 | 90 | in lowp vec4 v_color; 91 | 92 | vec4 getFromColor(vec2 uv) { 93 | return texture(texture, uv); 94 | } 95 | 96 | vec4 getToColor(vec2 uv) { 97 | return texture(texture2, uv); 98 | } 99 | 100 | #include 101 | 102 | void main () { 103 | gl_FragColor = v_color * transition(v_uv0); 104 | } 105 | 106 | }% 107 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/simple-zoom.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "ab21a7e6-6761-41f8-858c-f916baf5cc25", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nfloat progress = time;\nuniform float zoom_quickness;\nfloat nQuick = clamp(zoom_quickness,0.2,1.0);\nvec2 zoom(vec2 uv, float amount) {\n return 0.5 + ((uv - 0.5) * (1.0-amount));\n}\nvec4 transition (vec2 uv) {\n return mix(\n getFromColor(zoom(uv, smoothstep(0.0, nQuick, progress))),\n getToColor(uv),\n smoothstep(nQuick-0.2, 1.0, progress)\n );\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n float ratio;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nfloat progress = time;\nuniform Transition {\n float zoom_quickness;\n};\nfloat nQuick = clamp(zoom_quickness,0.2,1.0);\nvec2 zoom(vec2 uv, float amount) {\n return 0.5 + ((uv - 0.5) * (1.0-amount));\n}\nvec4 transition (vec2 uv) {\n return mix(\n getFromColor(zoom(uv, smoothstep(0.0, nQuick, progress))),\n getToColor(uv),\n smoothstep(nQuick-0.2, 1.0, progress)\n );\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/simple-zoom.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "simple-zoom", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "ab21a7e6-6761-41f8-858c-f916baf5cc25" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/simple-zoom.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "048cefd2-73d3-46d6-84fc-eb70b738d8b8", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/stereo-viewe.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "New Material", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "07fa0dc6-60aa-4730-9d8e-5f69ceb8d9cf" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/stereo-viewe.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "e630c884-3fe0-4295-b182-3e9b27622449", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/strip.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "939b8804-945f-4d06-a6cd-1e0fc20e3e04", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/strip/strip-lb.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "strip-lb", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "d15cd0bf-d054-4b07-b16c-817910574a13" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "direction": { 15 | "__type__": "cc.Vec2", 16 | "x": -1, 17 | "y": -1 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/strip/strip-lb.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "004dcd20-0a2b-4be2-8de4-4a356b346084", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/strip/strip-lt.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "strip-lt", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "d15cd0bf-d054-4b07-b16c-817910574a13" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "direction": { 15 | "__type__": "cc.Vec2", 16 | "x": -1, 17 | "y": 1 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/strip/strip-lt.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "baa9eac2-6efd-4468-8f50-0c298261c3c9", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/strip/strip-rb.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "strip-rb", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "d15cd0bf-d054-4b07-b16c-817910574a13" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "direction": { 15 | "__type__": "cc.Vec2", 16 | "x": 1, 17 | "y": -1 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/strip/strip-rb.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "974dad18-94d5-472b-85f3-d0bc4a02b4b4", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/strip/strip-rt.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "strip", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "d15cd0bf-d054-4b07-b16c-817910574a13" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {}, 13 | "props": { 14 | "direction": { 15 | "__type__": "cc.Vec2", 16 | "x": 1, 17 | "y": 1 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/strip/strip-rt.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "566c011c-b4c7-41d7-8edd-17f327d0b10d", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/strip/strip.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | direction: { value: [1, 1]} 23 | }% 24 | 25 | CCProgram transition %{ 26 | 27 | // https://www.shadertoy.com/view/ls3cDB 28 | 29 | const float PI = 3.141592653589793; 30 | const float PI_2 = 3.141592653589793; 31 | 32 | #define radius .1 33 | 34 | uniform Transition { 35 | vec2 direction; // = [1, 1] 36 | }; 37 | 38 | float aspect = 1.;//screenSize.x / screenSize.y; 39 | 40 | vec4 iMouse = vec4( 41 | screenSize.x * (mod((1.0 + time * direction.x), 1.0) + 0.2 * sign(direction.x)), 42 | screenSize.y * (mod((1.0 + time * direction.y), 1.0) + 0.2 * sign(direction.y)), 43 | screenSize.x * (1.0 - step(0.0, direction.x)), 44 | screenSize.y * (1.0 - step(0.0, direction.y)) 45 | ); 46 | 47 | 48 | vec2 mouse = iMouse.xy * vec2(aspect, 1.) / screenSize.xy; 49 | vec2 mouseDir = normalize(abs(iMouse.zw) - iMouse.xy); 50 | 51 | vec4 transition(vec2 uv) { 52 | // vec2 uv = fragCoord * vec2(aspect, 1.) / screenSize.xy; 53 | 54 | float dist = dot(uv - mouse, mouseDir); 55 | vec2 linePoint = uv - dist * mouseDir; 56 | 57 | vec4 fragColor = vec4(1.0); 58 | if (dist > radius) { 59 | fragColor = texture(texture2, uv); 60 | // add shadow 61 | // fragColor.rgb *= pow(clamp(dist - radius, 0., 1.) * 1.5, .2); 62 | } 63 | else if (dist >= 0.) { 64 | // map to cylinder point 65 | float theta = asin(dist / radius); 66 | vec2 p2 = linePoint + mouseDir * (PI - theta) * radius; 67 | vec2 p1 = linePoint + mouseDir * theta * radius; 68 | uv = (p2.x <= aspect && p2.y <= 1. && p2.x > 0. && p2.y > 0.) ? p2 : p1; 69 | fragColor = texture(texture, uv); 70 | fragColor.rgb *= pow(clamp((radius - dist) / radius, 0., 1.), .2); 71 | } 72 | else { 73 | vec2 p = linePoint + mouseDir * (abs(dist) + PI * radius); 74 | uv = (p.x <= aspect && p.y <= 1. && p.x > 0. && p.y > 0.) ? p : uv; 75 | fragColor = texture(texture, uv); 76 | } 77 | 78 | return fragColor; 79 | } 80 | 81 | }% 82 | 83 | CCProgram vs %{ 84 | 85 | precision highp float; 86 | 87 | #include 88 | #include 89 | 90 | in vec3 a_position; 91 | in lowp vec4 a_color; 92 | 93 | in mediump vec2 a_uv0; 94 | out mediump vec2 v_uv0; 95 | 96 | out lowp vec4 v_color; 97 | 98 | uniform Time { 99 | vec2 screenSize; 100 | float time; 101 | }; 102 | 103 | void main() { 104 | mat4 mvp; 105 | 106 | mvp = cc_matViewProj; 107 | 108 | v_uv0 = a_uv0; 109 | v_color = a_color; 110 | 111 | gl_Position = mvp * vec4(a_position, 1); 112 | } 113 | 114 | }% 115 | 116 | CCProgram fs %{ 117 | 118 | precision highp float; 119 | 120 | uniform sampler2D texture; 121 | uniform sampler2D texture2; 122 | in mediump vec2 v_uv0; 123 | 124 | uniform Time { 125 | vec2 screenSize; 126 | float time; 127 | }; 128 | 129 | in lowp vec4 v_color; 130 | 131 | vec4 getFromColor(vec2 uv) { 132 | return texture(texture, uv); 133 | } 134 | 135 | vec4 getToColor(vec2 uv) { 136 | return texture(texture2, uv); 137 | } 138 | 139 | #include 140 | 141 | void main () { 142 | gl_FragColor = v_color * transition(v_uv0); 143 | } 144 | 145 | }% 146 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/strip/strip.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "d15cd0bf-d054-4b07-b16c-817910574a13", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main() {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform vec2 screenSize;\nuniform float time;\nvarying lowp vec4 v_color;\nconst float PI = 3.141592653589793;\nconst float PI_2 = 3.141592653589793;\nuniform vec2 direction;\nfloat aspect = 1.;\nvec4 iMouse = vec4(\n screenSize.x * (mod((1.0 + time * direction.x), 1.0) + 0.2 * sign(direction.x)),\n screenSize.y * (mod((1.0 + time * direction.y), 1.0) + 0.2 * sign(direction.y)),\n screenSize.x * (1.0 - step(0.0, direction.x)),\n screenSize.y * (1.0 - step(0.0, direction.y))\n);\nvec2 mouse = iMouse.xy * vec2(aspect, 1.) / screenSize.xy;\nvec2 mouseDir = normalize(abs(iMouse.zw) - iMouse.xy);\nvec4 transition(vec2 uv) {\n float dist = dot(uv - mouse, mouseDir);\n vec2 linePoint = uv - dist * mouseDir;\n vec4 fragColor = vec4(1.0);\n if (dist > .1) {\n fragColor = texture2D(texture2, uv);\n }\n else if (dist >= 0.) {\n float theta = asin(dist / .1);\n vec2 p2 = linePoint + mouseDir * (PI - theta) * .1;\n vec2 p1 = linePoint + mouseDir * theta * .1;\n uv = (p2.x <= aspect && p2.y <= 1. && p2.x > 0. && p2.y > 0.) ? p2 : p1;\n fragColor = texture2D(texture, uv);\n fragColor.rgb *= pow(clamp((.1 - dist) / .1, 0., 1.), .2);\n }\n else {\n vec2 p = linePoint + mouseDir * (abs(dist) + PI * .1);\n uv = (p.x <= aspect && p.y <= 1. && p.x > 0. && p.y > 0.) ? p : uv;\n fragColor = texture2D(texture, uv);\n }\n return fragColor;\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "vert": "\nprecision highp float;\nuniform CCGlobal {\n mat4 cc_matView;\n mat4 cc_matViewInv;\n mat4 cc_matProj;\n mat4 cc_matProjInv;\n mat4 cc_matViewProj;\n mat4 cc_matViewProjInv;\n vec4 cc_cameraPos;\n vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nuniform Time {\n vec2 screenSize;\n float time;\n};\nvoid main() {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n vec2 screenSize;\n float time;\n};\nin lowp vec4 v_color;\nconst float PI = 3.141592653589793;\nconst float PI_2 = 3.141592653589793;\nuniform Transition {\n vec2 direction;\n};\nfloat aspect = 1.;\nvec4 iMouse = vec4(\n screenSize.x * (mod((1.0 + time * direction.x), 1.0) + 0.2 * sign(direction.x)),\n screenSize.y * (mod((1.0 + time * direction.y), 1.0) + 0.2 * sign(direction.y)),\n screenSize.x * (1.0 - step(0.0, direction.x)),\n screenSize.y * (1.0 - step(0.0, direction.y))\n);\nvec2 mouse = iMouse.xy * vec2(aspect, 1.) / screenSize.xy;\nvec2 mouseDir = normalize(abs(iMouse.zw) - iMouse.xy);\nvec4 transition(vec2 uv) {\n float dist = dot(uv - mouse, mouseDir);\n vec2 linePoint = uv - dist * mouseDir;\n vec4 fragColor = vec4(1.0);\n if (dist > .1) {\n fragColor = texture(texture2, uv);\n }\n else if (dist >= 0.) {\n float theta = asin(dist / .1);\n vec2 p2 = linePoint + mouseDir * (PI - theta) * .1;\n vec2 p1 = linePoint + mouseDir * theta * .1;\n uv = (p2.x <= aspect && p2.y <= 1. && p2.x > 0. && p2.y > 0.) ? p2 : p1;\n fragColor = texture(texture, uv);\n fragColor.rgb *= pow(clamp((.1 - dist) / .1, 0., 1.), .2);\n }\n else {\n vec2 p = linePoint + mouseDir * (abs(dist) + PI * .1);\n uv = (p.x <= aspect && p.y <= 1. && p.x > 0. && p.y > 0.) ? p : uv;\n fragColor = texture(texture, uv);\n }\n return fragColor;\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/swap.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | reflection: { value: 0.4 } 24 | perspective: { value: 0.2 } 25 | depth: { value: 3.0 } 26 | }% 27 | 28 | CCProgram transition %{ 29 | 30 | float progress = time; 31 | 32 | uniform Transition { 33 | float reflection; // = 0.4 34 | float perspective; // = 0.2 35 | float depth; // = 3.0 36 | }; 37 | // Author: gre 38 | // License: MIT 39 | 40 | const vec4 black = vec4(0.0, 0.0, 0.0, 1.0); 41 | const vec2 boundMin = vec2(0.0, 0.0); 42 | const vec2 boundMax = vec2(1.0, 1.0); 43 | 44 | bool inBounds (vec2 p) { 45 | return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax)); 46 | } 47 | 48 | vec2 project (vec2 p) { 49 | return p * vec2(1.0, -1.2) + vec2(0.0, -0.02); 50 | } 51 | 52 | vec4 bgColor (vec2 p, vec2 pfr, vec2 pto) { 53 | vec4 c = black; 54 | pfr = project(pfr); 55 | if (inBounds(pfr)) { 56 | c += mix(black, getFromColor(pfr), reflection * mix(1.0, 0.0, pfr.y)); 57 | } 58 | pto = project(pto); 59 | if (inBounds(pto)) { 60 | c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0, pto.y)); 61 | } 62 | return c; 63 | } 64 | 65 | vec4 transition(vec2 p) { 66 | vec2 pfr, pto = vec2(-1.); 67 | 68 | float size = mix(1.0, depth, progress); 69 | float persp = perspective * progress; 70 | pfr = (p + vec2(-0.0, -0.5)) * vec2(size/(1.0-perspective*progress), size/(1.0-size*persp*p.x)) + vec2(0.0, 0.5); 71 | 72 | size = mix(1.0, depth, 1.-progress); 73 | persp = perspective * (1.-progress); 74 | pto = (p + vec2(-1.0, -0.5)) * vec2(size/(1.0-perspective*(1.0-progress)), size/(1.0-size*persp*(0.5-p.x))) + vec2(1.0, 0.5); 75 | 76 | if (progress < 0.5) { 77 | if (inBounds(pfr)) { 78 | return getFromColor(pfr); 79 | } 80 | if (inBounds(pto)) { 81 | return getToColor(pto); 82 | } 83 | } 84 | if (inBounds(pto)) { 85 | return getToColor(pto); 86 | } 87 | if (inBounds(pfr)) { 88 | return getFromColor(pfr); 89 | } 90 | return bgColor(p, pfr, pto); 91 | } 92 | 93 | }% 94 | 95 | CCProgram vs %{ 96 | 97 | precision highp float; 98 | 99 | #include 100 | #include 101 | 102 | in vec3 a_position; 103 | in lowp vec4 a_color; 104 | 105 | in mediump vec2 a_uv0; 106 | out mediump vec2 v_uv0; 107 | 108 | out lowp vec4 v_color; 109 | 110 | void main () { 111 | mat4 mvp; 112 | 113 | mvp = cc_matViewProj; 114 | 115 | v_uv0 = a_uv0; 116 | v_color = a_color; 117 | 118 | gl_Position = mvp * vec4(a_position, 1); 119 | } 120 | 121 | }% 122 | 123 | CCProgram fs %{ 124 | 125 | precision highp float; 126 | 127 | uniform sampler2D texture; 128 | uniform sampler2D texture2; 129 | in mediump vec2 v_uv0; 130 | 131 | uniform Time { 132 | float time; 133 | float ratio; 134 | }; 135 | 136 | in lowp vec4 v_color; 137 | 138 | vec4 getFromColor(vec2 uv) { 139 | return texture(texture, uv); 140 | } 141 | 142 | vec4 getToColor(vec2 uv) { 143 | return texture(texture2, uv); 144 | } 145 | 146 | #include 147 | 148 | void main () { 149 | gl_FragColor = v_color * transition(v_uv0); 150 | } 151 | 152 | }% 153 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/swap.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "9be92263-dfaa-47cc-a494-d586bdb1e116", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nfloat progress = time;\nuniform float reflection;\nuniform float perspective;\nuniform float depth;\nconst vec4 black = vec4(0.0, 0.0, 0.0, 1.0);\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\nvec2 project (vec2 p) {\n return p * vec2(1.0, -1.2) + vec2(0.0, -0.02);\n}\nvec4 bgColor (vec2 p, vec2 pfr, vec2 pto) {\n vec4 c = black;\n pfr = project(pfr);\n if (inBounds(pfr)) {\n c += mix(black, getFromColor(pfr), reflection * mix(1.0, 0.0, pfr.y));\n }\n pto = project(pto);\n if (inBounds(pto)) {\n c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0, pto.y));\n }\n return c;\n}\nvec4 transition(vec2 p) {\n vec2 pfr, pto = vec2(-1.);\n float size = mix(1.0, depth, progress);\n float persp = perspective * progress;\n pfr = (p + vec2(-0.0, -0.5)) * vec2(size/(1.0-perspective*progress), size/(1.0-size*persp*p.x)) + vec2(0.0, 0.5);\n size = mix(1.0, depth, 1.-progress);\n persp = perspective * (1.-progress);\n pto = (p + vec2(-1.0, -0.5)) * vec2(size/(1.0-perspective*(1.0-progress)), size/(1.0-size*persp*(0.5-p.x))) + vec2(1.0, 0.5);\n if (progress < 0.5) {\n if (inBounds(pfr)) {\n return getFromColor(pfr);\n }\n if (inBounds(pto)) {\n return getToColor(pto);\n }\n }\n if (inBounds(pto)) {\n return getToColor(pto);\n }\n if (inBounds(pfr)) {\n return getFromColor(pfr);\n }\n return bgColor(p, pfr, pto);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n float ratio;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nfloat progress = time;\nuniform Transition {\n float reflection;\n float perspective;\n float depth;\n};\nconst vec4 black = vec4(0.0, 0.0, 0.0, 1.0);\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\nvec2 project (vec2 p) {\n return p * vec2(1.0, -1.2) + vec2(0.0, -0.02);\n}\nvec4 bgColor (vec2 p, vec2 pfr, vec2 pto) {\n vec4 c = black;\n pfr = project(pfr);\n if (inBounds(pfr)) {\n c += mix(black, getFromColor(pfr), reflection * mix(1.0, 0.0, pfr.y));\n }\n pto = project(pto);\n if (inBounds(pto)) {\n c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0, pto.y));\n }\n return c;\n}\nvec4 transition(vec2 p) {\n vec2 pfr, pto = vec2(-1.);\n float size = mix(1.0, depth, progress);\n float persp = perspective * progress;\n pfr = (p + vec2(-0.0, -0.5)) * vec2(size/(1.0-perspective*progress), size/(1.0-size*persp*p.x)) + vec2(0.0, 0.5);\n size = mix(1.0, depth, 1.-progress);\n persp = perspective * (1.-progress);\n pto = (p + vec2(-1.0, -0.5)) * vec2(size/(1.0-perspective*(1.0-progress)), size/(1.0-size*persp*(0.5-p.x))) + vec2(1.0, 0.5);\n if (progress < 0.5) {\n if (inBounds(pfr)) {\n return getFromColor(pfr);\n }\n if (inBounds(pto)) {\n return getToColor(pto);\n }\n }\n if (inBounds(pto)) {\n return getToColor(pto);\n }\n if (inBounds(pfr)) {\n return getFromColor(pfr);\n }\n return bgColor(p, pfr, pto);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/swap.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "swap", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "9be92263-dfaa-47cc-a494-d586bdb1e116" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/swap.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "e33cdf38-876e-427a-998f-19b69c3f5f95", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/swirl.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | }% 24 | 25 | CCProgram transition %{ 26 | 27 | float progress = time; 28 | 29 | // License: MIT 30 | // Author: Sergey Kosarevsky 31 | // ( http://www.linderdaum.com ) 32 | // ported by gre from https://gist.github.com/corporateshark/cacfedb8cca0f5ce3f7c 33 | 34 | vec4 transition(vec2 UV) 35 | { 36 | float Radius = 1.0; 37 | 38 | float T = progress; 39 | 40 | UV -= vec2( 0.5, 0.5 ); 41 | 42 | float Dist = length(UV); 43 | 44 | if ( Dist < Radius ) 45 | { 46 | float Percent = (Radius - Dist) / Radius; 47 | float A = ( T <= 0.5 ) ? mix( 0.0, 1.0, T/0.5 ) : mix( 1.0, 0.0, (T-0.5)/0.5 ); 48 | float Theta = Percent * Percent * A * 8.0 * 3.14159; 49 | float S = sin( Theta ); 50 | float C = cos( Theta ); 51 | UV = vec2( dot(UV, vec2(C, -S)), dot(UV, vec2(S, C)) ); 52 | } 53 | UV += vec2( 0.5, 0.5 ); 54 | 55 | vec4 C0 = getFromColor(UV); 56 | vec4 C1 = getToColor(UV); 57 | 58 | return mix( C0, C1, T ); 59 | } 60 | 61 | 62 | 63 | }% 64 | 65 | CCProgram vs %{ 66 | 67 | precision highp float; 68 | 69 | #include 70 | #include 71 | 72 | in vec3 a_position; 73 | in lowp vec4 a_color; 74 | 75 | in mediump vec2 a_uv0; 76 | out mediump vec2 v_uv0; 77 | 78 | out lowp vec4 v_color; 79 | 80 | void main () { 81 | mat4 mvp; 82 | 83 | mvp = cc_matViewProj; 84 | 85 | v_uv0 = a_uv0; 86 | v_color = a_color; 87 | 88 | gl_Position = mvp * vec4(a_position, 1); 89 | } 90 | 91 | }% 92 | 93 | CCProgram fs %{ 94 | 95 | precision highp float; 96 | 97 | uniform sampler2D texture; 98 | uniform sampler2D texture2; 99 | in mediump vec2 v_uv0; 100 | 101 | uniform Time { 102 | float time; 103 | float ratio; 104 | }; 105 | 106 | in lowp vec4 v_color; 107 | 108 | vec4 getFromColor(vec2 uv) { 109 | return texture(texture, uv); 110 | } 111 | 112 | vec4 getToColor(vec2 uv) { 113 | return texture(texture2, uv); 114 | } 115 | 116 | #include 117 | 118 | void main () { 119 | gl_FragColor = v_color * transition(v_uv0); 120 | } 121 | 122 | }% 123 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/swirl.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "8e6e9cbf-1cd3-4151-a85b-205f166f19ac", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nfloat progress = time;\nvec4 transition(vec2 UV)\n{\n float Radius = 1.0;\n float T = progress;\n UV -= vec2( 0.5, 0.5 );\n float Dist = length(UV);\n if ( Dist < Radius )\n {\n float Percent = (Radius - Dist) / Radius;\n float A = ( T <= 0.5 ) ? mix( 0.0, 1.0, T/0.5 ) : mix( 1.0, 0.0, (T-0.5)/0.5 );\n float Theta = Percent * Percent * A * 8.0 * 3.14159;\n float S = sin( Theta );\n float C = cos( Theta );\n UV = vec2( dot(UV, vec2(C, -S)), dot(UV, vec2(S, C)) );\n }\n UV += vec2( 0.5, 0.5 );\n vec4 C0 = getFromColor(UV);\n vec4 C1 = getToColor(UV);\n return mix( C0, C1, T );\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n float ratio;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nfloat progress = time;\nvec4 transition(vec2 UV)\n{\n float Radius = 1.0;\n float T = progress;\n UV -= vec2( 0.5, 0.5 );\n float Dist = length(UV);\n if ( Dist < Radius )\n {\n float Percent = (Radius - Dist) / Radius;\n float A = ( T <= 0.5 ) ? mix( 0.0, 1.0, T/0.5 ) : mix( 1.0, 0.0, (T-0.5)/0.5 );\n float Theta = Percent * Percent * A * 8.0 * 3.14159;\n float S = sin( Theta );\n float C = cos( Theta );\n UV = vec2( dot(UV, vec2(C, -S)), dot(UV, vec2(S, C)) );\n }\n UV += vec2( 0.5, 0.5 );\n vec4 C0 = getFromColor(UV);\n vec4 C1 = getToColor(UV);\n return mix( C0, C1, T );\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/swirl.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "swirl", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "8e6e9cbf-1cd3-4151-a85b-205f166f19ac" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/swirl.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "50b1b7f2-1d96-43d0-a740-511f589d1678", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/water-drop.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | amplitude: { value: 30 } 24 | speed: { value: 30 } 25 | }% 26 | 27 | CCProgram transition %{ 28 | 29 | float progress = time; 30 | 31 | uniform Transition { 32 | float amplitude; // = 30 33 | float speed; // = 30 34 | }; 35 | 36 | vec4 transition(vec2 p) { 37 | vec2 dir = p - vec2(.5); 38 | float dist = length(dir); 39 | 40 | if (dist > progress) { 41 | return mix(getFromColor( p), getToColor( p), progress); 42 | } else { 43 | vec2 offset = dir * sin(dist * amplitude - progress * speed); 44 | return mix(getFromColor( p + offset), getToColor( p), progress); 45 | } 46 | } 47 | 48 | }% 49 | 50 | CCProgram vs %{ 51 | 52 | precision highp float; 53 | 54 | #include 55 | #include 56 | 57 | in vec3 a_position; 58 | in lowp vec4 a_color; 59 | 60 | in mediump vec2 a_uv0; 61 | out mediump vec2 v_uv0; 62 | 63 | out lowp vec4 v_color; 64 | 65 | void main () { 66 | mat4 mvp; 67 | 68 | mvp = cc_matViewProj; 69 | 70 | v_uv0 = a_uv0; 71 | v_color = a_color; 72 | 73 | gl_Position = mvp * vec4(a_position, 1); 74 | } 75 | 76 | }% 77 | 78 | CCProgram fs %{ 79 | 80 | precision highp float; 81 | 82 | uniform sampler2D texture; 83 | uniform sampler2D texture2; 84 | in mediump vec2 v_uv0; 85 | 86 | uniform Time { 87 | float time; 88 | float ratio; 89 | }; 90 | 91 | in lowp vec4 v_color; 92 | 93 | vec4 getFromColor(vec2 uv) { 94 | return texture(texture, uv); 95 | } 96 | 97 | vec4 getToColor(vec2 uv) { 98 | return texture(texture2, uv); 99 | } 100 | 101 | #include 102 | 103 | void main () { 104 | gl_FragColor = v_color * transition(v_uv0); 105 | } 106 | 107 | }% 108 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/water-drop.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "406ebd98-50bf-4743-98c2-0115cc5fab2d", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nfloat progress = time;\nuniform float amplitude;\nuniform float speed;\nvec4 transition(vec2 p) {\n vec2 dir = p - vec2(.5);\n float dist = length(dir);\n if (dist > progress) {\n return mix(getFromColor( p), getToColor( p), progress);\n } else {\n vec2 offset = dir * sin(dist * amplitude - progress * speed);\n return mix(getFromColor( p + offset), getToColor( p), progress);\n }\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n float ratio;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nfloat progress = time;\nuniform Transition {\n float amplitude;\n float speed;\n};\nvec4 transition(vec2 p) {\n vec2 dir = p - vec2(.5);\n float dist = length(dir);\n if (dist > progress) {\n return mix(getFromColor( p), getToColor( p), progress);\n } else {\n vec2 offset = dir * sin(dist * amplitude - progress * speed);\n return mix(getFromColor( p + offset), getToColor( p), progress);\n }\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/water-drop.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "water-drop", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "406ebd98-50bf-4743-98c2-0115cc5fab2d" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/water-drop.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "9f705da5-4d51-47a9-95e5-3745eed94561", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/window-blinds.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | ratio: { value: 0 } 23 | }% 24 | 25 | CCProgram transition %{ 26 | 27 | float progress = time; 28 | 29 | // Author: Fabien Benetou 30 | // License: MIT 31 | 32 | vec4 transition (vec2 uv) { 33 | float t = progress; 34 | 35 | if (mod(floor(uv.y*100.*progress),2.)==0.) 36 | t*=2.-.5; 37 | 38 | return mix( 39 | getFromColor(uv), 40 | getToColor(uv), 41 | mix(t, progress, smoothstep(0.8, 1.0, progress)) 42 | ); 43 | } 44 | 45 | }% 46 | 47 | CCProgram vs %{ 48 | 49 | precision highp float; 50 | 51 | #include 52 | #include 53 | 54 | in vec3 a_position; 55 | in lowp vec4 a_color; 56 | 57 | in mediump vec2 a_uv0; 58 | out mediump vec2 v_uv0; 59 | 60 | out lowp vec4 v_color; 61 | 62 | void main () { 63 | mat4 mvp; 64 | 65 | mvp = cc_matViewProj; 66 | 67 | v_uv0 = a_uv0; 68 | v_color = a_color; 69 | 70 | gl_Position = mvp * vec4(a_position, 1); 71 | } 72 | 73 | }% 74 | 75 | CCProgram fs %{ 76 | 77 | precision highp float; 78 | 79 | uniform sampler2D texture; 80 | uniform sampler2D texture2; 81 | in mediump vec2 v_uv0; 82 | 83 | uniform Time { 84 | float time; 85 | float ratio; 86 | }; 87 | 88 | in lowp vec4 v_color; 89 | 90 | vec4 getFromColor(vec2 uv) { 91 | return texture(texture, uv); 92 | } 93 | 94 | vec4 getToColor(vec2 uv) { 95 | return texture(texture2, uv); 96 | } 97 | 98 | #include 99 | 100 | void main () { 101 | gl_FragColor = v_color * transition(v_uv0); 102 | } 103 | 104 | }% 105 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/window-blinds.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "f5ee27cf-8a00-403d-9369-7eb582d9fdd2", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nfloat progress = time;\nvec4 transition (vec2 uv) {\n float t = progress;\n if (mod(floor(uv.y*100.*progress),2.)==0.)\n t*=2.-.5;\n return mix(\n getFromColor(uv),\n getToColor(uv),\n mix(t, progress, smoothstep(0.8, 1.0, progress))\n );\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n float ratio;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nfloat progress = time;\nvec4 transition (vec2 uv) {\n float t = progress;\n if (mod(floor(uv.y*100.*progress),2.)==0.)\n t*=2.-.5;\n return mix(\n getFromColor(uv),\n getToColor(uv),\n mix(t, progress, smoothstep(0.8, 1.0, progress))\n );\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/window-blinds.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "window-blinds", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "f5ee27cf-8a00-403d-9369-7eb582d9fdd2" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/window-blinds.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "e737c8f0-3da8-4047-ba86-f12cebcb058f", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/window-slice.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 2 | 3 | // Note: Current format version is experiment, the format may be changed. 4 | // The future format may not be compatible, you may need to update the script manually. 5 | 6 | // 注意:当前版本的格式是实验性的,之后还会进行修改。 7 | // 后续版本的格式不保证兼容当前格式,可能需要手动升级到最新版本。, 8 | CCEffect %{ 9 | techniques: 10 | - passes: 11 | - vert: vs 12 | frag: fs 13 | blendState: 14 | targets: 15 | - blend: true 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | texture: { value: white } 20 | texture2: { value: white } 21 | time: { value: 0 } 22 | count: { value: 10 } 23 | smoothness: { value: 10 } 24 | }% 25 | 26 | CCProgram transition %{ 27 | 28 | uniform Transition { 29 | float count; // = 10.0 30 | float smoothness; // = 0.5 31 | }; 32 | 33 | vec4 transition (vec2 p) { 34 | float pr = smoothstep(-smoothness, 0.0, p.x - time * (1.0 + smoothness)); 35 | float s = step(pr, fract(count * p.x)); 36 | return mix(getFromColor(p), getToColor(p), s); 37 | } 38 | 39 | 40 | }% 41 | 42 | CCProgram vs %{ 43 | 44 | precision highp float; 45 | 46 | #include 47 | #include 48 | 49 | in vec3 a_position; 50 | in lowp vec4 a_color; 51 | 52 | in mediump vec2 a_uv0; 53 | out mediump vec2 v_uv0; 54 | 55 | out lowp vec4 v_color; 56 | 57 | void main () { 58 | mat4 mvp; 59 | 60 | mvp = cc_matViewProj; 61 | 62 | v_uv0 = a_uv0; 63 | v_color = a_color; 64 | 65 | gl_Position = mvp * vec4(a_position, 1); 66 | } 67 | 68 | }% 69 | 70 | CCProgram fs %{ 71 | 72 | precision highp float; 73 | 74 | uniform sampler2D texture; 75 | uniform sampler2D texture2; 76 | in mediump vec2 v_uv0; 77 | 78 | uniform Time { 79 | float time; 80 | }; 81 | 82 | in lowp vec4 v_color; 83 | 84 | vec4 getFromColor(vec2 uv) { 85 | return texture2D(texture, uv); 86 | } 87 | 88 | vec4 getToColor(vec2 uv) { 89 | return texture2D(texture2, uv); 90 | } 91 | 92 | #include 93 | 94 | void main () { 95 | gl_FragColor = v_color * transition(v_uv0); 96 | } 97 | 98 | }% 99 | -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/window-slice.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.25", 3 | "uuid": "c052d54d-5755-46ca-94fd-25ea42752b7a", 4 | "compiledShaders": [ 5 | { 6 | "glsl1": { 7 | "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 8 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform float time;\nvarying lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nuniform float count;\nuniform float smoothness;\nvec4 transition (vec2 p) {\n float pr = smoothstep(-smoothness, 0.0, p.x - time * (1.0 + smoothness));\n float s = step(pr, fract(count * p.x));\n return mix(getFromColor(p), getToColor(p), s);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 9 | }, 10 | "glsl3": { 11 | "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 lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nvoid main () {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}", 12 | "frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n float time;\n};\nin lowp vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nuniform Transition {\n float count;\n float smoothness;\n};\nvec4 transition (vec2 p) {\n float pr = smoothstep(-smoothness, 0.0, p.x - time * (1.0 + smoothness));\n float s = step(pr, fract(count * p.x));\n return mix(getFromColor(p), getToColor(p), s);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}" 13 | } 14 | } 15 | ], 16 | "subMetas": {} 17 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/window-slice.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "New Material", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "c052d54d-5755-46ca-94fd-25ea42752b7a" 8 | }, 9 | "_techniqueIndex": 0, 10 | "_techniqueData": { 11 | "0": { 12 | "defines": {} 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /assets/resources/transitions/shaders/window-slice.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.3", 3 | "uuid": "ede29a08-9c60-4dec-b18f-55438910a562", 4 | "dataAsSubAsset": null, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/transitions/transition-materials.js: -------------------------------------------------------------------------------- 1 | let materials = []; 2 | cc.game.on(cc.game.EVENT_GAME_INITED, () => { 3 | cc.loader.loadResDir('transitions', cc.Material, (err, assets) => { 4 | if (err) { 5 | cc.error(err); 6 | return; 7 | } 8 | materials.length = 0; 9 | for (let i = 0; i < assets.length; i++) { 10 | materials.push(assets[i]); 11 | } 12 | }) 13 | }) 14 | 15 | export default materials; 16 | -------------------------------------------------------------------------------- /assets/resources/transitions/transition-materials.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "f0ae4bdf-6b8d-4a9e-a643-add3d794fee7", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/resources/transitions/transitions.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "24cfdc15-3624-40af-8e4b-d9213ebb721b", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "6df28420-f32f-4d2c-ace3-e8bd58220716", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/scripts/Global.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "03d0b848-e1b1-4742-855b-9a099f3a832e", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/Global/ListItem.js: -------------------------------------------------------------------------------- 1 | 2 | const TipsManager = require('TipsManager'); 3 | 4 | cc.Class({ 5 | extends: cc.Component, 6 | 7 | properties: { 8 | label: { 9 | default: null, 10 | type: cc.Label 11 | }, 12 | bg: cc.Sprite, 13 | btn: cc.Button 14 | }, 15 | 16 | init (menu) { 17 | this.index = -1; 18 | this.__name = ''; 19 | this.menu = menu; 20 | }, 21 | 22 | loadExample () { 23 | this.menu.loadScene(0, this.index); 24 | }, 25 | 26 | updateItem (idx, y, name) { 27 | this.index = idx; 28 | this.node.y = y; 29 | this.node.x = 100; 30 | this.label.string = this.__name = name; 31 | } 32 | }); 33 | -------------------------------------------------------------------------------- /assets/scripts/Global/ListItem.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "aa63b58d-13c8-417f-83f8-4a9d17dae4f4", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/Global/SceneList.js: -------------------------------------------------------------------------------- 1 | const TipsManager = require('TipsManager'); 2 | const TransitionMaterials = require('transition-materials'); 3 | 4 | const SceneList = cc.Class({ 5 | extends: cc.Component, 6 | 7 | properties: { 8 | itemPrefab: { 9 | default: null, 10 | type: cc.Prefab 11 | }, 12 | initItemCount: 0, 13 | scrollView: cc.ScrollView, 14 | bufferZone: 0, // when item is away from bufferZone, we relocate it 15 | }, 16 | 17 | createItem: function (x, y, name, url) { 18 | var item = cc.instantiate(this.itemPrefab); 19 | var itemComp = item.getComponent('ListItem'); 20 | var label = itemComp.label; 21 | label.string = name; 22 | 23 | if (url) { 24 | itemComp.url = url; 25 | } 26 | 27 | // item.width = w; 28 | item.x = x; 29 | item.y = y; 30 | this.node.addChild(item); 31 | return item; 32 | }, 33 | 34 | init (menu) { 35 | this.menu = menu; 36 | this.sceneList = []; 37 | this.itemList = []; 38 | this.updateTimer = 0; 39 | this.updateInterval = 0.2; 40 | this.lastContentPosY = 0; // use this variable to detect if we are scrolling up or down 41 | TipsManager.init(); 42 | this.initList(); 43 | }, 44 | 45 | // use this for initialization 46 | initList () { 47 | let y = 0; 48 | this.node.height = (TransitionMaterials.length + 1) * 50; 49 | let initItemCount = Math.min(this.initItemCount, TransitionMaterials.length); 50 | for (let i = 0; i < initItemCount; ++i) { 51 | let item = cc.instantiate(this.itemPrefab).getComponent('ListItem'); 52 | let material = TransitionMaterials[i]; 53 | item.init(this.menu); 54 | this.node.addChild(item.node); 55 | y -= 50; 56 | item.updateItem(i, y, material.name); 57 | this.itemList.push(item); 58 | } 59 | }, 60 | 61 | getPositionInView: function (item) { // get item position in scrollview's node space 62 | let worldPos = item.parent.convertToWorldSpaceAR(item.position); 63 | let viewPos = this.scrollView.node.convertToNodeSpaceAR(worldPos); 64 | return viewPos; 65 | }, 66 | 67 | update (dt) { 68 | this.updateTimer += dt; 69 | if (this.updateTimer < this.updateInterval) { 70 | return; // we don't need to do the math every frame 71 | } 72 | this.updateTimer = 0; 73 | let items = this.itemList; 74 | let buffer = this.bufferZone; 75 | let isDown = this.node.y < this.lastContentPosY; // scrolling direction 76 | let curItemCount = this.itemList.length; 77 | let offset = 50 * curItemCount; 78 | for (let i = 0; i < curItemCount; ++i) { 79 | let item = items[i]; 80 | let itemNode = item.node; 81 | let viewPos = this.getPositionInView(itemNode); 82 | if (isDown) { 83 | // if away from buffer zone and not reaching top of content 84 | if (viewPos.y < -buffer && itemNode.y + offset < 0) { 85 | let newIdx = item.index - curItemCount; 86 | let newInfo = TransitionMaterials[newIdx]; 87 | item.updateItem(newIdx, itemNode.y + offset, newInfo.name); 88 | } 89 | } else { 90 | // if away from buffer zone and not reaching bottom of content 91 | if (viewPos.y > buffer && itemNode.y - offset > -this.node.height) { 92 | let newIdx = item.index + curItemCount; 93 | let newInfo = TransitionMaterials[newIdx]; 94 | item.updateItem(newIdx, itemNode.y - offset, newInfo.name); 95 | } 96 | } 97 | } 98 | // update lastContentPosY 99 | this.lastContentPosY = this.node.y; 100 | }, 101 | }); 102 | -------------------------------------------------------------------------------- /assets/scripts/Global/SceneList.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "473b8c31-b39e-4eb0-9be8-c557580b34c5", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/Tips.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "8f31f653-a1e3-4e50-876d-308f7efcd9fc", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/Tips/TipsManager.js: -------------------------------------------------------------------------------- 1 | // 2 | // Restricted the scenes platform permissions 3 | // 4 | 5 | // init platform info 6 | const isAndroid = cc.sys.platform === cc.sys.ANDROID; 7 | const isNative = cc.sys.isNative; 8 | const isBrowser = cc.sys.isBrowser; 9 | const isMobile = cc.sys.isMobile; 10 | const isIphone = cc.sys.platform === cc.sys.IPHONE; 11 | const isDesktopBrowser = cc.sys.platform === cc.sys.DESKTOP_BROWSER; 12 | 13 | const isWechat = cc.sys.platform === cc.sys.WECHAT_GAME; 14 | const isQQPlay = cc.sys.platform === cc.sys.QQ_PLAY; 15 | const isBaidu = cc.sys.platform === cc.sys.BAIDU_GAME; 16 | const isVivo = cc.sys.platform === cc.sys.VIVO_GAME; 17 | const isOPPO = cc.sys.platform === cc.sys.OPPO_GAME; 18 | const isXiaomi = cc.sys.platform === cc.sys.XIAOMI_GAME; 19 | const isHuawei = cc.sys.platform === cc.sys.HUAWEI_GAME; 20 | const isJkw = cc.sys.platform === cc.sys.JKW_GAME; 21 | const isAlipay = cc.sys.platform === cc.sys.ALIPAY_GAME; 22 | 23 | module.exports = { 24 | tispPrefab: null, 25 | 26 | SupportConfig: function (name) { 27 | console.log(name); 28 | switch (name) { 29 | case 'downloader-web': return !isNative; 30 | case 'EditBoxTabIndex': return !isNative && !isAlipay; 31 | case 'EditBox': 32 | case 'EditBoxEvent': return !isAlipay; 33 | case 'OnMultiTouchInput': return isMobile; 34 | case 'webp-test': return cc.sys.capabilities['webp']; 35 | case 'DeviceMotion': return isMobile && !isQQPlay && !isVivo; 36 | case 'Native_Call': return isMobile && (isAndroid || isIphone) && !CC_RUNTIME; 37 | case 'TTFFontLabel': return !isQQPlay; 38 | case 'Subpackages': 39 | return (!CC_PREVIEW && !CC_JSB && !isBrowser && !isQQPlay && !isJkw); 40 | case 'MousePropagation': return ((isNative && !isMobile && !isWechat && !isQQPlay && !isXiaomi && !isHuawei && !isAlipay) || isDesktopBrowser); 41 | case 'downloader-native': 42 | return isNative && !CC_RUNTIME; 43 | // Not support the VIVO_GAME and OPPO_GAME 44 | case 'capture_to_native': 45 | return isNative && !isVivo && !isOPPO; 46 | case 'iOS_getSafeArea': 47 | return (isIphone && isNative); 48 | case 'capture_to_wechat': 49 | return isWechat; 50 | case 'capture_to_web': 51 | case 'ShadowLabel': 52 | return isBrowser; 53 | 54 | // Only support the RENDER_TYPE_WEBGL 55 | case 'MotionStreak': 56 | case 'Mask_IMAGE_STENCIL': 57 | case 'Mask_NESTED': 58 | return cc.game.renderType === cc.game.RENDER_TYPE_WEBGL; 59 | 60 | // Not support isMobile 61 | case 'KeyboardInput': 62 | case 'platform': 63 | return !isMobile && !isWechat && !isBaidu && !isXiaomi && !isHuawei && !isAlipay; 64 | 65 | // Not support the Simulator, QQ_PLAY, WECHAT_GAME 66 | case 'videoPlayer': 67 | return (isMobile || isBrowser) && !CC_RUNTIME && !isQQPlay && !isBaidu && !isXiaomi && !isHuawei && !isAlipay; 68 | 69 | // Not support the VIVO_GAME, OPPO_GAME, WECHAT_GAME, QQ_PLAY, CC_RUNTIME 70 | case 'webview': 71 | return (isMobile || isBrowser) && !CC_RUNTIME && !isQQPlay && !isWechat && !isBaidu && !isXiaomi && !isHuawei && !isAlipay; 72 | case 'mesh': 73 | return !isVivo && !isOPPO; 74 | 75 | case 'videoPlayer-stayOnBottom': 76 | return (isMobile || isBrowser); 77 | } 78 | }, 79 | 80 | init () { 81 | if (this.tipsPrefab) return; 82 | 83 | cc.loader.loadRes('tips/Tips', (err, prefab) => { 84 | this.tipsPrefab = prefab; 85 | }); 86 | }, 87 | 88 | createTips (content) { 89 | let node = cc.instantiate(this.tipsPrefab); 90 | let tipsCtrl = node.getComponent('TipsCtrl'); 91 | if (content) { 92 | tipsCtrl.setContent(content); 93 | } 94 | node.parent = cc.director.getScene(); 95 | }, 96 | 97 | hasSupport (name, hideTip) { 98 | let support = this.SupportConfig(name); 99 | if (!support && support !== undefined) { 100 | if (!hideTip) { 101 | this.createTips(); 102 | } 103 | return false; 104 | } 105 | return true; 106 | } 107 | }; -------------------------------------------------------------------------------- /assets/scripts/Tips/TipsManager.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "6c9becc5-b6ee-401d-951c-c9d87ee90263", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/settings.js: -------------------------------------------------------------------------------- 1 | cc.game.on(cc.game.EVENT_GAME_INITED, () => { 2 | cc.debug.setDisplayStats(false); 3 | }) 4 | -------------------------------------------------------------------------------- /assets/scripts/settings.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "35d0791d-94fa-4e26-b065-7eccbd28d094", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/tests.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "0a9e740d-4bdb-40f5-a053-fedd267b3140", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/tests/loadNode.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "280b75f5-89b0-422d-b153-26354f6874ab", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/tests/test-loadNode.js: -------------------------------------------------------------------------------- 1 | let Transitions = require('transitions'); 2 | 3 | 4 | cc.Class({ 5 | extends: cc.Component, 6 | 7 | properties: { 8 | transitions: Transitions, 9 | 10 | fromRoot: cc.Node, 11 | fromCamera: cc.Camera, 12 | 13 | toRoot: cc.Node, 14 | toCamera: cc.Camera, 15 | }, 16 | 17 | // LIFE-CYCLE CALLBACKS: 18 | 19 | // onLoad () {}, 20 | 21 | start () { 22 | this.transition(() => { 23 | this.scheduleOnce(() => { 24 | let toRoot = this.fromRoot; 25 | let toCamera = this.toCamera; 26 | this.fromRoot = this.toRoot; 27 | this.fromCamera = this.toCamera; 28 | this.toRoot = toRoot; 29 | this.toCamera = toCamera; 30 | }, 1) 31 | }) 32 | }, 33 | 34 | transition () { 35 | this.transitions.loadNode(this.fromCamera, this.fromRoot, this.toCamera, this.toRoot, () => { 36 | this.scheduleOnce(() => { 37 | let toRoot = this.fromRoot; 38 | let toCamera = this.toCamera; 39 | this.fromRoot = this.toRoot; 40 | this.fromCamera = this.toCamera; 41 | this.toRoot = toRoot; 42 | this.toCamera = toCamera; 43 | 44 | // let tmp = this.transitions._texture1; 45 | // this.transitions._texture1 = this.transitions._texture2; 46 | // this.transitions._texture2 = tmp; 47 | 48 | this.transition(); 49 | }, 1) 50 | }); 51 | } 52 | 53 | // update (dt) {}, 54 | }); 55 | -------------------------------------------------------------------------------- /assets/tests/test-loadNode.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "afb538ae-381d-4bea-9f00-388def414cbc", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "experimentalDecorators": true 6 | }, 7 | "exclude": [ 8 | "node_modules", 9 | ".vscode", 10 | "library", 11 | "local", 12 | "settings", 13 | "temp" 14 | ] 15 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "deploy": "git-deploy" 4 | }, 5 | "git-deploy": { 6 | "deploy_dir": "build/web-mobile", 7 | "repo": "git@github.com:2youyou2/transitions.git" 8 | }, 9 | "devDependencies": { 10 | "git-deploy": "github:2youyou2/git-deploy" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos-creator-js", 3 | "packages": "packages", 4 | "version": "2.3.0", 5 | "id": "46d9a710-98fe-4d53-8d05-83ab25a0cf98" 6 | } -------------------------------------------------------------------------------- /settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "start-scene": "current", 3 | "group-list": [ 4 | "default" 5 | ], 6 | "collision-matrix": [ 7 | [ 8 | true 9 | ] 10 | ], 11 | "excluded-modules": [ 12 | "3D Physics/Builtin" 13 | ], 14 | "last-module-event-record-time": 0, 15 | "design-resolution-width": 960, 16 | "design-resolution-height": 640, 17 | "fit-width": false, 18 | "fit-height": true, 19 | "use-project-simulator-setting": false, 20 | "simulator-orientation": false, 21 | "use-customize-simulator": false, 22 | "simulator-resolution": { 23 | "width": 960, 24 | "height": 640 25 | }, 26 | "assets-sort-type": "name", 27 | "facebook": { 28 | "enable": false, 29 | "appID": "", 30 | "live": { 31 | "enable": false 32 | }, 33 | "audience": { 34 | "enable": false 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /settings/services.json: -------------------------------------------------------------------------------- 1 | { 2 | "game": { 3 | "name": "UNKNOW GAME", 4 | "appid": "UNKNOW" 5 | } 6 | } --------------------------------------------------------------------------------