texture problem
Hi,
First, I am a newbie in the OpenGL world.
I have some trouble to use texture with my polygon. Indeed I want to use a 640x480 texture but it don''t works (all is white). If I use a texture with these sizes : 128x128, 256x256 or 512x512 then all works well !?
I use one of first Nehe tutorial to load texture.
Someone can help me ?
regards.
You have almost answered yourself.
What differs 128x128, 256x256 and 512x512 from 640x480 (apart from the former works and the latter doesn''t)?
If you use Nehe''s tutorial to load textures (#06), then the answer is there, written in capital letters.
If you copy&paste some code, at least read how to use it.
HaND,
NewKid.
What differs 128x128, 256x256 and 512x512 from 640x480 (apart from the former works and the latter doesn''t)?
If you use Nehe''s tutorial to load textures (#06), then the answer is there, written in capital letters.
If you copy&paste some code, at least read how to use it.
HaND,
NewKid.
Ok I found this "the image height and width MUST be a power of 2".
But what is the solution to use a texture of any size ?
But what is the solution to use a texture of any size ?
you can''t use a texture of other sizes...
scale the texture to power of 2 width/height
scale the texture to power of 2 width/height
Visit our homepage: www.rarebyte.de.stGA
In fact you CAN use a texture with a size like 640x480.
The problem is that you may not repeat it (GL_REPEAT).
The problem is that you may not repeat it (GL_REPEAT).
gluBuild2DMipmaps 
If you use this function instead of glTexImage2D, not only can you use texture sizes that are not powers of 2, but you get much better filtering
"With my feet upon the ground I lose myself between the sounds and open wide to suck it in, I feel it move across my skin. I''m reaching up and reaching out. I''m reaching for the random or what ever will bewilder me, what ever will bewilder me. And following our will and wind we may just go where no one''s been. We''ll ride the spiral to the end and may just go where no one''s been." - Maynard James Keenan
[TheBlackJester ]
[Wildfire Studios ]

If you use this function instead of glTexImage2D, not only can you use texture sizes that are not powers of 2, but you get much better filtering

"With my feet upon the ground I lose myself between the sounds and open wide to suck it in, I feel it move across my skin. I''m reaching up and reaching out. I''m reaching for the random or what ever will bewilder me, what ever will bewilder me. And following our will and wind we may just go where no one''s been. We''ll ride the spiral to the end and may just go where no one''s been." - Maynard James Keenan
"With my feet upon the ground I lose myself between the sounds and open wide to suck it in, I feel it move across my skin. I'm reaching up and reaching out. I'm reaching for the random or what ever will bewilder me, what ever will bewilder me. And following our will and wind we may just go where no one's been. We'll ride the spiral to the end and may just go where no one's been." - Maynard James Keenan
Name: [email=darkswordtbj@hotmail.com]TheBlackJester[/email]Team: Wildfire Games
Projects O A.D.The Last Alliance
quote:
Original post by TheBlackJester
gluBuild2DMipmaps
If you use this function instead of glTexImage2D, not only can you use texture sizes that are not powers of 2, but you get much better filtering![]()
Not really.
In fact, gluBuild2DMipmaps resizes the picture for you. That''s the only thing it does for you (oh yes, and it adds mipmaps for sure

Much better filtering ? hell no !
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement