Page 1 of 1
Opengl + win32, sprite sheet solutions
Posted: Sun Mar 15, 2009 12:39 pm
by Spikey
My project is a 3D side scroller with 2D character sprites, made with win32 and opengl. I'm at the point where I need to crop a texture to get sprites for animation. I'm wondering what would be better. One way is to crop an existing texture to make a new texture and slap that on. Or just update the uv/rts coordinates of the object. I'll probably test both ways soon, but I guess I'm asking if anyone knows which way is more efficient/elegant/etc or any problems that might pop up. Thanks.
Re: Opengl + win32, sprite sheet solutions
Posted: Sun Mar 15, 2009 6:22 pm
by OverlordYertle
i believe that using the uv/rts coordinates is more efficient. Especially if you use display lists i don't think you'll have a problem. But any additional time it would take to pull up the coordinates i think would be outweighed by the amount of memory you'd be saving.
Re: Opengl + win32, sprite sheet solutions
Posted: Sun Mar 15, 2009 10:48 pm
by CC Ricers
In most applications, if you can do the job with one large texture, that method is preferred. Whether you're making sprites for animations or creating 2D impostors of 3D models, using one texture in place of many small ones is quicker and less expensive on the hardware. As long as you keep them reasonable sizes (something most video cards can handle) then you're fine.