zeux/meshoptimizer

Simplified meshes' UV coordinates are outside texture atlas's textures

Closed this issue · 2 comments

When I simplify a mesh (in this example, just a mesh off the Internet) the simplified mesh's triangles' UV coordinates no longer fit solely into the original texture atlas's textures, which results in the color that's outside the original textures in said texture atlas to appear (in this example, the color is white):

image

Is there some way to fix or mitigate this while maintaining the ability to plug and play with any mesh (i.e., without changing this color to a less jarring color based on the particular scenario)?

zeux commented

I’m not sure what you mean here by the texture atlas; the screenshot is very hard to understand. I would recommend attaching the mesh in question, or a UV view overlaid on top of the texture at least.

Here is the mesh in question: https://www.cgtrader.com/free-3d-models/character/man/archer-03a70527-aa8d-4607-9bf8-05d069b8fb3d

I have done further debugging and concluded that my original hypothesis as to why this happens is incorrect. I have attached a video of flying around to better demonstrate the problem.

Here's a screenshot showing the problem. In it, there are visible circular bands centered at the camera where the average color in some areas is different. The result is very visible LOD popping when models (especially clustered models as in my original screenshot) transition through this barrier, even when more sparse than the artificial example in the video. I can give a video if that'd help, but the file is huge (> 300 MiBs) and compressing it makes the effect much less visible.

out-0001