mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
fix light ubo not bind after build process (#4156)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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[] = [];
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user