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

Author Topic: Any advice on optimal sprite rendering?  (Read 1718 times)

0 Members and 1 Guest are viewing this topic.

Somnia

  • Newbie
  • *
  • Posts: 4
    • View Profile
Any advice on optimal sprite rendering?
« on: March 23, 2010, 10:44:39 am »
Hi,

I'm just designing my systems for things like tilesets and animated sprites. I'm wondering if there any guidelines for how best to set up your sf::Images. Is there likely to be any disadvantage in having every frame of animation in a separate image/texture? Alternatively I could use subrects and have say one animation cycle per texture, This would probably end up being around 512 x 512, but wih a bit of empty space. Is that a good size?

It's possible this kind of thing is completely hardware dependent, or that I'll never tell the difference for a modest number of sprites.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Any advice on optimal sprite rendering?
« Reply #1 on: March 23, 2010, 11:15:10 am »
Quote
Is there likely to be any disadvantage in having every frame of animation in a separate image/texture?

Yes, this will end up activating a new OpenGL texture every time the animation is updated, which is really bad. Using less images is always better.

Quote
This would probably end up being around 512 x 512, but wih a bit of empty space. Is that a good size?

Yes, it should be supported even by the oldest graphics cards :)
Laurent Gomila - SFML developer

 

anything