modify flows in view (#4078)

This commit is contained in:
zxg0622
2019-03-21 16:55:27 +08:00
committed by Weiliang Wang
parent b8a53dac3d
commit 986e4c5f64
4 changed files with 18 additions and 17 deletions
@@ -129,7 +129,7 @@ export class EditorCameraComponent extends CameraComponent {
targetDisplay: this._targetDisplay,
priority: this._priority,
isUI: true,
stages: ['UIFlow'],
flows: ['UIFlow'],
});
this._uiEditorCamera!.viewport = this._camera.viewport;
this._uiEditorCamera!.fov = this._camera.fov;
+2 -4
View File
@@ -190,10 +190,8 @@ export abstract class RenderPipeline {
this.updateUBOs(view);
for (const flow of this._flows) {
if (view.stages.indexOf(flow.name) !== -1) {
flow.render(view);
}
for (const flow of view.flows) {
flow.render(view);
}
}
+13 -10
View File
@@ -6,6 +6,7 @@ import { GFXTexture } from '../gfx/texture';
import { GFXTextureView } from '../gfx/texture-view';
import { GFXWindow } from '../gfx/window';
import { Camera } from '../renderer/scene/camera';
import { RenderFlow } from './render-flow';
export enum RenderViewPriority {
GENERAL = 100,
@@ -16,7 +17,7 @@ export interface IRenderViewInfo {
name: string;
priority: number;
isUI: boolean;
stages?: string[];
flows?: string[];
}
export interface IRenderTargetInfo {
@@ -72,8 +73,8 @@ export class RenderView {
return this._isUI;
}
public get stages (): string[] {
return this._stages;
public get flows (): RenderFlow[] {
return this._flows;
}
public set isOffscreen (isOffscreen: boolean) {
@@ -100,7 +101,7 @@ export class RenderView {
private _camera: Camera;
private _isEnable: boolean = true;
private _isUI: boolean = false;
private _stages: string[] = [];
private _flows: RenderFlow[] = [];
private _isOffscreen: boolean = false;
// For offscreen
@@ -121,12 +122,14 @@ export class RenderView {
this._name = info.name;
this._isUI = info.isUI;
this.priority = info.priority;
if (info.stages) {
this._stages.push(...info.stages);
} else {
this._stages.push('ForwardFlow');
this._stages.push('ToneMapFlow');
this._stages.push('SMAAFlow');
if (!info.flows) {
info.flows = ['ForwardFlow', 'ToneMapFlow', 'SMAAFlow'];
}
const pipelineFlows = cc.director.root.pipeline.flows;
for (const f of pipelineFlows) {
if (info.flows.indexOf(f.name) !== -1) {
this.flows.push(f);
}
}
return true;
+2 -2
View File
@@ -73,7 +73,7 @@ export interface ICameraInfo {
priority: number;
pipeline?: string;
isUI?: boolean;
stages?: string[];
flows?: string[];
}
const v_a = cc.v3();
@@ -139,7 +139,7 @@ export class Camera {
name: this._name,
priority: this._priority,
isUI,
stages: info.stages,
flows: info.flows,
});
this.changeTargetDisplay(info.targetDisplay);