mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 09:32:38 +08:00
seperate sampler bindings (#4654)
This commit is contained in:
committed by
Weiliang Wang
parent
780fa06f6b
commit
01d25588e7
@@ -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; }
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user