textures that are not power of 2

Mars_999
Unregistered
 
Post: #1
I have a texture that is 640x640 and would like to load it as texture and just call the texture coordinates to display what I need. I though I remember their was a way to get around the power of 2 problem and load the image? I really don't want to have to chop up the image to get the textures!!! Thanks
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
You can use the EXT_texture_rectangle extension if you want (doesn't work on Rage128 or software renderer). Otherwise you can use gluBuild2DMipmaps on the image and then pretend the resulting texture is non-power-of-two.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #3
Quote:Originally posted by OneSadCookie
You can use the EXT_texture_rectangle extension if you want (doesn't work on Rage128 or software renderer). Otherwise you can use gluBuild2DMipmaps on the image and then pretend the resulting texture is non-power-of-two.


Hey thanks OSC I tried the gluBuild2DMipmaps idea and seems to work. It loads the whole texture and then I am using the texture coord to display the part of the texture I want. So far so good. Grin
Quote this message in a reply
Mars_999
Unregistered
 
Post: #4
Ok now when I load the 640x640 texture up and display the area of the texture that I want by moving the texcoord's vs. cropping out the same 64x64 texture the cropped out texture looks better less washed out? Why would that be and both are using the same texture parameters?
Quote this message in a reply
Mars_999
Unregistered
 
Post: #5
However, non-power-of-two dimensioned (NPOTD) textures have
limitations that do not apply to power-of-two dimensioned (POT)
textures. NPOTD textures may not use mipmap filtering; POTD
textures support both mipmapped and non-mipmapped filtering.
NPOTD textures support only the GL_CLAMP, GL_CLAMP_TO_EDGE,
and GL_CLAMP_TO_BORDER_ARB wrap modes; POTD textures support
GL_CLAMP_TO_EDGE, GL_REPEAT, GL_CLAMP, GL_MIRRORED_REPEAT_IBM,
and GL_CLAMP_TO_BORDER. NPOTD textures do not support an optional
1-texel border; POTD textures do support an optional 1-texel border.


link
http://oss.sgi.com/projects/ogl-sample/r...tangle.txt
Quote this message in a reply
Tycho
Unregistered
 
Post: #6
AFAIK, gluBuild2DMipmaps does not actually use on power of two textures, but it resizes your texture so that it's dimensions are power of two.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #7
Quote:Originally posted by Tycho
AFAIK, gluBuild2DMipmaps does not actually use on power of two textures, but it resizes your texture so that it's dimensions are power of two.


Upon further tests I have determined your statement to be correct. Since my texture is 640x640 gluBuild2DMipmaps() is resizing my texture to 1024x1024 and making my texture look washed out. So I guess the correct thing to do is crop out all the 64x64 textures and load them seperately. Anyone know of a easy and free cropping utility? One thats usable to and not a bunch of do this to do that and get this result PC sytle crap!! thanks
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #8
Graphic Converter can do it really easily. On the "save as" dialog there is a split image option for spliting up web images. That will work for what you want it to do too.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #9
Quote:Originally posted by Skorche
Graphic Converter can do it really easily. On the "save as" dialog there is a split image option for spliting up web images. That will work for what you want it to do too.

Hey thanks that seems to be working good. But when I save it it saves the right side of the texture. How do I ago about moving it over one so it can save the next column? Or is this only going to save each row or column as a whole and you have crop out each one from the slice it takes? thanks
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #10
????
It's supposed to save them all at once. Do you mean that it's not?

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #11
Quote:Originally posted by Skorche
????
It's supposed to save them all at once. Do you mean that it's not?


I have a 640x640 texture, when I fill in the info and save it, it saves only the 10 64x64 far right textures? the first 9 columns aren't saved? So the 10 column and the 10 rows under that column are saved?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Question about handling non power-of-two bitmaps Malarkey 9 4,023 Apr 23, 2005 09:11 AM
Last Post: Malarkey