I have following problem image gets distorted along the face side (red line). I have a few layers like this on each I have the same distortion. I have double checked UV mapping and both faces have the same 2 UV coordinates for same 2 points. I would paste some code but it is a bit complex UV calculation. I am trying to see if somebody had a similar problem.
Uv mapping for this part (Red line matches picture above)
Here is the code for UV calculation but you probably wont be able to find an error there.
calculateNewUvMapping(vertices: Array<Vector3>): Array<Vector2> {
const orderedVertices = _.clone(vertices).reverse();
const newArray: Array<Vector2> = new Array<Vector2>();
const startV3 = orderedVertices[0];
const endV3 = orderedVertices[orderedVertices.length - 1];
const start = new Vector2(startV3.x, startV3.z);
const end = new Vector2(endV3.x, endV3.z);
// Distance between two vertices on scale from 0 to 1
const distanceAlpha = 1 / (orderedVertices.length - 1);
newArray.push(start);
for (let i = 1; i < orderedVertices.length - 1; i++) {
const newUv = new Vector2();
const interpolationValue = distanceAlpha * i;
newUv.lerpVectors(start, end, interpolationValue);
newArray.push(newUv);
}
newArray.push(end);
return newArray;
}
EDIT: Its not normals calculation.