Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance: Reduce the number of PIXI.Graphics objects to a minimum #115

Open
flekschas opened this issue Feb 24, 2020 · 0 comments
Open
Labels
improvement A feature improvement

Comments

@flekschas
Copy link
Owner

The more PIXI.Graphics objects we use the worse our performance gets. So let's reduce the number of graphics objects!

Some easy ones that can be removed:

  1. image-with-background.js doesn't need a dedicated graphics object for the background. Let's instead create a 1x1 texture for each background color and use scaled sprites as the background.
  2. pile.js might not need contentGraphics at all. We should be able to just replace it with a container.
  3. pile.js similar to 1, borderGraphics should be replaced by scaled PIXI.Sprite objects that are instantiated from fixed 1x1 textures. (One texture per color)

Even better would be to replace 1 and 3 with custom meshes. Alternatively, this might also work: https://pixijs.io/pixi-filters/docs/outline_src_OutlineFilter.js.html

@flekschas flekschas added the improvement A feature improvement label Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement A feature improvement
Projects
None yet
Development

No branches or pull requests

1 participant