Improve material hash id update and compare

This commit is contained in:
pandamicro
2018-03-21 16:39:31 +08:00
parent 10f56b59bd
commit 9f4a67a6f1
22 changed files with 152 additions and 172 deletions
+3 -1
View File
@@ -1326,10 +1326,12 @@ var ParticleSystem = cc.Class({
// Get material
if (!this._material) {
this._material = new ParticleMaterial();
// Particle System cannot be batched, so every one use a unique hash id
this._material.updateHash(this.__instanceId);
}
let vfx = this._vfx;
this._material.texture = this._texture.getImpl();
this._material.texture = this._texture;
this._material.stateMap = this._vfx.textures.state0;
this._material.quadMap = this._vfx.textures.quads;
this._material.z = this.node.z;