Commit Graph

81 Commits (06553710783ae3655fe6f1305418955839d09689)

Author SHA1 Message Date
Marc Gilleron 6441d1b864 Deprecate Vector3i(Vector3) constructor, make conversions explicit
Some conversions were wrong/unintented.
This is also in prevision of using Godot 4 Vector3i,
which default behavior differs from this module.
2021-10-31 16:01:47 +00:00
Marc Gilleron 1d62649b9a Fix leaking Pool objects 2021-10-04 01:36:15 +01:00
Marc Gilleron c921922a44 Fix missing assignment 2021-10-04 01:33:32 +01:00
Marc Gilleron e6f1be6ac3 Use same defaults as VoxelBuffer 2021-10-02 18:53:04 +01:00
Marc Gilleron c6b2275738 Fix some stats and add VoxelMemoryPool info 2021-10-02 18:31:48 +01:00
Marc Gilleron 228e41b71e Fixed writing out of bounds when the whole buffer is copied 2021-10-01 19:31:30 +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 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
Scott Wadden 511422c30d Fixed macos build errors 2021-09-22 09:48:35 -03:00
Marc Gilleron 176f46440f Merge meshing and generation thread pools, expecting better usage of available threads 2021-09-21 19:32:29 +01:00
Marc Gilleron 8e53fbaa47 Merge branch 'master' into octree_compression 2021-09-18 18:18:09 +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 cf00db1908 Should not exist yet 2021-09-16 22:16:57 +01:00
Marc Gilleron 8aaee73157 Merge branch 'master' into octree_compression 2021-09-16 20:52:32 +01:00
Marc Gilleron 0604a3492d Comments and formatting 2021-09-16 20:46:55 +01:00
Marc Gilleron c9b1840e99 Added `max_lod_hint` return value to block generators 2021-09-16 20:33:45 +01:00
Marc Gilleron 3cfb7f510b Fix lambda capture defaulting to const when it should be writable 2021-09-13 00:21:27 +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 58d365d2bf Profiling scopes 2021-09-09 18:53:22 +01:00
Marc Gilleron 5959699b9b Fix reorder GCC warning 2021-09-05 23:55:57 +01:00
Marc Gilleron 7cb1e4008e Use accessor 2021-08-15 17:27:55 +01:00
Marc Gilleron f9ba660c86 Fix warnings 2021-08-14 18:28:15 +01:00
Marc Gilleron 026c14fcb5 Added importer to import vox files into a single mesh
- New importer, needs restart to switch but it's a limitation of Godot
- Might blow up if the scene spans a really big area, may be optimized in the future.
- The scene importer remains the default choice
- Promoted some ints to 64-bit to avoid oveflowing with large volumes or distances
- Handle a few cases of malloc failure
2021-08-14 16:49:46 +01:00
Marc Gilleron 6ea6ce9581 Initialize to the same defaults as in VoxelBuffer 2021-08-01 15:41:23 +01:00
Marc Gilleron f74d29280a Fix channel enum names 2021-06-16 23:35:05 +01:00
Marc Gilleron 19f440527e Implemented VoxelToolTerrain.for_each_voxel_metadata_in_area 2021-06-16 23:31:00 +01:00
Marc Gilleron da8dc36590 Return all channels supported with region files and SQLite
This fixes a node configuration warning,
because before these were always returning no channels at all.
2021-06-14 18:51:19 +01:00
Marc Gilleron dc4569408d Fix wrong conditional 2021-06-11 18:43:57 +01:00
Marc Gilleron 1ee5bcb80d Renamed Rect3i -> Box3i 2021-05-31 17:12:04 +01:00
Marc Gilleron 411be94559 Renamed ArraySlice -> Span 2021-05-31 16:48:49 +01:00
Marc Gilleron 2e9d817246 Moved VoxelDataMap to storage/ folder 2021-05-31 16:27:08 +01:00
Marc Gilleron efb6a26b5e Fix GCC warnings (2) 2021-05-31 01:05:19 +01:00
Marc Gilleron 32e47a50e9 Fix GCC warnings 2021-05-31 00:34:53 +01:00
Marc Gilleron 8975a93c9b Fixed bad buffer adresses when multiple outputs are used
This was mainly apparent when optimization was enabled.
It caused outputs to be left uninitialized and either work by chance
or provide the wrong values.
2021-05-31 00:05:42 +01:00
Marc Gilleron 74e89b882e Implemented texture painting on all VoxelTools using faster access to voxels 2021-05-29 23:28:11 +01:00
Marc Gilleron c0955bb317 Use storage func, remove redundant one 2021-05-29 23:24:36 +01:00
Marc Gilleron a4f01b096e Moved some storage functions out of VoxelBuffer 2021-05-29 23:23:18 +01:00
Marc Gilleron 4cc47b9036 Extracted some functions from VoxelBuffer, optimized copy/paste a little 2021-05-24 23:23:50 +01:00
Marc Gilleron f943339f31 Researching tri-channel weights storage
- No changes made for now, but the code is there if we want to switch
- Renamed functions to be more explicit
2021-05-23 20:28:06 +01:00
Marc Gilleron 983b7bd83d Merge branch 'master' into smooth_texturing
# Conflicts:
#	util/godot/funcs.h
2021-05-22 19:43:39 +01:00
Marc Gilleron 9b3263d68b Fix copy 2021-05-15 16:31:36 +01:00
Marc Gilleron 40452c6d31 Getting a voxel out of bounds from a buffer is now an error 2021-05-08 20:36:58 +01:00
Marc Gilleron d5bd6c794b Merge branch 'master' into smooth_texturing 2021-05-07 21:48:11 +01:00
Marc Gilleron d53e7dd530 Fixed several bugs related to VoxelTool::paste()
- One of the Rect3i constructors was wrong
- Rewrite clipping logic of VoxelBuffer::copy_from
- Fix VoxelDataMap::paste to provide correct offsets
- Fix meshing data copy to account for clipping adjustments
2021-05-07 18:38:02 +01:00
Marc Gilleron ef448263c0 Merge branch 'master' into smooth_texturing
# Conflicts:
#	storage/voxel_buffer.cpp
2021-05-02 23:11:57 +01:00
Marc Gilleron 73aed51ea2 Optimized 16-bit voxel box copies (used when meshing) 2021-05-02 19:23:07 +01:00
Marc Gilleron 32f9006b75 Added initial support for texture weights in graph generators (not optimal) 2021-04-30 22:04:38 +01:00