fix light ubo not bind after build process (#4156)

This commit is contained in:
zxg0622
2019-04-07 16:03:15 +08:00
committed by Weiliang Wang
parent 5936b42393
commit e237afe0a1
3 changed files with 8 additions and 1 deletions
@@ -56,6 +56,8 @@ export class ForwardPipeline extends RenderPipeline {
return false;
}
this._name = 'ForwardPipeline';
if (!this._globalBindings.get(UBOForwardLight.BLOCK.name)) {
const lightsUBO = this._root.device.createBuffer({
usage: GFXBufferUsageBit.UNIFORM | GFXBufferUsageBit.TRANSFER_DST,
+5
View File
@@ -51,6 +51,10 @@ export abstract class RenderPipeline {
return this._device;
}
public get name (): string {
return this._name;
}
public get renderObjects (): IRenderObject[] {
return this._renderObjects;
}
@@ -157,6 +161,7 @@ export abstract class RenderPipeline {
protected _root: Root;
protected _device: GFXDevice;
protected _name: string = 'BasePipeline';
protected _renderObjects: IRenderObject[] = [];
protected _renderPasses: Map<number, GFXRenderPass> = new Map();
protected _flows: RenderFlow[] = [];
+1 -1
View File
@@ -323,7 +323,7 @@ export class Model {
break;
}
}
if (hasForwardLight && cc.director.root.pipeline.constructor.name === 'ForwardPipeline') {
if (hasForwardLight && cc.director.root.pipeline.name === 'ForwardPipeline') {
if (!this._localBindings.has(UBOForwardLight.BLOCK.name)) {
this._localBindings.set(UBOForwardLight.BLOCK.name, {
type: GFXBindingType.UNIFORM_BUFFER,