Skip to main content
gamedev.net
🔒 Locked

DevIL textures upside down

Started by eXXXile 3 replies 900+ views
Original Post
eXXXile
eXXXile
hi, I just tried to use DevIL to load my textures. Everything ok but the textures are upside-down for any image format... Im sure the texture mapping is correct. Does anyone know if this is normal and how can I correct it (except of reversing the y tex coords or inverting the image file). Is there a setting or something? Or is there a better image loading lib?
CRACK123
CRACK123
Hi,

Its working correctly. DevIL textures are correct. Textures in opengl - 0, 0 is top left and 1, 1 is bottom right.
The more applications I write, more I find out how less I know
dotproduct
dotproduct
Quote:
Original post by CRACK123
Hi,

Its working correctly. DevIL textures are correct. Textures in opengl - 0, 0 is top left and 1, 1 is bottom right.


No... textures in opengl: 0,0 - lower left, 1,1 - upper right.

Just flip the textures with Devil before sending to opengl..
Shai
Shai
Just use (0, 0) as top left, (1, 0) as top right,...
It's normal for several image formats to be displayed upside down due to the way image data is stored inside the format, a BMP however should be loaded normally.
"It's better to regret something you've done than to regret something you haven't done."
eXXXile
eXXXile
well, i found the problem

if you look at this
http://sourceforge.net/forum/forum.php?thread_id=1228834&forum_id=13560
you will see that the last DevIL version has a little..... trouble with that.

Anyway, it seems that the solution is calling iluFlipImage just before calling glTexImage2D...... thank you all

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.