SFML community forums

Help => Graphics => Topic started by: V0idExp on January 06, 2012, 01:34:03 am

Title: Pre-rendered images vs OpenGL transformations
Post by: V0idExp 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 ;)
Title: Pre-rendered images vs OpenGL transformations
Post by: Laurent 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.