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

Changing CSG node Snap doesn't regenerate mesh #93240

Closed
31 opened this issue Jun 16, 2024 · 0 comments · Fixed by #93242
Closed

Changing CSG node Snap doesn't regenerate mesh #93240

31 opened this issue Jun 16, 2024 · 0 comments · Fixed by #93242

Comments

@31
Copy link
Contributor

31 commented Jun 16, 2024

Tested versions

System information

Godot v4.2.2.stable - Windows 10.0.22631 - Vulkan (Forward+)

Issue description

I found this on a build of #91748, but it applies to 4.2.2 as well and the code is the same on tip.

I tried running TextMesh through CSGMesh3D and subtracting it from a box (Text.tscn) as a way to generate situations where CSG meshing might have problems without making a bunch of nodes or making a big mesh of my own. I spotted some bumpy triangles:

image

Changing the Box's Snap from 0.001 to 0.0001 and reloading the scene fixes it:

image

But: should I really need to reload the scene? Or should set_snap include _make_dirty(); like the other methods do?

void CSGShape3D::set_snap(float p_snap) {
snap = p_snap;
}

void CSGShape3D::set_operation(Operation p_operation) {
operation = p_operation;
_make_dirty();
update_gizmos();
}

I can imagine someone seeing this problem, not knowing to reload the scene (or jiggle a node) and thinking that Snap is broken! With the improvements to CSG in #91748, this might interfere with users attempting to try out the feature and make them think it's less capable than it is.


On 4.2.2, 0.001 snap looks worse, and the mesh has holes (a known issue across many scenarios):

image

Changing to 0.0001 snap doesn't look quite as good as #91748, but it is an improvement in this part of the mesh as there are no visible holes:

image

(There are plenty of holes elsewhere in the mesh, but I think that's to be expected.)

Steps to reproduce

  1. Load https://gist.github.com/31/c3c4bace42d4ca550ae6badf0f2b7cf9, or make a CSG scene with problems that need a lower snap value.
  2. Change snap.
  3. See that the generated mesh doesn't change.

Minimal reproduction project (MRP)

Text.tscn: https://gist.github.com/31/c3c4bace42d4ca550ae6badf0f2b7cf9

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

Successfully merging a pull request may close this issue.

4 participants