Advertisement

texture problem

Started by September 20, 2002 08:42 AM
7 comments, last by Bug System 22 years, 5 months ago
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.
Advertisement
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 ?
you can''t use a texture of other sizes...
scale the texture to power of 2 width/height
Visit our homepage: www.rarebyte.de.stGA
OK.
Thank you much.
CU
In fact you CAN use a texture with a size like 640x480.
The problem is that you may not repeat it (GL_REPEAT).
Advertisement
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 ]

"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 !

Yeah, I find a combination of MIPMAP_LINEAR to be at best acceptable. MIPMAP_NEAREST is just awful.

This topic is closed to new replies.

Advertisement