8000 do_sphere tool creates angular hole · Issue #867 · Zylann/godot_voxel · GitHub
[go: up one dir, main page]

Skip to content

do_sphere tool creates angular hole #867

Open

Description

@wehoit

First, thank you for this incredible tool!
I'm very new to using it, so I have a few questions.

Q1) I'm using do_sphere() as a removal tool and I'm noticing that the removal leaves very angular holes.
What can I do to smooth these holes so they appear less angular?

Q2) The sphere size here is 1.0. I've noticed that if I use smaller values, like 0.5, the hole is not always created.
How can I create smaller holes?

Q3) You can see texture stretching on the far sides of the hole - how can I eliminate this?
Can I use a procedural texture, and if so - where can I find instructions/info/tutorials on how to apply one?

Here's my settings:
The texture is applied to the Materials Override on the VoxelTerrain.
Settings:
Texture on Albedo > Texture
UV1:
Scale = 1.0
Triplanar = ON
Triplanar Sharpness = Curve at 3.86
World Triplanar = ON
Sampling:
Filter = Linear Mipmap
Repeat = ON
MeshBlockSize = 16

Voxel Settings:
Stream = VoxelStreamRegionFiles
Generator = VoxelGeneratorFlat
Mesher = VoxelmesherTransvoxel

Here's an example pic:

Image

Activity

  1. Zylann commented on Jun 8, 2026

    @Zylann
    Owner

    Q1) I'm using do_sphere() as a removal tool and I'm noticing that the removal leaves very angular holes.
    What can I do to smooth these holes so they appear less angular?

    As you wrote in your next question, you used sphere size 1.0. Voxels are 1x1x1. Your shape is just too small. It's like trying to use a few pixels as a brush in a painting app and expect a smooth sphere to come out. If you want a rounder result, you have to use a bigger brush, or scale down your terrain to make voxels smaller (though costs increase cubically as you do that: going from 1x1x1 voxels to 0.5x0.5x0.5 means 8 times more voxels).
    If you're looking for very sharp carvings without high resolution voxels maybe a CSG-based terrain could work better, though it's not my area.

    Q2) The sphere size here is 1.0. I've noticed that if I use smaller values, like 0.5, the hole is not always created.
    How can I create smaller holes?

    Same as Q1, making your brush even smaller will only make it worse.

    Q3) You can see texture stretching on the far sides of the hole - how can I eliminate this?

    Changing your shader, or material. The demos use triplanar mapping. Assuming that's what you use, there is usually a way to change the sharpness of plane transitions so that this stretching becomes less pronounced (either with a parameter or directly in code).

    Can I use a procedural texture

    I guess so, if you can afford the cost of computing it in the fragment shader. Otherwise a repeating texture usually works.

    if so - where can I find instructions/info/tutorials on how to apply one?

    If you're asking this, I suspect it won't actually help you much with your problem. But I don't know of a particular tutorial to render procedural textures. NoiseTexture is a procedural texture but I doubt you want that. I'm a bit unsure what you really mean by this because it could mean different things that aren't related to the issue, like applying different textures automatically based on slopes and other parameters.

  2. wehoit commented on Jun 8, 2026

    @wehoit
    Author

    Thanks for your comments.

    I tried scaling the mesh using the normal Transform scaling.
    I tried 0.5x1.0x0.5 and the holes looked better, however, I noticed that as I moved away from the origin, the holes' placement seemed to be a factor of the scaling - that is they appeared in a different place than my dig point.

    It's as though the scaling created the same mesh but moved the points, and when i tried to dig, the action did not affect the points at my location, rather the points in the same position as when it was 1x1x1.

    I guess I have to recalculate the dig point to account for the scaling so that it actually affects points further from the origin?

  3. Zylann commented on Jun 8, 2026

    @Zylann
    Owner

    I tried scaling the mesh using the normal Transform scaling.

    I assume you mean scaling the terrain?

    however, I noticed that as I moved away from the origin, the holes' placement seemed to be a factor of the scaling - that is they appeared in a different place than my dig point.

    That's likely because you're mixing up coordinate spaces, the VoxelTool of a terrain takes local coordinates, not global.

  4. wehoit commented on Jun 9, 2026

    @wehoit
    Author

    Yes, I meant scaling the terrain.

    Thanks! - I didn't know about the to_local() function - that fixed it.

  5. Zylann commented on Jun 9, 2026

    @Zylann
    Owner

    I should also mention that non-uniform scaling might not be well supported. It might work to an extent but I don't guarantee it.

  6. wehoit commented on Jun 9, 2026

    @wehoit
    Author

    I'm keeping it uniform, and it seems ok.

    I have noticed that the collision detection has gotten unreliable - my Player object falls through the voxel terrain at startup pretty frequently.

    I ended up moving the player up in Y in case part if it was below surface when the terrain is generated but this doesn't completely solve the issue.

    It shouldn't be a problem though as I'm using a Waves/Transvoxel and pretty flat params:
    Bounds Min: -64, -16, -64, Max: 64, 16, 64
    Transform Scale: 0.25, 1.0, 0.25 0.25 gives me fairly small 'holes' and keeps them rather smooth.

    I'm also using:
    voxel_tool.sdf_strength = 1.0
    voxel_tool.sdf_scale = 1.0
    voxel_tool.grow_sphere(voxel_terrain.to_local(dig_marker.global_position), 1.0, 0.5)

    I've also tried using a Flat generator but that doesn't solve the issue.
    I've triple checked all my collision shapes and nothing is out of place - it's quite strange.

    EDIT:

    I've done a lot of testing, including rebuilding the basic scene from scratch, and it simply appears as though the collision property is not working.
    I've added other collision objects (a small platform below my Player and just above the voxel terrain) and it works fine.
    Once the scene loads, the player interaction with the voxel terrain works as intended.
    I'm thinking there's an issue with the terrain not generating completely before the player does, so the collision never happens...

  7. Zylann commented on Jun 9, 2026

    @Zylann
    Owner

    The collision property works AFAIK. If it's not, then you'll have to describe this more accurately with a minimal test project that shows the problem, in a different issue (because your current issue is about something else).
    If these problems started happening when you scaled the terrain then I'm afraid that's a similar side-effect you would get with Godot's physics in the first place (the terrain just passes the meshes to Godot to make colliders, nothing special). Being a voxel terrain, shapes can be anything and almost always concave, so only mesh colliders can be used, and these are pretty much the "worst": slowest, and prone to tunnelling (easy to pass through if you're fast enough or small enough without CCD). I don't know why else you'd have problems with collision besides that.
    With Transform Scale: 0.25, 1.0, 0.25, it's more likely that it would break, it's not uniform scale, and physics typically don't like that.
    Of course collision doesn't become available until corresponding chunks are meshed, so falling through ground in a place that hasnt loaded yet is expected.

  8. wehoit commented on Jun 9, 2026

    @wehoit
    Author

    One last thing (I'll start another thread if you like)

    I deleted the .godot folder and restarted my project and all is working.

    I'm guessing something went wrong with the collision and the voxel terrain - do you want the cache for testing?

  9. Zylann commented on Jun 10, 2026

    @Zylann
    Owner

    I deleted the .godot folder and restarted my project and all is working.

    The voxel terrain doesn't do anything with the cache folder. I doubt it's related at all.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0