Jump to content
  • Advertisement
Sign in to follow this  
JulianAssange

OpenGL Quake 2 texture problem

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

Hello! I've tried to apply a Quake 2 texture to a Quake 2 MD2 model in my OpenGL texture.

This works, fine, but the texture doesn't look like it should. I have converted the PCX to a BMP file, because of the simplicity. Can I do so? Or how do I do it? I simply wanna use a BMP or TGA file, not a PCX file.

asdcm.png


Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
No idea how quake does things, but have you tried flipping the UV coords on the U,V or both axis?

Share this post


Link to post
Share on other sites

No idea how quake does things, but have you tried flipping the UV coords on the U,V or both axis?


Nope, although the PCX file works just fine. But because of simplicity and reduce my lines of code, I want to use a BMP or TGA file.

Like I said, PCX works fine, and therefore should the UV mapping not be wrong.

Share this post


Link to post
Share on other sites
I think you misunderstood me, Mr. Assange laugh.gif

I wasn't talking about textures but UV coordinates: have you even tried flipping them?

Share this post


Link to post
Share on other sites

I think you misunderstood me, Mr. Assange laugh.gif

I wasn't talking about textures but UV coordinates: have you even tried flipping them?


How do you mean by "flipping them"?

I know you weren't talking about textures :), but since the PCX files works like intended I assume the texture coords are okay.

Share this post


Link to post
Share on other sites

[quote name='n3Xus' timestamp='1312553248' post='4845015']
I think you misunderstood me, Mr. Assange laugh.gif

I wasn't talking about textures but UV coordinates: have you even tried flipping them?


How do you mean by "flipping them"?

I know you weren't talking about textures :), but since the PCX files works like intended I assume the texture coords are okay.
[/quote]

Not always the case. Some (most, actually) BMPs are stored "upside-down", so - assuming standard OpenGL naming conventions of s and t for texcoords - you need to set "t = 1.0f - t" in order to correct this.

Share this post


Link to post
Share on other sites

[quote name='JulianAssange' timestamp='1312553558' post='4845017']
[quote name='n3Xus' timestamp='1312553248' post='4845015']
I think you misunderstood me, Mr. Assange laugh.gif

I wasn't talking about textures but UV coordinates: have you even tried flipping them?


How do you mean by "flipping them"?

I know you weren't talking about textures :), but since the PCX files works like intended I assume the texture coords are okay.
[/quote]

Not always the case. Some (most, actually) BMPs are stored "upside-down", so - assuming standard OpenGL naming conventions of s and t for texcoords - you need to set "t = 1.0f - t" in order to correct this.
[/quote]


Thanks, that did the trick! Thanks :D

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!