PDA

View Full Version : How to load the texture that not power by 2?



尘羽泯
07-24-2011, 01:09 AM
Sorry,I am a programmer who is a Chinese. I cannot speak English very well.I hope you can understand me.

I use the function gluBuild2DMipmaps to load the texture that not power by 2. But it was scale the picture. The picture weight is 300. I use gluBuild2DMipmaps load it .Then I use glGetTexLevelParameter to get it's weight is 256.It said gluBuild2DMipmaps is scale the picture from weight 300 to weight 256.That is so bad. Because the picture is seems so ugly.So I want a function to instead of the gluBuild2DMipmaps to load the texture that not power by 2.

Help.How to load the texture that not power by 2?

V-man
07-24-2011, 02:03 AM
http://www.opengl.org/wiki/Textures

you need gl 1.4
http://www.opengl.org/wiki/Common_Mistakes#Legacy_Generation

or gl 3.0
http://www.opengl.org/wiki/Common_Mistakes#Creating_a_Texture

尘羽泯
07-24-2011, 03:53 AM
http://www.opengl.org/wiki/Textures

you need gl 1.4
http://www.opengl.org/wiki/Common_Mistakes#Legacy_Generation

or gl 3.0
http://www.opengl.org/wiki/Common_Mistakes#Creating_a_Texture

Thanks for your help.
But....

V-man
07-24-2011, 06:15 AM
but what?

And sorry about that. You need GL 2.0 at least.

And doing a search for NPOT
http://www.opengl.org/wiki/NPOT_Texture

尘羽泯
07-24-2011, 06:52 AM
but what?

And sorry about that. You need GL 2.0 at least.

And doing a search for NPOT
http://www.opengl.org/wiki/NPOT_Texture

NPOT Texture may is that I need.
But my computer don't have the extension that GL_ARB_texture_non_power_of_two.

I think I have to change the image's size to power of 2.haven't I?

_arts_
07-24-2011, 10:19 AM
Try this:

http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt

If still not supported, yes you'll have to stuck with POT textures.

Btw, what is your graphic card ?

V-man
07-25-2011, 05:34 AM
That's what that Wiki page says (http://www.opengl.org/wiki/NPOT_Texture)

Look at the bottom and click on the link.

尘羽泯
07-25-2011, 03:34 PM
Thanks.My question have already been deal.

Best wishes.

Love.