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

Author Topic: Pre-rendered images vs OpenGL transformations  (Read 1598 times)

0 Members and 1 Guest are viewing this topic.

V0idExp

  • Newbie
  • *
  • Posts: 5
    • ICQ Messenger - 251952950
    • View Profile
    • http://blog.v0idexp.net
Pre-rendered images vs OpenGL transformations
« on: January 06, 2012, 01:34:03 am »
I have a nooby question. Say, I want to create and animate an UFO sprite (a circular object with some details on it). And I want to let it rotate around its center. Coming from SDL experience, I simply pre-rendered in Blender the rotation animation into several images (48 pieces), and displayed a different one on each frame. But we're hardware-accelerated here, so I simply loaded the first frame, set up the origin on center and called Sprite::Rotate() on each update. It looked a bit ugly, so I turned on smoothing on Texture object, and it looks almost perfect. The question is, which of two methods is faster? I'll have a lot of UFOs, asteroids, debris and stuff like that, ignore the memory consumption of the first method, is OpenGL-variant good enough to handle a lot of this kind of stuff without a heavy performance impact? I know it depends on machine, and I'd like to be able to run my game on integrated GPUs and stuff like that... Thx in advice ;)
No life 'til leather!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Pre-rendered images vs OpenGL transformations
« Reply #1 on: January 06, 2012, 07:54:29 am »
Every primitive that is rendered by OpenGL is transformed, whether it is by a custom transform such as a rotation, or by the identity matrix. So it costs absolutely nothing to trqnsform your SFML entities.
Laurent Gomila - SFML developer