mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-06 11:31:59 +08:00
e8366a7a7b
* manually merge bloom, fg culling, native pipeline updates * fix lint * camera usage added * use parent name instead of default & add some phase names * adding render graph execution * execute render graph added * refactoring workflow * uses interface instead of abstract class * add setup step * camera usage added * adding setup stage * unify camera get set * adding ppl setup * fixed bloom effect * change descriptor merge * modify uniform collect as descriptor * revert * revert phase * adding render callback * update setup workflow * pipeline builder updated * refactoring native pipeline setup * revert jsb * improve cameraList clear Co-authored-by: zxx43 <zxx43@hotmail.com> Co-authored-by: qiuguohua <>
53 lines
2.2 KiB
TypeScript
53 lines
2.2 KiB
TypeScript
/*
|
|
Copyright (c) 2021-2022 Xiamen Yaji Software Co., Ltd.
|
|
|
|
https://www.cocos.com/
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated engine source code (the "Software"), a limited,
|
|
worldwide, royalty-free, non-assignable, revocable and non-exclusive license
|
|
to use Cocos Creator solely to develop games on your target platforms. You shall
|
|
not use Cocos Creator software for developing other software or tools that's
|
|
used for developing games. You are not granted to publish, distribute,
|
|
sublicense, and/or sell copies of Cocos Creator.
|
|
|
|
The software or tools in this License Agreement are licensed, not sold.
|
|
Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
*/
|
|
|
|
import { Pipeline, PipelineBuilder } from './pipeline';
|
|
import { WebPipeline } from './web-pipeline';
|
|
import { buildDeferredLayout, buildForwardLayout } from './effect';
|
|
import { macro } from '../../core/platform/macro';
|
|
import { DeferredPipelineBuilder, ForwardPipelineBuilder } from './builtin-pipelines';
|
|
import { CustomPipelineBuilder } from './custom-pipeline';
|
|
|
|
let _pipeline: WebPipeline | null = null;
|
|
|
|
export function createCustomPipeline (): Pipeline {
|
|
const ppl = new WebPipeline();
|
|
const pplName = macro.CUSTOM_PIPELINE_NAME;
|
|
ppl.setCustomPipelineName(pplName);
|
|
if (ppl.usesDeferredPipeline) {
|
|
buildDeferredLayout(ppl);
|
|
} else {
|
|
buildForwardLayout(ppl);
|
|
}
|
|
_pipeline = ppl;
|
|
return ppl;
|
|
}
|
|
|
|
export function addCustomBuiltinPipelines (map: Map<string, PipelineBuilder>) {
|
|
map.set('Forward', new ForwardPipelineBuilder());
|
|
map.set('Deferred', new DeferredPipelineBuilder());
|
|
map.set('Custom', new CustomPipelineBuilder());
|
|
}
|