Archived

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

RegularKid

Nehe's TGA loader...

Recommended Posts

RegularKid    139
I''m using Nehe''s TGA loader and it seems that I can only load in files who''s width and height are power''s of two?! If there not, then the TGA just shows up as a white rectangle! Anyone know why?

Share this post


Link to post
Share on other sites
Null and Void    1088
OpenGL wants them to have widthes and heightes that are powers of two, it''s not the Targa loader''s fault. Use gluScaleImage to force the image to the nearest size that''s supported by the OpenGL implementation.

Share this post


Link to post
Share on other sites
RegularKid    139
So there''s no way around it? I just have to make my canvas size a power of two and then create an alpha channel to not draw the extra parts? That seems wasteful.

Share this post


Link to post
Share on other sites
Null and Void    1088
You don''t have to do the alpha channel part (that would be wasteful). You can either use texture coordinate to ignore the extra portion of the texture, or you can simple (like I suggested before) resize the texture to fit the new size (very little degradation takes place in the up scale and then a down scale, but it does happen).

Share this post


Link to post
Share on other sites
davepermen    1047
damn.. how much names a question can have wich is answered tons of times yet and is the fuckin first thing you learn when using textures!

grmbl..
please first go through the tutorials 2 times before start asking questions.. most of the answers you''ll find yourself..

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
RegularKid    139
Actually, there is no place in the Nehe tutorial #25 that states you have to use textures that are powers of two. In fact, this sentence is in the tutorial:

"If the image was 100x100x32 bit our image size would be 100 * 100 * 32/8 which equals 10000 * 4 or 40000 bytes!"

I don''t think that 100 is a power of two. Anyways, what makes you think you''re so high and mighty that you can yell at people for asking questions. How did you learn stuff? Were you just born with all the knowledge of the world? I''d bet money that you asked a question before. How would you feel if you considered your question valid and someone started getting mad at you for asking it? Please have a little bit of patience with people new to some of this stuff and stop being an ass.

Share this post


Link to post
Share on other sites
davepermen    1047
well then move over to tuti6 wich describes texturing.. or the red book or what ever you want (its ALL online..)..

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
Null and Void    1088
I''m not Davepermen, but...
quote:
Original post by RegularKid
How did you learn stuff?

The red book (and now the man pages) for the most part .
quote:
Original post by RegularKid
Were you just born with all the knowledge of the world? I''d bet money that you asked a question before.

There are occasional questions I answer that I didn''t know how to answer before the question was asked; Google is of great help . He''s correct in that you could have found the reason behind the white textures if you''d looked in the red book, after all. I''m a pretty passive person though, to make me angry takes some luck in finding a topic that bothers me (and even making me angry doesn''t always get a visible reaction online). So, that''s why you''ll probably never see me do anything more than a "use google" type response in these situations .

Share this post


Link to post
Share on other sites