luknei Posted December 15, 2017 Share Posted December 15, 2017 Hey I am building quite huge tile map from hexagons. Basically for performance reasons I create single render texture and add a lot of sprites,and texts to it. It takes quite a lot of time to do so, but I get higher FPS and that texture is pretty much static. However there is another layer on top of this, which is dynamic, if I add another render texture to the game, FPS drops, so if I render everything to single texture FPS is still OK, however when dynamic part changes I need to rerendering whole texture and that takes too much time. So I was thinking to generate static texture and cache/clone it in the memory, and compose with with dynamic texture, the composition would take a bit of time, but end result - single texture would let me keep stable FPS. So when dynamic texture changes I would need to only render dynamic texture and compose it with already cached static texture, but not sure is it possible at all? Link to comment Share on other sites More sharing options...
samme Posted December 16, 2017 Share Posted December 16, 2017 Believe you can do game.cache.addImage('hugeMap', null, renderTexture.getImage()); Link to comment Share on other sites More sharing options...
luknei Posted December 18, 2017 Author Share Posted December 18, 2017 @samme thanks, it work. However getImage is so slow that it looses the the whole point of using it as performance optimization. Actually re-rendering everything from scrach is event faster than using getImage. Maybe you have any other ideas? Link to comment Share on other sites More sharing options...
Recommended Posts