Commit Graph

40 Commits (master)

Author SHA1 Message Date
Marc Gilleron 08bc5095d1 Removed old code 2022-09-03 17:51:47 +01:00
Marc Gilleron 74052885ad Removed block size cache in VoxelDataMap, takes space for no good use 2022-08-29 13:45:25 +01:00
Marc Gilleron d2b20f676e Removed default values from VoxelDataMap 2022-08-28 23:07:36 +01:00
Marc Gilleron 414aea52f3 Replaced VoxelDataMap with VoxelData in VoxelLodTerrain 2022-08-28 20:45:42 +01:00
Marc Gilleron c7c14d2e17 Added `do_graph` to VoxelToolLodTerrain 2022-08-23 22:58:20 +01:00
Marc Gilleron f535e7c089 Remove a few verbose prints, they spam too much 2022-08-23 21:00:51 +01:00
Marc Gilleron cbf7b96e3a Buffer should have been const 2022-08-23 20:59:11 +01:00
Marc Gilleron 7634df561e TODO, I'm not sure what to do about this 2022-07-03 03:25:57 +01:00
Marc Gilleron 392c335956 Fix crashing/not working edition in VoxelLodTerrain 2022-06-25 22:48:39 +01:00
Marc Gilleron 86ba74ce3a Some changes and fixes related modifiers
- VoxelLodTerrain no longer caches generated voxels by default, so
  generating on the fly is no longer exclusive to full load mode.
  Might add an option later, but not for now (VoxelTerrain is still
  unaffected and keeps caching them)
- The "Cached" state is represented with blocks having no voxel data,
  so it needs extra checks in some areas to avoid null access
- Fix generate task was not including modifiers after the base generator
- The "save_generator_output" option on streams now means such blocks are
  considered edited
- Modifying modifiers now clears cached generated blocks
  intersecting with them.
- Fix "re-generate" was erasing the internal stack of modifiers
- Added docs
2022-06-18 23:14:18 +01:00
Marc Gilleron 0e12e6dbf1 Initial WIP for SDF non-destructive voxel modifiers. Support is incomplete.
Some voxel queries and operations will not take modifiers into account.
It needs to be worked on, might involve some refactoring.
2022-06-09 20:35:29 +01:00
Marc Gilleron 5c716e360d Macros replacement 2022-06-04 03:36:42 +01:00
Marc Gilleron abdcb4c7d5 Storing position on VoxelDataBlock isn't necessary 2022-06-04 02:44:00 +01:00
Marc Gilleron f34d87d305 Simplified data VoxelDataMap structure 2022-06-04 02:23:56 +01:00
Marc Gilleron 87d98e9162 Engine-agnostic error macros 2022-04-11 02:10:44 +01:00
Marc Gilleron 0cc3801655 Define smart pointers default allocator in a single place 2022-04-10 20:10:33 +01:00
Marc Gilleron 219c7bfda3 Changed prefix of profiling macros 2022-04-09 15:33:08 +01:00
Marc Gilleron ab5d3a22d3 Abstract logging for verbose print 2022-04-09 15:00:34 +01:00
Marc Gilleron 5519054c01 Unify macro prefixes 2022-04-06 23:26:54 +01:00
Marc Gilleron 5ddcbc2065 Added optional threaded execution of VoxelLodTerrain's process function 2022-03-15 00:29:39 +00:00
Marc Gilleron e958739759 Fix some narrowing conversions 2022-02-13 16:19:54 +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 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 0fee995c0f Namespaced godot utility funcs 2022-01-03 23:52:54 +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 43df211e8e Fix conversion warning 2021-12-11 23:25:22 +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 e6f1be6ac3 Use same defaults as VoxelBuffer 2021-10-02 18:53:04 +01:00
Marc Gilleron 100b6d1816 Switch to unordered_map, slightly better performance 2021-09-28 22:37:37 +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 979e5c9c47 VoxelTool.paste now only expects 0xffffffff to turn off masking.
Before it was 0xffffffffffffffff, which the GDScript parser no longer
accepts because it is greater than INT64_MAX.
In the future we may rework this API.
2021-09-24 02:09:58 +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 32beb6f8a8 Stop printing in map destructors 2021-09-13 00:20:30 +01:00
Marc Gilleron 2fda5747c6 Comments 2021-09-13 00:19:51 +01:00
Marc Gilleron 7cb1e4008e Use accessor 2021-08-15 17:27:55 +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