20 Commits

Author SHA1 Message Date
Marc Gilleron
f993796ca1 Added inspector plugin to edit VoxelMeshSDF 2022-05-05 20:57:59 +01:00
Marc Gilleron
868ae90fbe Added VoxelMeshSDF and VoxelToolLodTerrain.stamp_sdf() 2022-05-02 19:14:12 +01:00
Marc Gilleron
4e3d4d4ed8 Threading classes wrappers 2022-04-19 00:32:37 +01:00
Marc Gilleron
d7e0af161a Abstracted voxel metadata so internals no longer depends on Variant 2022-04-18 19:59:38 +01:00
Marc Gilleron
8aec9cf777 VoxelBufferInternal doesnt depend on Image 2022-04-16 16:07:45 +01:00
Marc Gilleron
4a0a5068f0 Use custom error macros in VoxelBuffer 2022-04-13 23:15:46 +01:00
Marc Gilleron
61b27491f9 Initial implementation of binary search in Transvoxel.
It is very slow but seems to be working. It affines vertex positions,
but normals are not improved. Maybe more work will be done in the future
if that technique becomes more relevant.

Partly based on a prior experiment:
11f716f79d0ade59c0e9547a2333183e96b17b43
2022-03-27 21:36:30 +01:00
Marc Gilleron
f53f0a520d Require explicit parameters (were also not used) 2022-03-27 17:06:43 +01:00
Marc Gilleron
80d7399fbb Added more region file tests 2022-02-28 22:17:28 +00:00
Marc Gilleron
92474f8322 Use a FlatMap instead of Godot's Map to store voxel metadata.
Reasons:
- when switching to GDExtension, Map won't be available anymore
- FlatMap may be more efficient for small amounts of sparse items
2022-02-13 16:19:17 +00:00
Marc Gilleron
b3faec2bef Removed voxel_block_request.h, use specialized structs 2022-02-12 23:37:02 +00:00
Marc Gilleron
b67ca3d903 Namespaced every registered class 2022-01-09 22:16:44 +00:00
Marc Gilleron
38baeae2d9 Namespaced VoxelBufferInternal 2022-01-08 22:49:59 +00:00
Marc Gilleron
dcbb59b15c Namespaced storage funcs 2022-01-04 20:50:33 +00:00
Marc Gilleron
922f361cb0 Made it compile in Godot 4
- Made a bunch of changes to comply with Godot 4 API
- Use Godot's Vector3i and add the missing stuff with helper functions
- Transvoxel uses custom attributes API, the old way would not work
- Wrap MeshOptimizer in a unique namespace (see build script why)
- Added clang-format file for the module as some rules now differ
- Prevent thirdparty code and lookup tables from being clang-formatted
- Very likely full of runtime bugs that need fixing
2021-12-13 21:38:10 +00:00
Marc Gilleron
380e295d94 Merge branch 'master' into full_load_mode
# Conflicts:
#	meshers/transvoxel/transvoxel.h
#	server/voxel_server.cpp
#	terrain/voxel_lod_terrain.cpp
2021-12-11 22:59:24 +00:00
Marc Gilleron
7ca67e9e89 Added some checks 2021-11-14 18:40:50 +00:00
Marc Gilleron
e04091f3cb Added full load mode to VoxelLodTerrain
With this mode enabled, editing anywhere becomes possible.
All edited blocks are loaded at once when the stream is assigned.
The generator is used on the fly to fill the gaps, instead of being
pre-emptively cached only nearby the viewer to allow editing.
Editing is still on the main thread, so this can cause stalls if
the generator is complex. There is also no controlled limit on how
much data gets loaded, so if edited data is larger than RAM, it will
not be playable. The feature is already quite usable, but more work
may be done for wider viability.
2021-10-03 01:48:07 +01:00
Marc Gilleron
bfc4c0d363 Fix memory corruption occurring after writing out of bounds.
Found this after using VoxelBufferInternal in a pattern that was never
used before. Added reproduction as a test.
2021-10-01 00:54:34 +01:00
Marc Gilleron
30db0c5193 Split VoxelBuffer in two, script-facing wrapper and internal.
The internal is the main use within the voxel engine,
and does not inherit Reference.
2021-09-26 04:14:50 +01:00