SFML community forums

Help => Graphics => Topic started by: shackra on January 28, 2013, 07:28:03 am

Title: is a good idea to combine many sprite atlas in one at runtime?
Post by: shackra on January 28, 2013, 07:28:03 am
Hello! :D

I use Tiled to design my maps, so, sometimes I need to use more than one tileset. I was thinking on "paste" each tileset in one texture at loading of my scenery/map, Is It a good idea?

cheers!
Title: Re: is a good idea to combine many sprite atlas in one at runtime?
Post by: eigenbom on January 28, 2013, 07:44:07 am
Sure, why not! Another idea is to batch your tiles into the texture they belong to. So you minimise switching between textures. But, of course, you should only optimise only if necessary. ;)
Title: Re: is a good idea to combine many sprite atlas in one at runtime?
Post by: Nexus on January 28, 2013, 01:07:46 pm
Sure, why not!
Because the texture size is limited. If you exceed sf::Texture::getMaximumSize(), OpenGL will fail to allocate the texture.

Therefore, you need to find a good trade-off for the number of objects inside a texture.