Merge pull request #6462 from EmilSV/particle-render-fix

fixed particle using a white texture if flush happened
This commit is contained in:
Richard Davey 2023-04-12 01:54:43 +01:00 committed by GitHub
commit 1c6e0c81d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,7 @@ var ParticleEmitterWebGLRenderer = function (renderer, emitter, camera, parentMa
var getTint = Utils.getTintAppendFloatAlpha;
var camerAlpha = camera.alpha;
var emitterAlpha = emitter.alpha;
var texture = emitter.texture.glTexture;
var texture = emitter.frame.glTexture;
renderer.pipelines.preBatch(emitter);
@ -118,6 +118,12 @@ var ParticleEmitterWebGLRenderer = function (renderer, emitter, camera, parentMa
var quad = calcMatrix.setQuad(x, y, x + frame.width, y + frame.height, roundPixels);
var tint = getTint(particle.tint, alpha);
if (pipeline.shouldFlush(6))
{
pipeline.flush();
textureUnit = pipeline.setGameObject(emitter, emitter.frame);
}
pipeline.batchQuad(emitter, quad[0], quad[1], quad[2], quad[3], quad[4], quad[5], quad[6], quad[7], frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, texture, textureUnit);
}