These are chat archives for pixijs/pixi.js

16th
Sep 2016
Daniel
@bitbay
Sep 16 2016 07:24
hello devs, i have a project using pixi v3, and by switching to v4 (with a few minor issues, like the non-existen PIXI.filters.GrayFilter) i noticed elevated memory consumption. On v3 my app uses like 9.2-13.5 MB, but after updating to v4 i see 11.7-15.6 MB.
Sincerely, i was hoping quite the opposite... do i have to do some pixi-setup-magic as well apart from just switching the pixi library? Or is this to be expected?
Ivan Popelyshev
@ivanpopelyshev
Sep 16 2016 09:12
People say that GrayFilter can be emulated with ColorMatrixFilter
memory consumption raised because filters are using power-of-two textures
they take some extra memory for that, trading it for performance
Daniel
@bitbay
Sep 16 2016 10:26
@ivanpopelyshev thanks for the answer. I'm not convinced about the power of two texture argument, since apart from the (now deactivated) GrayFilter i don´t use other in the code i was talking about. But maybe i'll take some time and look more into it. The promised "lower memory consumption" of v4 would definitely come in handy on older ios devices - where the app v3 currently crashes at a certain point (i suspect because of low memory)
Ivan Popelyshev
@ivanpopelyshev
Sep 16 2016 12:10
I don't think of other places where pixi takes more memory. If you use webglrenderer, you can always do the following trick: 1. load your textures with PIXI.loader 2. update all base textures with "renderer.textureManager.updateTexture(tex)" 3. remove original source from them: "baseTexture.source.src=''"
that way texture will be preserved only in videomemory
2x less memory consumption for textures
that trick works both for v3 and v4, though in v3 second part is "renderer.updateTexture(tex)"