Jump to content
  • Advertisement
Sign in to follow this  
4fingers

OpenGL Flip texture or flip coordinates?

This topic is 3773 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

Hi, just a quick question more about semantics than syntax but here we go. I am currently using JOGL and was looking into how you simply import an image into OpenGL using Java. I managed to find this website "Jumping into JOGL" where it talks about having to flip the image so that it is displayed the right way in OpenGL when it is read in. Now I am wondering if I could maybe instead ignore this step and simply use a different texture coordinate system. By using glTexCoord for example I can simply display the texture the right way up, as in making the top left be (0,0). Is this similar to the question "Do I move the camera or the scene" where it doesn't really matter as long as I am consistent or is one way more effective than the other? Thanks again

Share this post


Link to post
Share on other sites
Advertisement
Yes, I thing it doesn't really matter as long as You make it the same way in all the places.
As for effectiveness it depends on particular program or algorithm. If You load some textures once and then render them many times - it doesn't matter. But if You make many loadings during rendering (in yout main loop) then ofcourse it's faster to send modified texture coordinates than flip texels in some loop.

Notice that it depends on image file format too. Some image formats holds data up side down.

Share this post


Link to post
Share on other sites
Thanks for your reply skovron,
It was just one of those questions where I was more worried about the unknown effects of a certain method over what I knew already.
Thankfully your answer was reassuring and something I was kind of expecting but good point about the image format. If things do get busy I can always just save the textures as being upside down.

Thanks again

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!