|
@@ -1731,16 +1731,15 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
|
|
|
|
|
|
// Material
|
|
|
if (!instanceDataStorage.isFrozen || !this._effectiveMaterial || this._effectiveMaterial !== material) {
|
|
|
-
|
|
|
- this._effectiveMaterial = material;
|
|
|
-
|
|
|
- if (this._effectiveMaterial._storeEffectOnSubMeshes) {
|
|
|
- if (!this._effectiveMaterial.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) {
|
|
|
+ if (material._storeEffectOnSubMeshes) {
|
|
|
+ if (!material.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) {
|
|
|
return this;
|
|
|
}
|
|
|
- } else if (!this._effectiveMaterial.isReady(this, hardwareInstancedRendering)) {
|
|
|
+ } else if (!material.isReady(this, hardwareInstancedRendering)) {
|
|
|
return this;
|
|
|
}
|
|
|
+
|
|
|
+ this._effectiveMaterial = material;
|
|
|
}
|
|
|
|
|
|
// Alpha mode
|