Jump to content

Memory management with game atlas


mazoku
 Share

Recommended Posts

I want to ask a question about using game atlas. So you have an image in it and you create a sprite and set frame to the actual image in the spritesheet. So what part of the spritesheet is copied into memory? The whole thing or only the part that is our frame?

Link to comment
Share on other sites

The whole spritesheet is kept in memory, but this is preferential unless you don't actually use a large part of the spritesheet, as otherwise you'd end up using pretty much the same amount of memory in individual sprites, but with the added overhead of having to load them individually. Regardless, the benefits of having an atlas when it comes to the huge performance gains in webGL, as well as the minor gains in loading speed when not make it well worth while.

Link to comment
Share on other sites

No, you will only have one. In webGL, all objects will share the same single texture in memory. I'm pretty sure basically the same is true of canvas, in that the portions that are needed are copied directly to the game canvas, rather than creating intermediate canvases for each sprite.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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