• Advertisement
Sign in to follow this  

Large texture coordinate range

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

So I'm working on converting files model files to my own format and I noticed that the texture coordinates range from -5 to 1.8. If I am understanding how textures are supposed to work, The coordinates are supposed to range from 0-1 and anything other than that is covered by the WRAP variable in the sampleState.

 

Is this correct? Do I need to do something else to handle the case of such a wide range of tex coords? because it doesnt show up right in my program, but other models do and it shows up fine in maya and blender.

 

Thank You

Share this post


Link to post
Share on other sites
Advertisement

If the model has been created and textured mapped correctly, then those coordinates mean that the texture repeats when mapped to the model.

In order to make it show correctly on your program, when you load the texture the model uses, you have to set the wrap mode to repeat instead of clamp.

For example, in OpenGL you'd do this:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

 

You can also try GL_MIRRORED_REPEAT instead of GL_REPEAT if it doesn't appear correct.

 

See if it works.

Share this post


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

  • Advertisement