Jump to content
  • Advertisement

Archived

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

Jason2Jason

Texture Sizes?!

This topic is 6081 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

Hi guys.. To start with, I''ll quote from NeHe''s tut #6: "The image height and width MUST be a power of 2. The width and height must be at least 64 pixels, and for compatability reasons, shouldn''t be more than 256 pixels. If the image you want to use is not 64, 128 or 256 pixels on the width or height, resize it in an art program." Why does the texture have to be to the power of 2? And keep it between 64 and 128 pixels in width or height? I made a program where the images i used were 16 by 16, and it seemed fine! Thx, -J

Share this post


Link to post
Share on other sites
Advertisement
All images sizes are, within the power of 2 limitation, supported up to the maximum for your hardware. Which obvioulsy varies from card to card ... here are some samples:

3dfx vodoo, banshee, vodoo 2, vodoo 3 = 256 * 256
3dfx vodoo 3 & 4 = 2048 * 2048
TNT = 1024 * 1024
Geforce 2048 * 2048
Geforce 3 = 4096 * 4096
Radeon = 1024 * 1024
Radeon 8500 1024 * 1024 or 2048 * 2048 (depending on drivers)

Share this post


Link to post
Share on other sites
If you want to make sure your textures show up on old 3dfx cards (Voodoo 1, 2 and 3), don''t let them get above 256x256.

Textures can be ANY size though - you just need to mipmap them using something like

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);

Check out the texture loading code in Lesson 7. A texture with dimensions that isn''t a typical size will only show up if you tap "F" twice - because that''s when it switches to the mipmapped textures.

_________
"Maybe this world is another planet''''s hell." -- Aldous Huxley

Share this post


Link to post
Share on other sites
>>Why does the texture have to be to the power of 2? And keep it between 64 and 128 pixels in width or height? I made a program where the images i used were 16 by 16, and it seemed fine!<<

16 IS a power of 2

pwers of 2 are
1 (not a power of 2? but u can use it)
2
4
8
16
32
64
128
etc


http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
>>Textures can be ANY size though - you just need to mipmap them using something like
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);<<

not correct they still have to be powers of 2 gluBuildMipmaps though will take say an image of size 123x432 + resize it to a power of 2 eg 128x256

also the voodoo3 can only do textures of maximum size 256x256 + also the voodoo1,2,3 have a problem of not accepting textures that are more than 8x wider than they are high
eg 4x32 is OK but 4x64 is not

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
The minimum size is 1x1.

As to the fact that TNT runs 4096x8192 - that must be the drivers doing ''something''. Nvidia drivers on TNT only official report the sizes I quoted.

Share this post


Link to post
Share on other sites
Why can't some one just make a 3d card that likes any texture size! Oh well. How do you guys get around this restriction then? Do you just change the texture co-ords?

Edited by - jason2jason on February 24, 2002 6:12:03 AM

Edited by - jason2jason on February 24, 2002 2:09:33 PM

Share this post


Link to post
Share on other sites
The power of two limitation is not a hardware limitation. It's written in the OpenGL specification that texture cannot have dimensions other than powers of two.

For GeForce hardware, and maybe the TNT series, don't know about them, you can use the NV_texture_rectangle extensions. Then you can use texture of any size, including non power of two. The only real restriction is that you can't mipmap those textures.

Edited by - Brother Bob on February 24, 2002 6:18:47 AM

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!