Open kevinloustau opened 2 years ago
I can confirm this on master
fc09d783f.
(Is it a LOD issue?)
Yes, it's very likely. The automatic mesh LOD does support vertex colors, but it's possible that your particular mesh isn't well handled.
As a workaround, set rendering/mesh_lod/lod_change/threshold_pixels
to 0.0
in the Project Settings to disable the rendering of automatic mesh LOD. To disable LOD temporarily in the editor, click the Perspective menu in the top-left corner of the 3D viewport and select Display Advanced… > Disable LOD. You can also use the Display Wireframe debug draw mode to check how different LOD levels look.
You can also disable LOD generation on specifc imported 3D scenes in the Import dock:
https://user-images.githubusercontent.com/180032/152448665-5d27d678-40ac-4cd1-9e6a-a077c62be587.mp4
If there are not enough vertices for the vertex color to look correct, do we interpolate?, do we disable lod?, do we do some magical mesh processing?
If we want to disable LOD, how do we scan it?
If there are any non-white data in the vertex color channel do we disable lod? This doesn't feel like the right design.
One way to improve the current situation is to post a documentation note explaining due to the nature of removing vertex indices the index colors will be incorrect.
From a user point of view, do this use case (low poly + vertex color) is a niche? If yes, to disable LOD in settings seems ok. As @fire said, to post a documentation note seems enough.
From a user point of view, do this use case (low poly + vertex color) is a niche?
When working with low-poly meshes, automatic mesh LOD won't benefit you much. For your use case, it makes sense to disable LOD for all your imported low-poly meshes in the Import Defaults tab of the Project Settings.
If there are any non-white data in the vertex color channel do we disable lod? This doesn't feel like the right design.
LOD on vertex-colored meshes should definitely be kept in. I wonder if meshoptimizer could be modified to take vertex colors into account (essentially treating significant vertex color differences as sharp edges for the purposes of simplification). See also https://github.com/godotengine/godot/issues/53818.
I think you can assign the 4 rgba channels to the attribute simplifier. Unknown worth.
I think we can resolve this with a documentation entry.
Can we investigate if it's possible to quickly mitigate this problem by passing vertex colors to meshopt?
Any updates? This issue has not been looked at in over 2 years.
We've upgraded the LOD tooling in meshoptimizer but haven't tested the original cases.
Godot version
v4.0.alpha.custom_build [2aee84c75]
System information
Windows 11
Issue description
https://user-images.githubusercontent.com/4235617/152444746-6d3e3279-3056-4ccc-a528-b92741715a07.mp4
Using vertex painting on a model. If I zoom/de-zoom on my model, there is a glitch as you can see above. It is working well in 3.4.2.
(Is it a LOD issue?)
Steps to reproduce
Files: cube vertex paint .blend + gltf.zip
Minimal reproduction project
vertex painting 3.4.2.zip vertex painting 4.0.zip