Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: is a good idea to combine many sprite atlas in one at runtime?  (Read 1807 times)

0 Members and 1 Guest are viewing this topic.

shackra

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
    • http://swt.encyclomundi.org
is a good idea to combine many sprite atlas in one at runtime?
« 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!

GNU User
Python programmer
Blog

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Re: is a good idea to combine many sprite atlas in one at runtime?
« Reply #1 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. ;)

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: is a good idea to combine many sprite atlas in one at runtime?
« Reply #2 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: