Sign in to follow this  
Gribbles

Large texture coordinate range

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this