Marc Gilleron
17c6b1f557
Fixed and tweaked a bunch of things, first working editing with LOD
2019-09-06 23:24:56 +01:00
Marc Gilleron
584698d428
Fix wrong binding
2019-09-05 20:36:21 +01:00
Marc Gilleron
b284541219
Cleanup includes
2019-09-05 19:43:25 +01:00
Marc Gilleron
bee83ecbe9
Merge branch 'master' into lod_editing
2019-09-05 02:24:41 +01:00
Marc Gilleron
4ab688c9be
Barebones edition, untested WIP
2019-09-05 02:24:16 +01:00
Marc Gilleron
fec6e624f6
Tweaked octree region loading to better center it on the viewer
2019-09-04 20:59:08 +01:00
Marc Gilleron
1ad71c5d9c
Fix VoxelLodTerrain view distance property, it was using inconsistent type in getter and setter
2019-09-03 22:56:57 +01:00
Marc Gilleron
f8a3cd0503
Implement `get_view_distance()` properly
2019-09-02 21:32:05 +01:00
Marc Gilleron
a24e6d1b5a
Use Rect3i::difference, remove check_cell_enters_and_exits for clarity
2019-09-02 20:08:33 +01:00
Marc Gilleron
ff51d83e55
Use better algorithm for blocks falling out of range
2019-09-02 00:45:20 +01:00
Marc Gilleron
aad7ecf9a6
Make octree region work under a bit more kinds of runtime changes
2019-09-02 00:44:28 +01:00
Marc Gilleron
ebe91427c3
#ifdef out debug boxes
2019-09-01 22:52:38 +01:00
Marc Gilleron
8060978126
Some cleanup
2019-09-01 21:49:58 +01:00
Marc Gilleron
98299f2b3c
Optimize octree further by taking out children pointers. Nodes are only 5 bytes now.
2019-09-01 21:07:38 +01:00
Marc Gilleron
0ee054dc3c
Took out position from octree nodes
2019-09-01 17:11:28 +01:00
Marc Gilleron
bd10e89dea
Implement proper box difference
2019-09-01 16:10:01 +01:00
Marc Gilleron
6369985b74
Fix problems with MinGW
2019-09-01 01:47:45 +01:00
Marc Gilleron
d4b69f7dae
Remove old commented code
2019-09-01 00:21:41 +01:00
Marc Gilleron
d0275b29ee
Apply split_scale to newly created octrees
2019-08-31 21:47:00 +01:00
Marc Gilleron
0e6d3873c7
Properly implement hiding of the terrain node, for LOD it was showing all blocks of all LODs at once
2019-08-31 21:46:40 +01:00
Marc Gilleron
fa22666ccf
Merge branch 'master' into paged_lod
2019-08-30 01:09:37 +01:00
Marc Gilleron
8574655c18
Re-enabled request dropping through exclusive region, except for last lod
2019-08-30 01:08:06 +01:00
Marc Gilleron
c3bc356119
Fix overlapping blocks, mesh instance visibility was not initialized properly
2019-08-30 00:13:28 +01:00
Marc Gilleron
6a540a8720
Remove old code
2019-08-30 00:04:20 +01:00
Marc Gilleron
eb01f99c2c
First WIP at paging LOD
2019-08-29 22:55:02 +01:00
Marc Gilleron
db398a96e2
Fix crash when duplicate rejection is used, the threaded part was wrong. That map only pertains to shared_input.
2019-08-28 00:20:49 +01:00
Marc Gilleron
7a7f5f679b
Include smooth surface to collision build in VoxelTerrain
2019-08-26 14:00:48 +01:00
Marc Gilleron
d4ed6372b7
Optimize collision shapes, doubles build speed
2019-08-25 22:59:55 +01:00
Marc Gilleron
8fc1e40230
Line up statistics variable names
2019-08-25 18:47:43 +01:00
Marc Gilleron
a0c7201fcd
Rename `get_stats()` => `get_statistics()`
2019-08-25 17:40:19 +01:00
Marc Gilleron
c13c0fbf20
Fix `remaining_main_thread_blocks` stat, it wasn't reported
2019-08-25 17:23:25 +01:00
Marc Gilleron
4ec82928b4
Remove redundant VoxelTerrain::BlockDirtyState
2019-08-25 15:14:10 +01:00
Marc Gilleron
4ff5f91e6f
Add optional physics collision through node-less static bodies
2019-08-25 13:04:49 +01:00
Marc Gilleron
332041751d
Move mesh instance into a thin wrapper
2019-08-25 01:11:38 +01:00
Marc Gilleron
ed2db2b443
Put back meshing threads to 1 for VoxelTerrain, it doesnt react well to unordered block responses
2019-08-24 23:31:48 +01:00
Marc Gilleron
368e3efd1e
Remove unecessary condition
2019-08-24 23:31:01 +01:00
Marc Gilleron
9ca40b854b
Don't stop threads when the terrain exits the tree, it prevents saving-on-destroy from completing
2019-08-24 23:26:01 +01:00
Marc Gilleron
68dfe9fc70
Fix crash where null maps were accessed
2019-08-24 22:38:27 +01:00
Marc Gilleron
e815f79a5e
Removed unused variable
2019-08-24 01:44:51 +01: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
adc6a9391c
Fix threading issue causing corruption when duplicate rejection is active
2019-08-23 22:49:43 +01:00
Marc Gilleron
457ebf626d
Added stat for time spent opening files
2019-08-18 16:10:40 +01:00
Marc Gilleron
e1d716d454
Merge branch 'master' into persistence
2019-08-17 20:16:22 +01:00
Marc Gilleron
0483413b80
Added stats to VoxelStream, tweak file handles and batch counts
2019-08-17 00:46:24 +01:00
Marc Gilleron
43446356e9
Switch block processing to use arrays instead of single blocks to allow batching
2019-08-16 20:56:07 +01:00
Marc Gilleron
45f132a930
I did not intend to commit this
2019-08-15 22:36:26 +01:00
Marc Gilleron
c6e0e59662
Fix uninitialized stats
2019-08-15 01:54:05 +01:00
Marc Gilleron
07d4deeaab
Formatting
2019-08-15 01:40:27 +01:00
Marc Gilleron
b00ec1ccad
Merge branch 'master' into persistence
2019-08-09 20:07:43 +01:00
Cory Petkovsek
2e6256f6a5
Revert adding material property to fix error message
2019-07-06 00:19:29 +09:00
Cory Petkovsek
18626133cd
Allow set_material from gdscript
2019-07-04 00:58:39 +09:00
Marc Gilleron
c272a37f1a
Merge branch 'master' into persistence
...
# Conflicts:
# terrain/block_thread_manager.h
# terrain/voxel_terrain.cpp
2019-06-25 20:51:35 +01:00
Cory Petkovsek
b13dccd998
Fix gcc shadow warning
2019-06-22 23:24:34 +09:00
Cory Petkovsek
3b7dccefb2
Revert some castings
2019-06-22 22:14:27 +09:00
Cory Petkovsek
f6a9c5761a
Fix gcc sign comparison warnings
2019-06-18 14:24:56 +09:00
Cory Petkovsek
0b854725f0
Fix gcc Wparentheses warnings
2019-06-18 12:13:44 +09:00
Cory Petkovsek
67bdcbd048
Gcc compiling fixes
2019-06-18 11:27:55 +09:00
Marc Gilleron
3feb32e194
Fix a crash when a VoxelTerrain is created and deleted without ever entering the tree. Was caused by Godot creating dummy instances of VoxelTerrain just to call `get_property_list` when I open the inspector...
2019-06-02 02:30:22 +01:00
Marc Gilleron
5ecd449acc
Fixed VXB saving so that it actually works for lod0-only terrain:
...
- Don't rely on ERR_FILE_NOT_FOUND, Godot never returns that from FileAccess...
- Fix LOD not used in block coordinates conversion
- Fix block size saved as u8 but read as u32 in meta file
- Fix block file path not being prepended directory path
- Fix negative coord block file path containing overflowed uint
- Fix VoxelDataLoader processor not being assigned block size in some cases
- Fix VoxelDataLoader not processing save requests properly
- Fix VoxelTerrain not actually sending save requests on destruction
2019-06-02 01:59:39 +01:00
Marc Gilleron
76d3dcf737
Added `dropped_count` to block thread manager stats
2019-06-02 01:57:19 +01:00
Marc Gilleron
439e5d9964
Fix sort heuristic being wrong on pending blocks surviving more than one thread_sync(), we really have to overwrite it
2019-06-02 01:54:17 +01:00
Marc Gilleron
f831d03cf5
Merge branch 'master' into persistence
...
# Conflicts:
# terrain/voxel_data_loader.cpp
2019-05-28 01:17:28 +01:00
Marc Gilleron
2c81db52f8
Rename remaining occurences of "provider" => stream
2019-05-28 01:10:50 +01:00
Marc Gilleron
82502d3397
Simple file-per-block saving WIP. Compiles but didn't test.
2019-05-28 00:40:09 +01:00
Marc Gilleron
4a90ca10a5
Rename "provider" files to "stream"
2019-05-25 16:16:03 +01:00
Marc Gilleron
2e1b13ffea
Rename VoxelProvider* => VoxelStream*
2019-05-25 16:07:38 +01:00
Marc Gilleron
9d2c491fe9
Remove some comments
2019-05-25 15:53:36 +01:00
Marc Gilleron
75cffa7d59
Rename VoxelBlock.pos => position
2019-05-25 15:50:01 +01:00
Marc Gilleron
15ae1b99ba
Rename voxel_provider_thread.h => voxel_data_loader.h to match class name
2019-05-25 15:07:16 +01:00
Marc Gilleron
d01b00a29b
Renamed VoxelMesherDMC::OctreeMode => SimplifyMode
2019-05-25 15:00:22 +01:00
Marc Gilleron
cae44985a8
Comments
2019-05-25 14:34:09 +01:00
Marc Gilleron
34653341cf
Turn block loading duplicate rejection back on
2019-05-25 14:31:01 +01:00
Marc Gilleron
5a7d0b6f1b
Added optional code to debug-draw unexpected block drops
2019-05-20 20:49:46 +01:00
Marc Gilleron
d8cab2d32b
Use generic block manager for loading and fix bugs:
...
- VoxelProviderThread is now VoxelDataLoader and uses generic block manager
- Fixed threads locking up, input mutex was not always unlocked due to for loop exiting early
- Fixed blocks failing to load, region rejection was using invalid pointer
- Fixed block shifting in region rejection, was replacing wrong index in `block_indexes`
- Fixed block region rejection missing blocks, was not stepping back the loop after shifting blocks
- Added output message to notify of block rejection
2019-05-20 20:48:58 +01:00
Marc Gilleron
ceb7f47fa1
Don't bother calling `remove_positions_outside_box`, it's not doing anything currently
2019-05-20 20:34:41 +01:00
Marc Gilleron
2b3b3e9488
Take lod factor into account for view direction in the block sorting heuristic
2019-05-20 20:30:08 +01:00
Marc Gilleron
e47afabe49
Sort blocks using a heuristic, take look direction into account
2019-05-19 21:04:26 +01:00
Marc Gilleron
b9add5d671
Allow more than one thread for mesh updates, also made it generic
2019-05-19 18:27:49 +01:00
Marc Gilleron
38062b32fe
Code style
2019-05-19 18:24:03 +01:00
Marc Gilleron
d5236239bf
Added sort time to provider stats
2019-05-16 23:05:06 +01:00
Marc Gilleron
efe58f1af6
Added exclusive area parameter to block processors so they can remove blocks from their queue
2019-05-12 16:33:25 +01:00
Marc Gilleron
561f95a506
Added stats for dropped block loads and meshs
2019-05-12 16:30:45 +01:00
Marc Gilleron
8126d732b6
Fix block processors' sorting function
2019-05-12 16:19:08 +01:00
Marc Gilleron
960236b155
Remove commented function I never used
2019-05-12 16:17:43 +01:00
Marc Gilleron
a521501add
Move both meshing and loading sheduling to LodOctree polling
2019-05-10 18:56:48 +01:00
Marc Gilleron
29298958e7
Fix mistake in previous commit about missing binding argument
2019-05-10 00:57:09 +01:00
Marc Gilleron
255acbb739
Remove wrong CRASH_COND, also use get/setters for VoxelBlock properties
2019-05-09 22:00:54 +01:00
Marc Gilleron
96183e0c51
Fix missing argument in voxel/block conversion functions
2019-05-09 21:59:03 +01:00
Marc Gilleron
cf7ece7a58
Remove BlockState and replace it with loading_blocks set and enum inside VoxelBlock
2019-05-09 19:11:17 +01:00
Marc Gilleron
73d5d9993c
Load blocks on demand instead of speculatively, it's faster
2019-05-08 20:53:51 +01:00
Marc Gilleron
035e45d0a3
Fix missing destructor in VoxelBlock... woopsie
2019-05-08 20:36:27 +01:00
Marc Gilleron
d21974e122
Changed debug methods, also fixed blocked lods due to small block region extent
2019-05-08 00:57:34 +01:00
Marc Gilleron
40ccdd8fea
Expose material and LOD settings
2019-05-05 19:54:47 +01:00
Marc Gilleron
310e2172ff
Added stat to monitor LODs blocked by non-ready meshes
2019-05-05 19:15:50 +01:00
Marc Gilleron
46784e4700
Make marching cubes skirts an option in VoxelMesherDMC, also use more C++11 initializers
2019-05-05 17:00:42 +01:00
Marc Gilleron
1f219e68eb
Added marching square skirts to hide most LOD cracks
2019-05-05 03:56:18 +01:00
Marc Gilleron
d93f23337a
Added stats to VoxelLodTerrain
2019-05-05 01:09:12 +01:00
Marc Gilleron
8850019dc4
Put LodOctree child position calculation in a function
2019-05-04 17:58:33 +01:00
Marc Gilleron
f0089dce8b
Use C++11 member initializers
2019-05-04 16:30:39 +01:00
Marc Gilleron
295374b99f
Don't subdivide or unsubdivide if meshes aren't ready
2019-05-04 16:29:52 +01:00