131 Commits

Author SHA1 Message Date
Marc Gilleron
669e5230ed Update VoxelLodTerrain stats 2022-03-20 18:30:18 +00:00
Marc Gilleron
79b1ebdaa0 Fix invalid member 2022-03-19 20:11:39 +00:00
Marc Gilleron
48670d9a8e Separate mesh map data structures between updating and final 2022-03-19 19:43:33 +00:00
Marc Gilleron
7f106f4358 Fix broken transition updates 2022-03-16 00:05:04 +00:00
Marc Gilleron
5ddcbc2065 Added optional threaded execution of VoxelLodTerrain's process function 2022-03-15 00:29:39 +00:00
Marc Gilleron
f631d8880c Added configuration warnings to resources 2022-03-06 01:10:47 +00:00
Marc Gilleron
21daedd5dc Fix old struct type 2022-02-13 17:17:37 +00:00
Marc Gilleron
942fc9e980 Option to show octree nodes in editor 2022-02-13 01:19:21 +00:00
Marc Gilleron
b3faec2bef Removed voxel_block_request.h, use specialized structs 2022-02-12 23:37:02 +00:00
Marc Gilleron
98eed9adba Remove some usages of Vector<T>. Also fixed some indexing issues in streams.
Reason: in a future port to GDExtension, that class won't be available.
This may also apply to Map and HashMap.

Note: the issues in streams were not hit so far because they are in
multi-block load/save functions. We've been loading and saving blocks
one by one at the moment.
2022-02-06 21:26:48 +00:00
Marc Gilleron
d1250ef0ad Added support functions to help setting up basic multiplayer with VoxelTerrain.
These might change in the future. Will have to test that later,
when Godot 4 gets more stable.
2022-01-31 21:23:39 +00:00
Marc Gilleron
ec19e7565d Moved member var into an internal TLS 2022-01-16 03:59:15 +00:00
Marc Gilleron
b67ca3d903 Namespaced every registered class 2022-01-09 22:16:44 +00:00
Marc Gilleron
774adfca3c VoxelServer no longer inherits Object.
The Godot-facing singleton is now a different class in gd:: namespace.
Moved the updater to its own file.
2022-01-09 04:53:33 +00:00
Marc Gilleron
e53dcf7c84 Re-namespaced VoxelConstants 2022-01-09 03:06:58 +00:00
Marc Gilleron
9c653b8a9f Namespaced FixedArray 2022-01-09 02:53:21 +00:00
Marc Gilleron
b112b620f7 Namespaced VoxelMeshBlock, VoxelMeshMap 2022-01-08 23:18:28 +00:00
Marc Gilleron
8166ebbfcf Namespaced VoxelDataBlock, VoxelDataGrid, VoxelDataMap 2022-01-08 23:04:49 +00:00
Marc Gilleron
38baeae2d9 Namespaced VoxelBufferInternal 2022-01-08 22:49:59 +00:00
Marc Gilleron
14840634de Re-namespaced VoxelDebug 2022-01-04 22:57:21 +00:00
Marc Gilleron
64415a3c86 Configure clang-format to put a newline after template declarations 2022-01-04 22:15:57 +00:00
Marc Gilleron
4ced432a3c Namespaced LodOctree 2022-01-03 23:42:31 +00:00
Marc Gilleron
89f3343354 Allow to dump VoxelInstancer as scene for debug inspection 2021-12-30 04:25:42 +00:00
Marc Gilleron
12caefe577 Renamed VoxelThreadPool => ThreadedTaskRunner and namespace it 2021-12-29 18:25:47 +00:00
Marc Gilleron
267bde13fb Added gi_mode property to VoxelNode to specify GI behavior 2021-12-16 00:11:11 +00:00
Marc Gilleron
3596c13475 Renamed set_process_mode to set_process_callback to fix conflict with newly renamed Godot4 Node method 2021-12-14 00:10:09 +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
a226111818 Run edits after preloads without a sync point on the main thread
- Still room for improvement, more parallelism is possible
- Started moving the data into its own structure
- Added locks to secure access to the data map (not truly used yet)
- Tasks with a tracker can schedule next ones when they complete
- Data loading responses also come with a callback, no buffer anymore
- Use new data grid to cache map access
2021-10-13 20:28:20 +01:00
Marc Gilleron
62447c7133 Moved some temporary vectors away from members.
They can be static thread locals since the whole point is to
re-use their allocated capacity. We don't need them to retain
any state between two calls to _process.
2021-10-06 18:34:02 +01:00
Marc Gilleron
123a3e3c9d Split VoxelLodTerrain::_process into sub-functions 2021-10-05 20:47:28 +01:00
Marc Gilleron
c5b0ac43fb Semi-async do_sphere() implementation. May change though.
It is a lot better than the fully synchronous do_sphere(),
but it would be a lot better if we could move everything async
2021-10-04 19:20:36 +01:00
Marc Gilleron
c5972a420e Fix compilation and gizmos 2021-10-03 15:47:56 +01:00
Marc Gilleron
bb7311b282 Merge branch 'master' into full_load_mode 2021-10-03 02:48:46 +01: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
16b7445d1d Changing data block size is not supported at the moment 2021-10-03 01:28:29 +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
Marc Gilleron
3197eaba35 Move main thread tasks into one runner in VoxelServer
So the timing budget is better respected even if there are multiple
voxel nodes in the scene
2021-09-25 00:02:41 +01:00
Marc Gilleron
44f00176d3 Use std::unordered_set instead of Godot Set in VoxelLodTerrain 2021-09-23 23:49:18 +01:00
Marc Gilleron
2971334e85 Changed VoxelToolLodTerrain to use write_box
- Should be faster than get/set_voxel
- No longer expose internal data map
2021-09-17 20:01:15 +01:00
Marc Gilleron
ff4e7f9560 Added debug drawing of mesh octree using multimesh (not exposed for now) 2021-09-16 21:54:04 +01:00
Marc Gilleron
e7e8e72507 Quick fix to avoid error when trying to edit across loaded border.
There should be a better solution in the future, it's not optimal
2021-07-25 19:48:51 +01:00
Marc Gilleron
8c17a1cf20 Added property to configure collision margin 2021-07-10 22:14:17 +01:00
Marc Gilleron
1ee5bcb80d Renamed Rect3i -> Box3i 2021-05-31 17:12:04 +01:00
Marc Gilleron
2e9d817246 Moved VoxelDataMap to storage/ folder 2021-05-31 16:27:08 +01:00
Marc Gilleron
efe8bcf9c0 Show a configuration warning when a mesher does not support LOD 2021-05-15 23:41:19 +01:00
Marc Gilleron
fa48523073 Added collision layer and mask properties 2021-05-09 20:49:45 +01:00
Marc Gilleron
ba78f67394 Fixed another property inconsistency to fix C# bindings 2021-05-08 17:15:15 +01:00
Marc Gilleron
14cc77eb7c Make getter and setter types match to fix an issue with C# bindings 2021-05-07 22:39:06 +01:00
Marc Gilleron
b846194bea Fix some GCC warnings 2021-04-18 01:29:26 +01:00
Marc Gilleron
e0f2f706aa Added debug_get_data_block_info and fix/improve debug_get_mesh_block_info 2021-04-05 03:46:15 +01:00