Commit Graph

31 Commits (ac2fb5f150c963f4dddef76bd16166803bacbfcc)

Author SHA1 Message Date
Marc Gilleron 3a0ebc73a7 Request saving of generated blocks if the option is enabled in VoxelStream 2021-01-17 22:22:10 +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 a0941cea83 Made all simple generators thread-safe 2021-01-16 13:41:46 +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 eb9a5b7e07 Added background tasks indicator when a terrain is selected 2020-12-20 00:14:08 +00:00
Marc Gilleron 418cf0e630 Streaming/LOD can be set to follow the editor camera instead of being centered on world origin 2020-12-19 23:16:10 +00:00
Marc Gilleron 71b4139fb3 Fix another warning about precedence clarity 2020-12-18 21:29:56 +00:00
Marc Gilleron 791bdafff1 Meshers are now resources assigned on terrain nodes 2020-12-18 21:01:50 +00:00
Marc Gilleron 2dfcc76600 Better fix for VoxelLodTerrain task drop 2020-10-20 23:58:55 +01:00
Marc Gilleron 30c6d7e436 Disabled task cancellation to make VoxelLodTerrain work, will need better option later.
VoxelLodTerrain's block requests were being cancelled constantly.

This commit also contains precision improvement for cancelling
block requests based on distance, which originally was an attempt to
"properly" fix the problem with VoxelLodTerrain, but it didnt fully
worked for that node.
I left it anyways, maybe it will change in the future once a
proper fix is figured out.
2020-10-19 23:21:14 +01:00
Marc Gilleron 6c80da0425 Moved VoxelBuffer and VoxelMemoryPool under storage/ directory 2020-09-14 19:33:02 +01:00
Marc Gilleron 7a235be108 Cancel block tasks if they are too far away 2020-09-06 23:57:41 +01:00
Marc Gilleron 7075773692 Fix tasks waiting suspecting an error too soon.
It was using seconds while measured time was milliseconds.
2020-09-06 23:56:36 +01:00
Marc Gilleron 9db2ced198 Fix out-of-bounds access in case all tasks got cancelled 2020-09-06 23:55:22 +01:00
Marc Gilleron a4611031e1 Fix viewer not being unpaired when destroyed 2020-09-06 19:29:56 +01:00
Marc Gilleron 81e1872f8b Implemented viewers for VoxelTerrain 2020-09-06 19:01:12 +01:00
Marc Gilleron b8c97ebc55 Switch VoxelLodTerrain to VoxelServer 2020-08-31 21:51:30 +01:00
Marc Gilleron 17ff16aa48 Neighbors are optional when sending meshing requests 2020-08-30 04:00:45 +01:00
Marc Gilleron d81ffb95f4 Detect usage of Tracy, add some profiler scopes 2020-08-30 04:00:01 +01:00
Marc Gilleron aa2b848102 Workaround crash on exit because the GDScript module is freed before voxel
See https://github.com/Zylann/godot_voxel/issues/189
2020-08-29 22:55:52 +01:00
Marc Gilleron d4d2b6fd9e No longer copy voxels before scheduling threaded tasks. VoxelBuffers now have a lock. 2020-08-29 22:09:54 +01:00
Marc Gilleron 92b10d9175 Fix deadlock on exit when more than one thread is used 2020-08-28 18:31:21 +01:00
Marc Gilleron f10209440f Fix performance hit due to priority being recalculated all the time 2020-08-28 18:30:54 +01:00
Marc Gilleron 28b5ae6580 Unused code 2020-08-28 18:29:42 +01:00
Marc Gilleron 2fda53f57f Fix warning about too many arguments 2020-08-28 18:29:33 +01:00
Marc Gilleron 0d1bd433d9 Multiple meshing threads seems to work 2020-08-27 23:40:36 +01:00
Marc Gilleron 07ca2c74c1 Fixed tasks being picked twice and causing double-deletes 2020-08-27 23:32:34 +01:00
Marc Gilleron bcfc8ce04e Add some stats 2020-08-26 21:17:57 +01:00
Marc Gilleron 57d306a033 Fix voxel library not always up to date 2020-08-26 19:49:04 +01:00
Marc Gilleron 56c2a0856a Initial integration on VoxelTerrain with static camera, fixed a bunch of things 2020-08-25 23:00:38 +01:00
Marc Gilleron 1fe50b01d6 Added VoxelServer. Compiles, but isn't used anywhere yet 2020-08-24 01:49:23 +01:00