Closed dganzella closed 9 months ago
I still have no idea what was happening to the Poor mesh inside ConvertDracoMeshToUnity
but I had an issue which was noticed by our QA analyst that it was randomly disappearing then moving the camera
here is the fixed code, I could onlu fix it my making a copy ,
var data = File.ReadAllBytes(filepath);
var draco = new DracoMeshLoader();
var mesh = await draco.ConvertDracoMeshToUnity(data);
var mesh_not_broken = new Mesh();
mesh_not_broken.SetVertices(mesh.vertices);
mesh_not_broken.SetColors(mesh.colors);
mesh_not_broken.indexFormat = mesh.vertexCount > 65535 ?
IndexFormat.UInt32 : IndexFormat.UInt16;
mesh_not_broken.SetIndices(
Enumerable.Range(0, mesh.vertexCount).ToArray(),
MeshTopology.Points, 0
);
mesh_not_broken.UploadMeshData(true);
setupPointCloud(mesh_not_broken);
Hi @dganzella,
Thanks for reporting. I could not reproduce that behavior with stock test files and custom created ones. Can you give me a sample .drc file that reproduces this error.
Also, which version of Unity and DracoUnity are you using?
Thanks
Might be related to #64
Or maybe even #63 . The lack of correct bounds might confuse the culling, so point clouds are (not) rendered when they shouldn't. Can you try replacing your fix with a Mesh.RecalculateBounds.
?
Both #63 and #64 have been fixed in Draco for Unity, the successor of this repository/package.
Hey!
Point cloud importing is kinda not working. After running draco.ConvertDracoMeshToUnity, I needed to make a few adjustments
Both the Index format is wrong, and no submesh is being created
so here is how to solve it for now: