diff --git a/cocos/3d/framework/batched-skinning-model-component.ts b/cocos/3d/framework/batched-skinning-model-component.ts index 10d406b917..7bba742b16 100644 --- a/cocos/3d/framework/batched-skinning-model-component.ts +++ b/cocos/3d/framework/batched-skinning-model-component.ts @@ -172,9 +172,11 @@ export class BatchedSkinningModelComponent extends SkinningModelComponent { public cookMaterials () { const mat = this.getMaterial(0); - if (!mat) { console.warn('batch material not specified!'); return; } - mat.copy(this._batchMaterial!); this.resizeAtlases(); - const tech = mat.effectAsset!.techniques[mat.technique]; + if (!mat || !this._batchMaterial || !mat.effectAsset) { + console.warn('incomplete batch material!'); return; + } + mat.copy(this._batchMaterial); this.resizeAtlases(); + const tech = mat.effectAsset.techniques[mat.technique]; for (let i = 0; i < tech.passes.length; i++) { const pass = tech.passes[i]; if (!pass.properties) { continue; } diff --git a/cocos/pipeline/define.ts b/cocos/pipeline/define.ts index 12e81e6e24..897a335dfa 100644 --- a/cocos/pipeline/define.ts +++ b/cocos/pipeline/define.ts @@ -76,8 +76,14 @@ export enum UniformBinding { UBO_SKINNING = MAX_BINDING_SUPPORTED - 5, UBO_SKINNING_TEXTURE = MAX_BINDING_SUPPORTED - 6, UBO_UI = MAX_BINDING_SUPPORTED - 7, + // samplers SAMPLER_JOINTS = MAX_BINDING_SUPPORTED + 1, + + // rooms left for custom bindings + // effect importer prepares bindings according to this + CUSTUM_UBO_BINDING_END_POINT = MAX_BINDING_SUPPORTED - 7, + CUSTOM_SAMPLER_BINDING_START_POINT = MAX_BINDING_SUPPORTED + 6, } /**