canvasman Posted March 11, 2019 Share Posted March 11, 2019 I need to make background for the game so my options are: 1. Create large image which fits to the map 2. Use tiling sprites What are the pros and cons between those two, regarding both canvas and webgl renderer? With tiling sprite less network usage when downloading? Less GPU memory needed? Is it slower to render tiling sprites spanning size of large image instead of rendering just that large image? Quote Link to comment Share on other sites More sharing options...
jonforum Posted March 11, 2019 Share Posted March 11, 2019 this will depend of your target projet ! i prefers on my side use large map (single picture as texture), and only if i need i will split in tiles from the texturePacker tool. https://www.codeandweb.com/blog/2018/10/29/how-to-create-sprite-sheets-and-animations-with-pixijs performance will depend on how your manage all your tiles. The peformance are same if you generate a big texture with all tiles to rendering a background. Just do it in a loader scene. But if you render each tiles separately, it need more computing. So yes one big texture it more fast for loading and rendering in most case. but if you rendering each tiles textures, you will have more manageability but more compute for rendering. But I'm pretty sure the difference in performance is very minor and that pixijs has a plugin to optimize all that. A good example you can take a look in the sofware rmmv, They use https://github.com/pixijs/pixi-tilemap for rendering each tiles for the map, but they also use big sprite for rendering parallax background. They have performance issue on very large map with a lot of tiles. If your curious , a clone of the core are available here . https://github.com/rpgtkoolmv/corescript/tree/master/js EDIT: it can, however, that you get better performance if you implement a system view-port and culling for compute and rendering only tiles your need in the camera You can not do this with a big sprite map. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 11, 2019 Share Posted March 11, 2019 If the tile is big you can use multiple Sprite's. TilingSprite shader is slow if you dont use repeat-wrapping on texture which works on non-pow2 textures only in pixi-v5 and you have to set it manually. 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.