Dan335 Posted May 2, 2017 Share Posted May 2, 2017 I'm using 4 layers of fullscreen TilingSprites for a background. Performance on laptops is bad. Each frame I'm setting the tilePosition. Any suggestions on how to get better performance and have the same parallax background? Can the TilingSprite code be simplified somehow? http://astroe.io is the game. I tried using CSS and a transparent renderer but performance wasn't much better. If I take out the tilingSprites performance is great but I would really like to keep them. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 2, 2017 Share Posted May 2, 2017 4 times to fill entire screen is a bad idea, both Sprite and TilingSprite wont work with that. UPD. may be TilingSpriet + multitexturing will work. I can try it on weekend. Quote Link to comment Share on other sites More sharing options...
Dan335 Posted May 2, 2017 Author Share Posted May 2, 2017 That would be awesome Ivan. My only other idea is use a sprite for each individual star. One of the layers I can get rid of. It adds to the effect but not enough to make it worth it. I would have to update the position of each star every frame but maybe if they use the particle container and an object pool it would be fast enough. That leaves only one layer done with TilingSprite for the hex grid. But maybe your idea would be faster. Quote Link to comment Share on other sites More sharing options...
Dan335 Posted May 3, 2017 Author Share Posted May 3, 2017 I tried what I said above. Much better! It also looks better I think because the stars each move independently instead of only on two layers. Having more than one tilingSprite fullscreen seems to have really bad performance. Quote Link to comment Share on other sites More sharing options...
Jammy Posted May 3, 2017 Share Posted May 3, 2017 I was running many sprites on my game which were static and only moved all together as the camera panned. I used RenderTexture every time I update the layer (not often), it improved performance on my laptop, not sure if it's an option here though. 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.