Koroldev 7 Posted February 16, 2018 Report Share Posted February 16, 2018 Hi! Have some problem, I create many particles systems in my game and very often delete them after first playing, but if I using the same texture in particle systems, then after first disposing of particle system the texture disposing too. And I should to cloning each one new texture, but it is bad for performance. How I can to create a particles systems with same texture but after disposing particles system do not dispose texture? Thanks! Quote Link to post Share on other sites
aWeirdo 339 Posted February 16, 2018 Report Share Posted February 16, 2018 Hi @negrant You could as you also mentioned clone the texture, Another option is to create your own dispose function, copy/paste the particleSystem.prototype.dispose function from core babylon.js file and remove the part which dispose the texture. A third option would be to not dispose them, keep the particleSystems in an array, simply stop() the particleSystems when they should end, and reuse, re-position/etc, and start(). Koroldev 1 Quote Link to post Share on other sites
Deltakosh 4315 Posted February 16, 2018 Report Share Posted February 16, 2018 We can also think about updating the dispose function of the particle system to add a boolean to let the system knows that you don't want the texture to be disposed Koroldev 1 Quote Link to post Share on other sites
Koroldev 7 Posted February 18, 2018 Author Report Share Posted February 18, 2018 On 17.02.2018 at 12:19 AM, Deltakosh said: We can also think about updating the dispose function of the particle system to add a boolean to let the system knows that you don't want the texture to be disposed It would be cool! Quote Link to post Share on other sites
Deltakosh 4315 Posted February 20, 2018 Report Share Posted February 20, 2018 I'm on it Will be done for next commit! Koroldev and Wingnut 2 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.