aweston5 Posted February 1, 2016 Share Posted February 1, 2016 Is there a way to have Pixi only redraw as needed? For example, in the RenderTexture sample, the GPU is at 20% but nothing is moving.http://pixijs.github.io/examples/index.html?s=basics&f=render-texture.js Can I tell items not to redraw if they are idle? Or how can I implement a "needsUpdate" flag? In my app, the screen does not change frequently, and it sits idle on a big screen for long periods of time. Over time the machine heats up and the fan kicks in with the GPU so high, in my case over 50%. I have looked at the requestAnimationFrame loop, and I need this because I do want to animate sometimes ... just wondering where can I hook in to Pixi to improve this. Thanks --Andy Quote Link to comment Share on other sites More sharing options...
xerver Posted February 1, 2016 Share Posted February 1, 2016 PIXI only draws when you tell it to. When you call .render(), if you don't want it to draw don't call .render(). If you use a render texture, and you don't want it to update. Don't call render() on it. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 1, 2016 Share Posted February 1, 2016 Separate game into front and back canvases, redraw back with CanvasRenderer only if scrolling happened. I did it for https://github.com/ivanpopelyshev/railways , and it works good on mobiles. dmko 1 Quote Link to comment Share on other sites More sharing options...
aweston5 Posted February 2, 2016 Author Share Posted February 2, 2016 Ok, thanks for the replies, I see now that render(stage) does everything, so I'll need to break that up and only render what is needed. I do have a background stage area that I can separate out into a layer too. Quote Link to comment Share on other sites More sharing options...
Megabyte Posted September 7, 2017 Share Posted September 7, 2017 I just pass throught same question, in pixi4 its necessary to call .stop() method to disable auto rendering firstly. Quote Link to comment Share on other sites More sharing options...
xerver Posted September 7, 2017 Share Posted September 7, 2017 11 minutes ago, Megabyte said: I just pass throught same question, in pixi4 its necessary to call .stop() method to disable auto rendering firstly. I assume you mean if you are using PIXI.Application. You can also pass { autoStart: false } to prevent it from starting the internal ticker. OSUblake and dmko 2 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.