Skip to content
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

Update snap value for precision in small scale models. #90950

Closed
wants to merge 1 commit into from

Conversation

fire
Copy link
Member

@fire fire commented Apr 20, 2024

Subtracting two CSG box nodes from a box can generate a floating triangle.

Not sure if this is the proper fix, so putting it out for testing.

Seems to resolve:

@fire
Copy link
Member Author

fire commented Apr 21, 2024

godot-csg-mesh-repro.zip

Fixes subtracting two CSG box nodes from a box can generate a floating triangle.
@fire fire force-pushed the smaller-csg-snap branch from a03ee0d to f9a5149 Compare April 25, 2024 13:25
@Calinou
Copy link
Member

Calinou commented Apr 25, 2024

How well does this behave when a few thousand units away from the world origin (between 4096 and 8192 units)? I believe this is why the default is 0.001.

@fire
Copy link
Member Author

fire commented Apr 25, 2024

@Calinou can send me a test case where this errors. I am not sure if it exists.

As far as I know this snapping value was because of a bug that used to cause an infinite loop.

#76521

I am imagining reusing that double precision tester where we have a scene at the origin and another one a million units away.

https://github.com/godotengine/godot/files/8137344/TestDoubles.zip From #58516

@fire
Copy link
Member Author

fire commented Apr 25, 2024

@Calinou I made a video of the double precision test with https://github.com/V-Sekai/godot-double-precision-test. How did you expect it to break because it doesn't seem to be breaking on a CSG box subtractions at the top left.

https://youtu.be/VD0_45cvXaU


I'll file a bug later, but @Zylann double precision has broken triplanar again.

@lyuma
Copy link
Contributor

lyuma commented May 6, 2024

This change is going to make CSG appear to have a precision issue without an obvious explanation why.

I would rather keep the current behavior which is obviously incorrect for some uses and have users change snap to a value appropriate for their application, than have a non obviously bad default that users won't notice or understand

@fire
Copy link
Member Author

fire commented May 6, 2024

I disagree because ordinary csg cases will be broken as in the bug reports which are human scale.

image

We discussed setting it to 0 and deprecating.

Edited: I refreshed manifold..

@fire
Copy link
Member Author

fire commented May 7, 2024

Closing due lack of agreement on this method.

@fire fire closed this May 7, 2024
@akien-mga akien-mga removed this from the 4.x milestone May 7, 2024
@fire fire deleted the smaller-csg-snap branch May 23, 2024 02:19
@fire
Copy link
Member Author

fire commented May 23, 2024

#91748 is a better theoretical fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants