Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

leiavoia

Irregular Images (Repetition and Resource Consumption)

This topic is 5283 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to figure out how to store and serve and draw textures for my 2D game. All OpenGL textures must be powers of 2 and square. okay... so now i''m packing several long graphics into one texture to take advantage of that. That prohibits them from repeating (at least in one direction). But i can live with that. Now on irregularly sized images: Q: I have an irregular image, say 100x200, pasted onto a 256x256 texture with the test of the canvas empty. I can just draw a quad 100 x 200 and map just the correct portion of the texture to it for the effect i want (drawing the image). My question is: Does the rest of the "empty space" on the texture still take up memory in the PC? Q: Is there any way to enable the repetition of oddly shaped images? They only way i can think of is to stetch the image to a power-of-two square, then "compress" it back when i map to a quad. Thanks

Share this post


Link to post
Share on other sites
Advertisement
Q1 - yes it does, although storing as a compressed image MIGHT remove the redundancy

Q2 - not that I know of, it might be possible to cheat with a fragment shader but i''ve never tried

btw, the textures dont have to be square, each side just has to be a power of 2, thus you could have a 128*256 texture and cut down on the wastage for your 100*200 image

Share this post


Link to post
Share on other sites
quote:

btw, the textures dont have to be square, each side just has to be a power of 2, thus you could have a 128*256 texture and cut down on the wastage for your 100*200 image



*blinks*

Well, hot dog! I didn''t know that. That helps a lot actually. Thanks!

Share this post


Link to post
Share on other sites
The newest vid cards like the Geforce 6800 allow for non-power of 2 textures. Can''t wait to get my hands on the aforementioned card. Finally, a real vid card for a real man.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!