toowren Posted October 12, 2022 Share Posted October 12, 2022 (edited) There are two sprites, one is dynamic and second have to be constantly updated with first one through PIXI.RenderTexture() let sprite = new PIXI.Sprite(), tmp = new PIXI.Sprite(); //some manimulations with these sprites app.ticker.add((delta_) => { ... updateTexture(w, h); //width is dynamic value ... }) Here is updateTexture() function function updateTexture(w_, h_){ let renderTexture = PIXI.RenderTexture.create({ width: w_, height: h_}); tmp.texture = sprite.texture; app.renderer.render(tmp, renderTexture); app.renderer.clear(); placeholder_.texture = renderTexture; placeholder_.texture.update(); } And it seems that let renderTexture = PIXI.RenderTexture.create({ width: w_, height: h_}); creates a new instance in memory dumping it every time up to browser crash. app.renderer.clear() doesn't helps. Any ideas? Edited October 13, 2022 by toowren Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 20, 2022 Share Posted October 20, 2022 You create renderTexture and not destroying it afterwards. Its pure webgl-side texture, pixi cant know that you dont use it anymore, please destroy it. Or dont destroy if size is the same. Quote Link to comment Share on other sites More sharing options...
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.