-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Fix mesh corruption of CSG by using elalish/manifold #94321
Fix mesh corruption of CSG by using elalish/manifold #94321
Conversation
5a2e7e0
to
ccdfea7
Compare
eb82d74
to
e28f331
Compare
Thanks for the ping on Discord about this. I finally got a chance to take a look. 🙂 I got materials working (it seems), but all I did was put my old code from #91748 (review) back in and change some names to fit the new place where this implementation lives: 31@5eaf7cb. Admittedly, my testing is still quite limited. Here's a simple scene that is looking good to me: https://gist.github.com/31/a3e597b32ab31b132ddbc488d8eb0324. The stress-test-ish scene with text also still seems to be working fine: https://gist.github.com/31/c3c4bace42d4ca550ae6badf0f2b7cf9. (Maybe even faster? Been a while.) I like the change of where this logic lives (vs. #91748). However, I'm not following why the implementation details were changed. It seems significantly more complex and I can't spot what it's fixing. Do you have a test case that this helps with? |
As far as I know the implementation details changed because Mesh became MeshGL in manifold. The rest of the changes were a result of this. I didn't like that fact that we are passing an increasingly growing material dictionary so that was removed, but I caused an error. Thanks for fixing! |
The developers working at manifold worked hard to remove exceptions and thrust, so we were able to vastly reduce the dependencies by 1/3. The changes here were due to api updates. |
f4c93df
to
3391f6b
Compare
e77e71d
to
db8d880
Compare
Exciting! |
https://github.com/catprisbrey/Cats-Godot4-Modular-Souls-like-Template load this project crash! |
After reverting this commit, the scene can be loaded normally. |
@zhangjiangen11 Can you create a new issue? I suggest clearing .godot because I can't recreate the crash. |
Can you post the script as an MIT-licensed GitHub project? The top portion of the sponge seems corrupted. |
Here it is. csgmanifoldtest.zip Set The holes gaps on the rotated combiners of boxes might be misaligned if 90degree rotation is implemented using the axis vectors I can't explain why one the triangles of the middle hexagram star on each edge is too large. |
I modified the CSG snap values, and it seemed to work ok. |
I associated godot engine |
There's no snapping in manifold itself. It almost looks like it's using 0.33 instead of a 1/3 or something. @fire even yours looks quite asymmetric and wrong to me.
That might be dangerous... I'm not sure exactly how snap is used internally by Godot, but we use tolerance for mesh simplification, which can yield pretty unexpected results if the value gets too large. |
We can deprecate snap and use the default manifold tolerance. How does that sound? |
Yeah, that sounds good to me. |
I already saw an issue with the default snap/tolerance a while back, example in this issue: #93240 I'm not sure how to rectify the meanings, but from what I've seen, it probably matters to expose it somehow. Maybe you can get around it by scaling/unscaling, but that doesn't sound all that nice to deal with for prototyping in-editor. (Edit: That all said, if the default tolerance for Manifold is (effectively) massively smaller than what anyone would be using, I suppose that's fine. 😄) |
I understand that, but I don't have a sense for what the default Manifold tolerance behavior means. If I scaled the text 1/100, would the default behavior show a similar problem? 1/10000? Or is the default behavior close enough to floating point epsilon that it's difficult to even encounter that kind of problem? I wasn't able to find any info in the Manifold docs that really told me what situation to expect here. 😕 |
Yes, the default is floating point epsilon. |
Looks like this also fixed #94174. |
Fixes: godotengine/godot-proposals#9711
Fixes: elalish/manifold#91
The goal is to supersede #91748.
Work was done as part of the V-Sekai development community, which is focused on providing social VR functionality for the open-source Godot Engine.
Materials are not transferringOk to review for style. Trying to debug why the materials are broken.Fixes: #43755
Fixes: #58637
Fixes: #41140
Future work