Advertisement Jump to content
Sign in to follow this  

Texture coordinates in the seam of a mesh

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

I am creating a simple block mesh programatically. Assuming that I want to stretch an entire texture(coordinates range from 0 to 1) around this block, am I on the right track here? (It is being drawn in a counterclockwise direction, that is for the front face: 0,1,5,  1, 6,5, and for the left face: 3,4,8,  4,9,8).




1.) Do I have to duplicate the vertices at the seam of the mesh if I want to stretch the entire width of the texture around the block? I think so.


2.) In case that I have to, what are the differences between the data of the duplicated vertices (in the pair 0 and 4 for example)?

     Position is the same of course. Assuming that normals for the vertex are an average of the normals of the faces, their normal should also be the same. So they would differ in the U texcoord(U0 = 0, U4 = 1) and in case of precalculating the tangents for bump mapping, in the tangent[1].


Is there anything else that needs to be taken care of that I haven't thought of? Or a smarter way of doing this?





In the case that neighboring triangles have discontinuous texture mapping, vertices along the border are generally already duplicated since they have different mapping coordinates anyway. We do not average tangents from such triangles because the result would not accurately represent the orientation of the bump map for either triangle.

Share this post

Link to post
Share on other sites

If you want it to look boxy, you can't average and share the normals, if you do it will be shaded like a very low resoluton sphere, but maybe that is what you want.

For a boxy-looking box, you need to have 3 vertexes for each corner, with each having a normal corresponding to the face it belongs to.


Apart from that, you seem to be on the right track.

Edited by Olof Hedman

Share this post

Link to post
Share on other sites

All good then :)


Btw, not sure what you meant with that note about tangents, but if the bumpmap is tileable, even though the texture coord is discontinuous, I think you should handle the tangent like for all other vertices and average them with its neighbors.

And set texture wrap mode to repeat.


Then it should blend over nicely to its neighbor.

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!