1
$\begingroup$

I am working on a texture mapping problem. I use vtk C++ library for my work. I have a very dense mesh with lots of vertices. I want to apply image texture to this mesh. Should I set texture coordinates for every vertex ? Or can I skip few vertices and setup the texture coordinates and still expect the texture to be set properly? Please see the image attached. enter image description here

If A,B,C,D, E, F are the vertices of 4 faces in a mesh, can I set the texture coordinates only to A,C,F,D ? Will the texture drape the faces stretching equally?

$\endgroup$
1
$\begingroup$

Typically, texture coordinates are interpolated from the vertices of a triangle during rendering. This can be seen in two ways. evaluating your texture at vertices and the interpolating the result or interpolating the texture coordinates and evaluating your texture at the fragment level.

If you do not supply vertices with corresponding texture coordinates then there is no guarantee that the interpolated texture coordinates or colours for the fragments of the rendered triangle will behave nicely. By skipping a few vertices, the vertices would need some default texture coordinate such as $(0,0)$, which would show up as a weird artefact in your rendering. The vertices B and E in your example are required to have texture coordinates in order to have a continuous set of interpolated texture coordinates or colour values.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.