Sign in to follow this  
Koroldev

Particles dispose

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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().

Share this post


Link to post
Share on other sites
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! B)

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.