You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get UV coordinates on a tessellated stroke by using the path advancement.
It nearly works, but where there are straight line segments joining other segments with tight angles, the tesselation creates large triangles. The inside and outside parts of the line are different lengths and the UVs end up drifting as we go along the path.
This image shows 10 cycles of the normalized advancement along the path.
This wireframe shows how the tessellation contributes to this.
For correct UV, I'd want the UV values to be equal along a line normal to the path. This happens in the curved segments because they're tessellated with a lot more triangles.
Some possible ways to resolve this issue would be:
As well as advancement, as a property of StrokeVertex, if we could also have the advancement of the nearest point on the path to this vertex (usually this will be the same as advancement, except at some corners)
Perhaps easier, but less preferable, would be an option to increase the triangulation of straight line segments in a path.
The text was updated successfully, but these errors were encountered:
Hi, yeah that's a bit tricky unfortunately (depending on what you expect the correct behavior to be). Increasing the tessellation of straight lines in a way that distributes the stretching introduced by a sharp turn would look better, but it would still stretch the uvs (it wouldn't look quite right if you draw, say, a road texture along it). and it would not address the same problem happening with two curves meeting at a sharp turn. One might argue that the best behavior should be to only introduce distortion near the join.
In any case I agree that the current behavior is not very good for shapes that aren't smooth.
Unfortunately I am very short on spare time to dedicate to improving the stroke tessellator at the moment. If you or someone else feel adventurous, I'd be happy to review contributions.
I'm trying to get UV coordinates on a tessellated stroke by using the path advancement.
It nearly works, but where there are straight line segments joining other segments with tight angles, the tesselation creates large triangles. The inside and outside parts of the line are different lengths and the UVs end up drifting as we go along the path.
This image shows 10 cycles of the normalized
advancement
along the path.This wireframe shows how the tessellation contributes to this.
For correct UV, I'd want the UV values to be equal along a line normal to the path. This happens in the curved segments because they're tessellated with a lot more triangles.
Some possible ways to resolve this issue would be:
advancement
, as a property ofStrokeVertex
, if we could also have the advancement of the nearest point on the path to this vertex (usually this will be the same as advancement, except at some corners)The text was updated successfully, but these errors were encountered: