Minimog Posted November 15, 2020 Share Posted November 15, 2020 I am working on a game view that has overlay modal with scrollable container (Parent container with mask and content container with y transforms on scroll). In general everything works fine, but I notice my phone heating up sometimes when scrolling this view for a while. I am not using any expensive things like antialiasing, however my stage devicePixelRatio is set at 3 (for iphone xs display). I assume that with every scroll my whole view is being re-rendered, hence causing this heating up? I was wondering if pixi has a mechanism to separate this scroll container onto a separate layer of some sort and not re-render anything else? The only solution I can come up with atm is to use second pixi stage on a separate canvas perhaps, but wanted to check here first just in case there is a more elegant solution. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 15, 2020 Share Posted November 15, 2020 (edited) yes. but there's no special thing that tracks whether that layer was changed and has to be recalculated. there's only middle-level stuff: renderTextures, filters. I made automatical caching for filtered/scrolled/masked containers in my app, but it took A LOT of me. its really hard to track all changes without performance loss or bugs Edited November 15, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
Minimog Posted November 16, 2020 Author Share Posted November 16, 2020 I see, can I ask how you skip recalculation / render on on your elements when you determine that they are not needed? I assume you mark each element as either dirty or not and based in that flag do something to either re-render them or skip? Quote Link to comment Share on other sites More sharing options...
Exca Posted November 16, 2020 Share Posted November 16, 2020 (edited) You have basically two options. 1. Render the expensive stuff into a separate rendertexture and use that as you would any other sprite. Rerender the rt when things change. 2. Use two canvases. Update the expensive canvas only when needed. [Edit] For 1 you can use cacheAsBitmap = true to create rt of a container and use that instead of the whole render list. Though I'd suggest using a custom handling with own RT to handle this as debugging cacheAsBitmap can be a nightmare if there's some errors. Edited November 16, 2020 by Exca 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.