[BUG] ParticleContainer can only be renderered in one renderer
See original GitHub issueI am using double buffering and i render a particleContainer once in a renderer, once in another renderer. The particleContainer is always correctly displayed in the first renderer and always invisble in second renderer. This can be seen in this demo. You just have to translate or zoom the map to see that the markers are displayed, invisible, displayed, invisible,…
If i patch ParticleContainer.prototype.renderWebGL
this way:
PIXI.particles.ParticleContainer.prototype.renderWebGL = function(renderer) {
if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable)
{
return;
}
if (!this.baseTexture)
{
this.baseTexture = this.children[0]._texture.baseTexture;
}
// patch begin
this.onChildrenChange(0);
// if (!this.baseTexture.hasLoaded)
// {
// this.baseTexture.once('update', () => this.onChildrenChange(0));
// }
// patch end
renderer.setObjectRenderer(renderer.plugins.particle);
renderer.plugins.particle.render(this);
};
the problem disappears like in this demo. Apparently, the texture is not usable in second renderer and needs to be uploaded. I’m not very happy with this solution. Do you think another approach is possible?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
[BUG] ParticleContainer can only be renderered in one renderer
The particleContainer is always correctly displayed in the first renderer and always invisble in second renderer. This can be seen in this demo....
Read more >PIXI.ParticleContainer - PixiJS API Documentation
IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. Default Value: 0xFFFFFF. Methods. destroy (options) ...
Read more >How to use PIXI.Graphic when using new PIXI.particles ...
In Canvas, when you use PIXI.Container to hold PIXI.Graphics , it will loop through all its Graphics object children and call CanvasGraphicsRenderer to...
Read more >new PIXI.particles.ParticleContainer (maxSize, properties ...
The ParticleContainer class is a really fast version of the Container built ... This is a webGL only feature and will be ignored...
Read more >Weird behavior of PIXI.particles.ParticleContainer, no children ...
If in canvas Container's performance for rendering thousands of sprites is not that different with ParticleContainer I will just use Container.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please try this one and confirm that it works: http://pixijs.download/dev-particle-two-renderers/pixi.js It takes a couple of minutes to build from a branch.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.