Open rondreas opened 1 year ago
Not an issue when using MeshDecl instead of UvMeshDecl
Seems I was mistaken. Issue still persists, getting the log after setting XA_CHECK_PARAM_WINDING 1
I could track down to it happening during the PackCharts, and not ComputeCharts.
Flipping is no issue if xatlas::PackOptions.rotateCharts
is set to false, but charts also seem to get skewed unless rotateChartsToAxis
also is set false in this case.
I think the flipping of the charts happens in the swap here, https://github.com/jpcy/xatlas/blob/f700c7790aaa030e794b52ba7791a05c085faf0c/source/xatlas/xatlas.cpp#L8583-L8593
I also encountered the same problem。I found that the vertex order of the flipped triangular surface is arranged counterclockwise。
Description
Using the included .obj and .mtl and changing the
example_uvmesh.cpp
so it does not loop the same shape 10 times but only use input shapes. The resulting images show many instances where a chart is flipped. Issue persist even when setting xatlas chart options to fix winding.The input mesh is a single shape, 125 arrayed triangulated boxes with unique materials. The uvs for each disconnected geometry is overlapping.
Steps to reproduce
Commenting out the lines 211, 212 & 232
Then editing line 226, so
shapes[s]
instead ofshapes[i]
Adding the following lines at 239,
With the .obj and .mlt extracted to folder of example_uvmesh.exe, and running
The resulting .tga output will show that some of the charts are flipped randomly.
overlapping_uvs.zip
I have also tried changing line 125 in xatlas.cpp to
And to have it compile change line 9713 in xatlas.cpp from
to the following,
I might have misunderstood the purpose of fixUnwinding as I assumed it would solve the issue of charts being flipped so happy to learn of any other setting that might solve this.