Jump to content

Tiling sprite vs large image


canvasman
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...