GLBasic forum

Main forum => GLBasic - en => Topic started by: bigtunacan on 2011-Sep-23

Title: Texture Atlases and LOADBMP?
Post by: bigtunacan on 2011-Sep-23
I don't see a clear way to do something like a POLYVECTOR build and push onto LOADBMP like I do for my sprite drawing for the rest of images using texture atlases.  Is there a way to do this?  For that matter though; is this something I should bother with anyway, or is it not really worth it to try pushing your background into a texture atlas since it will take up so much space?  I'm not real sure of the performance implications here, since I'm fairly new to this.  For my current game though; I'm looking at trying to fit entire level assets into a single texture atlas, but don't know if that is feasible if I try to keep my background in there as well.
Title: Re: Texture Atlases and LOADBMP?
Post by: Wampus on 2011-Sep-23
Background and sprites in a single texture atlas is nice, if its possible. Regarding available space you probably know this already; depending on the hardware you plan your app to run on the texture atlas can be larger than the minimum 1024x1024. Any PC or newer iDevice should handle 2048x2048, for example.

Not sure of performance implications. Why not write a quick test routine. LOADBMP vs POLYVECTOR (with CLEARSCREEN -1).
Title: Re: Texture Atlases and LOADBMP?
Post by: bigtunacan on 2011-Sep-23
Unfortunately I'm targeting iPhone as my first device and I don't own one, so I have no way to test on physical hardware yet.  I'm familiar with the allowed texture sizes; but ideally would like to keep it to the 1024x1024 so it can run on the lower end devices like the iPhone 2g to maximize my potential customer base (I'm not sure how many people are still running on a 2g?).  Hopefully I will get some hardware soon; I have found one donor device possibly (fingers are crossed).
Title: Re: Texture Atlases and LOADBMP?
Post by: Slydog on 2011-Sep-23
I'd say put the background in the texture file.
Then POLYVECTOR it to the background before drawing that frame.

You gain the advantage of keeping all graphics in one file like you wanted.
You could scale it easily too. Apply colour effects like dynamic gradients, etc.

Plus, since this is for a portable device, I think this would result in one less OpenGL draw call.
Assuming you draw ALL your graphics from that file in one step without changing the material/texture.