Quick question for you developers out there. I was wondering if it would be more economically efficient (require less memory) if I use the same image for 4 textures? For example. say I have a square image, every quarter of that square has a different image, can I take that image and basicilly use it as four different textures? If so does the image degrade very much? Thanks for any help.
It won't use less memory but it will cut down on texture uploads which is definitely a plus. Apple recommends this technique in their documentation (Google "texture atlas") but there are some caveats so it may not work for all situations.
Realmaze3D uses this technique extensively...there are normally only 5 actual textures visible: 1 for walls/floor/ceiling (1024x1024 texture divided into 3x3 square segments for a total of 9 'textures'), 1 for the various decorations (512x512 divided arbitrarily depending on objects), 1 for ladders (512x512 also arbitrarily divided), 1 for light halos (64x64 divided into 2x2 square segments), and 1 for the UI stuff (256x256 divided arbitrarily). The biggest problem is probably preventing mipmap bleeding. Also getting the walls/floor/ceiling texture segments to tile took quite a bit more work than usual, although that's partially because the 3 wall sections have to tile with each other (same for floor and ceiling). --Eric
To be clear, I should've said: *can* cut down on texture uploads. Ideally your atlases should only be bound once per frame - bind once, draw lots. Same goes for other GL state changes.