Zylann / godot_voxel

Voxel module for Godot Engine
MIT License
2.72k stars 251 forks source link

VoxelToolLodTerrain.stamp_sdf() doesn't work #612

Closed Piratux closed 8 months ago

Piratux commented 8 months ago

Describe the bug As the title says, VoxelToolLodTerrain.stamp_sdf() doesn't work ~90% of the time. On other 10% of the time, I'm not getting expected mesh shape.

More precisely, by "90% of the time", I mean when I start the project, if I get unlucky (90% chance), no matter what I do, stamp_sdf() produces no result. In remaining case, when starting the project, if I get lucky (10% chance), I always see some result from stamp_sdf().

I have checked whether stamp_sdf() works in the following project but I get similar results - sometimes I see mesh stamped, sometimes nothing happens:

I have checked whether SDF data is correct with the following, but in all cases I saw no issues:

I see no errors in console.

To Reproduce Steps to reproduce the behavior:

  1. Download minimal reproduction project.
  2. Run it with Godot.
  3. Follow the instructions shown in window upon running the project (see image below).
  4. Notice that VoxelToolLodTerrain.stamp_sdf() doesn't work. If it does work, try closing the project and running it again (because as mentioned, in some cases it works and in some cases it doesn't). image

Expected behavior See stamp_sdf() modify terrain using mesh shape.

Environment

Zip with minimal reproduction project stamp_sdf_issue_mrp.zip

Zylann commented 8 months ago

Try with this fix 75cfda9854a2f45d00298a48ec84f7c9201ab606

Piratux commented 8 months ago

Alright, let me try.

Piratux commented 8 months ago

Okay, it seems that it works now, thanks.

I'm going to close this now.