-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build a manifold extension to glTF #422
Comments
Here's the glTF extension draft: KhronosGroup/glTF#2286 |
@elalish If I wanted to support this in Godot Engine should I implement this extension? How does it degrade? I unhappily wasn't able to integrate your manifold library into Godot Engine in a reasonable time. |
If you can explain your use case I'll be able to give you a better answer. How do you plan to use manifold meshes? Are you still interested in integrating manifold into Godot, or has that been blocked? Anything I can do to make it easier? |
One of the problems with using the manifold library is requiring input manifold meshes. If I can keep a chain of meshes that are manifold in gltf form, I can keep the chain all the way to the output. Starting from the cad / 3d modeler, imported into godot engine (triangulated), and then csg merge, subtract and intersect operations, to the resulting mesh which also be used for the input of this chain. I rejected using a system where the non-manifold meshes are voxelized with openvdb and then forced into manifold structure. |
Then yes, this is exactly the kind of workflow I was envisioning this glTF extension would be useful for. This way a manifold mesh can be marked as such and transmitted without loss. Of course it doesn't solve the hard problem: many meshes (including CAD) are not even close to manifold and fixing them is often non-trivial. But at least we now have the |
I think from a point of view of a user, I can have a scene that enforces manifold input. As long as the chain is unbroken, I get a manifold output. |
Considering that Manifold handles arbitrary mesh properties like normals and UVs, it would be nice to be able to round-trip this type of material data through a file format losslessly. This is not generally possible, as even indexed files like OBJ or glTF must be exported as non-manifold when they contain multiple materials (or even sharp corners) as GPUs require the vertex positions to be duplicated for any vertex properties that don't match. Relying on geometric checks (verts having identical positions) to reassemble the manifold will often work, but is unreliable in general.
It appears that a glTF extension is possible to make that will encode this manifoldness data, and at very little size cost, by using their concept of sparse accessors. I'll write up this extension and propose it to Khronos (since I work with them for my day job anyway), but as far as Manifold is concerned, the work will be to make a reader and writer of this extension, proving that it works.
I think it'll also be a good opportunity to show off #394 by making a small web tool to upload a GLB and download the manifold version of it (or show that we can't fix it automatically), which will hopefully help with problems like #91 (comment)
The text was updated successfully, but these errors were encountered: