20 Commits

Author SHA1 Message Date
Marc Gilleron
3101d7f092 Namespaced file_utils 2022-01-09 02:21:49 +00:00
Marc Gilleron
38baeae2d9 Namespaced VoxelBufferInternal 2022-01-08 22:49:59 +00:00
Marc Gilleron
2fdf0bf6df Namespaced VoxelBlockSerializerInternal 2022-01-03 02:52:06 +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
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
f0c59acf0b Fix VoxelStreamBlockFiles always showing a warning about channels 2021-09-18 01:44:33 +01:00
Marc Gilleron
d1207bdd96 Reorganized some utility files 2021-02-17 20:34:35 +00:00
Marc Gilleron
b66b9a01a9 Removed VoxelStreamFile 2021-02-01 22:25:25 +00:00
Marc Gilleron
c6b169b978 Upgraded block serialized format, added some error handling 2021-01-30 01:36:37 +00:00
Marc Gilleron
4ec60074bb Refactor generators and streams
- VoxelGenerator no longer inherit VoxelStream
- VoxelStream is now more focused on files
- Nodes have separate stream and generator properties
- Generators use 2 dedicated threads instead of sharing a single one with streams
- TODO Image.lock() is problematic for multithreading
- TODO Voxel graph can cause RWLock contention if edited while it runs
- TODO Saving generator output no longer works, need to put it back
2021-01-17 17:18:05 +00:00
Marc Gilleron
89750a20f8 Made file streams thread-safe (but still won't be used in more than one thread)
- Added a global file locker so threads can synchronize when accessing files
- Added mutexes to serialize access to file streams (i.e to call in series)
- VoxelStream API now expects implementations to be thread-safe
- Did some logic/data separation in RegionFile in case we need an
  in-memory implementation, however I might just use SQLite in the
  future instead
2021-01-16 13:34:45 +00:00
Marc Gilleron
071c5ee5c0 Fix channel depth not being applied to VoxelMap::get_buffer_copy() 2020-07-11 18:05:26 +01:00
Marc Gilleron
b1dc8d3762 More fixes to file streams:
- Assign channel formats before saving for the first time
- Always try to load meta file if not loaded, rather than saving it over
2020-02-09 18:41:39 +00:00
Marc Gilleron
6851818733 Fix non-initialized default metadata in VoxelStreamBlockFiles 2020-02-09 18:29:47 +00:00
Marc Gilleron
a8c5fed29d File streams fixes:
- Uniform compression now supports more than 8-bit depth (compat implementation)
- Fix buffers not being set to correct depth before loading from file
- Check if we save correct buffer depths in region files
- Fix inverted check when reading region meta file
- Fix version check not working in JSON meta file because it's float
2020-02-09 17:07:53 +00:00
Marc Gilleron
8224346846 Added depth info to VoxelStreamBlockFiles. No versionning for this one, it's not a recommended stream anyways. 2020-01-25 22:54:49 +00:00
Marc Gilleron
f14b374931 Made block size and a few other params modifiable (not so easy, though) 2019-08-24 01:44:27 +01:00
Marc Gilleron
457ebf626d Added stat for time spent opening files 2019-08-18 16:10:40 +01:00
Marc Gilleron
c7cf0c5b17 Show directory picker in inspector for file streams 2019-08-17 20:22:57 +01:00
Marc Gilleron
ece3a355af Rename VoxelStreamVXB => VoxelStreamBlockFiles 2019-08-17 19:43:08 +01:00