141 Commits

Author SHA1 Message Date
Marc Gilleron
d7a2e4e5c5 Don't crash when a generator is assigned but no mesher 2022-07-04 20:14:49 +01:00
Marc Gilleron
3792cd486d Removed I/O thread, all tasks use the same pool.
- Now one more thread becomes available to do other tasks
- Introduced "serial" tasks to keep similar logic to the old I/O thread
- Added some tests
- Updated docs
2022-07-03 21:11:02 +01:00
Marc Gilleron
dac0af3a04 Build mesh resource on the task thread now the Vulkan renderer supports it 2022-07-02 23:01:49 +01:00
Marc Gilleron
eaa40876b8 Don't generate transition meshes when VoxelMesherTransvoxel is used in a fixed-lod volume 2022-06-26 17:20:08 +01:00
Marc Gilleron
c7d8c2557c Attempting to give priority to main mesh building over transition meshes.
This effectively creates them after ALL main meshes have been built,
resulting in a seemingly faster convergence of LOD, however when moving
around it causes some cracks to appear briefly. This can be bad if the
terrain is dark and the underlying skybox is bright. Might need to be
optional, or find a different approach.
2022-06-22 22:05:25 +01:00
Marc Gilleron
76de7a439b Added a low-priority queue to TimeSpreadTaskRunner 2022-06-22 22:01:10 +01:00
Marc Gilleron
fdd8ff3889 Fix data block loading when no stream is assigned 2022-06-19 20:23:40 +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
177d7a99c9 Added basic stack tracking for memory pool allocations 2022-06-06 21:54:20 +01:00
Marc Gilleron
3b152842aa Macro replacements 2022-06-04 22:54:56 +01:00
Marc Gilleron
bfe37af5e7 Update comment on VoxelServer 2022-06-04 01:59:04 +01:00
Marc Gilleron
6ab6f4a8b6 Unnecessary includes 2022-06-03 19:02:03 +01:00
Marc Gilleron
6c47c177ab Moved Godot config access to module initialization 2022-05-23 00:13:37 +01:00
Marc Gilleron
acbc52e717 Unnecessary forward-declaration 2022-05-22 22:25:55 +01:00
Marc Gilleron
6fd56e2054 Removed intermediate struct 2022-05-22 22:00:21 +01:00
Marc Gilleron
863c9a81b6 Unused enum 2022-05-22 21:20:54 +01:00
Marc Gilleron
b9c9b2bcee Schedule tasks more directly, remove VoxelServer data copies 2022-05-22 00:18:58 +01:00
Marc Gilleron
fa027cbe4e Allow to specify which surfaces have collision 2022-05-17 22:12:54 +01:00
Marc Gilleron
994aa50126 Comments 2022-05-02 14:50:27 +01:00
Marc Gilleron
5965bcf98f FileLocker doesn't depend on Godot 2022-04-19 00:58:29 +01:00
Marc Gilleron
4e3d4d4ed8 Threading classes wrappers 2022-04-19 00:32:37 +01:00
Marc Gilleron
bfa24402ac Renamed util/funcs.h => container_funcs.h 2022-04-14 21:43:45 +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
259a914cbf Return a ref instead of pointer, it must not be null 2022-04-09 15:05:04 +01:00
Marc Gilleron
ab5d3a22d3 Abstract logging for verbose print 2022-04-09 15:00:34 +01:00
Marc Gilleron
ca83c720ff Return reference, pointer must not be null 2022-04-08 23:54:04 +01:00
Marc Gilleron
f58199e7de Added class to schedule custom tasks from scripts 2022-04-07 22:34:07 +01:00
Marc Gilleron
7517ec9a10 Merge branch 'expression_node'
# Conflicts:
#	server/load_all_blocks_data_task.cpp
2022-04-07 20:18:20 +01:00
Marc Gilleron
5519054c01 Unify macro prefixes 2022-04-06 23:26:54 +01:00
Marc Gilleron
c9aa295b03 Fix unused variables 2022-04-06 01:31:51 +01:00
Marc Gilleron
57357df658 Fix Variant conversion for MacOS clang 2022-04-06 01:31:34 +01:00
Marc Gilleron
f90960d596 Hack something to allow using different depth than default in some cases 2022-04-03 23:15:34 +01:00
Marc Gilleron
61b27491f9 Initial implementation of binary search in Transvoxel.
It is very slow but seems to be working. It affines vertex positions,
but normals are not improved. Maybe more work will be done in the future
if that technique becomes more relevant.

Partly based on a prior experiment:
11f716f79d0ade59c0e9547a2333183e96b17b43
2022-03-27 21:36:30 +01:00
Marc Gilleron
3d747f6525 Schedule tasks in batches to reduce locking when many are sent 2022-03-22 20:51:56 +00:00
Marc Gilleron
5ddcbc2065 Added optional threaded execution of VoxelLodTerrain's process function 2022-03-15 00:29:39 +00:00
Marc Gilleron
36ad5a75a2 Fix non-initialized variable 2022-02-13 16:20:08 +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
f1c59d452a Removed more Vector<T> usages.
Remaining uses are necessary to communicate with Godot APIs.
2022-02-06 22:26:30 +00:00
Marc Gilleron
392f2d94bf Don't assign unused fields 2022-02-06 13:48:34 +00:00
Marc Gilleron
320cc7422c Rename tasks:
- As verbs for the task they do
- Suffixed with Task instead of Request,
  to avoid confusion with network stuff
2022-02-06 13:45:51 +00:00
Marc Gilleron
ff6bd7b82d Fix GCC initializer list reorder warnings 2022-02-05 17:32:36 +00:00
Marc Gilleron
5aeb6a69e7 Fix shadowing declaration 2022-02-05 17:22:25 +00:00
Marc Gilleron
c6199563c8 Split data request 2022-02-02 23:12:59 +00:00
Marc Gilleron
b7e56c6bec Moved other tasks out of VoxelServer 2022-02-02 21:03:09 +00:00
Marc Gilleron
0ad7be9281 Moved BlockMeshRequest out of VoxelServer 2022-02-02 01:11:28 +00:00
Marc Gilleron
14fc940491 Moved StructDB to utils 2022-01-31 21:33:12 +00:00