Jump to content
  • Advertisement
Sign in to follow this  
crunch

Texture problem in opengl

This topic is 4077 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!:) When I apply texture on my object, the textures appear either stretched or just does not fit the primitives at all. I have built a more complicated object out of only quads, but on some of the quads the texture fits nicely, but some just does`not seem right at all. On one of the longer quads the texture seem literally stretched, and on the smaller ones the texture seem "compressed".(i.e the details in the texture are just too close together) The texture I am using have the following dimensions: 512*512. The texture enviroment is set to: glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); The texture parameter is set to the following: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); Does anyone have any idea what I can do to make the textures look better on my objects? Or: How do I tweak the placement of the texture on my object, to make it more good-looking?

Share this post


Link to post
Share on other sites
Advertisement
Make your model have quads which are roughly the same size. If a quad is too big for a tecture then OpenGL will streth the texture for it to fit in the quad, and vice versa.
I think you should model your work on a 3D modelleing software and apply the texture to see the result before exporting it to your game. Try blender, i hear it's free.

Share this post


Link to post
Share on other sites
You also adjust the texture coordinates of the vertices that make up the quad to adjust how the texture looks.

Before continuing I suggest that you look at some tuturials on texturing; google can provide you with many.

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!