Skip to content

Commit eceb435

Browse files
committed
Fixed issue on particle emitter rendering not writing directly to the vertex count property
1 parent 89c9da5 commit eceb435

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

src/renderer/webgl/pipelines/TextureTintPipeline.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ var TextureTintPipeline = new Class({
401401
var vertexCapacity = this.vertexCapacity;
402402
var texture = emitterManager.defaultFrame.source.glTexture;
403403
var pca, pcb, pcc, pcd, pce, pcf;
404-
var vertexCount = this.vertexCount;
405404

406405
if (parentMatrix)
407406
{
@@ -446,12 +445,10 @@ var TextureTintPipeline = new Class({
446445

447446
renderer.setBlendMode(emitter.blendMode);
448447

449-
if (vertexCount >= vertexCapacity)
448+
if (this.vertexCount >= vertexCapacity)
450449
{
451-
this.vertexCount = vertexCount;
452450
this.flush();
453451
this.setTexture2D(texture, 0);
454-
vertexCount = 0;
455452
}
456453

457454
for (var batchIndex = 0; batchIndex < batchCount; ++batchIndex)
@@ -496,7 +493,7 @@ var TextureTintPipeline = new Class({
496493
var ty2 = xw * mvb + yh * mvd + mvf;
497494
var tx3 = xw * mva + y * mvc + mve;
498495
var ty3 = xw * mvb + y * mvd + mvf;
499-
var vertexOffset = vertexCount * vertexComponentCount;
496+
var vertexOffset = this.vertexCount * vertexComponentCount;
500497

501498
if (roundPixels)
502499
{
@@ -541,31 +538,27 @@ var TextureTintPipeline = new Class({
541538
vertexViewF32[vertexOffset + 28] = uvs.y3;
542539
vertexViewU32[vertexOffset + 29] = color;
543540

544-
vertexCount += 6;
541+
this.vertexCount += 6;
545542

546-
if (vertexCount >= vertexCapacity)
543+
if (this.vertexCount >= vertexCapacity)
547544
{
548-
this.vertexCount = vertexCount;
549545
this.flush();
550-
vertexCount = 0;
546+
this.setTexture2D(texture, 0);
551547
}
552548

553549
}
554550

555551
particleOffset += batchSize;
556552
aliveLength -= batchSize;
557553

558-
if (vertexCount >= vertexCapacity)
554+
if (this.vertexCount >= vertexCapacity)
559555
{
560-
this.vertexCount = vertexCount;
561556
this.flush();
562557
this.setTexture2D(texture, 0);
563-
vertexCount = 0;
564558
}
565559
}
566560
}
567561

568-
this.vertexCount = vertexCount;
569562
this.setTexture2D(texture, 0);
570563
},
571564

0 commit comments

Comments
 (0)