Jump to content
  • Advertisement
Sign in to follow this  
thorpe

Textures are mirrored (DevIL/LibPNG)

This topic is 5152 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
mirror them in photoshop? =)

no, seriously.. you could manually change the pixels after you´ve loaded the textures... I don't know how your texture loading code looks, so you´re on your own there...

It's seems like the easiest way would be to mirror them in photoshop thou... :)

Share this post


Link to post
Share on other sites
Quote:
Original post by thorpe
When I load my textures using DevIL, they get mirrored. How do I get around these problems?


You're probably drawing your quads/triangles in the wrong vertex order (or maybe the texcoords). Mess around a little until it gets right.

Share this post


Link to post
Share on other sites
Thing is, everything worked properly before when I had my own bmp read code. When I call glu functions, the textures get mirrored and I want to be able to use glu (and have proper coordinates). I suspect you have to call some DevIL function but I can't find any good example code.

Share this post


Link to post
Share on other sites
Well, you could try using the texture matrix. Just add a glScalef on it to mirror around the axis in question.

Share this post


Link to post
Share on other sites
No, the texture matrix is applied to the texture coordinates, not the textures, so you would have to have this transformation there every time you render an object that needs the texture coordinates mirrored.
Perhaps not the best solution, but it's a solution ;)

Share this post


Link to post
Share on other sites
Cheers!
Managed to solve it with iluFlipImage() which flips it around the x-axis (while iluMirrorImage() flips it around the y axis - good naming :) ). Quite ineffective having to flip the image once loaded though. DevIL doesn't seem to be too good implemented and documentation sucks.

ilOrigin() didn't work which would do these things before loading didn't work :(

Ah well, now it's working....

Thanks guys!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!