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

VoxelModifier preview mesh has gaps with smoothness #654

Open
Piratux opened this issue Jun 12, 2024 · 3 comments
Open

VoxelModifier preview mesh has gaps with smoothness #654

Piratux opened this issue Jun 12, 2024 · 3 comments

Comments

@Piratux
Copy link
Contributor

Piratux commented Jun 12, 2024

Describe the bug
VoxelModifier (this includes VoxelModifierMesh and VoxelModifierSphere) preview mesh starts to have gaps with high enough smoothness.

Image that shows gaps in mesh:
image

To Reproduce
Steps to reproduce the behavior:

  1. Create VoxelLodTerrain and add VoxelGeneratorFlat generator.
  2. Under VoxelLodTerrain add VoxelModifierSphere.
  3. Set VoxelModifierSphere's radius=30 and smoothness=40.
  4. Notice gaps in the mesh.

Expected behavior
Preview mesh should not have any gaps in the mesh.

Environment

  • OS: Windows 10
  • Graphics card: GTX 650 Ti
  • Godot version: 4.2.2 stable
  • Module version: 1.2.0
  • Renderer: Forward+

MRP
Test VoxelModifier mesh gaps.zip

@Zylann
Copy link
Owner

Zylann commented Jun 12, 2024

I believe this is happening purely because of the generator. The flat generator fills space with gradients up to a certain distance to ground. Beyond that, it sets it to uniform far SDF as an optimization. But that means if you use large smoothness factors in modifiers, chunks that lie in the area that's been "optimized out" by the generator will not "blobify" the same way as in areas that have accurate SDF, because gradients dont extend that far. If you wanted this to work at any distance, that optimization just can't happen.

Note that the same issue could happen with different generators doing the same trick. You'd have to calculate full SDF everywhere if you want smoothness to cause shapes to "connect" through arbitrary distances.

@Piratux
Copy link
Contributor Author

Piratux commented Jun 12, 2024

I see, that makes sense.
I think it could be a good idea to mention this issue under VoxelModifier's smoothness description.

@Zylann
Copy link
Owner

Zylann commented Jun 12, 2024

Added in 30d6b73

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

No branches or pull requests

2 participants