Jump to content

  • Log In with Google      Sign In   
  • Create Account

Large texture coordinate range


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Gribbles   Members   -  Reputation: 120

Like
0Likes
Like

Posted 22 February 2013 - 09:46 PM

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



Sponsor:

#2 __SKYe   Members   -  Reputation: 1099

Like
1Likes
Like

Posted 23 February 2013 - 08:12 PM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS