68 Commits

Author SHA1 Message Date
Marc Gilleron
8cf52b8967 Fix voxel graph test 2022-04-22 22:06:35 +01:00
Marc Gilleron
f48ebe8557 Moved StreamPeer stuff to Godot-specific wrapper 2022-04-18 20:40:25 +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
a5c3f8b824 Fix code to work with Godot's new FileAccess RefCounted object 2022-04-15 23:13:31 +01:00
Marc Gilleron
bfa24402ac Renamed util/funcs.h => container_funcs.h 2022-04-14 21:43:45 +01:00
Marc Gilleron
47fbddf73b Fix nodes of the graph never get freed 2022-04-11 19:17:37 +01:00
Marc Gilleron
0cc3801655 Define smart pointers default allocator in a single place 2022-04-10 20:10:33 +01:00
Marc Gilleron
18584f4e87 Added per-node profiling info 2022-04-10 14:42:40 +01:00
Marc Gilleron
090d3485e5 Use unique pointers in ExpressionParser 2022-04-06 22:00:32 +01:00
Marc Gilleron
0e523f79fe Added functions to expression node 2022-04-06 01:13:38 +01:00
Marc Gilleron
7e03e7f384 Fix several issues with functions in expressions
- Too many arguments error
- Too few arguments error
- Expected argument error
- Unexpected closing parenthesis
2022-04-06 01:00:06 +01:00
Marc Gilleron
d26262d03c Fix include directory 2022-04-06 00:56:48 +01:00
Marc Gilleron
4634cfac0e Merge branch 'master' into expression_node 2022-04-04 22:43:05 +01:00
Marc Gilleron
e0008d3335 Fix compilation now Godot comes with its own FastNoiseLite.
The version shipped with the module is now prefixed.
Removed usages of OpenSimplexNoise.
2022-04-03 20:07:17 +01:00
Marc Gilleron
646cbacd64 Added Expression node to VoxelGeneratorGraph. Needs polishing.
Some things to do:
- Support function calls
- Show expression in the node GUI, eventually edit it there
- Optimize power function
2022-04-03 16:43:04 +01:00
Marc Gilleron
f53856f2c3 Made LodOctree update recursively.
If subdivision conditions are fulfilled, it no longer needs to be
updated several times to reach its target shape.
2022-03-22 19:35:52 +00:00
Marc Gilleron
a6196bd84d Added test for serializing blocks with the StreamPeerBuffer API 2022-03-20 14:54:10 +00:00
Marc Gilleron
80d7399fbb Added more region file tests 2022-02-28 22:17:28 +00:00
Marc Gilleron
072472bec5 Fix FlatMap was using the type of values to sort keys... 2022-02-19 23:09:01 +00:00
Marc Gilleron
8b8b991060 Fix FlatMap insert methods randomly failing to insert 2022-02-19 22:08:04 +00:00
Marc Gilleron
c844a65325 More explicit include guard 2022-02-19 22:07:11 +00:00
Marc Gilleron
8406299e2d Use a specific macro to check tests, so it can be swapped easily.
Also made it break by default so in debug we stop at the failing line.
2022-02-19 19:59:39 +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
d18bbe0376 Made LodOctree more generic
- `update` now solely relies on predicates to split/join
- Removed some member variables only used in the older update
- Distance checks now use "octree space", elininates some coordinate
  conversions which are now done up-front
2022-02-12 18:09:46 +00:00
Marc Gilleron
3045e9a489 BlockSerializer is no longer a class 2022-01-16 04:01:22 +00:00
Marc Gilleron
f8b8b27ff2 Renamed Voxel => VoxelBlockyModel, VoxelLibrary => VoxelBlockyLibrary 2022-01-09 23:27:38 +00:00
Marc Gilleron
9c6118806f Namespaced remaining stuff 2022-01-09 22:46:26 +00:00
Marc Gilleron
e53dcf7c84 Re-namespaced VoxelConstants 2022-01-09 03:06:58 +00:00
Marc Gilleron
08cacc7ff4 Print SIMD level name in FastNoise2 test 2022-01-08 01:02:47 +00:00
Marc Gilleron
c0cb82888e Changed run_blocky_random_tick so it respects its given area instead of somehow snapping it 2022-01-06 22:06:43 +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
e20684ce69 Namespaced math funcs 2022-01-03 23:14:18 +00:00
Marc Gilleron
a9476227cb Namespaced Interval 2022-01-03 22:29:39 +00:00
Marc Gilleron
2fdf0bf6df Namespaced VoxelBlockSerializerInternal 2022-01-03 02:52:06 +00:00
Marc Gilleron
404d2cd911 Namespace VoxelRegionFile 2022-01-03 02:17:41 +00:00
Marc Gilleron
6bbc1f898a Exposed tileable grid noise generation 2021-12-31 16:31:46 +00:00
Marc Gilleron
56b4920902 Updated and integrated FastNoise2 2021-12-31 05:06:00 +00:00
Marc Gilleron
e46b1a023d Added test for VoxelBlockSerializerInternal and RegionFile; added namespaces 2021-12-17 19:30:23 +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
ca7ac42cde Merge branch 'master' into full_load_mode
# Conflicts:
#	edition/voxel_tool_lod_terrain.cpp
#	generators/graph/voxel_generator_graph.cpp
#	terrain/voxel_lod_terrain.cpp
2021-10-31 16:17:27 +00:00
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
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
884a5c38d4 Fix test 2021-10-01 21:20:49 +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
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
e602b9bffe Merge branch 'master' into octree_compression
# Conflicts:
#	tests/tests.cpp
2021-09-19 20:15:16 +01:00
Marc Gilleron
3cf2e92483 Optimized Curve range analysis by dividing it into monotonic sections 2021-09-19 18:20:54 +01:00