Proton icon indicating copy to clipboard operation
Proton copied to clipboard

Updated PixiRenderer to v8

Open rafucuk opened this issue 9 months ago • 10 comments

This is an early prototype, please use with caution.

rafucuk avatar Mar 07 '25 14:03 rafucuk

I am planning to use ParticleContainer

rafucuk avatar Mar 08 '25 20:03 rafucuk

added "particlecontainer" to usage added batching and texturecaching for optimizing

rafucuk avatar Mar 14 '25 01:03 rafucuk

Oh, thank you very much. merge it later. a bit busy now.

drawcall avatar Mar 14 '25 03:03 drawcall

I readded batching and caching and particlecontainer, it lags at around 50k particles, needs optimizing.

rafucuk avatar Mar 14 '25 13:03 rafucuk

I will reopen this PR from draft when I done with optimizations. I believe we can get more performance with more particles.

rafucuk avatar Mar 14 '25 13:03 rafucuk

critical issue;

colors (and probably other behaviours too) uses old pooled particles too when using default particles, will fix soon

rafucuk avatar Mar 14 '25 19:03 rafucuk

I fixed the issue with using EmitterAwarePool;

Store Emitter ID during the "onParticleCreated" method and store emitter ID directly on particle "particle.__emitterId" Check null parents, particle.parent might be null Fallback to "orphaned", if a particle somehow loses its parent reference and doesnt have a stored emitter ID, added "orphaned" so code doesn't crash

rafucuk avatar Mar 14 '25 21:03 rafucuk

Currently added features;

Added new renderer options

    this.options = {
      useParticleContainer: true,
      autoResize: true,
      scale: 1,
      maxParticles: 10000,
      properties: {
        position: true,
        rotation: true,
        scale: true,
        uvs: true,
        alpha: true
      },
      ...options
    };

Now uses particle containers as default, Particles are now texture-based, Automatically routes particles to the appropriate container based on their type, Automatically converts circle graphics to texture-based sprites when ParticleContainer is enabled.

Maintains compatibility with v7 by defaulting original behavior (WIP, not intended to work well) Rebuilds containers when needed

Added thorough cleanup for all resources (textures, containers) More robust parent-child relationship handling during removal

Improved error checking throughout the code

rafucuk avatar Mar 14 '25 21:03 rafucuk

I rewrote the whole code to figure-out whats wrong with emitters using old/deleted particles, I fixed it (magic idk how), and I tried to add full backwards comp. Will try to add performance fixes later but currently this handles particles well, but as always can be better

rafucuk avatar Mar 14 '25 21:03 rafucuk

Oh, I've been quite busy lately, so I may not be able to respond to you immediately.

drawcall avatar Mar 16 '25 04:03 drawcall