Flip texture or flip coordinates?

Started by
1 comment, last by 4fingers 15 years, 10 months ago
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
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.
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

This topic is closed to new replies.

Advertisement