Commit Graph

27 Commits (master)

Author SHA1 Message Date
Marc Gilleron dda396bb00 Fix narrowing conversion warning 2022-09-03 18:12:37 +01:00
Marc Gilleron d2b20f676e Removed default values from VoxelDataMap 2022-08-28 23:07:36 +01:00
Marc Gilleron c7c14d2e17 Added `do_graph` to VoxelToolLodTerrain 2022-08-23 22:58:20 +01:00
Marc Gilleron 66cf6e1539 Error message tweak 2022-08-09 23:55:47 +01:00
Marc Gilleron 177d7a99c9 Added basic stack tracking for memory pool allocations 2022-06-06 21:54:20 +01:00
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 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 bfa24402ac Renamed util/funcs.h => container_funcs.h 2022-04-14 21:43:45 +01:00
Marc Gilleron ec90ea9f77 Fix some macros 2022-04-14 21:22:32 +01:00
Marc Gilleron 4a0a5068f0 Use custom error macros in VoxelBuffer 2022-04-13 23:15:46 +01:00
Marc Gilleron 259a914cbf Return a ref instead of pointer, it must not be null 2022-04-09 15:05:04 +01:00
Marc Gilleron 493b93a051 SDF is now encoded with inorm8 and inorm16 2022-02-26 22:51:29 +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 e53dcf7c84 Re-namespaced VoxelConstants 2022-01-09 03:06:58 +00:00
Marc Gilleron 38baeae2d9 Namespaced VoxelBufferInternal 2022-01-08 22:49:59 +00:00
Marc Gilleron 5ece3b840e Namespace VoxelMemoryPool 2022-01-03 23:20:38 +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 308dfe01a0 Fix macro 2021-11-14 18:54:21 +00:00
Marc Gilleron 7ca67e9e89 Added some checks 2021-11-14 18:40:50 +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 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