├── .gitignore ├── README.md ├── assets ├── caseBloom.meta ├── caseBloom │ ├── Bloom.ts │ ├── Bloom.ts.meta │ ├── BloomBaseStage.ts │ ├── BloomBaseStage.ts.meta │ ├── BloomBlurXStage.ts │ ├── BloomBlurXStage.ts.meta │ ├── BloomBlurYStage.ts │ ├── BloomBlurYStage.ts.meta │ ├── BloomMergeStage.ts │ ├── BloomMergeStage.ts.meta │ ├── BloomRenderQueue.ts │ ├── BloomRenderQueue.ts.meta │ ├── BloomThresholdStage.ts │ ├── BloomThresholdStage.ts.meta │ ├── FakeUIPhase.ts │ ├── FakeUIPhase.ts.meta │ ├── PostProcess.ts │ ├── PostProcess.ts.meta │ ├── bloom.scene │ ├── bloom.scene.meta │ ├── bloomeffect.effect │ ├── bloomeffect.effect.meta │ ├── bloommat.mtl │ ├── bloommat.mtl.meta │ ├── effect.meta │ ├── effect │ │ ├── BloomBlur.effect │ │ ├── BloomBlur.effect.meta │ │ ├── BloomMerge.effect │ │ ├── BloomMerge.effect.meta │ │ ├── BloomThreshold.effect │ │ └── BloomThreshold.effect.meta │ ├── material.meta │ └── material │ │ ├── BloomBlurX.mtl │ │ ├── BloomBlurX.mtl.meta │ │ ├── BloomBlurY.mtl │ │ ├── BloomBlurY.mtl.meta │ │ ├── BloomMerge.mtl │ │ ├── BloomMerge.mtl.meta │ │ ├── BloomThreshold.mtl │ │ ├── BloomThreshold.mtl.meta │ │ ├── builtin-default1.mtl │ │ ├── builtin-default1.mtl.meta │ │ ├── builtin-default2.mtl │ │ ├── builtin-default2.mtl.meta │ │ ├── builtin-default3.mtl │ │ ├── builtin-default3.mtl.meta │ │ ├── builtin-default4.mtl │ │ └── builtin-default4.mtl.meta ├── caseBloom2.meta ├── caseBloom2 │ ├── bloom2.scene │ ├── bloom2.scene.meta │ ├── bloom2.ts │ ├── bloom2.ts.meta │ ├── effect.meta │ ├── effect │ │ ├── blur.effect │ │ ├── blur.effect.meta │ │ ├── merge.effect │ │ ├── merge.effect.meta │ │ ├── threshold.effect │ │ └── threshold.effect.meta │ ├── material.meta │ ├── material │ │ ├── blur.mtl │ │ ├── blur.mtl.meta │ │ ├── merge.mtl │ │ ├── merge.mtl.meta │ │ ├── threshold.mtl │ │ └── threshold.mtl.meta │ ├── stage.meta │ └── stage │ │ ├── PPBlurXStage.ts │ │ ├── PPBlurXStage.ts.meta │ │ ├── PPBlurYStage.ts │ │ ├── PPBlurYStage.ts.meta │ │ ├── PPMergeStage.ts │ │ ├── PPMergeStage.ts.meta │ │ ├── PPThresholdStage.ts │ │ └── PPThresholdStage.ts.meta ├── caseDecals.meta ├── caseDecals │ ├── DecalModel.ts │ ├── DecalModel.ts.meta │ ├── decalmat.mtl │ ├── decalmat.mtl.meta │ ├── decals.scene │ ├── decals.scene.meta │ ├── main.ts │ ├── main.ts.meta │ ├── method2.meta │ └── method2 │ │ ├── DecalMeshRenderer.ts │ │ ├── DecalMeshRenderer.ts.meta │ │ ├── d2.scene │ │ ├── d2.scene.meta │ │ ├── decal2.ts │ │ └── decal2.ts.meta ├── caseDissolve.meta ├── caseDissolve │ ├── Dissolve.ts │ ├── Dissolve.ts.meta │ ├── dissolve.effect │ ├── dissolve.effect.meta │ ├── dissolve.mtl │ ├── dissolve.mtl.meta │ ├── dissolve.scene │ └── dissolve.scene.meta ├── caseDynamicMesh.meta ├── caseDynamicMesh │ ├── Vertexs.ts │ ├── Vertexs.ts.meta │ ├── dynamicMesh.mtl │ ├── dynamicMesh.mtl.meta │ ├── dynamicMesh.scene │ ├── dynamicMesh.scene.meta │ ├── dynamicMesh.ts │ └── dynamicMesh.ts.meta ├── caseInnerGrow.meta ├── caseInnerGrow │ ├── innergrow.effect │ ├── innergrow.effect.meta │ ├── innergrow.mtl │ ├── innergrow.mtl.meta │ ├── innergrow.scene │ └── innergrow.scene.meta ├── caseMultiTex.meta ├── caseMultiTex │ ├── MTBatcher2D.ts │ ├── MTBatcher2D.ts.meta │ ├── MTSprite.ts │ ├── MTSprite.ts.meta │ ├── MTTex.ts │ ├── MTTex.ts.meta │ ├── multitex.effect │ ├── multitex.effect.meta │ ├── multitex.mtl │ ├── multitex.mtl.meta │ ├── multitex.scene │ ├── multitex.scene.meta │ ├── origin_sprite.effect │ └── origin_sprite.effect.meta ├── caseOutLine.meta ├── caseOutLine │ ├── outline.effect │ ├── outline.effect.meta │ ├── outline.mtl │ ├── outline.mtl.meta │ ├── outline.scene │ └── outline.scene.meta ├── caseRaindrop.meta ├── caseRaindrop │ ├── PPRaindropStage.ts │ ├── PPRaindropStage.ts.meta │ ├── raindrop.effect │ ├── raindrop.effect.meta │ ├── raindrop.mtl │ ├── raindrop.mtl.meta │ ├── raindrop.scene │ ├── raindrop.scene.meta │ ├── raindrop.ts │ └── raindrop.ts.meta ├── effects.meta ├── effects │ ├── fox.effect │ └── fox.effect.meta ├── materials.meta ├── materials │ ├── fox.mtl │ └── fox.mtl.meta ├── model.meta ├── model │ ├── PrimaryIonDrive.glb │ ├── PrimaryIonDrive.glb.meta │ ├── cat.meta │ ├── cat │ │ ├── Texture.png │ │ ├── Texture.png.meta │ │ ├── cat.mtl │ │ ├── cat.mtl.meta │ │ ├── cat_Idle.fbx │ │ └── cat_Idle.fbx.meta │ ├── fox.meta │ └── fox │ │ ├── Fox.fbx │ │ ├── Fox.fbx.meta │ │ ├── material.meta │ │ ├── material │ │ ├── fox.mtl │ │ └── fox.mtl.meta │ │ ├── textures.meta │ │ └── textures │ │ ├── T_Fox_AO.png │ │ ├── T_Fox_AO.png.meta │ │ ├── T_Fox_BC.png │ │ ├── T_Fox_BC.png.meta │ │ ├── T_Fox_Normal.png │ │ └── T_Fox_Normal.png.meta ├── postprocess.meta ├── postprocess │ ├── PPBaseStage.ts │ ├── PPBaseStage.ts.meta │ ├── PPMgr.ts │ └── PPMgr.ts.meta ├── resources.meta ├── resources │ ├── atlas.meta │ ├── atlas │ │ ├── emoji.plist │ │ ├── emoji.plist.meta │ │ ├── emoji.png │ │ ├── emoji.png.meta │ │ ├── sheep.plist │ │ ├── sheep.plist.meta │ │ ├── sheep.png │ │ ├── sheep.png.meta │ │ ├── ui.plist │ │ ├── ui.plist.meta │ │ ├── ui.png │ │ └── ui.png.meta │ ├── textures.meta │ └── textures │ │ ├── image.png │ │ └── image.png.meta ├── scene.scene ├── scene.scene.meta ├── scripts.meta ├── scripts │ ├── AutoRotate.ts │ ├── AutoRotate.ts.meta │ ├── CamCtl.ts │ ├── CamCtl.ts.meta │ ├── DebugCube.ts │ ├── DebugCube.ts.meta │ ├── DragAndRotate.ts │ ├── DragAndRotate.ts.meta │ ├── Utils.ts │ └── Utils.ts.meta ├── textures.meta └── textures │ ├── decal.meta │ ├── decal │ ├── LICENSE.TXT │ ├── LICENSE.TXT.meta │ ├── decal-diffuse.png │ ├── decal-diffuse.png.meta │ ├── decal-normal.jpg │ └── decal-normal.jpg.meta │ ├── noise2.png │ ├── noise2.png.meta │ ├── noise_snow.png │ └── noise_snow.png.meta ├── doc └── images │ ├── bloom1.png │ ├── bloom2.gif │ ├── bloom2.png │ ├── decal.gif │ ├── dissolve1.gif │ ├── outline1.jpg │ ├── outline2.jpg │ └── rainOnWindow.gif ├── package.json ├── settings └── v2 │ └── packages │ ├── builder.json │ ├── cocos-service.json │ ├── device.json │ ├── engine.json │ ├── program.json │ └── project.json └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | 4 | #/////////////////////////// 5 | # Cocos Creator 3D Project 6 | #/////////////////////////// 7 | library/ 8 | temp/ 9 | local/ 10 | build/ 11 | profiles/ 12 | native 13 | #////////////////////////// 14 | # NPM 15 | #////////////////////////// 16 | node_modules/ 17 | 18 | #////////////////////////// 19 | # VSCode 20 | #////////////////////////// 21 | .vscode/ 22 | 23 | #////////////////////////// 24 | # WebStorm 25 | #////////////////////////// 26 | .idea/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Effect Case 2 | 3 | ## 环境 4 | 5 | 使用 Cocos Creator 来实现的效果 6 | 7 | ## 列表 8 | 9 | * 内发光 (assets/caseInnerGrow) 10 | 11 | ![内发光](./doc/images/outline2.jpg) 12 | 13 | * 外发光 (assets/caseOutLine) 14 | 15 | ![内发光](./doc/images/outline1.jpg) 16 | 17 | * Bloom辉光 (assets/caseBloom) (Derepcated) 18 | 19 | ![Bloom辉光](./doc/images/bloom1.png) 20 | 21 | * 玻璃上的雨滴 22 | 23 | ![雨滴](./doc/images/rainOnWindow.gif) 24 | 25 | * Bloom辉光2 (assets/caseBloom) 26 | 27 | ![Bloom辉光2](./doc/images/bloom2.gif) 28 | 29 | * Dissolve (assets/caseDissolve) 30 | 31 | ![Dissolve消融](./doc/images/dissolve1.gif) 32 | 33 | * 合批支持多纹理 MultiTex (assets/caseMultiTex) 34 | 35 | 36 | * Decals 贴花 (assets/caseDecals/method2) 37 | 38 | ![Decals贴花](./doc/images/decal.gif) 39 | 40 | -------------------------------------------------------------------------------- /assets/caseBloom.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "df4503de-d4ae-48dc-b8e2-c7a95257f1f6", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseBloom/Bloom.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "b5ecf7c6-1917-4b36-b5f4-43f06cf40a06", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseBloom/BloomBaseStage.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, Node, ForwardStage, renderer, getPhaseID, gfx, pipeline, ForwardPipeline, ForwardFlow, CCLoader, find, Sprite, Size, UITransform, Material, RenderStage, PipelineStateManager, Camera } from 'cc'; 3 | import { Bloom } from './Bloom'; 4 | import { BloomRenderQueue, bloomRenderQueueClearFunc, opaqueCompareFn, transparentCompareFn } from './BloomRenderQueue'; 5 | const { ccclass, property } = _decorator; 6 | 7 | const colors: gfx.Color[] = [new gfx.Color(0, 0, 0, 1)]; 8 | 9 | const _samplerInfo = [ 10 | gfx.Filter.LINEAR, 11 | gfx.Filter.LINEAR, 12 | gfx.Filter.NONE, 13 | gfx.Address.CLAMP, 14 | gfx.Address.CLAMP, 15 | gfx.Address.CLAMP, 16 | ]; 17 | 18 | const samplerHash = renderer.genSamplerHash(_samplerInfo); 19 | 20 | class BloomRenderData { 21 | gbufferFrameBuffer: gfx.Framebuffer | null = null; 22 | gbufferRenderTargets: gfx.Texture[] = []; 23 | depthTex: gfx.Texture | null = null; 24 | } 25 | 26 | @ccclass('BloomBaseStage') 27 | export class BloomBaseStage extends RenderStage { 28 | 29 | private _bloomMat: Material|null = null; 30 | private _bloom: Bloom | null = null; 31 | private _framebuffer: gfx.Framebuffer | null = null; 32 | private _descriptorSet: gfx.DescriptorSet | null = null; 33 | 34 | private _texture1: gfx.Texture | null = null; 35 | private _texture2: gfx.Texture | null = null; 36 | private _textureSample: gfx.Sampler | null = null; 37 | 38 | constructor() { 39 | super(); 40 | this._name = "BloomBaseStage"; 41 | } 42 | 43 | get bloomMat() { 44 | return this._bloomMat; 45 | } 46 | set bloomMat(val) { 47 | this._bloomMat = val; 48 | } 49 | 50 | get bloom() { 51 | return this._bloom; 52 | } 53 | set bloom(val) { 54 | this._bloom = val; 55 | } 56 | 57 | get framebuffer() { 58 | return this._framebuffer; 59 | } 60 | set framebuffer(val) { 61 | this._framebuffer = val; 62 | } 63 | 64 | get descriptorSet() { 65 | return this._descriptorSet; 66 | } 67 | set descriptorSet(val) { 68 | this._descriptorSet = val; 69 | } 70 | 71 | get texture1() { 72 | return this._texture1; 73 | } 74 | set texture1(val) { 75 | this._texture1 = val; 76 | } 77 | 78 | get texture2() { 79 | return this._texture2; 80 | } 81 | set texture2(val) { 82 | this._texture2 = val; 83 | } 84 | 85 | get textureSample() { 86 | return this._textureSample; 87 | } 88 | set textureSample(val) { 89 | this._textureSample = val; 90 | } 91 | 92 | public activate (pl: ForwardPipeline, flow: ForwardFlow) { 93 | super.activate(pl, flow); 94 | const device = pl.device; 95 | 96 | const layoutInfo = new gfx.DescriptorSetLayoutInfo(pipeline.localDescriptorSetLayout.bindings); 97 | const layout = device.createDescriptorSetLayout(layoutInfo); 98 | const descSetInfo = new gfx.DescriptorSetInfo(layout); 99 | this._descriptorSet = device.createDescriptorSet(descSetInfo); 100 | } 101 | 102 | public render (camera: renderer.scene.Camera): void { 103 | if (camera.projectionType != Camera.ProjectionType.PERSPECTIVE) { return; } 104 | if (null == this._bloomMat) { return; } 105 | 106 | const pl = this._pipeline; 107 | const device = pl.device; 108 | const cmdBuff = pl.commandBuffers[0]; 109 | let fb = this.framebuffer ? this.framebuffer : camera.window?.framebuffer; 110 | if (null == fb) { return; } 111 | const rp = fb.renderPass; 112 | 113 | pl.pipelineUBO.updateCameraUBO(camera); 114 | 115 | const renderArea = new gfx.Rect(0, 0, 1, 1); 116 | const vp = camera.viewport; 117 | renderArea.x = vp.x * camera.width; 118 | renderArea.y = vp.y * camera.height; 119 | renderArea.width = vp.width * camera.width * pl.pipelineSceneData.shadingScale; 120 | renderArea.height = vp.height * camera.height * pl.pipelineSceneData.shadingScale; 121 | this.bloom?.updateQuadVertexData(pl.device, renderArea); 122 | 123 | if (camera.clearFlag & gfx.ClearFlagBit.COLOR) { 124 | colors[0].x = camera.clearColor.x; 125 | colors[0].y = camera.clearColor.y; 126 | colors[0].z = camera.clearColor.z; 127 | } 128 | colors[0].w = camera.clearColor.w; 129 | 130 | cmdBuff.beginRenderPass(rp, fb, renderArea, colors, camera.clearDepth, camera.clearStencil); 131 | cmdBuff.bindDescriptorSet(pipeline.SetIndex.GLOBAL, pl.descriptorSet); 132 | 133 | const pass = this.bloomMat!.passes[0]; 134 | const shader = this.bloomMat!.passes[0].getShaderVariant(); 135 | 136 | let inputAssembler = camera.window!.hasOffScreenAttachments ? this._bloom!.quadIAOffscreen : this._bloom!.quadIAOnscreen; 137 | let pso: gfx.PipelineState | null = null; 138 | if (pass != null && shader != null && inputAssembler != null) { 139 | pso = PipelineStateManager.getOrCreatePipelineState(device, pass, shader, rp, inputAssembler); 140 | } 141 | 142 | const renderObjects = pl.pipelineSceneData.renderObjects; 143 | if (pso != null) { 144 | cmdBuff.bindPipelineState(pso); 145 | cmdBuff.bindDescriptorSet(pipeline.SetIndex.MATERIAL, pass.descriptorSet); 146 | cmdBuff.bindInputAssembler(inputAssembler); 147 | cmdBuff.draw(inputAssembler); 148 | } 149 | 150 | cmdBuff.endRenderPass(); 151 | } 152 | 153 | destroy() { 154 | } 155 | 156 | } 157 | -------------------------------------------------------------------------------- /assets/caseBloom/BloomBaseStage.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "a4fd33db-cb7b-475f-97b7-a6cc7bdc594e", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseBloom/BloomBlurXStage.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator } from 'cc'; 3 | import { BloomBaseStage } from './BloomBaseStage'; 4 | const { ccclass, property } = _decorator; 5 | @ccclass('BloomBlurXStage') 6 | 7 | export class BloomBlurXStage extends BloomBaseStage { 8 | constructor() { 9 | super(); 10 | this._name = "BloomBlurXStage"; 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /assets/caseBloom/BloomBlurXStage.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "b7bcf5ec-0508-4db6-a59d-97e12353e4d2", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseBloom/BloomBlurYStage.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator } from 'cc'; 3 | import { BloomBaseStage } from './BloomBaseStage'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('BloomBlurYStage') 7 | export class BloomBlurYStage extends BloomBaseStage { 8 | constructor() { 9 | super(); 10 | this._name = "BloomBlurYStage"; 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /assets/caseBloom/BloomBlurYStage.ts.meta: -------------------------------------------------------------------------------- 1 | {"ver":"4.0.22","importer":"typescript","imported":true,"uuid":"423dd3d1-bd24-4501-b4b6-c38666740cf5","files":[],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/caseBloom/BloomMergeStage.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator } from 'cc'; 3 | import { BloomBaseStage } from './BloomBaseStage'; 4 | const { ccclass, property } = _decorator; 5 | @ccclass('BloomMergeStage') 6 | export class BloomMergeStage extends BloomBaseStage { 7 | constructor() { 8 | super(); 9 | this._name = "BloomMergeStage"; 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /assets/caseBloom/BloomMergeStage.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "f1781578-a219-4ce2-be61-0f1d504471db", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseBloom/BloomRenderQueue.ts: -------------------------------------------------------------------------------- 1 | 2 | // import { RecyclePool } from '../memop'; 3 | // import { CachedArray } from '../memop/cached-array'; 4 | // import { IRenderObject, IRenderPass, IRenderQueueDesc, SetIndex } from './define'; 5 | // import { PipelineStateManager } from './pipeline-state-manager'; 6 | // import { RenderPass, Device, CommandBuffer } from '../gfx'; 7 | // import { PassPool, PassView, DSPool, SubModelView, SubModelPool, ShaderPool, PassHandle, ShaderHandle } from '../renderer/core/memory-pools'; 8 | // import { RenderQueueDesc, RenderQueueSortMode } from './pipeline-serialization'; 9 | // import { getPhaseID } from './pass-phase'; 10 | 11 | import { gfx, memop, pipeline, PipelineStateManager, renderer } from "cc"; 12 | 13 | /** 14 | * @en Comparison sorting function. Opaque objects are sorted by priority -> depth front to back -> shader ID. 15 | * @zh 比较排序函数。不透明对象按优先级 -> 深度由前向后 -> Shader ID 顺序排序。 16 | */ 17 | export function opaqueCompareFn (a: pipeline.IRenderPass, b: pipeline.IRenderPass) { 18 | return (a.hash - b.hash) || (a.depth - b.depth) || (a.shaderId - b.shaderId); 19 | } 20 | 21 | /** 22 | * @en Comparison sorting function. Transparent objects are sorted by priority -> depth back to front -> shader ID. 23 | * @zh 比较排序函数。半透明对象按优先级 -> 深度由后向前 -> Shader ID 顺序排序。 24 | */ 25 | export function transparentCompareFn (a: pipeline.IRenderPass, b: pipeline.IRenderPass) { 26 | return (a.hash - b.hash) || (b.depth - a.depth) || (a.shaderId - b.shaderId); 27 | } 28 | 29 | /** 30 | * @en The render queue. It manages a GFX [[RenderPass]] queue which will be executed by the [[RenderStage]]. 31 | * @zh 渲染队列。它管理一个 GFX [[RenderPass]] 队列,队列中的渲染过程会被 [[RenderStage]] 所执行。 32 | */ 33 | export class BloomRenderQueue { 34 | /** 35 | * @en A cached array of render passes 36 | * @zh 基于缓存数组的渲染过程队列。 37 | */ 38 | public queue: memop.CachedArray; 39 | 40 | private _passDesc: pipeline.IRenderQueueDesc; 41 | private _passPool: memop.RecyclePool; 42 | 43 | /** 44 | * @en Construct a RenderQueue with render queue descriptor 45 | * @zh 利用渲染队列描述来构造一个 RenderQueue。 46 | * @param desc Render queue descriptor 47 | */ 48 | constructor (desc: pipeline.IRenderQueueDesc) { 49 | this._passDesc = desc; 50 | this._passPool = new memop.RecyclePool(() => ({ 51 | hash: 0, 52 | depth: 0, 53 | shaderId: 0, 54 | subModel: null!, 55 | passIdx: 0, 56 | }), 64); 57 | this.queue = new memop.CachedArray(64, this._passDesc.sortFunc); 58 | } 59 | 60 | /** 61 | * @en Clear the render queue 62 | * @zh 清空渲染队列。 63 | */ 64 | public clear () { 65 | this.queue.clear(); 66 | this._passPool.reset(); 67 | } 68 | 69 | /** 70 | * @en Insert a render pass into the queue 71 | * @zh 插入渲染过程。 72 | * @param renderObj The render object of the pass 73 | * @param modelIdx The model id 74 | * @param passIdx The pass id 75 | * @returns Whether the new render pass is successfully added 76 | */ 77 | public insertRenderPass (renderObj: pipeline.IRenderObject, subModelIdx: number, passIdx: number): boolean { 78 | const subModel = renderObj.model.subModels[subModelIdx]; 79 | const hPass = renderer.SubModelPool.get(subModel.handle, renderer.SubModelView.PASS_0 + passIdx) as renderer.PassHandle; 80 | const isTransparent = subModel.passes[passIdx].blendState.targets[0].blend; 81 | if (isTransparent !== this._passDesc.isTransparent || !(renderer.PassPool.get(hPass, renderer.PassView.PHASE) & this._passDesc.phases)) { 82 | return false; 83 | } 84 | const hash = (0 << 30) | renderer.PassPool.get(hPass, renderer.PassView.PRIORITY) << 16 | subModel.priority << 8 | passIdx; 85 | const rp = this._passPool.add(); 86 | rp.hash = hash; 87 | rp.depth = renderObj.depth || 0; 88 | rp.shaderId = renderer.SubModelPool.get(subModel.handle, renderer.SubModelView.SHADER_0 + passIdx) as number; 89 | rp.subModel = subModel; 90 | rp.passIdx = passIdx; 91 | this.queue.push(rp); 92 | return true; 93 | } 94 | 95 | /** 96 | * @en Sort the current queue 97 | * @zh 排序渲染队列。 98 | */ 99 | public sort () { 100 | this.queue.sort(); 101 | } 102 | 103 | public recordCommandBuffer (device: gfx.Device, renderPass: gfx.RenderPass, cmdBuff: gfx.CommandBuffer) { 104 | for (let i = 0; i < this.queue.length; ++i) { 105 | const { subModel, passIdx } = this.queue.array[i]; 106 | const { inputAssembler, handle: hSubModel } = subModel; 107 | const pass = subModel.passes[passIdx]; 108 | const shader = renderer.ShaderPool.get(renderer.SubModelPool.get(hSubModel, renderer.SubModelView.SHADER_0 + passIdx) as renderer.ShaderHandle); 109 | const pso = PipelineStateManager.getOrCreatePipelineState(device, pass, shader, renderPass, inputAssembler); 110 | cmdBuff.bindPipelineState(pso); 111 | cmdBuff.bindDescriptorSet(pipeline.SetIndex.MATERIAL, pass.descriptorSet); 112 | cmdBuff.bindDescriptorSet(pipeline.SetIndex.LOCAL, subModel.descriptorSet); 113 | cmdBuff.bindInputAssembler(inputAssembler); 114 | cmdBuff.draw(inputAssembler); 115 | } 116 | } 117 | } 118 | 119 | export function bloomRenderQueueClearFunc (rq: BloomRenderQueue) { 120 | rq.clear(); 121 | } 122 | -------------------------------------------------------------------------------- /assets/caseBloom/BloomRenderQueue.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "111bdc6e-f231-41d0-8c47-a751abedfb27", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseBloom/BloomThresholdStage.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, Node, ForwardStage, renderer, getPhaseID, gfx, pipeline, ForwardPipeline, ForwardFlow, CCLoader, find, Sprite, Size, UITransform, Material, RenderStage, PipelineStateManager } from 'cc'; 3 | import { Bloom } from './Bloom'; 4 | import { BloomBaseStage } from './BloomBaseStage'; 5 | import { BloomRenderQueue, bloomRenderQueueClearFunc, opaqueCompareFn, transparentCompareFn } from './BloomRenderQueue'; 6 | const { ccclass, property } = _decorator; 7 | 8 | const colors: gfx.Color[] = [new gfx.Color(0, 0, 0, 1)]; 9 | 10 | const _samplerInfo = [ 11 | gfx.Filter.LINEAR, 12 | gfx.Filter.LINEAR, 13 | gfx.Filter.NONE, 14 | gfx.Address.CLAMP, 15 | gfx.Address.CLAMP, 16 | gfx.Address.CLAMP, 17 | ]; 18 | 19 | const samplerHash = renderer.genSamplerHash(_samplerInfo); 20 | 21 | class BloomRenderData { 22 | gbufferFrameBuffer: gfx.Framebuffer | null = null; 23 | gbufferRenderTargets: gfx.Texture[] = []; 24 | depthTex: gfx.Texture | null = null; 25 | } 26 | 27 | @ccclass('BloomThresholdStage') 28 | export class BloomThresholdStage extends BloomBaseStage { 29 | constructor() { 30 | super(); 31 | this._name = "BloomThresholdStage"; 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /assets/caseBloom/BloomThresholdStage.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "4cf92e0e-e0ee-4003-becc-c98a07141213", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseBloom/FakeUIPhase.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, Node, RenderPipeline, Camera, gfx } from 'cc'; 3 | const { ccclass, property } = _decorator; 4 | 5 | @ccclass('FakeUIPhase') 6 | export class FakeUIPhase { 7 | 8 | public activate (pipeline: RenderPipeline) { 9 | } 10 | 11 | public render (camera: Camera, renderPass: gfx.RenderPass) { 12 | } 13 | 14 | } 15 | 16 | -------------------------------------------------------------------------------- /assets/caseBloom/FakeUIPhase.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "d5221b9d-ca8e-4cc8-a284-3a594129698b", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseBloom/PostProcess.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, Node, gfx, pipeline, RenderStage, renderer } from 'cc'; 3 | const { ccclass, property } = _decorator; 4 | 5 | @ccclass('PostProcess') 6 | export class PostProcess extends RenderStage { 7 | 8 | destroy() { 9 | throw new Error('Method not implemented.'); 10 | } 11 | render(camera: renderer.scene.Camera) { 12 | throw new Error('Method not implemented.'); 13 | } 14 | 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /assets/caseBloom/PostProcess.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "5bd2b2d9-b156-461f-a887-bfbe26955591", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseBloom/bloom.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.32", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "0a6d4469-122e-4fa8-9775-b7eccba40eca", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom/bloomeffect.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "052d265b-0bc1-4fd7-952d-d328500506ee", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom/bloommat.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "052d265b-0bc1-4fd7-952d-d328500506ee", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | {}, 13 | {}, 14 | {}, 15 | {} 16 | ], 17 | "_states": [ 18 | { 19 | "rasterizerState": {}, 20 | "depthStencilState": {}, 21 | "blendState": { 22 | "targets": [ 23 | {} 24 | ] 25 | } 26 | }, 27 | {}, 28 | {}, 29 | {} 30 | ], 31 | "_props": [ 32 | {}, 33 | {}, 34 | {}, 35 | {} 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /assets/caseBloom/bloommat.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "5eddf753-767d-4189-8e17-ad8ed38fd326", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom/effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "37449ed2-6f08-44d3-b8ea-aa306811f830", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseBloom/effect/BloomBlur.effect: -------------------------------------------------------------------------------- 1 | 2 | CCEffect %{ 3 | techniques: 4 | - name: opaque 5 | passes: 6 | - vert: fx-bloom-blur-vs:vert 7 | frag: fx-bloom-blur-fs:frag 8 | properties: 9 | windowStep: { value: 0.01, editor: { displayName: window step X size, range: [0, 0.1] } } 10 | }% 11 | 12 | CCProgram fx-bloom-blur-vs %{ 13 | precision highp float; 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | out vec2 v_uv; 20 | 21 | vec4 vert () { 22 | StandardVertInput In; 23 | CCVertInput(In); 24 | 25 | v_uv = a_texCoord; 26 | 27 | return In.position; 28 | } 29 | }% 30 | 31 | CCProgram fx-bloom-blur-fs %{ 32 | precision highp float; 33 | #include 34 | #include 35 | 36 | in vec2 v_uv; 37 | 38 | #pragma builtin(global) 39 | layout(set = 0, binding = 9) uniform sampler2D cc_gbuffer_emissiveMap; 40 | #pragma builtin(global) 41 | layout(set = 0, binding = 10) uniform sampler2D cc_lighting_resultMap; 42 | 43 | uniform Constants { 44 | float windowStep; 45 | }; 46 | 47 | #define WINDOW_SIZE 5. 48 | 49 | vec4 frag () { 50 | vec4 col = vec4(0., 0., 0., 0.); 51 | 52 | #if DIRECTIONX 53 | col += texture(cc_gbuffer_emissiveMap, v_uv); 54 | for (float i = 1.; i <= WINDOW_SIZE; i += 1.) { 55 | col += texture(cc_gbuffer_emissiveMap, v_uv + vec2(i * windowStep, 0.)); 56 | col += texture(cc_gbuffer_emissiveMap, v_uv - vec2(i * windowStep, 0.)); 57 | } 58 | #else 59 | col += texture(cc_lighting_resultMap, v_uv); 60 | for (float i = 1.; i <= WINDOW_SIZE; i += 1.) { 61 | col += texture(cc_lighting_resultMap, v_uv + vec2(0., i * windowStep)); 62 | col += texture(cc_lighting_resultMap, v_uv - vec2(0., i * windowStep)); 63 | } 64 | #endif 65 | 66 | col /= (WINDOW_SIZE * 2. + 1.); 67 | 68 | return CCFragOutput(col); 69 | } 70 | }% 71 | -------------------------------------------------------------------------------- /assets/caseBloom/effect/BloomBlur.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "c113bafc-44c7-41fa-a41c-45713ab5df32", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom/effect/BloomMerge.effect: -------------------------------------------------------------------------------- 1 | 2 | CCEffect %{ 3 | techniques: 4 | - name: opaque 5 | passes: 6 | - vert: fx-bloom-merge-vs:vert 7 | frag: fx-bloom-merge-fs:frag 8 | properties: 9 | toneExp: { value: 1.0, editor: { displayName: tone exp param } } 10 | }% 11 | 12 | CCProgram fx-bloom-merge-vs %{ 13 | precision highp float; 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | out vec2 v_uv; 20 | 21 | vec4 vert () { 22 | StandardVertInput In; 23 | CCVertInput(In); 24 | 25 | v_uv = a_texCoord; 26 | 27 | return In.position; 28 | } 29 | }% 30 | 31 | CCProgram fx-bloom-merge-fs %{ 32 | precision highp float; 33 | #include 34 | #include 35 | 36 | in vec2 v_uv; 37 | #pragma builtin(global) 38 | layout(set = 0, binding = 6) uniform sampler2D cc_gbuffer_albedoMap; 39 | #pragma builtin(global) 40 | layout(set = 0, binding = 9) uniform sampler2D cc_gbuffer_emissiveMap; 41 | #pragma builtin(global) 42 | layout(set = 0, binding = 10) uniform sampler2D cc_lighting_resultMap; 43 | 44 | uniform Constants { 45 | float toneExp; 46 | }; 47 | 48 | vec4 frag () { 49 | vec4 difCol = texture(cc_gbuffer_albedoMap, v_uv); 50 | vec4 blurCol = texture(cc_gbuffer_emissiveMap, v_uv); 51 | vec4 col = difCol + blurCol; 52 | 53 | // col = vec4(1.) - exp(-col * toneExp); 54 | 55 | return CCFragOutput(col); 56 | } 57 | }% 58 | -------------------------------------------------------------------------------- /assets/caseBloom/effect/BloomMerge.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "731f95e1-c0b3-425b-abae-777a026adebc", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom/effect/BloomThreshold.effect: -------------------------------------------------------------------------------- 1 | 2 | CCEffect %{ 3 | techniques: 4 | - name: opaque 5 | passes: 6 | - vert: fx-bloom-threshold-vs:vert 7 | frag: fx-bloom-threshold-fs:frag 8 | properties: 9 | thresholdVal: { value: 0.3, editor: { displayName: threshold val, range: [0, 1] }} 10 | }% 11 | 12 | CCProgram fx-bloom-threshold-vs %{ 13 | precision highp float; 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | out vec2 v_uv; 20 | 21 | vec4 vert () { 22 | StandardVertInput In; 23 | CCVertInput(In); 24 | 25 | v_uv = a_texCoord; 26 | 27 | return In.position; 28 | } 29 | }% 30 | 31 | CCProgram fx-bloom-threshold-fs %{ 32 | precision highp float; 33 | #include 34 | #include 35 | 36 | in vec2 v_uv; 37 | 38 | #pragma builtin(global) 39 | layout(set = 0, binding = 6) uniform sampler2D cc_gbuffer_albedoMap; 40 | 41 | uniform Constants { 42 | float thresholdVal; 43 | }; 44 | 45 | vec4 frag () { 46 | vec4 col = texture(cc_gbuffer_albedoMap, v_uv); 47 | float luminace = sqrt(col.r*col.r*0.299 + col.g*col.g*0.587 + col.b*col.b*0.114); 48 | 49 | if (luminace < thresholdVal) { 50 | col = vec4(0., 0., 0., 1.); 51 | } 52 | 53 | return CCFragOutput(col); 54 | } 55 | }% 56 | -------------------------------------------------------------------------------- /assets/caseBloom/effect/BloomThreshold.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "7357325d-dc7e-4ae6-b459-101c13d85923", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom/material.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "4aba61a9-db83-449e-9d21-0fbb0533439d", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseBloom/material/BloomBlurX.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "c113bafc-44c7-41fa-a41c-45713ab5df32", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | { 13 | "DIRECTIONX": true 14 | } 15 | ], 16 | "_states": [ 17 | { 18 | "rasterizerState": {}, 19 | "depthStencilState": {}, 20 | "blendState": { 21 | "targets": [ 22 | {} 23 | ] 24 | } 25 | } 26 | ], 27 | "_props": [ 28 | { 29 | "windowStep": 0.01 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /assets/caseBloom/material/BloomBlurX.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "7197e72a-8727-437c-9dba-067fbf966058", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom/material/BloomBlurY.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "c113bafc-44c7-41fa-a41c-45713ab5df32", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | {} 13 | ], 14 | "_states": [ 15 | { 16 | "rasterizerState": {}, 17 | "depthStencilState": {}, 18 | "blendState": { 19 | "targets": [ 20 | {} 21 | ] 22 | } 23 | } 24 | ], 25 | "_props": [ 26 | {} 27 | ] 28 | } -------------------------------------------------------------------------------- /assets/caseBloom/material/BloomBlurY.mtl.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.0.9","importer":"material","imported":true,"uuid":"6feee30a-5bea-4313-9300-b9e91eaf68ab","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/caseBloom/material/BloomMerge.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "731f95e1-c0b3-425b-abae-777a026adebc", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | {} 13 | ], 14 | "_states": [ 15 | { 16 | "rasterizerState": {}, 17 | "depthStencilState": {}, 18 | "blendState": { 19 | "targets": [ 20 | {} 21 | ] 22 | } 23 | } 24 | ], 25 | "_props": [ 26 | { 27 | "toneExp": 0.8 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /assets/caseBloom/material/BloomMerge.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "3604ea5b-e63d-412d-9f3f-f5356dcba555", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom/material/BloomThreshold.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "6f23bf67-b265-4de1-bad4-836cf6686619", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | {} 13 | ], 14 | "_states": [ 15 | { 16 | "rasterizerState": {}, 17 | "depthStencilState": {}, 18 | "blendState": { 19 | "targets": [ 20 | {} 21 | ] 22 | } 23 | } 24 | ], 25 | "_props": [ 26 | {} 27 | ] 28 | } -------------------------------------------------------------------------------- /assets/caseBloom/material/BloomThreshold.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "e29e92cd-e2e7-4c92-947b-0b868745dc1c", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom/material/builtin-default1.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "1baf0fc9-befa-459c-8bdd-af1a450a0319", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | {}, 13 | {}, 14 | {}, 15 | {} 16 | ], 17 | "_states": [ 18 | { 19 | "rasterizerState": {}, 20 | "depthStencilState": {}, 21 | "blendState": { 22 | "targets": [ 23 | {} 24 | ] 25 | } 26 | }, 27 | {}, 28 | {}, 29 | {} 30 | ], 31 | "_props": [ 32 | { 33 | "mainColor": { 34 | "__type__": "cc.Color", 35 | "r": 235, 36 | "g": 58, 37 | "b": 58, 38 | "a": 255 39 | } 40 | }, 41 | {}, 42 | {}, 43 | {} 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /assets/caseBloom/material/builtin-default1.mtl.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.0.9","importer":"material","imported":true,"uuid":"c95553da-efee-423e-89eb-ea0984b3b91f","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/caseBloom/material/builtin-default2.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "1baf0fc9-befa-459c-8bdd-af1a450a0319", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | {}, 13 | {}, 14 | {}, 15 | {} 16 | ], 17 | "_states": [ 18 | { 19 | "rasterizerState": {}, 20 | "depthStencilState": {}, 21 | "blendState": { 22 | "targets": [ 23 | {} 24 | ] 25 | } 26 | }, 27 | {}, 28 | {}, 29 | {} 30 | ], 31 | "_props": [ 32 | { 33 | "mainColor": { 34 | "__type__": "cc.Color", 35 | "r": 53, 36 | "g": 35, 37 | "b": 185, 38 | "a": 255 39 | } 40 | }, 41 | {}, 42 | {}, 43 | {} 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /assets/caseBloom/material/builtin-default2.mtl.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.0.9","importer":"material","imported":true,"uuid":"eb1f898e-d42b-4db2-8fbb-b5281e4929d3","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/caseBloom/material/builtin-default3.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "1baf0fc9-befa-459c-8bdd-af1a450a0319", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | {}, 13 | {}, 14 | {}, 15 | {} 16 | ], 17 | "_states": [ 18 | { 19 | "rasterizerState": {}, 20 | "depthStencilState": {}, 21 | "blendState": { 22 | "targets": [ 23 | {} 24 | ] 25 | } 26 | }, 27 | {}, 28 | {}, 29 | {} 30 | ], 31 | "_props": [ 32 | { 33 | "mainColor": { 34 | "__type__": "cc.Color", 35 | "r": 43, 36 | "g": 201, 37 | "b": 43, 38 | "a": 255 39 | } 40 | }, 41 | {}, 42 | {}, 43 | {} 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /assets/caseBloom/material/builtin-default3.mtl.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.0.9","importer":"material","imported":true,"uuid":"ed7a7b50-71ec-4f97-9a62-edc85a09464a","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/caseBloom/material/builtin-default4.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "1baf0fc9-befa-459c-8bdd-af1a450a0319", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | {}, 13 | {}, 14 | {}, 15 | {} 16 | ], 17 | "_states": [ 18 | { 19 | "rasterizerState": {}, 20 | "depthStencilState": {}, 21 | "blendState": { 22 | "targets": [ 23 | {} 24 | ] 25 | } 26 | }, 27 | {}, 28 | {}, 29 | {} 30 | ], 31 | "_props": [ 32 | { 33 | "mainColor": { 34 | "__type__": "cc.Color", 35 | "r": 211, 36 | "g": 182, 37 | "b": 34, 38 | "a": 255 39 | } 40 | }, 41 | {}, 42 | {}, 43 | {} 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /assets/caseBloom/material/builtin-default4.mtl.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.0.9","importer":"material","imported":true,"uuid":"66464239-236b-4906-a1cd-43045db1ccce","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/caseBloom2.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "36d5d6a5-57ed-41bd-9e3a-ca2f48dbaf56", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseBloom2/bloom2.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.32", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "e5e029e1-1bbe-417e-9e38-4eb50820406c", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom2/bloom2.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, Node } from 'cc'; 3 | import { PPBaseStage } from '../postprocess/PPBaseStage'; 4 | import { PPMgr } from '../postprocess/PPMgr'; 5 | import { PPThresholdStage } from './stage/PPThresholdStage'; 6 | import { PPBlurXStage } from './stage/PPBlurXStage'; 7 | import { PPBlurYStage } from './stage/PPBlurYStage'; 8 | import { PPMergeStage } from './stage/PPMergeStage'; 9 | const { ccclass, property } = _decorator; 10 | 11 | @ccclass('Bloom2') 12 | export class Bloom2 extends Component { 13 | 14 | @property(PPMgr) 15 | mgr: PPMgr|null = null; 16 | 17 | start () { 18 | this.mgr?.registerCreateStage(stageDesc => { 19 | let stage : PPBaseStage | null = null; 20 | if ('PPThresholdStage' == stageDesc.stageName) { 21 | stage = new PPThresholdStage(); 22 | } else if ('PPBlurXStage' == stageDesc.stageName) { 23 | stage = new PPBlurXStage(); 24 | } else if ('PPBlurYStage' == stageDesc.stageName) { 25 | stage = new PPBlurYStage(); 26 | } else if ('PPMergeStage' == stageDesc.stageName) { 27 | stage = new PPMergeStage(); 28 | } 29 | 30 | if (stage) { 31 | stage.mat = stageDesc.mat; 32 | } 33 | 34 | return stage; 35 | }); 36 | this.mgr?.init(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /assets/caseBloom2/bloom2.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "f1d0c87b-1ac1-4ac3-99ef-d22719ca02f2", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseBloom2/effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "66a4c119-60c5-42cd-93cd-6e8a59878725", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseBloom2/effect/blur.effect: -------------------------------------------------------------------------------- 1 | 2 | CCEffect %{ 3 | techniques: 4 | - name: opaque 5 | passes: 6 | - vert: fx-bloom2-threshold-vs:vert # builtin header 7 | frag: fx-bloom2-threshold-fs:frag 8 | properties: 9 | texSize: { value: [1, 1]} 10 | direction: { value: [0, 1]} 11 | tempTex: { value: white } 12 | }% 13 | 14 | CCProgram fx-bloom2-threshold-vs %{ 15 | precision highp float; 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | out vec2 v_uv; 22 | 23 | vec4 vert () { 24 | StandardVertInput In; 25 | CCVertInput(In); 26 | 27 | v_uv = a_texCoord; 28 | 29 | return In.position; 30 | } 31 | }% 32 | 33 | CCProgram fx-bloom2-threshold-fs %{ 34 | precision highp float; 35 | #include 36 | #include 37 | 38 | in vec2 v_uv; 39 | 40 | uniform sampler2D tempTex; 41 | uniform Constants { 42 | vec2 texSize; 43 | vec2 direction; 44 | }; 45 | 46 | #define WINDOW_SIZE 5. 47 | 48 | float gaussianPdf(in float x, in float sigma) { 49 | return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma; 50 | } 51 | 52 | vec4 frag () { 53 | vec2 invSize = 1.0 / texSize; 54 | float fSigma = 3.0; 55 | float weightSum = gaussianPdf(0.0, fSigma); 56 | vec3 diffuseSum = texture( tempTex, v_uv).rgb * weightSum; 57 | for( int i = 1; i < 3; i++ ) { 58 | float x = float(i); 59 | float w = gaussianPdf(x, fSigma); 60 | vec2 uvOffset = direction * invSize * x; 61 | vec3 sample1 = texture( tempTex, v_uv + uvOffset).rgb; 62 | vec3 sample2 = texture( tempTex, v_uv - uvOffset).rgb; 63 | diffuseSum += (sample1 + sample2) * w; 64 | weightSum += 2.0 * w; 65 | } 66 | 67 | return CCFragOutput(vec4(diffuseSum/weightSum, 1.0)); 68 | } 69 | 70 | }% 71 | 72 | -------------------------------------------------------------------------------- /assets/caseBloom2/effect/blur.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "357470fb-d3d2-4ca9-9ad4-76fe0efa1cfa", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom2/effect/merge.effect: -------------------------------------------------------------------------------- 1 | 2 | CCEffect %{ 3 | techniques: 4 | - name: opaque 5 | passes: 6 | - vert: fx-bloom2-merge-vs:vert 7 | frag: fx-bloom2-merge-fs:frag 8 | properties: 9 | screenTex: { value: white } 10 | tempTex: { value: white } 11 | }% 12 | 13 | CCProgram fx-bloom2-merge-vs %{ 14 | precision highp float; 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | out vec2 v_uv; 21 | 22 | vec4 vert () { 23 | StandardVertInput In; 24 | CCVertInput(In); 25 | 26 | v_uv = a_texCoord; 27 | 28 | return In.position; 29 | } 30 | }% 31 | 32 | CCProgram fx-bloom2-merge-fs %{ 33 | precision highp float; 34 | #include 35 | #include 36 | 37 | in vec2 v_uv; 38 | 39 | uniform sampler2D screenTex; 40 | uniform sampler2D tempTex; 41 | 42 | vec4 frag () { 43 | vec4 col = vec4(0., 0., 0., 0.); 44 | 45 | col += texture(screenTex, v_uv); 46 | col += texture(tempTex, v_uv); 47 | 48 | // return CCFragOutput(col); 49 | return col; 50 | } 51 | 52 | }% 53 | 54 | -------------------------------------------------------------------------------- /assets/caseBloom2/effect/merge.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "d8c20c15-7e01-4bb4-8ccc-5d0aa82a4e62", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom2/effect/threshold.effect: -------------------------------------------------------------------------------- 1 | // Effect Syntax Guide: https://github.com/cocos-creator/docs-3d/blob/master/zh/material-system/effect-syntax.md 2 | 3 | CCEffect %{ 4 | techniques: 5 | - name: opaque 6 | passes: 7 | - vert: fx-bloom2-threshold-vs:vert # builtin header 8 | frag: fx-bloom2-threshold-fs:frag 9 | properties: &props 10 | thresholdVal: { value: 0.3, editor: { displayName: threshold val, range: [0, 1] }} 11 | screenTex: { value: white } 12 | }% 13 | 14 | CCProgram fx-bloom2-threshold-vs %{ 15 | precision highp float; 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | out vec2 v_uv; 22 | 23 | vec4 vert () { 24 | StandardVertInput In; 25 | CCVertInput(In); 26 | 27 | v_uv = a_texCoord; 28 | 29 | return In.position; 30 | } 31 | }% 32 | 33 | CCProgram fx-bloom2-threshold-fs %{ 34 | precision highp float; 35 | #include 36 | #include 37 | 38 | in vec2 v_uv; 39 | 40 | uniform sampler2D screenTex; 41 | 42 | uniform Constants { 43 | float thresholdVal; 44 | }; 45 | 46 | vec4 frag () { 47 | vec4 col = texture(screenTex, v_uv); 48 | float luminace = sqrt(col.r*col.r*0.299 + col.g*col.g*0.587 + col.b*col.b*0.114); 49 | 50 | if (luminace < thresholdVal) { 51 | col = vec4(0., 0., 0., 1.); 52 | } 53 | 54 | return CCFragOutput(col); 55 | } 56 | }% 57 | -------------------------------------------------------------------------------- /assets/caseBloom2/effect/threshold.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "01d6d955-a2f4-4605-b952-0f0713e6cc43", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom2/material.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "44ef1388-717e-4ce6-ad0d-e95b2bcc5115", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseBloom2/material/blur.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "357470fb-d3d2-4ca9-9ad4-76fe0efa1cfa", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | {} 13 | ], 14 | "_states": [ 15 | { 16 | "rasterizerState": {}, 17 | "depthStencilState": {}, 18 | "blendState": { 19 | "targets": [ 20 | {} 21 | ] 22 | } 23 | } 24 | ], 25 | "_props": [ 26 | {} 27 | ] 28 | } -------------------------------------------------------------------------------- /assets/caseBloom2/material/blur.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "096cf0e8-7a8e-4561-92b5-50850fab81b8", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom2/material/merge.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "d8c20c15-7e01-4bb4-8ccc-5d0aa82a4e62", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | {} 13 | ], 14 | "_states": [ 15 | { 16 | "rasterizerState": {}, 17 | "depthStencilState": {}, 18 | "blendState": { 19 | "targets": [ 20 | {} 21 | ] 22 | } 23 | } 24 | ], 25 | "_props": [ 26 | {} 27 | ] 28 | } -------------------------------------------------------------------------------- /assets/caseBloom2/material/merge.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "d9c14479-b655-48a2-8a6a-8f95493cd8ee", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom2/material/threshold.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "01d6d955-a2f4-4605-b952-0f0713e6cc43", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | {} 13 | ], 14 | "_states": [ 15 | { 16 | "rasterizerState": {}, 17 | "depthStencilState": {}, 18 | "blendState": { 19 | "targets": [ 20 | {} 21 | ] 22 | } 23 | } 24 | ], 25 | "_props": [ 26 | {} 27 | ] 28 | } -------------------------------------------------------------------------------- /assets/caseBloom2/material/threshold.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "c2c9b65a-6146-4980-95ff-164b02bd458c", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseBloom2/stage.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "6f94ff64-2619-4544-811f-d09f20074a7b", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseBloom2/stage/PPBlurXStage.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, RenderPipeline, Vec2 } from 'cc'; 3 | import { PPBaseStage } from '../../postprocess/PPBaseStage'; 4 | import { PPMgr } from '../../postprocess/PPMgr'; 5 | const { ccclass } = _decorator; 6 | 7 | @ccclass('PPBlurXStage') 8 | export class PPBlurXStage extends PPBaseStage { 9 | 10 | constructor() { 11 | super(); 12 | this._name = "PPBlurXStage"; 13 | } 14 | 15 | public initWithStageDesc(mgr: PPMgr, pl: RenderPipeline) { 16 | this.outputTexName = 'tempTex2'; 17 | 18 | const tex = mgr.getFrameBuffer('screenTex'); 19 | const texSize = new Vec2(1, 1); 20 | if (tex && tex.colorTextures[0]) { 21 | texSize.x = tex.colorTextures[0].width; 22 | texSize.y = tex.colorTextures[0].height; 23 | } 24 | this.bindShaderParamsTexture(mgr, 'tempTex', 'tempTex'); 25 | this.setOutputFramebuffer(mgr); 26 | this.bindShaderParamsVec2('texSize', texSize); 27 | this.bindShaderParamsVec2('direction', new Vec2(1, 0)); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /assets/caseBloom2/stage/PPBlurXStage.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "dd5e44e9-62d4-4d94-8cff-858718d422d3", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseBloom2/stage/PPBlurYStage.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, RenderPipeline, Vec2, Material } from 'cc'; 3 | import { PPBaseStage } from '../../postprocess/PPBaseStage'; 4 | import { PPMgr } from '../../postprocess/PPMgr'; 5 | const { ccclass } = _decorator; 6 | 7 | @ccclass('PPBlurYStage') 8 | export class PPBlurYStage extends PPBaseStage { 9 | 10 | constructor() { 11 | super(); 12 | this._name = "PPBlurYStage"; 13 | } 14 | 15 | public initWithStageDesc(mgr: PPMgr, pl: RenderPipeline) { 16 | this.outputTexName = 'tempTex'; 17 | 18 | const originMat = this.mat; 19 | if (originMat) { 20 | this.mat = new Material(); 21 | this.mat.copy(originMat); 22 | } 23 | const tex = mgr.getFrameBuffer('screenTex'); 24 | const texSize = new Vec2(1, 1); 25 | if (tex && tex.colorTextures[0]) { 26 | texSize.x = tex.colorTextures[0].width; 27 | texSize.y = tex.colorTextures[0].height; 28 | } 29 | this.bindShaderParamsTexture(mgr, 'tempTex', 'tempTex2'); 30 | this.setOutputFramebuffer(mgr); 31 | this.bindShaderParamsVec2('texSize', texSize); 32 | this.bindShaderParamsVec2('direction', new Vec2(0, 1)); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /assets/caseBloom2/stage/PPBlurYStage.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "3eea3972-484a-48fa-ba12-3088bf9b0ceb", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseBloom2/stage/PPMergeStage.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, RenderPipeline, Vec2 } from 'cc'; 3 | import { PPBaseStage } from '../../postprocess/PPBaseStage'; 4 | import { PPMgr } from '../../postprocess/PPMgr'; 5 | const { ccclass } = _decorator; 6 | 7 | @ccclass('PPMergeStage') 8 | export class PPMergeStage extends PPBaseStage { 9 | 10 | constructor() { 11 | super(); 12 | this._name = "PPMergeStage"; 13 | } 14 | 15 | public initWithStageDesc(mgr: PPMgr, pl: RenderPipeline) { 16 | this.paramTexs = ['screenTex', 'tempTex']; 17 | this.outputTexName = ''; 18 | 19 | super.initWithStageDesc(mgr, pl); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /assets/caseBloom2/stage/PPMergeStage.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "bd762900-b1a1-46c6-89de-85fe1337ff97", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseBloom2/stage/PPThresholdStage.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, RenderPipeline } from 'cc'; 3 | import { PPBaseStage } from '../../postprocess/PPBaseStage'; 4 | import { PPMgr } from '../../postprocess/PPMgr'; 5 | const { ccclass } = _decorator; 6 | 7 | @ccclass('PPThresholdStage') 8 | export class PPThresholdStage extends PPBaseStage { 9 | 10 | constructor() { 11 | super(); 12 | this._name = "PPThresholdStage"; 13 | } 14 | 15 | public initWithStageDesc(mgr: PPMgr, pl: RenderPipeline) { 16 | this.paramTexs = ['screenTex']; 17 | this.outputTexName = 'tempTex'; 18 | 19 | super.initWithStageDesc(mgr, pl); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /assets/caseBloom2/stage/PPThresholdStage.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "a1156d1c-7bd4-48e8-b8b1-a66177d5d1af", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseDecals.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "8439f5fb-412d-421a-9c2b-78f2251e604f", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseDecals/DecalModel.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "af636671-e5bf-4e36-a458-18eaf71a1c3e", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseDecals/decalmat.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "1baf0fc9-befa-459c-8bdd-af1a450a0319", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": "1", 11 | "_defines": [ 12 | { 13 | "USE_NORMAL_MAP": true, 14 | "USE_ALBEDO_MAP": true 15 | }, 16 | {}, 17 | {} 18 | ], 19 | "_states": [ 20 | { 21 | "rasterizerState": {}, 22 | "depthStencilState": {}, 23 | "blendState": { 24 | "targets": [ 25 | {} 26 | ] 27 | } 28 | }, 29 | {}, 30 | {} 31 | ], 32 | "_props": [ 33 | { 34 | "mainColor": { 35 | "__type__": "cc.Color", 36 | "r": 173, 37 | "g": 84, 38 | "b": 84, 39 | "a": 255 40 | }, 41 | "mainTexture": { 42 | "__uuid__": "7cc1916e-56f8-4f75-8106-a017237044d2@6c48a", 43 | "__expectedType__": "cc.Texture2D" 44 | }, 45 | "normalMap": { 46 | "__uuid__": "66cdbeec-33c8-4cad-971c-9aa755df25cd@6c48a", 47 | "__expectedType__": "cc.Texture2D" 48 | } 49 | }, 50 | {}, 51 | {} 52 | ] 53 | } -------------------------------------------------------------------------------- /assets/caseDecals/decalmat.mtl.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.0.9","importer":"material","imported":true,"uuid":"29379b99-c104-4057-857e-4f31ccbef3c6","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/caseDecals/decals.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.32", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "679742ec-3d0b-46ac-b7ca-590003d18e9f", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseDecals/main.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, systemEvent, SystemEvent, EventTouch, Touch, geometry, Camera, MeshRenderer, gfx, Vec3, find, Node, TERRAIN_HEIGHT_BASE, random } from 'cc'; 3 | import { DecalModel } from './DecalModel'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('Main') 7 | export class Main extends Component { 8 | 9 | @property(Camera) 10 | mainCamera: Camera | null = null; 11 | 12 | @property(Node) 13 | targetNode: Node | null = null; 14 | 15 | @property(Node) 16 | decalTemplate: Node | null = null; 17 | 18 | @property(Camera) 19 | subCamera: Camera | null = null; 20 | 21 | private decalRoot: Node | null = null; 22 | private _ray = new geometry.Ray(); 23 | private modOpt: geometry.IRayModelOptions = { 24 | distance: Infinity, 25 | doubleSided: false, 26 | mode: geometry.ERaycastMode.ANY, 27 | subIndices: [], 28 | result: [] 29 | }; 30 | 31 | start () { 32 | // [3] 33 | this.decalRoot = find("decals") 34 | } 35 | 36 | // update (deltaTime: number) { 37 | // // [4] 38 | // } 39 | 40 | onEnable () { 41 | systemEvent.on(SystemEvent.EventType.TOUCH_START, this.onTouchStart, this); 42 | } 43 | 44 | onDisable () { 45 | systemEvent.off(SystemEvent.EventType.TOUCH_START, this.onTouchStart, this); 46 | } 47 | 48 | onTouchStart1 (touch: Touch, event: EventTouch) { 49 | if (null == this.decalTemplate) { return; } 50 | 51 | let mr = this.targetNode?.getComponent(MeshRenderer); 52 | if (null == mr) { return; } 53 | 54 | console.log(this.subCamera?.camera.matProj); 55 | const decalNode = DecalModel.create( 56 | this.decalTemplate, 57 | mr, 58 | new Vec3(0, 0.5, 0), 59 | new Vec3(0, 1, 0), 60 | new Vec3(1, 1, 1.1)); 61 | if (decalNode) { 62 | this.decalRoot?.addChild(decalNode); 63 | } 64 | } 65 | 66 | onTouchStart (touch: Touch, event: EventTouch) { 67 | if (null == this.targetNode) { 68 | // this.targetNode = find('Cube'); 69 | this.targetNode = find('Sphere'); 70 | // this.targetNode = find('cat_Idle/cat'); 71 | } 72 | 73 | if (null == this.mainCamera) { 74 | console.log('main camera is not set'); 75 | return; 76 | } 77 | if (null == this.decalTemplate) { 78 | console.log('decal template is not set'); 79 | return; 80 | } 81 | if (null == this.targetNode) { 82 | console.log('targetNode is not set'); 83 | return; 84 | } 85 | const mr = this.targetNode?.getComponent(MeshRenderer); 86 | 87 | const point = touch.getLocation(); 88 | this.mainCamera.screenPointToRay(point.x, point.y, this._ray); 89 | 90 | if (this.modOpt.result) { 91 | this.modOpt.result.length = 0; 92 | } 93 | if (this.modOpt.subIndices) { 94 | this.modOpt.subIndices.length = 0; 95 | } 96 | let intersectCount = 0; 97 | 98 | const mo = mr?.model; 99 | if (!mo) { 100 | console.log('model is null'); 101 | return; 102 | } 103 | const me = mr?.mesh; 104 | if (!me) { 105 | console.log('mesh is null'); 106 | return; 107 | } 108 | intersectCount = geometry.intersect.rayModel(this._ray, mo, this.modOpt); 109 | if (intersectCount) { 110 | if (!this.modOpt.subIndices || !this.modOpt.result) { 111 | console.log(this.modOpt); 112 | return; 113 | } 114 | console.log('model touched'); 115 | const r = this.modOpt.result!; 116 | const s = this.modOpt.subIndices; 117 | 118 | const position = new Vec3(); 119 | const direction = new Vec3(); 120 | if (me.renderingSubMeshes.length > 0) { 121 | const subIdx = s[0]; 122 | // if (!me.renderingSubMeshes[subIdx]) { 123 | // return; 124 | // } 125 | // const pos = me.renderingSubMeshes[subIdx].geometricInfo.positions; 126 | const pos = me.readAttribute(subIdx, gfx.AttributeName.ATTR_POSITION); 127 | if (!pos) {return; } 128 | 129 | const pa = new Vec3(); 130 | let posIndex = r[0].vertexIndex0 * 3; 131 | pa.set(pos[posIndex], pos[posIndex + 1], pos[posIndex + 2]); 132 | Vec3.transformMat4(pa, pa, this.targetNode.worldMatrix); 133 | 134 | const pb = new Vec3(); 135 | posIndex = r[0].vertexIndex1 * 3; 136 | pb.set(pos[posIndex], pos[posIndex + 1], pos[posIndex + 2]); 137 | Vec3.transformMat4(pb, pb, this.targetNode.worldMatrix); 138 | 139 | const pc = new Vec3(); 140 | posIndex = r[0].vertexIndex2 * 3; 141 | pc.set(pos[posIndex], pos[posIndex + 1], pos[posIndex + 2]); 142 | Vec3.transformMat4(pc, pc, this.targetNode.worldMatrix); 143 | 144 | position.add(pa); 145 | position.add(pb); 146 | position.add(pc); 147 | position.divide3f(3, 3, 3); 148 | 149 | /* 150 | const normals = me.readAttribute(subIdx, gfx.AttributeName.ATTR_NORMAL); 151 | if (normals) { 152 | const na = new Vec3(); 153 | let nIdx = r[0].vertexIndex0 * 3; 154 | na.set(normals[nIdx], normals[nIdx + 1], normals[nIdx + 2]); 155 | 156 | const nb = new Vec3(); 157 | nIdx = r[0].vertexIndex1 * 3; 158 | nb.set(normals[nIdx], normals[nIdx + 1], normals[nIdx + 2]); 159 | 160 | const nc = new Vec3(); 161 | nIdx = r[0].vertexIndex2 * 3; 162 | nc.set(normals[nIdx], normals[nIdx + 1], normals[nIdx + 2]); 163 | 164 | normal.add(na); 165 | normal.add(nb); 166 | normal.add(nc); 167 | normal.divide3f(3, 3, 3); 168 | Vec3.transformMat4(normal, normal, mo.node.worldMatrix); 169 | } 170 | */ 171 | } else { 172 | this._ray.computeHit(position, r[0].distance); 173 | } 174 | Vec3.subtract(direction, this.mainCamera.node.worldPosition, position); 175 | direction.normalize(); 176 | console.log('WPos:', position.clone()); 177 | console.log('WDir:', direction.clone()); 178 | 179 | // const posArr = mesh?.readAttribute(subMod.subMesh.subMeshIdx!, gfx.AttributeName.ATTR_POSITION) as unknown as Float32Array; 180 | // const pos = new Vec3(posArr[rst.vertexIndex0], posArr[rst.vertexIndex1], posArr[rst.vertexIndex2]); 181 | // const norArr = mesh?.readAttribute(subMod.subMesh.subMeshIdx!, gfx.AttributeName.ATTR_NORMAL) as unknown as Float32Array; 182 | // const nor = new Vec3(norArr[rst.vertexIndex0], norArr[rst.vertexIndex1], norArr[rst.vertexIndex2]); 183 | 184 | const decalNode = DecalModel.create(this.decalTemplate, mr, 185 | position, direction, new Vec3(0.1, 0.1, 2)); 186 | if (decalNode) { 187 | this.targetNode.addChild(decalNode); 188 | // this.decalRoot?.addChild(decalNode); 189 | } 190 | } else { 191 | console.log('model not touched'); 192 | console.log('children length: ' + this.decalRoot?.children.length); 193 | } 194 | } 195 | } 196 | -------------------------------------------------------------------------------- /assets/caseDecals/main.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "d3c875db-b06a-468f-b757-64b0989463aa", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseDecals/method2.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "d36298f9-2d93-439a-9725-f39c13445595", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseDecals/method2/DecalMeshRenderer.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "bc49fe31-c677-4932-be32-50eb27f528d1", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseDecals/method2/d2.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.32", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "3734ef02-2cbc-4646-8e8f-db9bba15aae9", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseDecals/method2/decal2.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "1bbb9bc8-90e6-4654-bbf1-018d23a58380", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseDissolve.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "63a93b59-50da-4f7b-bbc1-f35e985cdc9e", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseDissolve/Dissolve.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, MeshRenderer, gfx, renderer, Material, Texture2D } from 'cc'; 3 | const { ccclass, property } = _decorator; 4 | 5 | 6 | @ccclass('Dissolve') 7 | export class Dissolve extends Component { 8 | 9 | @property(MeshRenderer) 10 | mr: MeshRenderer | null = null; 11 | 12 | @property(Texture2D) 13 | txtNoise1: Texture2D | null = null; 14 | 15 | @property(Texture2D) 16 | txtNoise2: Texture2D | null = null; 17 | 18 | private dissolve: boolean = false; 19 | private dissolve2: boolean = false; 20 | 21 | private dissolveThresholdHandle: number = -1; 22 | private dissolveThresholdTyeHandle: number = -1; 23 | private dissolveType2Handle: number = -1; 24 | private dissolveNoiseMapBinding: number = -1; 25 | private dissolveThreshold: number = 0.0; 26 | 27 | start () { 28 | } 29 | 30 | update (deltaTime: number) { 31 | if (this.mr?.materials) { 32 | let pass = this.mr?.materials[0]?.passes[0]; 33 | if (pass) { 34 | if (this.dissolve) { 35 | this.dissolveThreshold += 0.5 * deltaTime; 36 | if (this.dissolveThreshold > 1) { 37 | this.dissolveThreshold = 0; 38 | } 39 | } 40 | this.processPass(pass); 41 | } 42 | 43 | pass = this.mr?.materials[1]?.passes[0]; 44 | if (pass) { 45 | this.processPass(pass); 46 | } 47 | 48 | if (0 == this.dissolveThreshold) { 49 | this.dissolve = false; 50 | } 51 | } 52 | } 53 | 54 | processPass(pass: renderer.Pass) { 55 | if (this.dissolve) { 56 | this.setDissolveThreshold(pass, this.dissolveThreshold); 57 | } else if (this.dissolve2) { 58 | this.setDissolveThreshold(pass, this.dissolveThreshold); 59 | } 60 | } 61 | 62 | preFetchHandles(pass: renderer.Pass) { 63 | if (-1 == this.dissolveThresholdHandle) { 64 | this.dissolveThresholdHandle = pass.getHandle('dissolveThreshold') 65 | } 66 | if (-1 == this.dissolveThresholdTyeHandle) { 67 | this.dissolveThresholdTyeHandle = pass.getHandle('dissolveOffsetDir', 3, gfx.Type.FLOAT); 68 | } 69 | if (-1 == this.dissolveType2Handle) { 70 | this.dissolveType2Handle = pass.getHandle('dissolveParams2', 0, gfx.Type.FLOAT); 71 | } 72 | if (-1 == this.dissolveNoiseMapBinding) { 73 | this.dissolveNoiseMapBinding = pass.getBinding('dissolveMap'); 74 | } 75 | } 76 | 77 | setDissolveThreshold(pass: renderer.Pass, value: number) { 78 | pass.setUniform(this.dissolveThresholdHandle, value); 79 | pass.update(); 80 | } 81 | 82 | onBtnDissolve() { 83 | this.dissolve = true; 84 | if (this.mr?.materials) { 85 | let pass = this.mr?.materials[0]?.passes[0]; 86 | if (pass) { 87 | this.preFetchHandles(pass); 88 | pass.setUniform(this.dissolveThresholdTyeHandle, 1.0); 89 | pass.setUniform(this.dissolveType2Handle, 1.0); 90 | pass.bindTexture(this.dissolveNoiseMapBinding, this.txtNoise1?.getGFXTexture()!); 91 | pass.update(); 92 | } 93 | 94 | pass = this.mr?.materials[1]?.passes[0]; 95 | if (pass) { 96 | pass.setUniform(this.dissolveThresholdTyeHandle, 1.0); 97 | pass.setUniform(this.dissolveType2Handle, 1.0); 98 | pass.bindTexture(this.dissolveNoiseMapBinding, this.txtNoise1?.getGFXTexture()!); 99 | pass.update(); 100 | } 101 | } 102 | } 103 | 104 | onBtnDissolveUp() { 105 | this.dissolve = true; 106 | if (this.mr?.materials) { 107 | let pass = this.mr?.materials[0]?.passes[0]; 108 | if (pass) { 109 | this.preFetchHandles(pass); 110 | pass.setUniform(this.dissolveThresholdTyeHandle, 1.0); 111 | pass.setUniform(this.dissolveType2Handle, 0.0); 112 | pass.bindTexture(this.dissolveNoiseMapBinding, this.txtNoise2?.getGFXTexture()!); 113 | pass.update(); 114 | } 115 | 116 | pass = this.mr?.materials[1]?.passes[0]; 117 | if (pass) { 118 | pass.setUniform(this.dissolveThresholdTyeHandle, 1.0); 119 | pass.setUniform(this.dissolveType2Handle, 0.0); 120 | pass.bindTexture(this.dissolveNoiseMapBinding, this.txtNoise2?.getGFXTexture()!); 121 | pass.update(); 122 | } 123 | } 124 | } 125 | 126 | onBtnDissolveExpand() { 127 | this.dissolve = true; 128 | 129 | if (this.mr?.materials) { 130 | let pass = this.mr?.materials[0]?.passes[0]; 131 | if (pass) { 132 | this.preFetchHandles(pass); 133 | pass.setUniform(this.dissolveThresholdTyeHandle, 0.0); 134 | pass.setUniform(this.dissolveType2Handle, 0.0); 135 | pass.bindTexture(this.dissolveNoiseMapBinding, this.txtNoise2?.getGFXTexture()!); 136 | pass.update(); 137 | } 138 | 139 | pass = this.mr?.materials[1]?.passes[0]; 140 | if (pass) { 141 | pass.setUniform(this.dissolveThresholdTyeHandle, 0.0); 142 | pass.setUniform(this.dissolveType2Handle, 0.0); 143 | pass.bindTexture(this.dissolveNoiseMapBinding, this.txtNoise2?.getGFXTexture()!); 144 | pass.update(); 145 | } 146 | } 147 | } 148 | 149 | } 150 | 151 | -------------------------------------------------------------------------------- /assets/caseDissolve/Dissolve.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "f44e1131-8aec-43a9-9986-abd19611c768", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseDissolve/dissolve.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "16f7312f-6134-4447-aef4-cd4736ec984e", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseDissolve/dissolve.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "16f7312f-6134-4447-aef4-cd4736ec984e", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | { 13 | "USE_NORMAL_MAP": true, 14 | "USE_ALBEDO_MAP": true, 15 | "USE_OCCLUSION_MAP": true 16 | }, 17 | {}, 18 | {}, 19 | {} 20 | ], 21 | "_states": [ 22 | { 23 | "rasterizerState": {}, 24 | "depthStencilState": {}, 25 | "blendState": { 26 | "targets": [ 27 | {} 28 | ] 29 | } 30 | }, 31 | {}, 32 | {}, 33 | {} 34 | ], 35 | "_props": [ 36 | { 37 | "mainTexture": { 38 | "__uuid__": "b2073635-1962-443b-a2ae-ca53fa946624@6c48a", 39 | "__expectedType__": "cc.Texture2D" 40 | }, 41 | "normalMap": { 42 | "__uuid__": "79578435-543a-4b64-b73e-d3396923606a@6c48a", 43 | "__expectedType__": "cc.Texture2D" 44 | }, 45 | "occlusionMap": { 46 | "__uuid__": "e4cd7626-c53d-438d-b9a7-7e7f57f7eb60@6c48a", 47 | "__expectedType__": "cc.Texture2D" 48 | }, 49 | "dissolveMap": { 50 | "__uuid__": "56a2a6b4-7b20-485a-9496-321bc2d7da85@6c48a", 51 | "__expectedType__": "cc.Texture2D" 52 | }, 53 | "dissolveOffsetDir": { 54 | "__type__": "cc.Vec4", 55 | "x": 0, 56 | "y": 1, 57 | "z": 0, 58 | "w": 1 59 | }, 60 | "dissolveParams2": { 61 | "__type__": "cc.Vec4", 62 | "x": 1, 63 | "y": 0, 64 | "z": 0, 65 | "w": 0 66 | } 67 | }, 68 | {}, 69 | {}, 70 | {} 71 | ] 72 | } 73 | -------------------------------------------------------------------------------- /assets/caseDissolve/dissolve.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "6c63db09-2a5b-4116-b89d-9faa7ee1c20f", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseDissolve/dissolve.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.32", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "91b986ef-594b-4070-9e95-d65c7ff83aed", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseDynamicMesh.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "ace15697-8939-4bad-8475-cb102c589fe3", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseDynamicMesh/Vertexs.ts: -------------------------------------------------------------------------------- 1 | import { gfx, primitives, Vec3 } from "cc"; 2 | 3 | export class VertexInfo { 4 | position: number[] = []; 5 | normal: number[] | null = null; 6 | color: number[] | null = null; 7 | } 8 | 9 | export class VerticesMgr { 10 | 11 | private vectexInfos: VertexInfo[] = []; 12 | private idxArray: number[] = []; 13 | private positionStep = 0; 14 | private normalStep = 0; 15 | private colorStep = 0; 16 | 17 | reset() { 18 | this.positionStep = 0; 19 | this.normalStep = 0; 20 | this.colorStep = 0; 21 | } 22 | 23 | addTriangle(pa: VertexInfo, pb: VertexInfo, pc: VertexInfo) { 24 | if (!this._isVertexInfoValid(pa) 25 | || !this._isVertexInfoValid(pb) 26 | || !this._isVertexInfoValid(pc)) { 27 | return; 28 | } 29 | 30 | this._addVertexInfo(pa); 31 | this._addVertexInfo(pb); 32 | this._addVertexInfo(pc); 33 | } 34 | 35 | addPlane(pa: VertexInfo, pb: VertexInfo, pc: VertexInfo, pd: VertexInfo) { 36 | this.addTriangle(pa, pb, pc); 37 | this.addTriangle(pc, pd, pa); 38 | } 39 | 40 | genGeometry(): primitives.IGeometry { 41 | const geo = { 42 | primitiveMode: gfx.PrimitiveMode.TRIANGLE_STRIP, 43 | positions: this._getComp("position"), 44 | colors: this._getComp("color"), 45 | normals: this._getComp("normal"), 46 | attributes: this._getAttr(), 47 | indices: this.idxArray, 48 | } 49 | 50 | return geo; 51 | } 52 | 53 | genGeometryLines(): primitives.IGeometry { 54 | const geo = this.genGeometry(); 55 | 56 | geo.primitiveMode = gfx.PrimitiveMode.LINE_STRIP; 57 | const idxs = geo.indices; 58 | geo.indices = this._idxTri2Line(idxs); 59 | 60 | return geo; 61 | } 62 | 63 | _addVertexInfo(vec: VertexInfo) { 64 | let idx = this._vecExist(vec); 65 | if (idx < 0) { 66 | idx = this.vectexInfos.push(vec) - 1; 67 | } 68 | this.idxArray.push(idx); 69 | } 70 | 71 | _vecExist(vec: VertexInfo): number { 72 | for (let idx = 0; idx < this.vectexInfos.length; idx++) { 73 | const item = this.vectexInfos[idx]; 74 | if (this._vertexInfoEqual(item, vec)) { 75 | return idx; 76 | } 77 | } 78 | 79 | return -1; 80 | } 81 | 82 | _vertexInfoEqual(veca: VertexInfo, vecb: VertexInfo): boolean { 83 | if (!this._vec3Equal(veca.position, vecb.position)) { return false; } 84 | if (!this._vec3Equal(veca.color, vecb.color)) { return false; } 85 | if (!this._vec3Equal(veca.normal, vecb.normal)) { return false; } 86 | 87 | return true; 88 | } 89 | 90 | _vec3Equal(va: number[]|null, vb: number[]|null): boolean { 91 | if (null == va && null == vb) { return true; } 92 | if (null == va && null != vb) { return false; } 93 | if (null != va && null == vb) { return false; } 94 | if (va?.length != vb?.length) { return false; } 95 | 96 | for (let i = 0; i < va!.length; i++) { 97 | if (Math.abs(va![i] - vb![i]) > Number.EPSILON) { 98 | return false; 99 | } 100 | } 101 | 102 | return true; 103 | } 104 | 105 | _getComp(compName: string): number[] { 106 | let arr: number[] = []; 107 | for(let vecInfo of this.vectexInfos) { 108 | if ("position" == compName) { 109 | arr.concat(vecInfo.position); 110 | } else if ("normal" == compName && vecInfo.normal) { 111 | arr.concat(vecInfo.normal); 112 | } else if ("color" == compName && vecInfo.color) { 113 | arr.concat(vecInfo.color); 114 | } 115 | } 116 | 117 | return arr; 118 | } 119 | 120 | _getAttr(): gfx.Attribute[] { 121 | let attrs: gfx.Attribute[] = []; 122 | 123 | if (this.positionStep) { 124 | attrs.push(new gfx.Attribute(gfx.AttributeName.ATTR_POSITION, gfx.Format.RGB32F)); 125 | } 126 | if (this.normalStep) { 127 | attrs.push(new gfx.Attribute(gfx.AttributeName.ATTR_NORMAL, gfx.Format.RGB32F)); 128 | } 129 | if (this.colorStep) { 130 | attrs.push(new gfx.Attribute(gfx.AttributeName.ATTR_COLOR, gfx.Format.RGBA32F)); 131 | } 132 | 133 | return attrs; 134 | } 135 | 136 | _isVertexInfoValid(ver: VertexInfo): boolean { 137 | if (this.positionStep && this.positionStep != ver.position.length) { 138 | return false; 139 | } 140 | if (this.normalStep && this.normalStep != ver.normal?.length) { 141 | return false; 142 | } 143 | if (this.colorStep && this.colorStep != ver.color?.length) { 144 | return false; 145 | } 146 | if (0 == this.positionStep) { 147 | this.positionStep = ver.position.length; 148 | } 149 | if (0 == this.normalStep && ver.normal) { 150 | this.normalStep = ver.normal.length; 151 | } 152 | if (0 == this.colorStep && ver.color) { 153 | this.colorStep = ver.color.length; 154 | } 155 | 156 | return true; 157 | } 158 | 159 | _idxTri2Line(idxs: number[] | undefined): number[] | undefined { 160 | if (!idxs) { return idxs; } 161 | 162 | let newIdx: number[] = []; 163 | for (let i = 0; i < idxs.length; i+=3) { 164 | newIdx.push(idxs[i], idxs[i+1]); 165 | newIdx.push(idxs[i+1], idxs[i+2]); 166 | newIdx.push(idxs[i+2], idxs[i+3]); 167 | } 168 | 169 | return newIdx; 170 | } 171 | 172 | } 173 | -------------------------------------------------------------------------------- /assets/caseDynamicMesh/Vertexs.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "e9736b17-426c-4cf4-b774-4eadc5d21ab8", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseDynamicMesh/dynamicMesh.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "1baf0fc9-befa-459c-8bdd-af1a450a0319", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | { 13 | "USE_VERTEX_COLOR": true 14 | }, 15 | {}, 16 | {}, 17 | {} 18 | ], 19 | "_states": [ 20 | { 21 | "rasterizerState": {}, 22 | "depthStencilState": {}, 23 | "blendState": { 24 | "targets": [ 25 | {} 26 | ] 27 | } 28 | }, 29 | {}, 30 | {}, 31 | {} 32 | ], 33 | "_props": [ 34 | {}, 35 | {}, 36 | {}, 37 | {} 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /assets/caseDynamicMesh/dynamicMesh.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "c6700ee6-580e-4d63-82ea-2895b08455c5", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseDynamicMesh/dynamicMesh.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.32", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "d327d1f9-d947-4c4d-9ed3-d6da6f3d4f0e", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseDynamicMesh/dynamicMesh.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, Node, MeshRenderer, Mesh, misc, utils, primitives, Primitive, gfx, Color } from 'cc'; 3 | const { ccclass, property } = _decorator; 4 | 5 | 6 | @ccclass('DynamicMesh') 7 | export class DynamicMesh extends Component { 8 | 9 | @property(MeshRenderer) 10 | mr: MeshRenderer | null = null; 11 | 12 | start () { 13 | } 14 | 15 | onBtnChangeMesh() { 16 | console.log('auto generate dynamic mesh'); 17 | if (null == this.mr) { 18 | return; 19 | } 20 | let mesh = this.mr.mesh; 21 | mesh?.reset(this.genMesh()); 22 | this.mr.mesh = mesh; 23 | } 24 | 25 | genMesh(): Mesh.ICreateInfo { 26 | let geo: primitives.IGeometry = { 27 | primitiveMode: gfx.PrimitiveMode.TRIANGLE_STRIP, 28 | positions: [ 29 | -1, 1, 1, 30 | -1, -1, 1, 31 | 1, -1, 1, 32 | 1, 1, 1, 33 | 34 | 1, 1, -1, 35 | 1, -1, -1, 36 | -1, -1, -1, 37 | -1, 1, -1, 38 | 39 | 1, 1, 1, 40 | 1, -1, 1, 41 | 1, -1, -1, 42 | 1, 1, -1, 43 | 44 | -1, 1, -1, 45 | -1, -1, -1, 46 | -1, -1, 1, 47 | -1, 1, 1, 48 | 49 | -1, 1, -1, 50 | -1, 1, 1, 51 | 1, 1, 1, 52 | 1, 1, -1, 53 | 54 | -1, -1, 1, 55 | -1, -1, -1, 56 | 1, -1, -1, 57 | 1, -1, 1, 58 | ], 59 | colors: [ 60 | 1, 0, 0, 1, 61 | 0, 1, 0, 1, 62 | 0, 0, 1, 1, 63 | 1, 1, 1, 1, 64 | 1, 1, 0, 1, 65 | 0, 1, 1, 1, 66 | 1, 0, 1, 1, 67 | 0.5, 0.5, 0.5, 1, 68 | 0.5, 0, 0, 1, 69 | 0, 0.5, 0, 1, 70 | 0, 0, 0.5, 1, 71 | 0.5, 0.5, 0, 1, 72 | 0, 0.5, 0.5, 1, 73 | 0.5, 0, 0.5, 1, 74 | 0.2, 0.2, 0, 1, 75 | 0, 0.2, 0.2, 1, 76 | 0.2, 0, 0.2, 1, 77 | 0.5, 0.8, 0, 1, 78 | 0, 0.5, 0.8, 1, 79 | 0.8, 0, 0.5, 1, 80 | 0.7, 0.2, 0.5, 1, 81 | 0.7, 0.5, 0.2, 1, 82 | 0.2, 0.5, 0.7, 1, 83 | 0.2, 0.7, 0.5, 1, 84 | 85 | ], 86 | normals: [ 87 | 0, 0, 1, 88 | 0, 0, 1, 89 | 0, 0, 1, 90 | 0, 0, 1, 91 | 0, 0, -1, 92 | 0, 0, -1, 93 | 0, 0, -1, 94 | 0, 0, -1, 95 | 1, 0, 0, 96 | 1, 0, 0, 97 | 1, 0, 0, 98 | 1, 0, 0, 99 | -1, 0, 0, 100 | -1, 0, 0, 101 | -1, 0, 0, 102 | -1, 0, 0, 103 | 0, 1, 0, 104 | 0, 1, 0, 105 | 0, 1, 0, 106 | 0, 1, 0, 107 | 0, -1, 0, 108 | 0, -1, 0, 109 | 0, -1, 0, 110 | 0, -1, 0, 111 | ], 112 | attributes: [ 113 | new gfx.Attribute(gfx.AttributeName.ATTR_POSITION, gfx.Format.RGB32F), 114 | new gfx.Attribute(gfx.AttributeName.ATTR_COLOR, gfx.Format.RGBA32F), 115 | new gfx.Attribute(gfx.AttributeName.ATTR_NORMAL, gfx.Format.RGB32F), 116 | ], 117 | indices: [ 118 | 0, 1, 2, 3, 0, 2, 119 | 4, 5, 6, 7, 4, 6, 120 | 8, 9, 10, 11, 8, 10, 121 | 12, 13, 14, 15, 12, 14, 122 | 16, 17, 18, 19, 16, 18, 123 | 20, 21, 22, 23, 20, 22 124 | ], 125 | }; 126 | 127 | return utils.createMesh(geo, undefined, { calculateBounds: false }); 128 | } 129 | 130 | } 131 | 132 | -------------------------------------------------------------------------------- /assets/caseDynamicMesh/dynamicMesh.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "eac7d2ed-6631-4184-9bad-5186cebdca4f", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseInnerGrow.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "3f4cb2ea-665f-43a6-ac2f-d53412f1384d", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseInnerGrow/innergrow.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "db39c7cd-e128-418d-9596-3d2e61dce956", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseInnerGrow/innergrow.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "db39c7cd-e128-418d-9596-3d2e61dce956", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": "1", 11 | "_defines": [ 12 | {}, 13 | {}, 14 | {}, 15 | {} 16 | ], 17 | "_states": [ 18 | { 19 | "rasterizerState": {}, 20 | "depthStencilState": {}, 21 | "blendState": { 22 | "targets": [ 23 | {} 24 | ] 25 | } 26 | }, 27 | { 28 | "rasterizerState": {}, 29 | "depthStencilState": {}, 30 | "blendState": { 31 | "targets": [ 32 | {} 33 | ] 34 | } 35 | }, 36 | {}, 37 | {} 38 | ], 39 | "_props": [ 40 | {}, 41 | {}, 42 | {}, 43 | {} 44 | ] 45 | } -------------------------------------------------------------------------------- /assets/caseInnerGrow/innergrow.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "198d74d8-8980-4705-9bbd-e914f85806bf", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseInnerGrow/innergrow.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.32", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "a799458b-36d3-4f15-ad78-6345215a2b2e", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseMultiTex.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "cf48174e-b305-48d5-9584-eaf3db3e799d", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseMultiTex/MTBatcher2D.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Node, UI, Renderable2D, SpriteFrame, StencilManager, gfx, Color, Sprite } from 'cc'; 3 | 4 | export class MTBatcher2D { 5 | 6 | private static readonly GL_MAX_Texture = 8; 7 | private static isHacked = false; 8 | private static gInstance: MTBatcher2D = new MTBatcher2D(); 9 | 10 | private textures: gfx.Texture[] = []; 11 | private samplers: gfx.Sampler[] = []; 12 | private textureHashs: number[] = []; 13 | private samplerHashs: number[] = []; 14 | private curIsMTSprite: boolean = false; 15 | private texBindingMap: Map = new Map(); 16 | 17 | private getTexturesIdx(textHash: number): number { 18 | for (let i = 0; i < this.textureHashs.length; i++) { 19 | if (this.textureHashs[i] === textHash) { 20 | return i; 21 | } 22 | } 23 | 24 | return -1; 25 | } 26 | 27 | private addTexture(texture: gfx.Texture, textHash: number, maxTextureSize: number): boolean { 28 | if (this.textures.length >= maxTextureSize) { 29 | return false; 30 | } 31 | this.textures.push(texture); 32 | this.textureHashs.push(textHash); 33 | 34 | return true; 35 | } 36 | 37 | private canBatchTexture(texture: gfx.Texture, textHash: number, maxTextureSize: number): boolean { 38 | if (this.getTexturesIdx(textHash) >= 0) { 39 | return true; 40 | } 41 | if (this.addTexture(texture, textHash, maxTextureSize)) { 42 | return true; 43 | } 44 | return false; 45 | } 46 | 47 | private getSamplerIdx(samplerHash: number): number { 48 | for (let i = 0; i < this.samplerHashs.length; i++) { 49 | if (this.samplerHashs[i] === samplerHash) { 50 | return i; 51 | } 52 | } 53 | 54 | return -1; 55 | } 56 | 57 | private addSampler(sampler: gfx.Sampler, samplerHash: number, maxTextureSize: number): boolean { 58 | if (this.samplers.length >= maxTextureSize) { 59 | return false; 60 | } 61 | this.samplers.push(sampler); 62 | this.samplerHashs.push(samplerHash); 63 | 64 | return true; 65 | } 66 | 67 | private canBatchSampler(sampler: gfx.Sampler, samplerHash: number, maxTextureSize: number): boolean { 68 | if (this.getSamplerIdx(samplerHash) >= 0) { 69 | return true; 70 | } 71 | if (this.addSampler(sampler, samplerHash, maxTextureSize)) { 72 | return true; 73 | } 74 | return false; 75 | } 76 | 77 | private reset() { 78 | this.textures.length = 0; 79 | this.textureHashs.length = 0; 80 | this.samplers.length = 0; 81 | this.samplerHashs.length = 0; 82 | } 83 | 84 | public static getInstance(): MTBatcher2D { 85 | return MTBatcher2D.gInstance; 86 | } 87 | 88 | public setTexturesBindingMap(bm: Map) { 89 | this.texBindingMap = bm; 90 | } 91 | 92 | public hackBatch2d(batcher: UI) { 93 | if (MTBatcher2D.isHacked) { 94 | return; 95 | } 96 | MTBatcher2D.isHacked = true; 97 | const mtBatcher = MTBatcher2D.getInstance(); 98 | batcher.commitComp = MTBatcher2D.commitComp; 99 | batcher.mtBatcher = mtBatcher; 100 | 101 | const origin_getDescriptorSet = batcher._descriptorSetCache.getDescriptorSet; 102 | batcher._descriptorSetCache.getDescriptorSet = function(batch: any) { 103 | const ds = origin_getDescriptorSet.call(this, batch); 104 | if (batch.fromMTSprite) { 105 | const pass = batch.passes[0]; 106 | for (let i = 1; i < mtBatcher.textures.length; i++) { 107 | const texName = "spriteTexture" + i; 108 | if (mtBatcher.texBindingMap.has(texName)) { 109 | const binding = mtBatcher.texBindingMap.get(texName); 110 | if (mtBatcher.textures[i]) { 111 | pass.bindTexture(binding, mtBatcher.textures[i]); 112 | } 113 | if (mtBatcher.samplers[i]) { 114 | pass.bindSampler(binding, mtBatcher.samplers[i]); 115 | } 116 | } 117 | } 118 | } 119 | 120 | return ds; 121 | } 122 | 123 | const origin_autoMergeBatches = batcher.autoMergeBatches; 124 | batcher.autoMergeBatches = function(renderComp?: Renderable2D) { 125 | const originLength = this._batches.length; 126 | origin_autoMergeBatches.call(this, renderComp); 127 | const newLength = this._batches.length; 128 | if (newLength === originLength) { 129 | return; 130 | } 131 | const isMTSprite: boolean = renderComp._isMTSprite || false; 132 | this._batches.get(newLength-1).fromMTSprite = isMTSprite; 133 | } 134 | } 135 | 136 | public static commitComp(comp: Renderable2D, frame: SpriteFrame | null, assembler: any, transform: Node | null) { 137 | const renderComp = comp; 138 | let texture; 139 | let samp; 140 | let textureHash = 0; 141 | let samplerHash = 0; 142 | if (frame) { 143 | texture = frame.getGFXTexture(); 144 | samp = frame.getGFXSampler(); 145 | textureHash = frame.getHash(); 146 | samplerHash = frame.getSamplerHash(); 147 | } else { 148 | texture = null; 149 | samp = null; 150 | } 151 | 152 | const renderScene = renderComp._getRenderScene(); 153 | const mat = renderComp.getRenderMaterial(0); 154 | renderComp.stencilStage = StencilManager.sharedManager!.stage; 155 | 156 | const blendTargetHash = renderComp.blendHash; 157 | const depthStencilStateStage = renderComp.stencilStage; 158 | 159 | const mtBatcher = this.mtBatcher as any as MTBatcher2D 160 | const isMTSprite: boolean = comp._isMTSprite || false; 161 | 162 | if (this._currScene !== renderScene 163 | || this._currLayer !== comp.node.layer 164 | || this._currMaterial !== mat 165 | || this._currBlendTargetHash !== blendTargetHash 166 | || this._currDepthStencilStateStage !== depthStencilStateStage 167 | || this._currTransform !== transform 168 | || mtBatcher.curIsMTSprite !== isMTSprite 169 | || !mtBatcher.canBatchTexture(texture, textureHash, isMTSprite ? MTBatcher2D.GL_MAX_Texture : 1) 170 | || !mtBatcher.canBatchSampler(samp, samplerHash, isMTSprite ? MTBatcher2D.GL_MAX_Texture : 1) 171 | ) { 172 | this.autoMergeBatches(this._currComponent!); 173 | mtBatcher.reset(); 174 | mtBatcher.addTexture(texture, textureHash); 175 | mtBatcher.addSampler(samp, samplerHash); 176 | mtBatcher.curIsMTSprite = isMTSprite; 177 | 178 | this._currScene = renderScene; 179 | this._currComponent = renderComp; 180 | this._currTransform = transform; 181 | this._currMaterial = mat!; 182 | this._currTexture = texture; 183 | this._currSampler = samp; 184 | this._currTextureHash = textureHash; 185 | this._currSamplerHash = samplerHash; 186 | this._currBlendTargetHash = blendTargetHash; 187 | this._currDepthStencilStateStage = depthStencilStateStage; 188 | this._currLayer = comp.node.layer; 189 | 190 | } 191 | 192 | if (isMTSprite) { 193 | const sp = comp as Sprite; 194 | sp.color = new Color(mtBatcher.getTexturesIdx(textureHash)); 195 | } 196 | if (assembler) { 197 | assembler.fillBuffers(renderComp, this); 198 | } 199 | } 200 | 201 | } 202 | 203 | -------------------------------------------------------------------------------- /assets/caseMultiTex/MTBatcher2D.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "ead7e31d-6ce1-4ade-804e-2fc54840c675", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseMultiTex/MTSprite.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Sprite, Component } from 'cc'; 3 | import { MTTex } from './MTTex'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('MTSprite') 7 | export class MTSprite extends Component { 8 | 9 | start () { 10 | this.tagAsMTSprite(); 11 | } 12 | 13 | tagAsMTSprite() { 14 | const sp = this.getComponent(Sprite); 15 | if (null == sp) { 16 | return; 17 | } 18 | const mtTex = MTTex.getInstance(); 19 | if (null == mtTex) { 20 | return; 21 | } 22 | sp._isMTSprite = true; 23 | sp.customMaterial = mtTex.mtMat; 24 | } 25 | 26 | } 27 | 28 | -------------------------------------------------------------------------------- /assets/caseMultiTex/MTSprite.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "de746afb-8f3f-42f9-8544-a2bb1da40e2c", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseMultiTex/MTTex.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, Node, director, Material } from 'cc'; 3 | import { MTBatcher2D } from './MTBatcher2D'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('MTTex') 7 | export class MTTex extends Component { 8 | private static gInstance: MTTex | null = null; 9 | 10 | @property(Material) 11 | mtMat: Material | null = null; 12 | 13 | static getInstance(): MTTex | null { 14 | return MTTex.gInstance; 15 | } 16 | 17 | start () { 18 | if (MTTex.gInstance) { 19 | console.log('ERROR! MTTex must just exist only one instance.'); 20 | } 21 | if (director.root) { 22 | MTBatcher2D .getInstance().hackBatch2d(director.root.batcher2D); 23 | } 24 | this.loadTextureBindings(); 25 | MTTex.gInstance = this; 26 | } 27 | 28 | loadTextureBindings() { 29 | if (null == this.mtMat) { 30 | return; 31 | } 32 | const pass = this.mtMat?.passes[0]; 33 | const mtTexBindingMap = new Map(); 34 | for (let i = 1; i < 8; i++) { 35 | const name = 'spriteTexture' + i; 36 | const binding = pass.getBinding(name); 37 | if (binding >= 0) { 38 | mtTexBindingMap.set(name, binding); 39 | } 40 | } 41 | MTBatcher2D.getInstance().setTexturesBindingMap(mtTexBindingMap); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /assets/caseMultiTex/MTTex.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "145241b4-a50b-4521-992b-31131ba57c6a", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/caseMultiTex/multitex.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd. 2 | CCEffect %{ 3 | techniques: 4 | - passes: 5 | - vert: sprite-vs:vert 6 | frag: sprite-fs:frag 7 | depthStencilState: 8 | depthTest: false 9 | depthWrite: false 10 | blendState: 11 | targets: 12 | - blend: true 13 | blendSrc: src_alpha 14 | blendDst: one_minus_src_alpha 15 | blendDstAlpha: one_minus_src_alpha 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | alphaThreshold: { value: 0.5 } 20 | }% 21 | 22 | CCProgram sprite-vs %{ 23 | precision highp float; 24 | #include 25 | #if USE_LOCAL 26 | #include 27 | #endif 28 | #if SAMPLE_FROM_RT 29 | #include 30 | #endif 31 | in vec3 a_position; 32 | in vec2 a_texCoord; 33 | in vec4 a_color; 34 | 35 | out vec4 color; 36 | out vec2 uv0; 37 | 38 | vec4 vert () { 39 | vec4 pos = vec4(a_position, 1); 40 | 41 | #if USE_LOCAL 42 | pos = cc_matWorld * pos; 43 | #endif 44 | 45 | #if USE_PIXEL_ALIGNMENT 46 | pos = cc_matView * pos; 47 | pos.xyz = floor(pos.xyz); 48 | pos = cc_matProj * pos; 49 | #else 50 | pos = cc_matViewProj * pos; 51 | #endif 52 | 53 | uv0 = a_texCoord; 54 | #if SAMPLE_FROM_RT 55 | CC_HANDLE_RT_SAMPLE_FLIP(uv0); 56 | #endif 57 | color = a_color; 58 | 59 | return pos; 60 | } 61 | }% 62 | 63 | CCProgram sprite-fs %{ 64 | precision highp float; 65 | #include 66 | #include 67 | 68 | in vec4 color; 69 | 70 | #if USE_TEXTURE 71 | in vec2 uv0; 72 | #pragma builtin(local) 73 | layout(set = 2, binding = 10) uniform sampler2D cc_spriteTexture; 74 | 75 | uniform sampler2D spriteTexture1; 76 | uniform sampler2D spriteTexture2; 77 | uniform sampler2D spriteTexture3; 78 | uniform sampler2D spriteTexture4; 79 | uniform sampler2D spriteTexture5; 80 | uniform sampler2D spriteTexture6; 81 | uniform sampler2D spriteTexture7; 82 | 83 | #endif 84 | 85 | 86 | float getCalVal(float texID) { 87 | return step(-0.5, -step(texID, -0.5) - step(0.5, texID)); 88 | } 89 | 90 | vec4 frag () { 91 | vec4 o = vec4(1, 1, 1, 1); 92 | 93 | #if USE_TEXTURE 94 | float texID = color.x * 255.; 95 | 96 | o = vec4(0., 0., 0., 0.); 97 | o += getCalVal(texID) * CCSampleWithAlphaSeparated(cc_spriteTexture, uv0); 98 | texID -= 1.; 99 | o += getCalVal(texID) * CCSampleWithAlphaSeparated(spriteTexture1, uv0); 100 | texID -= 1.; 101 | o += getCalVal(texID) * CCSampleWithAlphaSeparated(spriteTexture2, uv0); 102 | texID -= 1.; 103 | o += getCalVal(texID) * CCSampleWithAlphaSeparated(spriteTexture3, uv0); 104 | texID -= 1.; 105 | o += getCalVal(texID) * CCSampleWithAlphaSeparated(spriteTexture4, uv0); 106 | texID -= 1.; 107 | o += getCalVal(texID) * CCSampleWithAlphaSeparated(spriteTexture5, uv0); 108 | texID -= 1.; 109 | o += getCalVal(texID) * CCSampleWithAlphaSeparated(spriteTexture6, uv0); 110 | texID -= 1.; 111 | o += getCalVal(texID) * CCSampleWithAlphaSeparated(spriteTexture7, uv0); 112 | 113 | #endif 114 | 115 | ALPHA_TEST(o); 116 | return o; 117 | } 118 | }% 119 | -------------------------------------------------------------------------------- /assets/caseMultiTex/multitex.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "c4aa2b8a-1bd5-436a-a620-5ecdc23502d1", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseMultiTex/multitex.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "c4aa2b8a-1bd5-436a-a620-5ecdc23502d1", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | { 13 | "USE_TEXTURE": true 14 | } 15 | ], 16 | "_states": [ 17 | { 18 | "rasterizerState": {}, 19 | "depthStencilState": {}, 20 | "blendState": { 21 | "targets": [ 22 | {} 23 | ] 24 | } 25 | } 26 | ], 27 | "_props": [ 28 | {} 29 | ] 30 | } -------------------------------------------------------------------------------- /assets/caseMultiTex/multitex.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "7bde4089-2867-4f1a-8996-e6fafe3e13a3", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseMultiTex/multitex.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.32", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "27c77f7d-2281-40ab-96f2-c0bbd778575a", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseMultiTex/origin_sprite.effect: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd. 2 | CCEffect %{ 3 | techniques: 4 | - passes: 5 | - vert: sprite-vs:vert 6 | frag: sprite-fs:frag 7 | depthStencilState: 8 | depthTest: false 9 | depthWrite: false 10 | blendState: 11 | targets: 12 | - blend: true 13 | blendSrc: src_alpha 14 | blendDst: one_minus_src_alpha 15 | blendDstAlpha: one_minus_src_alpha 16 | rasterizerState: 17 | cullMode: none 18 | properties: 19 | alphaThreshold: { value: 0.5 } 20 | }% 21 | 22 | CCProgram sprite-vs %{ 23 | precision highp float; 24 | #include 25 | #if USE_LOCAL 26 | #include 27 | #endif 28 | #if SAMPLE_FROM_RT 29 | #include 30 | #endif 31 | in vec3 a_position; 32 | in vec2 a_texCoord; 33 | in vec4 a_color; 34 | 35 | out vec4 color; 36 | out vec2 uv0; 37 | 38 | vec4 vert () { 39 | vec4 pos = vec4(a_position, 1); 40 | 41 | #if USE_LOCAL 42 | pos = cc_matWorld * pos; 43 | #endif 44 | 45 | #if USE_PIXEL_ALIGNMENT 46 | pos = cc_matView * pos; 47 | pos.xyz = floor(pos.xyz); 48 | pos = cc_matProj * pos; 49 | #else 50 | pos = cc_matViewProj * pos; 51 | #endif 52 | 53 | uv0 = a_texCoord; 54 | #if SAMPLE_FROM_RT 55 | CC_HANDLE_RT_SAMPLE_FLIP(uv0); 56 | #endif 57 | color = a_color; 58 | 59 | return pos; 60 | } 61 | }% 62 | 63 | CCProgram sprite-fs %{ 64 | precision highp float; 65 | #include 66 | #include 67 | 68 | in vec4 color; 69 | 70 | #if USE_TEXTURE 71 | in vec2 uv0; 72 | #pragma builtin(local) 73 | layout(set = 2, binding = 10) uniform sampler2D cc_spriteTexture; 74 | #endif 75 | 76 | vec4 frag () { 77 | vec4 o = vec4(1, 1, 1, 1); 78 | 79 | #if USE_TEXTURE 80 | o *= CCSampleWithAlphaSeparated(cc_spriteTexture, uv0); 81 | #if IS_GRAY 82 | float gray = 0.2126 * o.r + 0.7152 * o.g + 0.0722 * o.b; 83 | o.r = o.g = o.b = gray; 84 | #endif 85 | #endif 86 | 87 | o *= color; 88 | ALPHA_TEST(o); 89 | return o; 90 | } 91 | }% 92 | -------------------------------------------------------------------------------- /assets/caseMultiTex/origin_sprite.effect.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.4.7","importer":"effect","imported":true,"uuid":"526ef31e-912d-4b4f-9f9e-99fcf95ff9bb","files":[".json"],"subMetas":{},"userData":{"combinations":[{}]}} 2 | -------------------------------------------------------------------------------- /assets/caseOutLine.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "1cc0e925-7854-4131-80c9-9d7548adb003", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseOutLine/outline.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "ce97bf65-4004-4229-a77f-4255fe3a2518", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseOutLine/outline.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "ce97bf65-4004-4229-a77f-4255fe3a2518", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": "1", 11 | "_defines": [ 12 | {}, 13 | {}, 14 | {}, 15 | {} 16 | ], 17 | "_states": [ 18 | { 19 | "rasterizerState": { 20 | "cullMode": 0 21 | }, 22 | "depthStencilState": { 23 | "depthWrite": false 24 | }, 25 | "blendState": { 26 | "targets": [ 27 | {} 28 | ] 29 | } 30 | }, 31 | { 32 | "rasterizerState": {}, 33 | "depthStencilState": { 34 | "depthWrite": true 35 | }, 36 | "blendState": { 37 | "targets": [ 38 | {} 39 | ] 40 | } 41 | }, 42 | {}, 43 | {} 44 | ], 45 | "_props": [ 46 | {}, 47 | {}, 48 | {}, 49 | {} 50 | ] 51 | } -------------------------------------------------------------------------------- /assets/caseOutLine/outline.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "b80b1f5c-9566-487c-a969-55a0f4745f40", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseOutLine/outline.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.32", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "45f5528a-175e-4459-a697-aa9c1b0e7200", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseRaindrop.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "6125b5d2-5402-4ba1-abe2-12c02eebd0fb", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/caseRaindrop/PPRaindropStage.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, RenderPipeline, Vec2 } from 'cc'; 3 | import { PPBaseStage } from '../postprocess/PPBaseStage'; 4 | import { PPMgr } from '../postprocess/PPMgr'; 5 | const { ccclass } = _decorator; 6 | 7 | @ccclass('PPRaindropStage') 8 | export class PPRaindropStage extends PPBaseStage { 9 | 10 | constructor() { 11 | super(); 12 | this._name = "PPRaindropStage"; 13 | } 14 | 15 | public initWithStageDesc(mgr: PPMgr, pl: RenderPipeline) { 16 | this.paramTexs = ['screenTex']; 17 | this.outputTexName = ''; 18 | 19 | super.initWithStageDesc(mgr, pl); 20 | 21 | const tex = mgr.getFrameBuffer('screenTex'); 22 | const texSize = new Vec2(1, 1); 23 | if (tex && tex.colorTextures[0]) { 24 | texSize.x = tex.colorTextures[0].width; 25 | texSize.y = tex.colorTextures[0].height; 26 | } 27 | this.bindShaderParamsVec2('winSize', texSize); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /assets/caseRaindrop/PPRaindropStage.ts.meta: -------------------------------------------------------------------------------- 1 | {"ver":"4.0.22","importer":"typescript","imported":true,"uuid":"a30f52b2-e1a1-4d60-bca3-58ca4c2532ab","files":[],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/caseRaindrop/raindrop.effect: -------------------------------------------------------------------------------- 1 | 2 | CCEffect %{ 3 | techniques: 4 | - name: transparent 5 | passes: 6 | - vert: fx-raindrop-vs:vert # builtin header 7 | frag: unlit-fs:frag 8 | properties: 9 | winSize: { value: [375.0, 667.0], editor: { displayName: window size } } 10 | screenTex: { value: white } 11 | }% 12 | 13 | CCProgram fx-raindrop-vs %{ 14 | precision highp float; 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | out vec2 v_uv; 21 | 22 | vec4 vert () { 23 | StandardVertInput In; 24 | CCVertInput(In); 25 | 26 | v_uv = a_texCoord; 27 | 28 | return In.position; 29 | } 30 | }% 31 | 32 | CCProgram unlit-fs %{ 33 | precision highp float; 34 | #include 35 | #include 36 | #include 37 | 38 | uniform Constants { 39 | vec2 winSize; 40 | }; 41 | 42 | in vec2 v_uv; 43 | 44 | uniform sampler2D screenTex; 45 | 46 | #define DROP_TAILTILE 3.0 47 | 48 | float N11(float t) { 49 | return fract(sin(t*10234.324)*123423.23512); 50 | } 51 | 52 | float N12(vec2 p) 53 | { // Dave Hoskins - https://www.shadertoy.com/view/4djSRW 54 | vec3 p3 = fract(vec3(p.xyx) * vec3(443.897, 441.423, 437.195)); 55 | p3 += dot(p3, p3.yzx + 19.19); 56 | return fract((p3.x + p3.y) * p3.z); 57 | } 58 | 59 | vec2 rain(vec2 uv, vec2 gridsWH, float speed) { 60 | float time = cc_time.x; 61 | uv.y += time * speed; 62 | 63 | vec2 cellUV = uv*gridsWH; 64 | vec2 id = floor(cellUV); 65 | cellUV = fract(cellUV); 66 | float noise = N12(id); 67 | time += noise * 6.14; 68 | 69 | vec2 dropUV = cellUV - 0.5; 70 | vec2 gridSize = winSize/gridsWH; 71 | gridSize /= gridSize.y; 72 | float rDrop = 0.; 73 | dropUV.y += sin(time + sin(time + sin(time)* 0.5)) * 0.4; 74 | rDrop = length(dropUV * gridSize); 75 | rDrop = smoothstep(0.1, 0.08, rDrop); 76 | 77 | vec2 trailUV = cellUV * vec2(1., 8.); 78 | trailUV = fract(trailUV); 79 | trailUV -= 0.5; 80 | float rTrail = length(trailUV * gridSize / vec2(1., 8.)); 81 | rTrail = smoothstep(0.05, 0.03, rTrail); 82 | rTrail *= smoothstep(-0.01, 0., dropUV.y); 83 | rTrail *= smoothstep(0.4, 0., dropUV.y); 84 | 85 | // if (cellUV.x > .99 || cellUV.y > .99) rDrop = 1.; 86 | 87 | // return vec2(rDrop + rTrail); 88 | return vec2(rDrop * dropUV + rTrail * trailUV); 89 | } 90 | 91 | vec4 frag() { 92 | vec2 uv = v_uv; 93 | vec4 col = vec4(0.); 94 | 95 | float x = 0.18; 96 | float s = sin(x); 97 | float c = cos(x); 98 | mat2 rot = mat2(c, -s, s, c); 99 | uv = rot * uv; 100 | 101 | vec2 offsetUV = vec2(0.); 102 | offsetUV += rain(uv, vec2(10., 6.), 0.1); 103 | offsetUV += rain(uv, vec2(26., 15.), 0.03); 104 | col += vec4(length(offsetUV)); 105 | vec4 texCol = texture(screenTex, v_uv + offsetUV); 106 | col = texCol; 107 | 108 | return CCFragOutput(col); 109 | } 110 | 111 | }% 112 | -------------------------------------------------------------------------------- /assets/caseRaindrop/raindrop.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "77f4c4d5-f34b-488c-a622-f170e186d7de", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseRaindrop/raindrop.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "77f4c4d5-f34b-488c-a622-f170e186d7de", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | {} 13 | ], 14 | "_states": [ 15 | { 16 | "rasterizerState": {}, 17 | "depthStencilState": {}, 18 | "blendState": { 19 | "targets": [ 20 | {} 21 | ] 22 | } 23 | } 24 | ], 25 | "_props": [ 26 | {} 27 | ] 28 | } -------------------------------------------------------------------------------- /assets/caseRaindrop/raindrop.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "a58aab85-351a-40d5-a229-a538b020ed3e", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseRaindrop/raindrop.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.32", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "750b24ee-081b-4f9b-a2bc-46e81f04005a", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/caseRaindrop/raindrop.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, Node } from 'cc'; 3 | import { PPBaseStage } from '../postprocess/PPBaseStage'; 4 | import { PPMgr } from '../postprocess/PPMgr'; 5 | import { PPRaindropStage } from './PPRaindropStage'; 6 | const { ccclass, property } = _decorator; 7 | 8 | @ccclass('Raindrop') 9 | export class Raindrop extends Component { 10 | 11 | @property(PPMgr) 12 | mgr: PPMgr|null = null; 13 | 14 | start () { 15 | this.mgr?.registerCreateStage(stageDesc => { 16 | let stage : PPBaseStage | null = null; 17 | if ('PPRaindropStage' == stageDesc.stageName) { 18 | stage = new PPRaindropStage(); 19 | } 20 | 21 | if (stage) { 22 | stage.mat = stageDesc.mat; 23 | } 24 | 25 | return stage; 26 | }); 27 | this.mgr?.init(); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /assets/caseRaindrop/raindrop.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "66ec8896-0135-4027-b290-69dee19f95d0", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/effects.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "0c509eef-4dcb-4467-bfcb-8513a1d84819", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/effects/fox.effect: -------------------------------------------------------------------------------- 1 | // Effect Syntax Guide: https://github.com/cocos-creator/docs-3d/blob/master/zh/material-system/effect-syntax.md 2 | 3 | CCEffect %{ 4 | techniques: 5 | - name: opaque 6 | passes: 7 | - vert: general-vs:vert # builtin header 8 | frag: unlit-fs:frag 9 | properties: &props 10 | mainTexture: { value: white } 11 | mainColor: { value: [1, 1, 1, 1], editor: { type: color } } 12 | - name: transparent 13 | passes: 14 | - vert: general-vs:vert # builtin header 15 | frag: unlit-fs:frag 16 | blendState: 17 | targets: 18 | - blend: true 19 | blendSrc: src_alpha 20 | blendDst: one_minus_src_alpha 21 | blendSrcAlpha: src_alpha 22 | blendDstAlpha: one_minus_src_alpha 23 | properties: *props 24 | }% 25 | 26 | CCProgram unlit-fs %{ 27 | precision highp float; 28 | #include 29 | #include 30 | 31 | in vec2 v_uv; 32 | uniform sampler2D mainTexture; 33 | 34 | uniform Constant { 35 | vec4 mainColor; 36 | }; 37 | 38 | vec4 frag () { 39 | vec4 col = mainColor * texture(mainTexture, v_uv); 40 | CC_APPLY_FOG(col); 41 | return CCFragOutput(col); 42 | } 43 | }% 44 | -------------------------------------------------------------------------------- /assets/effects/fox.effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.4.7", 3 | "importer": "effect", 4 | "imported": true, 5 | "uuid": "01c255eb-5cff-43cb-9c04-23391bb26acc", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/materials.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "4095e8bc-e898-4120-b41e-612b799d5203", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/materials/fox.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "01c255eb-5cff-43cb-9c04-23391bb26acc", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": "0", 11 | "_defines": [ 12 | {} 13 | ], 14 | "_states": [ 15 | { 16 | "rasterizerState": {}, 17 | "depthStencilState": {}, 18 | "blendState": { 19 | "targets": [ 20 | {} 21 | ] 22 | } 23 | } 24 | ], 25 | "_props": [ 26 | { 27 | "mainTexture": { 28 | "__uuid__": "3d0ad999-a62e-403b-821d-d1967c6a7ab7@6c48a", 29 | "__expectedType__": "cc.Texture2D" 30 | } 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /assets/materials/fox.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "b5555851-399e-440c-a361-0b8be6dc6591", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/model.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "2f785f48-bbcb-45cd-86dd-39381fc00f00", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/model/PrimaryIonDrive.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/model/PrimaryIonDrive.glb -------------------------------------------------------------------------------- /assets/model/PrimaryIonDrive.glb.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.1.4", 3 | "importer": "gltf", 4 | "imported": true, 5 | "uuid": "be264c31-7d70-4efa-8e6f-3fe06e924ca5", 6 | "files": [ 7 | "__original-animation-0.cconb" 8 | ], 9 | "subMetas": { 10 | "47132": { 11 | "importer": "gltf-material", 12 | "uuid": "be264c31-7d70-4efa-8e6f-3fe06e924ca5@47132", 13 | "displayName": "", 14 | "id": "47132", 15 | "name": "HoloFillDark.material", 16 | "userData": { 17 | "gltfIndex": 1 18 | }, 19 | "ver": "1.0.14", 20 | "imported": true, 21 | "files": [ 22 | ".json" 23 | ], 24 | "subMetas": {} 25 | }, 26 | "03a89": { 27 | "importer": "gltf-mesh", 28 | "uuid": "be264c31-7d70-4efa-8e6f-3fe06e924ca5@03a89", 29 | "displayName": "", 30 | "id": "03a89", 31 | "name": "circle_constant1_0.mesh", 32 | "userData": { 33 | "gltfIndex": 0 34 | }, 35 | "ver": "1.1.0", 36 | "imported": true, 37 | "files": [ 38 | ".bin", 39 | ".json" 40 | ], 41 | "subMetas": {} 42 | }, 43 | "e20fe": { 44 | "importer": "gltf-mesh", 45 | "uuid": "be264c31-7d70-4efa-8e6f-3fe06e924ca5@e20fe", 46 | "displayName": "", 47 | "id": "e20fe", 48 | "name": "circle_HoloFillDark_0.mesh", 49 | "userData": { 50 | "gltfIndex": 1 51 | }, 52 | "ver": "1.1.0", 53 | "imported": true, 54 | "files": [ 55 | ".bin", 56 | ".json" 57 | ], 58 | "subMetas": {} 59 | }, 60 | "bb3f1": { 61 | "importer": "gltf-mesh", 62 | "uuid": "be264c31-7d70-4efa-8e6f-3fe06e924ca5@bb3f1", 63 | "displayName": "", 64 | "id": "bb3f1", 65 | "name": "geo1_constant1_0.mesh", 66 | "userData": { 67 | "gltfIndex": 2 68 | }, 69 | "ver": "1.1.0", 70 | "imported": true, 71 | "files": [ 72 | ".bin", 73 | ".json" 74 | ], 75 | "subMetas": {} 76 | }, 77 | "b1c91": { 78 | "importer": "gltf-mesh", 79 | "uuid": "be264c31-7d70-4efa-8e6f-3fe06e924ca5@b1c91", 80 | "displayName": "", 81 | "id": "b1c91", 82 | "name": "geo1_HoloFillDark_0.mesh", 83 | "userData": { 84 | "gltfIndex": 3 85 | }, 86 | "ver": "1.1.0", 87 | "imported": true, 88 | "files": [ 89 | ".bin", 90 | ".json" 91 | ], 92 | "subMetas": {} 93 | }, 94 | "cbe29": { 95 | "importer": "gltf-mesh", 96 | "uuid": "be264c31-7d70-4efa-8e6f-3fe06e924ca5@cbe29", 97 | "displayName": "", 98 | "id": "cbe29", 99 | "name": "circle1_constant2_0.mesh", 100 | "userData": { 101 | "gltfIndex": 4 102 | }, 103 | "ver": "1.1.0", 104 | "imported": true, 105 | "files": [ 106 | ".bin", 107 | ".json" 108 | ], 109 | "subMetas": {} 110 | }, 111 | "b11f9": { 112 | "importer": "gltf-mesh", 113 | "uuid": "be264c31-7d70-4efa-8e6f-3fe06e924ca5@b11f9", 114 | "displayName": "", 115 | "id": "b11f9", 116 | "name": "circle2_constant2_0.mesh", 117 | "userData": { 118 | "gltfIndex": 5 119 | }, 120 | "ver": "1.1.0", 121 | "imported": true, 122 | "files": [ 123 | ".bin", 124 | ".json" 125 | ], 126 | "subMetas": {} 127 | }, 128 | "0aab2": { 129 | "importer": "gltf-animation", 130 | "uuid": "be264c31-7d70-4efa-8e6f-3fe06e924ca5@0aab2", 131 | "displayName": "", 132 | "id": "0aab2", 133 | "name": "Main.animation", 134 | "userData": { 135 | "gltfIndex": 0, 136 | "wrapMode": 2, 137 | "sample": 30, 138 | "span": { 139 | "from": 0, 140 | "to": 10 141 | }, 142 | "events": [] 143 | }, 144 | "ver": "1.0.16", 145 | "imported": true, 146 | "files": [ 147 | ".cconb" 148 | ], 149 | "subMetas": {} 150 | }, 151 | "aaa6b": { 152 | "importer": "gltf-material", 153 | "uuid": "be264c31-7d70-4efa-8e6f-3fe06e924ca5@aaa6b", 154 | "displayName": "", 155 | "id": "aaa6b", 156 | "name": "constant1.material", 157 | "userData": { 158 | "gltfIndex": 0 159 | }, 160 | "ver": "1.0.14", 161 | "imported": true, 162 | "files": [ 163 | ".json" 164 | ], 165 | "subMetas": {} 166 | }, 167 | "d7593": { 168 | "importer": "gltf-material", 169 | "uuid": "be264c31-7d70-4efa-8e6f-3fe06e924ca5@d7593", 170 | "displayName": "", 171 | "id": "d7593", 172 | "name": "constant2.material", 173 | "userData": { 174 | "gltfIndex": 2 175 | }, 176 | "ver": "1.0.14", 177 | "imported": true, 178 | "files": [ 179 | ".json" 180 | ], 181 | "subMetas": {} 182 | }, 183 | "f5a98": { 184 | "importer": "gltf-scene", 185 | "uuid": "be264c31-7d70-4efa-8e6f-3fe06e924ca5@f5a98", 186 | "displayName": "", 187 | "id": "f5a98", 188 | "name": "PrimaryIonDrive.prefab", 189 | "userData": { 190 | "gltfIndex": 0 191 | }, 192 | "ver": "1.0.12", 193 | "imported": true, 194 | "files": [ 195 | ".json" 196 | ], 197 | "subMetas": {} 198 | } 199 | }, 200 | "userData": { 201 | "imageMetas": [], 202 | "legacyFbxImporter": false, 203 | "animationImportSettings": [ 204 | { 205 | "name": "Main", 206 | "duration": 10, 207 | "fps": 30, 208 | "splits": [ 209 | { 210 | "name": "Main", 211 | "from": 0, 212 | "to": 10, 213 | "wrapMode": 2 214 | } 215 | ] 216 | } 217 | ], 218 | "redirect": "be264c31-7d70-4efa-8e6f-3fe06e924ca5@f5a98", 219 | "assetFinder": { 220 | "meshes": [ 221 | "be264c31-7d70-4efa-8e6f-3fe06e924ca5@03a89", 222 | "be264c31-7d70-4efa-8e6f-3fe06e924ca5@e20fe", 223 | "be264c31-7d70-4efa-8e6f-3fe06e924ca5@bb3f1", 224 | "be264c31-7d70-4efa-8e6f-3fe06e924ca5@b1c91", 225 | "be264c31-7d70-4efa-8e6f-3fe06e924ca5@cbe29", 226 | "be264c31-7d70-4efa-8e6f-3fe06e924ca5@b11f9" 227 | ], 228 | "skeletons": [], 229 | "textures": [], 230 | "materials": [ 231 | "be264c31-7d70-4efa-8e6f-3fe06e924ca5@aaa6b", 232 | "be264c31-7d70-4efa-8e6f-3fe06e924ca5@47132", 233 | "be264c31-7d70-4efa-8e6f-3fe06e924ca5@d7593" 234 | ], 235 | "scenes": [ 236 | "be264c31-7d70-4efa-8e6f-3fe06e924ca5@f5a98" 237 | ] 238 | } 239 | } 240 | } 241 | -------------------------------------------------------------------------------- /assets/model/cat.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "7f60fc2b-3b3a-4eec-90ae-bdcdaf9a63b5", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/model/cat/Texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/model/cat/Texture.png -------------------------------------------------------------------------------- /assets/model/cat/Texture.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.21", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "f9061c7c-a5cd-4e7c-8102-2b97e767ce3f", 6 | "files": [ 7 | ".png", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "f9061c7c-a5cd-4e7c-8102-2b97e767ce3f@6c48a", 14 | "displayName": "Texture", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "repeat", 19 | "wrapModeT": "repeat", 20 | "minfilter": "linear", 21 | "magfilter": "linear", 22 | "mipfilter": "none", 23 | "anisotropy": 0, 24 | "isUuid": true, 25 | "imageUuidOrDatabaseUri": "f9061c7c-a5cd-4e7c-8102-2b97e767ce3f" 26 | }, 27 | "ver": "1.0.21", 28 | "imported": true, 29 | "files": [ 30 | ".json" 31 | ], 32 | "subMetas": {} 33 | } 34 | }, 35 | "userData": { 36 | "hasAlpha": false, 37 | "type": "texture", 38 | "redirect": "f9061c7c-a5cd-4e7c-8102-2b97e767ce3f@6c48a" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /assets/model/cat/cat.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "1baf0fc9-befa-459c-8bdd-af1a450a0319", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | { 13 | "USE_ALBEDO_MAP": true 14 | }, 15 | {}, 16 | {}, 17 | {} 18 | ], 19 | "_states": [ 20 | { 21 | "rasterizerState": {}, 22 | "depthStencilState": {}, 23 | "blendState": { 24 | "targets": [ 25 | {} 26 | ] 27 | } 28 | }, 29 | {}, 30 | {}, 31 | {} 32 | ], 33 | "_props": [ 34 | { 35 | "normalStrenth": 0.254, 36 | "mainTexture": { 37 | "__uuid__": "f9061c7c-a5cd-4e7c-8102-2b97e767ce3f@6c48a", 38 | "__expectedType__": "cc.Texture2D" 39 | }, 40 | "normalMap": { 41 | "__uuid__": "08fb5bcb-69d1-4d2a-93f3-325bf470a044@6c48a", 42 | "__expectedType__": "cc.Texture2D" 43 | } 44 | }, 45 | {}, 46 | {}, 47 | {} 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /assets/model/cat/cat.mtl.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.0.9","importer":"material","imported":true,"uuid":"45b9757f-4d74-4a8a-8ccc-b225d63086b8","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/model/cat/cat_Idle.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/model/cat/cat_Idle.fbx -------------------------------------------------------------------------------- /assets/model/cat/cat_Idle.fbx.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.1.4", 3 | "importer": "fbx", 4 | "imported": true, 5 | "uuid": "5a0c2c4b-acbc-4c48-a027-f6dc837a7824", 6 | "files": [ 7 | "__original-animation-0.cconb" 8 | ], 9 | "subMetas": { 10 | "549cc": { 11 | "importer": "gltf-mesh", 12 | "uuid": "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@549cc", 13 | "displayName": "", 14 | "id": "549cc", 15 | "name": "cat.mesh", 16 | "userData": { 17 | "gltfIndex": 0 18 | }, 19 | "ver": "1.1.0", 20 | "imported": true, 21 | "files": [ 22 | ".bin", 23 | ".json" 24 | ], 25 | "subMetas": {} 26 | }, 27 | "73b7f": { 28 | "importer": "gltf-animation", 29 | "uuid": "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@73b7f", 30 | "displayName": "", 31 | "id": "73b7f", 32 | "name": "Take 001.animation", 33 | "userData": { 34 | "gltfIndex": 0, 35 | "wrapMode": 2, 36 | "sample": 30, 37 | "span": { 38 | "from": 0, 39 | "to": 5.875 40 | }, 41 | "events": [] 42 | }, 43 | "ver": "1.0.16", 44 | "imported": true, 45 | "files": [ 46 | ".cconb" 47 | ], 48 | "subMetas": {} 49 | }, 50 | "438fe": { 51 | "importer": "gltf-skeleton", 52 | "uuid": "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@438fe", 53 | "displayName": "", 54 | "id": "438fe", 55 | "name": "UnnamedSkeleton.skeleton", 56 | "userData": { 57 | "gltfIndex": 0, 58 | "jointsLength": 42 59 | }, 60 | "ver": "1.0.1", 61 | "imported": true, 62 | "files": [ 63 | ".json" 64 | ], 65 | "subMetas": {} 66 | }, 67 | "d4f45": { 68 | "importer": "gltf-embeded-image", 69 | "uuid": "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@d4f45", 70 | "displayName": "", 71 | "id": "d4f45", 72 | "name": "Map #2.image", 73 | "userData": { 74 | "gltfIndex": 0 75 | }, 76 | "ver": "1.0.3", 77 | "imported": true, 78 | "files": [ 79 | ".png", 80 | ".json" 81 | ], 82 | "subMetas": {} 83 | }, 84 | "1da29": { 85 | "importer": "texture", 86 | "uuid": "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@1da29", 87 | "displayName": "", 88 | "id": "1da29", 89 | "name": "Map #2.texture", 90 | "userData": { 91 | "wrapModeS": "repeat", 92 | "wrapModeT": "repeat", 93 | "minfilter": "linear", 94 | "magfilter": "linear", 95 | "mipfilter": "none", 96 | "anisotropy": 0, 97 | "isUuid": true, 98 | "imageUuidOrDatabaseUri": "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@d4f45" 99 | }, 100 | "ver": "1.0.21", 101 | "imported": true, 102 | "files": [ 103 | ".json" 104 | ], 105 | "subMetas": {} 106 | }, 107 | "4937b": { 108 | "importer": "gltf-material", 109 | "uuid": "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@4937b", 110 | "displayName": "", 111 | "id": "4937b", 112 | "name": "ult.material", 113 | "userData": { 114 | "gltfIndex": 0 115 | }, 116 | "ver": "1.0.14", 117 | "imported": true, 118 | "files": [ 119 | ".json" 120 | ], 121 | "subMetas": {} 122 | }, 123 | "1b42e": { 124 | "importer": "gltf-scene", 125 | "uuid": "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@1b42e", 126 | "displayName": "", 127 | "id": "1b42e", 128 | "name": "cat_Idle.prefab", 129 | "userData": { 130 | "gltfIndex": 0 131 | }, 132 | "ver": "1.0.12", 133 | "imported": true, 134 | "files": [ 135 | ".json" 136 | ], 137 | "subMetas": {} 138 | } 139 | }, 140 | "userData": { 141 | "imageMetas": [ 142 | { 143 | "name": "Map #2", 144 | "uri": "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@d4f45" 145 | } 146 | ], 147 | "legacyFbxImporter": false, 148 | "animationImportSettings": [ 149 | { 150 | "name": "Take 001", 151 | "duration": 5.875, 152 | "fps": 30, 153 | "splits": [ 154 | { 155 | "name": "Take 001", 156 | "from": 0, 157 | "to": 5.875, 158 | "wrapMode": 2 159 | } 160 | ] 161 | } 162 | ], 163 | "redirect": "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@1b42e", 164 | "assetFinder": { 165 | "meshes": [ 166 | "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@549cc" 167 | ], 168 | "skeletons": [ 169 | "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@438fe" 170 | ], 171 | "textures": [ 172 | "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@1da29" 173 | ], 174 | "materials": [ 175 | "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@4937b" 176 | ], 177 | "scenes": [ 178 | "5a0c2c4b-acbc-4c48-a027-f6dc837a7824@1b42e" 179 | ] 180 | } 181 | } 182 | } 183 | -------------------------------------------------------------------------------- /assets/model/fox.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "c02a4217-cdc8-43a1-aba8-05bf68ebdd93", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/model/fox/Fox.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/model/fox/Fox.fbx -------------------------------------------------------------------------------- /assets/model/fox/Fox.fbx.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.1.4", 3 | "importer": "fbx", 4 | "imported": true, 5 | "uuid": "3d11ceab-0d69-4bad-a669-456fa7647d29", 6 | "files": [ 7 | "__original-animation-0.cconb" 8 | ], 9 | "subMetas": { 10 | "59253": { 11 | "importer": "gltf-material", 12 | "uuid": "3d11ceab-0d69-4bad-a669-456fa7647d29@59253", 13 | "displayName": "", 14 | "id": "59253", 15 | "name": "08 - Default.material", 16 | "userData": { 17 | "gltfIndex": 0 18 | }, 19 | "ver": "1.0.14", 20 | "imported": true, 21 | "files": [ 22 | ".json" 23 | ], 24 | "subMetas": {} 25 | }, 26 | "1ce4d": { 27 | "importer": "gltf-mesh", 28 | "uuid": "3d11ceab-0d69-4bad-a669-456fa7647d29@1ce4d", 29 | "displayName": "", 30 | "id": "1ce4d", 31 | "name": "fox.mesh", 32 | "userData": { 33 | "gltfIndex": 0 34 | }, 35 | "ver": "1.1.0", 36 | "imported": true, 37 | "files": [ 38 | ".bin", 39 | ".json" 40 | ], 41 | "subMetas": {} 42 | }, 43 | "73b7f": { 44 | "importer": "gltf-animation", 45 | "uuid": "3d11ceab-0d69-4bad-a669-456fa7647d29@73b7f", 46 | "displayName": "", 47 | "id": "73b7f", 48 | "name": "Take 001.animation", 49 | "userData": { 50 | "gltfIndex": 0, 51 | "wrapMode": 2, 52 | "sample": 30, 53 | "span": { 54 | "from": 0, 55 | "to": 0.0416666679084301 56 | }, 57 | "events": [] 58 | }, 59 | "ver": "1.0.16", 60 | "imported": true, 61 | "files": [ 62 | ".cconb" 63 | ], 64 | "subMetas": {} 65 | }, 66 | "438fe": { 67 | "importer": "gltf-skeleton", 68 | "uuid": "3d11ceab-0d69-4bad-a669-456fa7647d29@438fe", 69 | "displayName": "", 70 | "id": "438fe", 71 | "name": "UnnamedSkeleton.skeleton", 72 | "userData": { 73 | "gltfIndex": 0, 74 | "jointsLength": 39 75 | }, 76 | "ver": "1.0.1", 77 | "imported": true, 78 | "files": [ 79 | ".json" 80 | ], 81 | "subMetas": {} 82 | }, 83 | "ace8f": { 84 | "importer": "gltf-embeded-image", 85 | "uuid": "3d11ceab-0d69-4bad-a669-456fa7647d29@ace8f", 86 | "displayName": "", 87 | "id": "ace8f", 88 | "name": "Map #4.image", 89 | "userData": { 90 | "gltfIndex": 0 91 | }, 92 | "ver": "1.0.3", 93 | "imported": true, 94 | "files": [ 95 | ".png", 96 | ".json" 97 | ], 98 | "subMetas": {} 99 | }, 100 | "d4f45": { 101 | "importer": "gltf-embeded-image", 102 | "uuid": "3d11ceab-0d69-4bad-a669-456fa7647d29@d4f45", 103 | "displayName": "", 104 | "id": "d4f45", 105 | "name": "Map #2.image", 106 | "userData": { 107 | "gltfIndex": 1 108 | }, 109 | "ver": "1.0.3", 110 | "imported": true, 111 | "files": [ 112 | ".png", 113 | ".json" 114 | ], 115 | "subMetas": {} 116 | }, 117 | "f8008": { 118 | "importer": "texture", 119 | "uuid": "3d11ceab-0d69-4bad-a669-456fa7647d29@f8008", 120 | "displayName": "", 121 | "id": "f8008", 122 | "name": "Map #4.texture", 123 | "userData": { 124 | "wrapModeS": "repeat", 125 | "wrapModeT": "repeat", 126 | "minfilter": "linear", 127 | "magfilter": "linear", 128 | "mipfilter": "none", 129 | "anisotropy": 0, 130 | "isUuid": true, 131 | "imageUuidOrDatabaseUri": "3d11ceab-0d69-4bad-a669-456fa7647d29@ace8f" 132 | }, 133 | "ver": "1.0.21", 134 | "imported": true, 135 | "files": [ 136 | ".json" 137 | ], 138 | "subMetas": {} 139 | }, 140 | "1da29": { 141 | "importer": "texture", 142 | "uuid": "3d11ceab-0d69-4bad-a669-456fa7647d29@1da29", 143 | "displayName": "", 144 | "id": "1da29", 145 | "name": "Map #2.texture", 146 | "userData": { 147 | "wrapModeS": "repeat", 148 | "wrapModeT": "repeat", 149 | "minfilter": "linear", 150 | "magfilter": "linear", 151 | "mipfilter": "none", 152 | "anisotropy": 0, 153 | "isUuid": true, 154 | "imageUuidOrDatabaseUri": "3d11ceab-0d69-4bad-a669-456fa7647d29@d4f45" 155 | }, 156 | "ver": "1.0.21", 157 | "imported": true, 158 | "files": [ 159 | ".json" 160 | ], 161 | "subMetas": {} 162 | }, 163 | "4f6bf": { 164 | "importer": "gltf-scene", 165 | "uuid": "3d11ceab-0d69-4bad-a669-456fa7647d29@4f6bf", 166 | "displayName": "", 167 | "id": "4f6bf", 168 | "name": "Fox.prefab", 169 | "userData": { 170 | "gltfIndex": 0 171 | }, 172 | "ver": "1.0.12", 173 | "imported": true, 174 | "files": [ 175 | ".json" 176 | ], 177 | "subMetas": {} 178 | } 179 | }, 180 | "userData": { 181 | "imageMetas": [ 182 | { 183 | "name": "Map #4", 184 | "uri": "3d11ceab-0d69-4bad-a669-456fa7647d29@ace8f" 185 | }, 186 | { 187 | "name": "Map #2", 188 | "uri": "3d11ceab-0d69-4bad-a669-456fa7647d29@d4f45" 189 | } 190 | ], 191 | "legacyFbxImporter": false, 192 | "animationImportSettings": [ 193 | { 194 | "name": "Take 001", 195 | "duration": 0.0416666679084301, 196 | "fps": 30, 197 | "splits": [ 198 | { 199 | "name": "Take 001", 200 | "from": 0, 201 | "to": 0.0416666679084301, 202 | "wrapMode": 2 203 | } 204 | ] 205 | } 206 | ], 207 | "redirect": "3d11ceab-0d69-4bad-a669-456fa7647d29@4f6bf", 208 | "assetFinder": { 209 | "meshes": [ 210 | "3d11ceab-0d69-4bad-a669-456fa7647d29@1ce4d" 211 | ], 212 | "skeletons": [ 213 | "3d11ceab-0d69-4bad-a669-456fa7647d29@438fe" 214 | ], 215 | "textures": [ 216 | "3d11ceab-0d69-4bad-a669-456fa7647d29@f8008", 217 | "3d11ceab-0d69-4bad-a669-456fa7647d29@1da29" 218 | ], 219 | "materials": [ 220 | "3d11ceab-0d69-4bad-a669-456fa7647d29@59253" 221 | ], 222 | "scenes": [ 223 | "3d11ceab-0d69-4bad-a669-456fa7647d29@4f6bf" 224 | ] 225 | } 226 | } 227 | } 228 | -------------------------------------------------------------------------------- /assets/model/fox/material.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "22659d81-ce3f-4527-a8b5-48a498b4fc9a", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/model/fox/material/fox.mtl: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.Material", 3 | "_name": "", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_effectAsset": { 7 | "__uuid__": "1baf0fc9-befa-459c-8bdd-af1a450a0319", 8 | "__expectedType__": "cc.EffectAsset" 9 | }, 10 | "_techIdx": 0, 11 | "_defines": [ 12 | { 13 | "USE_NORMAL_MAP": true, 14 | "USE_ALBEDO_MAP": true, 15 | "NORMAL_UV": "v_uv1", 16 | "USE_OCCLUSION_MAP": true 17 | }, 18 | {}, 19 | {}, 20 | {} 21 | ], 22 | "_states": [ 23 | { 24 | "rasterizerState": {}, 25 | "depthStencilState": {}, 26 | "blendState": { 27 | "targets": [ 28 | {} 29 | ] 30 | } 31 | }, 32 | {}, 33 | {}, 34 | {} 35 | ], 36 | "_props": [ 37 | { 38 | "mainTexture": { 39 | "__uuid__": "b2073635-1962-443b-a2ae-ca53fa946624@6c48a", 40 | "__expectedType__": "cc.Texture2D" 41 | }, 42 | "normalMap": { 43 | "__uuid__": "79578435-543a-4b64-b73e-d3396923606a@6c48a", 44 | "__expectedType__": "cc.Texture2D" 45 | }, 46 | "occlusionMap": { 47 | "__uuid__": "e4cd7626-c53d-438d-b9a7-7e7f57f7eb60@6c48a", 48 | "__expectedType__": "cc.Texture2D" 49 | } 50 | }, 51 | {}, 52 | {}, 53 | {} 54 | ] 55 | } 56 | -------------------------------------------------------------------------------- /assets/model/fox/material/fox.mtl.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.9", 3 | "importer": "material", 4 | "imported": true, 5 | "uuid": "2ef641d8-311a-4093-9fc4-e1cd74fdf33c", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/model/fox/textures.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "e88eeb46-83c2-4ebb-b901-6678f4671b25", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/model/fox/textures/T_Fox_AO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/model/fox/textures/T_Fox_AO.png -------------------------------------------------------------------------------- /assets/model/fox/textures/T_Fox_AO.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.21", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "e4cd7626-c53d-438d-b9a7-7e7f57f7eb60", 6 | "files": [ 7 | ".png", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "e4cd7626-c53d-438d-b9a7-7e7f57f7eb60@6c48a", 14 | "displayName": "T_Fox_AO", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "repeat", 19 | "wrapModeT": "repeat", 20 | "minfilter": "linear", 21 | "magfilter": "linear", 22 | "mipfilter": "none", 23 | "anisotropy": 0, 24 | "isUuid": true, 25 | "imageUuidOrDatabaseUri": "e4cd7626-c53d-438d-b9a7-7e7f57f7eb60" 26 | }, 27 | "ver": "1.0.21", 28 | "imported": true, 29 | "files": [ 30 | ".json" 31 | ], 32 | "subMetas": {} 33 | } 34 | }, 35 | "userData": { 36 | "hasAlpha": false, 37 | "type": "texture", 38 | "redirect": "e4cd7626-c53d-438d-b9a7-7e7f57f7eb60@6c48a" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /assets/model/fox/textures/T_Fox_BC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/model/fox/textures/T_Fox_BC.png -------------------------------------------------------------------------------- /assets/model/fox/textures/T_Fox_BC.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.21", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "b2073635-1962-443b-a2ae-ca53fa946624", 6 | "files": [ 7 | ".png", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "b2073635-1962-443b-a2ae-ca53fa946624@6c48a", 14 | "displayName": "T_Fox_BC", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "repeat", 19 | "wrapModeT": "repeat", 20 | "minfilter": "linear", 21 | "magfilter": "linear", 22 | "mipfilter": "none", 23 | "anisotropy": 0, 24 | "isUuid": true, 25 | "imageUuidOrDatabaseUri": "b2073635-1962-443b-a2ae-ca53fa946624" 26 | }, 27 | "ver": "1.0.21", 28 | "imported": true, 29 | "files": [ 30 | ".json" 31 | ], 32 | "subMetas": {} 33 | } 34 | }, 35 | "userData": { 36 | "hasAlpha": false, 37 | "type": "texture", 38 | "redirect": "b2073635-1962-443b-a2ae-ca53fa946624@6c48a" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /assets/model/fox/textures/T_Fox_Normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/model/fox/textures/T_Fox_Normal.png -------------------------------------------------------------------------------- /assets/model/fox/textures/T_Fox_Normal.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.21", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "79578435-543a-4b64-b73e-d3396923606a", 6 | "files": [ 7 | ".png", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "79578435-543a-4b64-b73e-d3396923606a@6c48a", 14 | "displayName": "T_Fox_Normal", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "repeat", 19 | "wrapModeT": "repeat", 20 | "minfilter": "linear", 21 | "magfilter": "linear", 22 | "mipfilter": "none", 23 | "anisotropy": 0, 24 | "isUuid": true, 25 | "imageUuidOrDatabaseUri": "79578435-543a-4b64-b73e-d3396923606a" 26 | }, 27 | "ver": "1.0.21", 28 | "imported": true, 29 | "files": [ 30 | ".json" 31 | ], 32 | "subMetas": {} 33 | } 34 | }, 35 | "userData": { 36 | "hasAlpha": true, 37 | "type": "texture", 38 | "redirect": "79578435-543a-4b64-b73e-d3396923606a@6c48a" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /assets/postprocess.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "375c85c6-e053-4c48-baf7-e3a55e5fc434", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/postprocess/PPBaseStage.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, renderer, gfx, pipeline, Material, RenderStage, PipelineStateManager, Camera, RenderPipeline, Vec2, RenderFlow } from 'cc'; 3 | import { PPMgr } from './PPMgr'; 4 | const { ccclass, property } = _decorator; 5 | 6 | const colors: gfx.Color[] = [new gfx.Color(0, 0, 0, 1)]; 7 | 8 | @ccclass('PPBaseStage') 9 | export class PPBaseStage extends RenderStage { 10 | 11 | @property (Material) 12 | mat: Material | null = null; 13 | 14 | private _ia: gfx.InputAssembler | null = null; 15 | private _framebuffer: gfx.Framebuffer | null = null; 16 | 17 | paramTexs: string[] = ['screenTex']; 18 | outputTexName: string = ''; 19 | 20 | constructor() { 21 | super(); 22 | this._name = "PPBaseStage"; 23 | } 24 | 25 | get ia() { 26 | return this._ia; 27 | } 28 | set ia(val) { 29 | this._ia = val; 30 | } 31 | 32 | get framebuffer() { 33 | return this._framebuffer; 34 | } 35 | set framebuffer(val) { 36 | this._framebuffer = val; 37 | } 38 | 39 | public initWithStageDesc(mgr: PPMgr, pl: RenderPipeline) { 40 | this.bindShaderParamsTexs(mgr); 41 | this.setOutputFramebuffer(mgr); 42 | } 43 | 44 | protected bindShaderParamsVec2(name: string, value: Vec2) { 45 | const pass = this.mat?.passes[0]; 46 | if (!pass) { return; } 47 | 48 | const handle = pass.getHandle(name); 49 | if (handle < 1) { return; } 50 | 51 | pass.setUniform(handle, value) 52 | } 53 | 54 | protected bindShaderParamsTexs(mgr: PPMgr) { 55 | this.paramTexs.forEach(fbName => { 56 | this.bindShaderParamsTexture(mgr, fbName, fbName); 57 | }); 58 | } 59 | 60 | protected setOutputFramebuffer(mgr: PPMgr) { 61 | if (!this.outputTexName) { return; } 62 | const fb = mgr.createFrameBufferIf(this.outputTexName); 63 | if (!fb) { return; } 64 | this.framebuffer = fb; 65 | } 66 | 67 | protected bindShaderParamsTexture(mgr: PPMgr, fbName: string, keyFBName: string) { 68 | const pass = this.mat?.passes[0]; 69 | if (!pass) { return; } 70 | 71 | const binding = pass.getBinding(fbName); 72 | if (binding < 0) { return; } 73 | 74 | const fb = mgr.createFrameBufferIf(keyFBName); 75 | if (!fb) { return; } 76 | const samper = mgr.samper; 77 | if (!samper) { return; } 78 | 79 | pass.bindTexture(binding, fb.colorTextures[0]!); 80 | pass.bindSampler(binding, samper); 81 | } 82 | 83 | public activate (pipeline: RenderPipeline, flow: RenderFlow) { 84 | super.activate(pipeline, flow); 85 | this.mat?.passes[0].update(); 86 | } 87 | 88 | public render (camera: renderer.scene.Camera): void { 89 | if (camera.projectionType != Camera.ProjectionType.PERSPECTIVE) { return; } 90 | if (null == this.mat) { return; } 91 | if (null == this._ia) { return; } 92 | 93 | const pl = this._pipeline; 94 | const device = pl.device; 95 | const cmdBuff = pl.commandBuffers[0]; 96 | let fb = this.framebuffer ? this.framebuffer : camera.window?.framebuffer; 97 | if (null == fb) { return; } 98 | const rp = fb.renderPass; 99 | 100 | pl.pipelineUBO.updateCameraUBO(camera); 101 | 102 | const renderArea = new gfx.Rect(0, 0, 1, 1); 103 | const vp = camera.viewport; 104 | renderArea.x = vp.x * camera.width; 105 | renderArea.y = vp.y * camera.height; 106 | renderArea.width = vp.width * camera.width * pl.pipelineSceneData.shadingScale; 107 | renderArea.height = vp.height * camera.height * pl.pipelineSceneData.shadingScale; 108 | 109 | if (camera.clearFlag & gfx.ClearFlagBit.COLOR) { 110 | colors[0].x = camera.clearColor.x; 111 | colors[0].y = camera.clearColor.y; 112 | colors[0].z = camera.clearColor.z; 113 | } 114 | colors[0].w = camera.clearColor.w; 115 | 116 | cmdBuff.beginRenderPass(rp, fb, renderArea, colors, camera.clearDepth, camera.clearStencil); 117 | cmdBuff.bindDescriptorSet(pipeline.SetIndex.GLOBAL, pl.descriptorSet); 118 | 119 | const pass = this.mat!.passes[0]; 120 | const shader = this.mat!.passes[0].getShaderVariant(); 121 | 122 | let inputAssembler = this._ia; 123 | let pso: gfx.PipelineState | null = null; 124 | if (pass != null && shader != null && inputAssembler != null) { 125 | pso = PipelineStateManager.getOrCreatePipelineState(device, pass, shader, rp, inputAssembler); 126 | } 127 | 128 | if (pso != null) { 129 | cmdBuff.bindPipelineState(pso); 130 | cmdBuff.bindDescriptorSet(pipeline.SetIndex.MATERIAL, pass.descriptorSet); 131 | cmdBuff.bindInputAssembler(inputAssembler); 132 | cmdBuff.draw(inputAssembler); 133 | } 134 | 135 | cmdBuff.endRenderPass(); 136 | } 137 | 138 | destroy() { 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /assets/postprocess/PPBaseStage.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "17a84c79-c7cb-4ca5-9fee-3d79a5254e0f", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/postprocess/PPMgr.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "8a762b8e-d78f-46da-893e-b71f6d7c02cb", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/resources.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "6d74179e-2f66-4965-afe4-64af11b2d3b4", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "isBundle": true, 10 | "bundleName": "resources", 11 | "priority": 8, 12 | "compressionType": {}, 13 | "isRemoteBundle": {} 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assets/resources/atlas.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "938626a0-d32c-4df8-8e62-e603251669e7", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/resources/atlas/emoji.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | emoji1.png 8 | 9 | aliases 10 | 11 | spriteOffset 12 | {0,0} 13 | spriteSize 14 | {68,68} 15 | spriteSourceSize 16 | {68,68} 17 | textureRect 18 | {{1,1},{68,68}} 19 | textureRotated 20 | 21 | 22 | emoji2.png 23 | 24 | aliases 25 | 26 | spriteOffset 27 | {0,0} 28 | spriteSize 29 | {66,66} 30 | spriteSourceSize 31 | {68,68} 32 | textureRect 33 | {{141,1},{66,66}} 34 | textureRotated 35 | 36 | 37 | emoji3.png 38 | 39 | aliases 40 | 41 | spriteOffset 42 | {0,0} 43 | spriteSize 44 | {68,68} 45 | spriteSourceSize 46 | {68,68} 47 | textureRect 48 | {{71,1},{68,68}} 49 | textureRotated 50 | 51 | 52 | 53 | metadata 54 | 55 | format 56 | 3 57 | pixelFormat 58 | RGBA8888 59 | premultiplyAlpha 60 | 61 | realTextureFileName 62 | emoji.png 63 | size 64 | {208,70} 65 | smartupdate 66 | $TexturePacker:SmartUpdate:04650b9904b71a681a18ce42a7a4120a:ffdde0c98fc84bd1f99493bb3f077f8e:4ec14ac0cf4724fb75b15ad0d1f4335a$ 67 | textureFileName 68 | emoji.png 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /assets/resources/atlas/emoji.plist.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.6", 3 | "importer": "sprite-atlas", 4 | "imported": true, 5 | "uuid": "7aaef392-2317-4f83-9b99-16dd63a07a72", 6 | "files": [ 7 | ".plist", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "19fe2": { 12 | "importer": "sprite-frame", 13 | "uuid": "7aaef392-2317-4f83-9b99-16dd63a07a72@19fe2", 14 | "displayName": "", 15 | "id": "19fe2", 16 | "name": "emoji1", 17 | "userData": { 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 1, 24 | "trimY": 1, 25 | "width": 68, 26 | "height": 68, 27 | "rawWidth": 68, 28 | "rawHeight": 68, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "packable": true, 34 | "isUuid": true, 35 | "imageUuidOrDatabaseUri": "7cdfdd93-13bd-44bf-b577-3cae38d5f82b@6c48a", 36 | "atlasUuid": "7aaef392-2317-4f83-9b99-16dd63a07a72" 37 | }, 38 | "ver": "1.0.9", 39 | "imported": true, 40 | "files": [ 41 | ".json" 42 | ], 43 | "subMetas": {} 44 | }, 45 | "34f21": { 46 | "importer": "sprite-frame", 47 | "uuid": "7aaef392-2317-4f83-9b99-16dd63a07a72@34f21", 48 | "displayName": "", 49 | "id": "34f21", 50 | "name": "emoji2", 51 | "userData": { 52 | "trimType": "auto", 53 | "trimThreshold": 1, 54 | "rotated": false, 55 | "offsetX": 0, 56 | "offsetY": 0, 57 | "trimX": 141, 58 | "trimY": 1, 59 | "width": 66, 60 | "height": 66, 61 | "rawWidth": 68, 62 | "rawHeight": 68, 63 | "borderTop": 0, 64 | "borderBottom": 0, 65 | "borderLeft": 0, 66 | "borderRight": 0, 67 | "packable": true, 68 | "isUuid": true, 69 | "imageUuidOrDatabaseUri": "7cdfdd93-13bd-44bf-b577-3cae38d5f82b@6c48a", 70 | "atlasUuid": "7aaef392-2317-4f83-9b99-16dd63a07a72" 71 | }, 72 | "ver": "1.0.9", 73 | "imported": true, 74 | "files": [ 75 | ".json" 76 | ], 77 | "subMetas": {} 78 | }, 79 | "ecc53": { 80 | "importer": "sprite-frame", 81 | "uuid": "7aaef392-2317-4f83-9b99-16dd63a07a72@ecc53", 82 | "displayName": "", 83 | "id": "ecc53", 84 | "name": "emoji3", 85 | "userData": { 86 | "trimType": "auto", 87 | "trimThreshold": 1, 88 | "rotated": false, 89 | "offsetX": 0, 90 | "offsetY": 0, 91 | "trimX": 71, 92 | "trimY": 1, 93 | "width": 68, 94 | "height": 68, 95 | "rawWidth": 68, 96 | "rawHeight": 68, 97 | "borderTop": 0, 98 | "borderBottom": 0, 99 | "borderLeft": 0, 100 | "borderRight": 0, 101 | "packable": true, 102 | "isUuid": true, 103 | "imageUuidOrDatabaseUri": "7cdfdd93-13bd-44bf-b577-3cae38d5f82b@6c48a", 104 | "atlasUuid": "7aaef392-2317-4f83-9b99-16dd63a07a72" 105 | }, 106 | "ver": "1.0.9", 107 | "imported": true, 108 | "files": [ 109 | ".json" 110 | ], 111 | "subMetas": {} 112 | } 113 | }, 114 | "userData": { 115 | "atlasTextureName": "emoji.png", 116 | "format": 3, 117 | "uuid": "7aaef392-2317-4f83-9b99-16dd63a07a72", 118 | "textureUuid": "7cdfdd93-13bd-44bf-b577-3cae38d5f82b@6c48a" 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /assets/resources/atlas/emoji.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/resources/atlas/emoji.png -------------------------------------------------------------------------------- /assets/resources/atlas/emoji.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.21", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "7cdfdd93-13bd-44bf-b577-3cae38d5f82b", 6 | "files": [ 7 | ".png", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "7cdfdd93-13bd-44bf-b577-3cae38d5f82b@6c48a", 14 | "displayName": "emoji", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "clamp-to-edge", 19 | "wrapModeT": "clamp-to-edge", 20 | "imageUuidOrDatabaseUri": "7cdfdd93-13bd-44bf-b577-3cae38d5f82b", 21 | "minfilter": "linear", 22 | "magfilter": "linear", 23 | "mipfilter": "none", 24 | "anisotropy": 0, 25 | "isUuid": true 26 | }, 27 | "ver": "1.0.21", 28 | "imported": true, 29 | "files": [ 30 | ".json" 31 | ], 32 | "subMetas": {} 33 | }, 34 | "f9941": { 35 | "importer": "sprite-frame", 36 | "uuid": "7cdfdd93-13bd-44bf-b577-3cae38d5f82b@f9941", 37 | "displayName": "emoji", 38 | "id": "f9941", 39 | "name": "spriteFrame", 40 | "userData": { 41 | "trimType": "auto", 42 | "trimThreshold": 1, 43 | "rotated": false, 44 | "offsetX": -1, 45 | "offsetY": 0, 46 | "trimX": 0, 47 | "trimY": 0, 48 | "width": 206, 49 | "height": 70, 50 | "rawWidth": 208, 51 | "rawHeight": 70, 52 | "borderTop": 0, 53 | "borderBottom": 0, 54 | "borderLeft": 0, 55 | "borderRight": 0, 56 | "packable": true, 57 | "isUuid": true, 58 | "imageUuidOrDatabaseUri": "7cdfdd93-13bd-44bf-b577-3cae38d5f82b@6c48a", 59 | "atlasUuid": "" 60 | }, 61 | "ver": "1.0.9", 62 | "imported": true, 63 | "files": [ 64 | ".json" 65 | ], 66 | "subMetas": {} 67 | } 68 | }, 69 | "userData": { 70 | "type": "sprite-frame", 71 | "hasAlpha": true, 72 | "redirect": "7cdfdd93-13bd-44bf-b577-3cae38d5f82b@f9941" 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /assets/resources/atlas/sheep.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | sheep_down_0.png 8 | 9 | frame 10 | {{2,2},{224,87}} 11 | offset 12 | {0,-25} 13 | rotated 14 | 15 | sourceColorRect 16 | {{2,61},{224,87}} 17 | sourceSize 18 | {228,159} 19 | 20 | sheep_down_1.png 21 | 22 | frame 23 | {{326,367},{152,103}} 24 | offset 25 | {-6,-8} 26 | rotated 27 | 28 | sourceColorRect 29 | {{32,36},{152,103}} 30 | sourceSize 31 | {228,159} 32 | 33 | sheep_down_2.png 34 | 35 | frame 36 | {{2,335},{166,105}} 37 | offset 38 | {-7,-3} 39 | rotated 40 | 41 | sourceColorRect 42 | {{24,30},{166,105}} 43 | sourceSize 44 | {228,159} 45 | 46 | sheep_jump_0.png 47 | 48 | frame 49 | {{326,472},{144,151}} 50 | offset 51 | {-10,0} 52 | rotated 53 | 54 | sourceColorRect 55 | {{32,4},{144,151}} 56 | sourceSize 57 | {228,159} 58 | 59 | sheep_jump_1.png 60 | 61 | frame 62 | {{170,351},{154,131}} 63 | offset 64 | {-13,2} 65 | rotated 66 | 67 | sourceColorRect 68 | {{24,12},{154,131}} 69 | sourceSize 70 | {228,159} 71 | 72 | sheep_jump_2.png 73 | 74 | frame 75 | {{348,260},{160,105}} 76 | offset 77 | {-10,4} 78 | rotated 79 | 80 | sourceColorRect 81 | {{24,23},{160,105}} 82 | sourceSize 83 | {228,159} 84 | 85 | sheep_jump_3.png 86 | 87 | frame 88 | {{2,442},{152,115}} 89 | offset 90 | {-12,-2} 91 | rotated 92 | 93 | sourceColorRect 94 | {{26,24},{152,115}} 95 | sourceSize 96 | {228,159} 97 | 98 | sheep_jump_4.png 99 | 100 | frame 101 | {{360,119},{148,139}} 102 | offset 103 | {-12,-2} 104 | rotated 105 | 106 | sourceColorRect 107 | {{28,12},{148,139}} 108 | sourceSize 109 | {228,159} 110 | 111 | sheep_run_0.png 112 | 113 | frame 114 | {{178,236},{168,113}} 115 | offset 116 | {-4,0} 117 | rotated 118 | 119 | sourceColorRect 120 | {{26,23},{168,113}} 121 | sourceSize 122 | {228,159} 123 | 124 | sheep_run_1.png 125 | 126 | frame 127 | {{182,119},{176,115}} 128 | offset 129 | {1,2} 130 | rotated 131 | 132 | sourceColorRect 133 | {{27,20},{176,115}} 134 | sourceSize 135 | {228,159} 136 | 137 | sheep_run_2.png 138 | 139 | frame 140 | {{228,2},{178,115}} 141 | offset 142 | {1,11} 143 | rotated 144 | 145 | sourceColorRect 146 | {{26,11},{178,115}} 147 | sourceSize 148 | {228,159} 149 | 150 | sheep_run_3.png 151 | 152 | frame 153 | {{2,91},{178,113}} 154 | offset 155 | {2,1} 156 | rotated 157 | 158 | sourceColorRect 159 | {{27,22},{178,113}} 160 | sourceSize 161 | {228,159} 162 | 163 | sheep_touch_0.png 164 | 165 | frame 166 | {{2,206},{174,127}} 167 | offset 168 | {-5,16} 169 | rotated 170 | 171 | sourceColorRect 172 | {{22,0},{174,127}} 173 | sourceSize 174 | {228,159} 175 | 176 | 177 | metadata 178 | 179 | format 180 | 2 181 | realTextureFileName 182 | sheep.png 183 | size 184 | {512,1024} 185 | smartupdate 186 | $TexturePacker:SmartUpdate:a7b82875050232ffbd24deccd7e379b7:847cb78fe45f863139518baf3831526a:13084b924613a7ef2ca9c6df3339651b$ 187 | textureFileName 188 | sheep.png 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /assets/resources/atlas/sheep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/resources/atlas/sheep.png -------------------------------------------------------------------------------- /assets/resources/atlas/sheep.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.21", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "673b443a-9339-4826-927c-1c76e6ce8dc4", 6 | "files": [ 7 | ".png", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "673b443a-9339-4826-927c-1c76e6ce8dc4@6c48a", 14 | "displayName": "sheep", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "clamp-to-edge", 19 | "wrapModeT": "clamp-to-edge", 20 | "imageUuidOrDatabaseUri": "673b443a-9339-4826-927c-1c76e6ce8dc4", 21 | "minfilter": "linear", 22 | "magfilter": "linear", 23 | "mipfilter": "none", 24 | "anisotropy": 0, 25 | "isUuid": true 26 | }, 27 | "ver": "1.0.21", 28 | "imported": true, 29 | "files": [ 30 | ".json" 31 | ], 32 | "subMetas": {} 33 | }, 34 | "f9941": { 35 | "importer": "sprite-frame", 36 | "uuid": "673b443a-9339-4826-927c-1c76e6ce8dc4@f9941", 37 | "displayName": "sheep", 38 | "id": "f9941", 39 | "name": "spriteFrame", 40 | "userData": { 41 | "trimType": "auto", 42 | "trimThreshold": 1, 43 | "rotated": false, 44 | "offsetX": -1, 45 | "offsetY": 203, 46 | "trimX": 2, 47 | "trimY": 2, 48 | "width": 506, 49 | "height": 614, 50 | "rawWidth": 512, 51 | "rawHeight": 1024, 52 | "borderTop": 0, 53 | "borderBottom": 0, 54 | "borderLeft": 0, 55 | "borderRight": 0, 56 | "packable": true, 57 | "isUuid": true, 58 | "imageUuidOrDatabaseUri": "673b443a-9339-4826-927c-1c76e6ce8dc4@6c48a", 59 | "atlasUuid": "" 60 | }, 61 | "ver": "1.0.9", 62 | "imported": true, 63 | "files": [ 64 | ".json" 65 | ], 66 | "subMetas": {} 67 | } 68 | }, 69 | "userData": { 70 | "type": "sprite-frame", 71 | "hasAlpha": true, 72 | "redirect": "673b443a-9339-4826-927c-1c76e6ce8dc4@f9941" 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /assets/resources/atlas/ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/resources/atlas/ui.png -------------------------------------------------------------------------------- /assets/resources/atlas/ui.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.21", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "295bfe3f-4205-4abf-aefc-fd41039f959a", 6 | "files": [ 7 | ".png", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "295bfe3f-4205-4abf-aefc-fd41039f959a@6c48a", 14 | "displayName": "ui", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "clamp-to-edge", 19 | "wrapModeT": "clamp-to-edge", 20 | "imageUuidOrDatabaseUri": "295bfe3f-4205-4abf-aefc-fd41039f959a", 21 | "minfilter": "linear", 22 | "magfilter": "linear", 23 | "mipfilter": "none", 24 | "anisotropy": 0, 25 | "isUuid": true 26 | }, 27 | "ver": "1.0.21", 28 | "imported": true, 29 | "files": [ 30 | ".json" 31 | ], 32 | "subMetas": {} 33 | }, 34 | "f9941": { 35 | "importer": "sprite-frame", 36 | "uuid": "295bfe3f-4205-4abf-aefc-fd41039f959a@f9941", 37 | "displayName": "ui", 38 | "id": "f9941", 39 | "name": "spriteFrame", 40 | "userData": { 41 | "trimType": "auto", 42 | "trimThreshold": 1, 43 | "rotated": false, 44 | "offsetX": 0, 45 | "offsetY": 0, 46 | "trimX": 0, 47 | "trimY": 0, 48 | "width": 459, 49 | "height": 255, 50 | "rawWidth": 459, 51 | "rawHeight": 255, 52 | "borderTop": 0, 53 | "borderBottom": 0, 54 | "borderLeft": 0, 55 | "borderRight": 0, 56 | "packable": true, 57 | "isUuid": true, 58 | "imageUuidOrDatabaseUri": "295bfe3f-4205-4abf-aefc-fd41039f959a@6c48a", 59 | "atlasUuid": "" 60 | }, 61 | "ver": "1.0.9", 62 | "imported": true, 63 | "files": [ 64 | ".json" 65 | ], 66 | "subMetas": {} 67 | } 68 | }, 69 | "userData": { 70 | "type": "sprite-frame", 71 | "hasAlpha": true, 72 | "redirect": "295bfe3f-4205-4abf-aefc-fd41039f959a@f9941" 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /assets/resources/textures.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "94b430e2-f67b-4ea3-a432-e531f8ea0877", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/resources/textures/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/resources/textures/image.png -------------------------------------------------------------------------------- /assets/resources/textures/image.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.21", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "012105ed-a429-49b9-ba0e-9b0c27a741a3", 6 | "files": [ 7 | ".png", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "012105ed-a429-49b9-ba0e-9b0c27a741a3@6c48a", 14 | "displayName": "image", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "clamp-to-edge", 19 | "wrapModeT": "clamp-to-edge", 20 | "imageUuidOrDatabaseUri": "012105ed-a429-49b9-ba0e-9b0c27a741a3", 21 | "minfilter": "linear", 22 | "magfilter": "linear", 23 | "mipfilter": "none", 24 | "anisotropy": 0, 25 | "isUuid": true 26 | }, 27 | "ver": "1.0.21", 28 | "imported": true, 29 | "files": [ 30 | ".json" 31 | ], 32 | "subMetas": {} 33 | }, 34 | "f9941": { 35 | "importer": "sprite-frame", 36 | "uuid": "012105ed-a429-49b9-ba0e-9b0c27a741a3@f9941", 37 | "displayName": "image", 38 | "id": "f9941", 39 | "name": "spriteFrame", 40 | "userData": { 41 | "trimType": "auto", 42 | "trimThreshold": 1, 43 | "rotated": false, 44 | "offsetX": 0, 45 | "offsetY": 0, 46 | "trimX": 0, 47 | "trimY": 0, 48 | "width": 137, 49 | "height": 216, 50 | "rawWidth": 137, 51 | "rawHeight": 216, 52 | "borderTop": 0, 53 | "borderBottom": 0, 54 | "borderLeft": 0, 55 | "borderRight": 0, 56 | "packable": true, 57 | "isUuid": true, 58 | "imageUuidOrDatabaseUri": "012105ed-a429-49b9-ba0e-9b0c27a741a3@6c48a", 59 | "atlasUuid": "" 60 | }, 61 | "ver": "1.0.9", 62 | "imported": true, 63 | "files": [ 64 | ".json" 65 | ], 66 | "subMetas": {} 67 | } 68 | }, 69 | "userData": { 70 | "type": "sprite-frame", 71 | "hasAlpha": true, 72 | "redirect": "012105ed-a429-49b9-ba0e-9b0c27a741a3@f9941" 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /assets/scene.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.32", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "d0c787e2-472a-4c1d-9b6e-83bd476ea719", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/scripts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "627b99f1-8b5f-4e0d-8a7e-70286745909c", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/scripts/AutoRotate.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, Node, Vec3, Quat } from 'cc'; 3 | const { ccclass, property } = _decorator; 4 | 5 | @ccclass('AutoRotate') 6 | export class AutoRotate extends Component { 7 | // [1] 8 | // dummy = ''; 9 | 10 | // [2] 11 | // @property 12 | // serializableDummy = 0; 13 | 14 | private euler: Vec3 = new Vec3(); 15 | private quat: Quat = new Quat(); 16 | private speed: number = 10; 17 | 18 | start () { 19 | // [3] 20 | } 21 | 22 | angleNormalize(x: number) { 23 | while(x >= 360) { x -= 360; } 24 | while(x < 0) { x += 360; } 25 | 26 | return x; 27 | } 28 | 29 | eulerNormalize(v: Vec3) { 30 | v.x = this.angleNormalize(v.x); 31 | v.y = this.angleNormalize(v.y); 32 | v.z = this.angleNormalize(v.z); 33 | } 34 | 35 | update (deltaTime: number) { 36 | this.euler.x += deltaTime * this.speed; 37 | this.euler.y += deltaTime * this.speed * 2; 38 | this.euler.z += deltaTime * this.speed * 3; 39 | this.eulerNormalize(this.euler); 40 | 41 | Quat.fromEuler(this.quat, this.euler.x, this.euler.y, this.euler.z) 42 | this.node.setRotation(this.quat); 43 | } 44 | } 45 | 46 | /** 47 | * [1] Class member could be defined like this. 48 | * [2] Use `property` decorator if your want the member to be serializable. 49 | * [3] Your initialization goes here. 50 | * [4] Your update function goes here. 51 | * 52 | * Learn more about scripting: https://docs.cocos.com/creator/3.0/manual/en/scripting/ 53 | * Learn more about CCClass: https://docs.cocos.com/creator/3.0/manual/en/scripting/ccclass.html 54 | * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.0/manual/en/scripting/life-cycle-callbacks.html 55 | */ 56 | -------------------------------------------------------------------------------- /assets/scripts/AutoRotate.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "9cd5db94-8253-4b06-b593-19a26b5130ff", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/scripts/CamCtl.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, Node, systemEvent, SystemEvent, EventKeyboard, KeyCode, Vec3, Touch, EventTouch, Quat } from 'cc'; 3 | const { ccclass, property } = _decorator; 4 | 5 | @ccclass('CamCtl') 6 | export class CamCtl extends Component { 7 | 8 | private euler: Vec3 = new Vec3(); 9 | private speed: Vec3 = new Vec3(); 10 | private distance: Vec3 = new Vec3(); 11 | 12 | start () { 13 | } 14 | 15 | onEnable () { 16 | systemEvent.on(SystemEvent.EventType.KEY_DOWN, this.onKeyDown, this); 17 | systemEvent.on(SystemEvent.EventType.KEY_UP, this.onKeyUp, this); 18 | systemEvent.on(SystemEvent.EventType.TOUCH_MOVE, this.onTouchMove, this); 19 | systemEvent.on(SystemEvent.EventType.TOUCH_MOVE, this.onTouchEnd, this); 20 | } 21 | 22 | onDisable () { 23 | systemEvent.off(SystemEvent.EventType.KEY_DOWN, this.onKeyDown, this); 24 | systemEvent.off(SystemEvent.EventType.KEY_UP, this.onKeyUp, this); 25 | systemEvent.off(SystemEvent.EventType.TOUCH_MOVE, this.onTouchMove, this); 26 | systemEvent.off(SystemEvent.EventType.TOUCH_MOVE, this.onTouchEnd, this); 27 | } 28 | 29 | handleSpeed(speed: number, initSpeed: number): number { 30 | if (0 == speed) { return initSpeed; } 31 | return speed * 1.1; 32 | } 33 | 34 | onKeyDown (event: EventKeyboard) { 35 | switch (event.keyCode) { 36 | case KeyCode.KEY_W: 37 | case KeyCode.ARROW_UP: { 38 | this.speed.z = this.handleSpeed(this.speed.z, -1); 39 | break; 40 | } 41 | case KeyCode.KEY_S: 42 | case KeyCode.ARROW_DOWN: { 43 | this.speed.z = this.handleSpeed(this.speed.z, 1); 44 | break; 45 | } 46 | case KeyCode.KEY_A: 47 | case KeyCode.ARROW_LEFT: { 48 | this.speed.x = this.handleSpeed(this.speed.x, -1); 49 | break; 50 | } 51 | case KeyCode.KEY_D: 52 | case KeyCode.ARROW_RIGHT: { 53 | this.speed.x = this.handleSpeed(this.speed.x, 1); 54 | break; 55 | } 56 | case KeyCode.KEY_Q: { 57 | this.speed.y = this.handleSpeed(this.speed.y, -1); 58 | break; 59 | } 60 | case KeyCode.KEY_E: { 61 | this.speed.y = this.handleSpeed(this.speed.y, 1); 62 | break; 63 | } 64 | } 65 | } 66 | 67 | onKeyUp (event: EventKeyboard) { 68 | this.speed.set(0, 0, 0); 69 | } 70 | 71 | onTouchMove (touch: Touch, event: EventTouch) { 72 | let dir = event.getDelta(); 73 | this.euler.x = dir.y / 10; 74 | this.euler.y = dir.x / 10; 75 | } 76 | 77 | onTouchEnd (touch: Touch, event: EventTouch) { 78 | this.euler.x = 0; 79 | this.euler.y = 0; 80 | this.euler.z = 0; 81 | } 82 | 83 | update (deltaTime: number) { 84 | Vec3.multiplyScalar(this.distance, this.speed, deltaTime); 85 | this.node.translate(this.distance); 86 | 87 | if (!Vec3.equals(Vec3.ZERO, this.euler)) { 88 | this.node.rotate(Quat.fromEuler(new Quat(), -this.euler.x, this.euler.y, this.euler.z)); 89 | } 90 | } 91 | 92 | } 93 | 94 | -------------------------------------------------------------------------------- /assets/scripts/CamCtl.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "19fb274d-aeeb-4cc9-af8f-14979fc3c87e", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/scripts/DebugCube.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, Node, Mesh, primitives, gfx, MeshRenderer, utils } from 'cc'; 3 | const { ccclass, property } = _decorator; 4 | 5 | @ccclass('DebugCube') 6 | export class DebugCube extends Component { 7 | // [1] 8 | // dummy = ''; 9 | 10 | // [2] 11 | // @property 12 | // serializableDummy = 0; 13 | 14 | start () { 15 | const mr = this.getComponent(MeshRenderer); 16 | const mesh = mr?.mesh; 17 | if (mr && mesh) { 18 | mesh.reset(this.genMesh()); 19 | mr.mesh = mesh; 20 | } else { 21 | console.log('mesh renderer is null'); 22 | } 23 | } 24 | 25 | // update (deltaTime: number) { 26 | // // [4] 27 | // } 28 | 29 | genMesh(): Mesh.ICreateInfo { 30 | let geo: primitives.IGeometry = { 31 | primitiveMode: gfx.PrimitiveMode.TRIANGLE_STRIP, 32 | positions: [ 33 | // front 34 | -1, 1, 1, 35 | -1, -1, 1, 36 | 1, -1, 1, 37 | 1, 1, 1, 38 | 39 | // back 40 | 1, 1, -1, 41 | 1, -1, -1, 42 | -1, -1, -1, 43 | -1, 1, -1, 44 | 45 | // right 46 | 1, 1, 1, 47 | 1, -1, 1, 48 | 1, -1, -1, 49 | 1, 1, -1, 50 | 51 | // left 52 | -1, 1, -1, 53 | -1, -1, -1, 54 | -1, -1, 1, 55 | -1, 1, 1, 56 | 57 | // top 58 | -1, 1, -1, 59 | -1, 1, 1, 60 | 1, 1, 1, 61 | 1, 1, -1, 62 | 63 | // bottom 64 | -1, -1, 1, 65 | -1, -1, -1, 66 | 1, -1, -1, 67 | 1, -1, 1, 68 | ], 69 | colors: [ 70 | 0, 0, 1, 1, 71 | 0, 0, 1, 1, 72 | 0, 0, 1, 1, 73 | 0, 0, 1, 1, 74 | 75 | 0.1, 0.1, 1, 1, 76 | 0.1, 0.1, 1, 1, 77 | 0.1, 0.1, 1, 1, 78 | 0.1, 0.1, 1, 1, 79 | 80 | 1, 0, 0, 1, 81 | 1, 0, 0, 1, 82 | 1, 0, 0, 1, 83 | 1, 0, 0, 1, 84 | 85 | 1, 0.1, 0.1, 1, 86 | 1, 0.1, 0.1, 1, 87 | 1, 0.1, 0.1, 1, 88 | 1, 0.1, 0.1, 1, 89 | 90 | 0, 1, 0, 1, 91 | 0, 1, 0, 1, 92 | 0, 1, 0, 1, 93 | 0, 1, 0, 1, 94 | 95 | 0.1, 1, 0.1, 1, 96 | 0.1, 1, 0.1, 1, 97 | 0.1, 1, 0.1, 1, 98 | 0.1, 1, 0.1, 1, 99 | 100 | ], 101 | normals: [ 102 | 0, 0, 1, 103 | 0, 0, 1, 104 | 0, 0, 1, 105 | 0, 0, 1, 106 | 0, 0, -1, 107 | 0, 0, -1, 108 | 0, 0, -1, 109 | 0, 0, -1, 110 | 1, 0, 0, 111 | 1, 0, 0, 112 | 1, 0, 0, 113 | 1, 0, 0, 114 | -1, 0, 0, 115 | -1, 0, 0, 116 | -1, 0, 0, 117 | -1, 0, 0, 118 | 0, 1, 0, 119 | 0, 1, 0, 120 | 0, 1, 0, 121 | 0, 1, 0, 122 | 0, -1, 0, 123 | 0, -1, 0, 124 | 0, -1, 0, 125 | 0, -1, 0, 126 | ], 127 | attributes: [ 128 | new gfx.Attribute(gfx.AttributeName.ATTR_POSITION, gfx.Format.RGB32F), 129 | new gfx.Attribute(gfx.AttributeName.ATTR_COLOR, gfx.Format.RGBA32F), 130 | new gfx.Attribute(gfx.AttributeName.ATTR_NORMAL, gfx.Format.RGB32F), 131 | ], 132 | indices: [ 133 | 0, 1, 2, 3, 0, 2, 134 | 4, 5, 6, 7, 4, 6, 135 | 8, 9, 10, 11, 8, 10, 136 | 12, 13, 14, 15, 12, 14, 137 | 16, 17, 18, 19, 16, 18, 138 | 20, 21, 22, 23, 20, 22 139 | ], 140 | }; 141 | 142 | return utils.createMesh(geo, undefined, { calculateBounds: false }); 143 | } 144 | } 145 | 146 | -------------------------------------------------------------------------------- /assets/scripts/DebugCube.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "2e6ab1ce-7133-4e54-9ec8-2fa6f2b70bbe", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/scripts/DragAndRotate.ts: -------------------------------------------------------------------------------- 1 | 2 | import { _decorator, Component, Node, systemEvent, SystemEvent, EventTouch, Touch, Quat, Vec2 } from 'cc'; 3 | const { ccclass, property } = _decorator; 4 | 5 | 6 | @ccclass('DragAndRotate') 7 | export class DragAndRotate extends Component { 8 | 9 | private quat: Quat = new Quat(); 10 | private delta: Vec2 = Vec2.ZERO; 11 | 12 | start () { 13 | } 14 | 15 | onEnable () { 16 | systemEvent.on(SystemEvent.EventType.TOUCH_START, this.onTouchStart, this); 17 | systemEvent.on(SystemEvent.EventType.TOUCH_MOVE, this.onTouchMove, this); 18 | systemEvent.on(SystemEvent.EventType.TOUCH_END, this.onTouchEnd, this); 19 | } 20 | 21 | onDisable () { 22 | systemEvent.off(SystemEvent.EventType.TOUCH_START, this.onTouchStart, this); 23 | systemEvent.off(SystemEvent.EventType.TOUCH_MOVE, this.onTouchMove, this); 24 | systemEvent.off(SystemEvent.EventType.TOUCH_END, this.onTouchEnd, this); 25 | } 26 | 27 | onTouchStart (touch: Touch, event: EventTouch) { 28 | this.delta = Vec2.ZERO; 29 | } 30 | 31 | onTouchMove (touch: Touch, event: EventTouch) { 32 | this.delta = touch.getUIDelta(); 33 | } 34 | 35 | onTouchEnd (touch: Touch, event: EventTouch) { 36 | this.delta = Vec2.ZERO; 37 | } 38 | 39 | update() { 40 | Quat.fromEuler(this.quat, -this.delta.y, this.delta.x, 0); 41 | this.node.rotate(this.quat, 1); 42 | } 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /assets/scripts/DragAndRotate.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "2301421d-bd56-4d3e-b26c-d10a99f10938", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/scripts/Utils.ts: -------------------------------------------------------------------------------- 1 | import { Mat3, Quat } from 'cc'; 2 | 3 | export class Utils { 4 | 5 | public static quat2Rot(quat: Quat): Mat3 { 6 | const qx = quat.x; 7 | const qy = quat.y; 8 | const qz = quat.z; 9 | const qw = quat.w; 10 | 11 | return new Mat3( 12 | 1 - 2*qy^2 - 2*qz^2, 2*qx*qy - 2*qz*qw, 2*qx*qz + 2*qy*qw, 13 | 2*qx*qy + 2*qz*qw, 1 - 2*qx^2 - 2*qz^2, 2*qy*qz - 2*qx*qw, 14 | 2*qx*qz - 2*qy*qw, 2*qy*qz + 2*qx*qw, 1 - 2*qx^2 - 2*qy^2); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /assets/scripts/Utils.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.22", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "6f7d7b81-da16-4add-a429-8cf9474cb451", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/textures.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "3bc78cb8-a71f-47fa-a640-2a907e232f36", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/textures/decal.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "aadab4d0-764f-46bd-9863-1702d3feeec5", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/textures/decal/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | decal-diffuse.png 2 | decal-normal.jpg 3 | 4 | Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication License: 5 | http://creativecommons.org/publicdomain/zero/1.0/ -------------------------------------------------------------------------------- /assets/textures/decal/LICENSE.TXT.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "importer": "text", 4 | "imported": true, 5 | "uuid": "9a050d9d-e569-4731-bf6d-710b4acf4134", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/textures/decal/decal-diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/textures/decal/decal-diffuse.png -------------------------------------------------------------------------------- /assets/textures/decal/decal-diffuse.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.21", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "7cc1916e-56f8-4f75-8106-a017237044d2", 6 | "files": [ 7 | ".png", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "7cc1916e-56f8-4f75-8106-a017237044d2@6c48a", 14 | "displayName": "decal-diffuse", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "repeat", 19 | "wrapModeT": "repeat", 20 | "minfilter": "linear", 21 | "magfilter": "linear", 22 | "mipfilter": "none", 23 | "anisotropy": 0, 24 | "isUuid": true, 25 | "imageUuidOrDatabaseUri": "7cc1916e-56f8-4f75-8106-a017237044d2" 26 | }, 27 | "ver": "1.0.21", 28 | "imported": true, 29 | "files": [ 30 | ".json" 31 | ], 32 | "subMetas": {} 33 | } 34 | }, 35 | "userData": { 36 | "hasAlpha": true, 37 | "type": "texture", 38 | "redirect": "7cc1916e-56f8-4f75-8106-a017237044d2@6c48a" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /assets/textures/decal/decal-normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/textures/decal/decal-normal.jpg -------------------------------------------------------------------------------- /assets/textures/decal/decal-normal.jpg.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.21", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "66cdbeec-33c8-4cad-971c-9aa755df25cd", 6 | "files": [ 7 | ".jpg", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "66cdbeec-33c8-4cad-971c-9aa755df25cd@6c48a", 14 | "displayName": "decal-normal", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "repeat", 19 | "wrapModeT": "repeat", 20 | "minfilter": "linear", 21 | "magfilter": "linear", 22 | "mipfilter": "none", 23 | "anisotropy": 0, 24 | "isUuid": true, 25 | "imageUuidOrDatabaseUri": "66cdbeec-33c8-4cad-971c-9aa755df25cd" 26 | }, 27 | "ver": "1.0.21", 28 | "imported": true, 29 | "files": [ 30 | ".json" 31 | ], 32 | "subMetas": {} 33 | } 34 | }, 35 | "userData": { 36 | "hasAlpha": false, 37 | "type": "texture", 38 | "redirect": "66cdbeec-33c8-4cad-971c-9aa755df25cd@6c48a" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /assets/textures/noise2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/textures/noise2.png -------------------------------------------------------------------------------- /assets/textures/noise2.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.21", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "d92ac11e-4008-427d-9377-4efffa989d82", 6 | "files": [ 7 | ".png", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "d92ac11e-4008-427d-9377-4efffa989d82@6c48a", 14 | "displayName": "noise2", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "repeat", 19 | "wrapModeT": "repeat", 20 | "minfilter": "linear", 21 | "magfilter": "linear", 22 | "mipfilter": "none", 23 | "anisotropy": 0, 24 | "isUuid": true, 25 | "imageUuidOrDatabaseUri": "d92ac11e-4008-427d-9377-4efffa989d82" 26 | }, 27 | "ver": "1.0.21", 28 | "imported": true, 29 | "files": [ 30 | ".json" 31 | ], 32 | "subMetas": {} 33 | } 34 | }, 35 | "userData": { 36 | "hasAlpha": true, 37 | "type": "texture", 38 | "redirect": "d92ac11e-4008-427d-9377-4efffa989d82@6c48a" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /assets/textures/noise_snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/assets/textures/noise_snow.png -------------------------------------------------------------------------------- /assets/textures/noise_snow.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.21", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "56a2a6b4-7b20-485a-9496-321bc2d7da85", 6 | "files": [ 7 | ".png", 8 | ".json" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "56a2a6b4-7b20-485a-9496-321bc2d7da85@6c48a", 14 | "displayName": "noise_snow", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "repeat", 19 | "wrapModeT": "repeat", 20 | "minfilter": "linear", 21 | "magfilter": "linear", 22 | "mipfilter": "none", 23 | "anisotropy": 0, 24 | "isUuid": true, 25 | "imageUuidOrDatabaseUri": "56a2a6b4-7b20-485a-9496-321bc2d7da85" 26 | }, 27 | "ver": "1.0.21", 28 | "imported": true, 29 | "files": [ 30 | ".json" 31 | ], 32 | "subMetas": {} 33 | } 34 | }, 35 | "userData": { 36 | "hasAlpha": true, 37 | "type": "texture", 38 | "redirect": "56a2a6b4-7b20-485a-9496-321bc2d7da85@6c48a" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /doc/images/bloom1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/doc/images/bloom1.png -------------------------------------------------------------------------------- /doc/images/bloom2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/doc/images/bloom2.gif -------------------------------------------------------------------------------- /doc/images/bloom2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/doc/images/bloom2.png -------------------------------------------------------------------------------- /doc/images/decal.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/doc/images/decal.gif -------------------------------------------------------------------------------- /doc/images/dissolve1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/doc/images/dissolve1.gif -------------------------------------------------------------------------------- /doc/images/outline1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/doc/images/outline1.jpg -------------------------------------------------------------------------------- /doc/images/outline2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/doc/images/outline2.jpg -------------------------------------------------------------------------------- /doc/images/rainOnWindow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hugohuang1111/fxcase/d509af3488041bc528c6019ace733f28cdc24324/doc/images/rainOnWindow.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "creator": { 3 | "version": "3.3.1" 4 | }, 5 | "name": "shadercase", 6 | "type": "3d", 7 | "uuid": "fd1b0173-606d-4fcd-80ba-d788952d8581", 8 | "version": "3.3.1" 9 | } 10 | -------------------------------------------------------------------------------- /settings/v2/packages/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.2.9" 3 | } 4 | -------------------------------------------------------------------------------- /settings/v2/packages/cocos-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "game": { 3 | "name": "UNKNOW GAME", 4 | "app_id": "UNKNOW", 5 | "c_id": "0" 6 | }, 7 | "appConfigMaps": [ 8 | { 9 | "app_id": "UNKNOW", 10 | "config_id": "5b4b6f" 11 | } 12 | ], 13 | "configs": [ 14 | { 15 | "app_id": "UNKNOW", 16 | "config_id": "5b4b6f", 17 | "config_name": "Default", 18 | "config_remarks": "", 19 | "services": [] 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /settings/v2/packages/device.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.1" 3 | } 4 | -------------------------------------------------------------------------------- /settings/v2/packages/engine.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.5" 3 | } 4 | -------------------------------------------------------------------------------- /settings/v2/packages/program.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.0" 3 | } 4 | -------------------------------------------------------------------------------- /settings/v2/packages/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.1", 3 | "general": { 4 | "renderPipeline": "fd8ec536-a354-4a17-9c74-4f3883c378c8" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | /* Base configuration. Do not edit this field. */ 3 | "extends": "./temp/tsconfig.cocos.json" 4 | 5 | /* Add your custom configuration here. */ 6 | } 7 | --------------------------------------------------------------------------------