How to texture files which do not have height /width thats a power of 2

Started by
22 comments, last by frmzero2hero 21 years, 6 months ago
quote:Original post by KalvinB
DirectDraw... DirectDraw ..DirectDraw ... D3D ... DX7..


quote:Original post by frmzero2here
note:I am working on Linux for this project.


RTFQ.


Note to frmzero2hero: sizing up the texture to the nearest power of two when you load it is an easy solution, as someone suggested. Don''t stretch the image, just fill the additional space with black or white. Adjust your texture coordinates so that they match the size of the valid data in the surface, and you''re done.

I actually implemented that straight into my image loader. It always sizes images to powers of 2, since I''m always using them as textures anyway. Sure, I''m throwing out memory by the bucketload, but these are research projects anyway, so it''s not like I need to run them at 150FPS on a 20 Mhz machine.
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
Advertisement
Small point, to everyone who keeps suggesting gluBuild2DMipmaps:

quote:
I do not want to strech or shrink the resolution ..ie i want to display it as it is.


As others have suggested, I would use a 1024x1024 texture with an 800x600 image in the corner. Render it with GL_NEAREST filtering, scaling your tex coords appropriately, and you''re away. The only problem with this is if you''ve got very limited video card memory or if there''s a texture size limit. Decent (ie: not 3dfx) cards shouldn''t have a problem with this.

____________________________________________________________
www.elf-stone.com

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

hellrizzer:
The material link does not open.
Tell me More
Where in the SDK does it say DDraw forces powers of 2 for regular offscreen surfaces?




IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com | GameShot ]

This topic is closed to new replies.

Advertisement