402 Commits

Author SHA1 Message Date
Marc Gilleron
7161942ee1 Fix memory leak in VoxelBuffer::fill() 2020-01-26 01:59:53 +00:00
Marc Gilleron
b1b7d4ba03 Merge branch 'heightmap_generators' 2020-01-24 00:00:47 +00:00
Marc Gilleron
4f9b05dfc0 Bake LOD into Transvoxel instead of scaling afterwards 2020-01-23 23:33:48 +00:00
Marc Gilleron
a751b0ca63 Fix edited block producing a hole when going away from it 2020-01-23 23:20:23 +00:00
Marc Gilleron
73491cd1ff Fix LOD getting stuck if you teleport far away
Now the octree is always allowed to merge nodes even if the parent block isn't available.
Also removed unused userdata from LodOctree::Node,
merged callbacks into one struct,
removed some old debug code
2020-01-23 00:37:13 +00:00
Marc Gilleron
df719187b7 Added optional curve to VoxelStreamNoise2D 2020-01-22 00:32:58 +00:00
Marc Gilleron
01b3201689 Rename height_base to be height_start, for consistency 2020-01-21 23:57:22 +00:00
Marc Gilleron
df3a649e18 Added VoxelStreamNoise2D 2020-01-21 23:52:25 +00:00
Marc Gilleron
b90e6b8207 Abstract most of VoxelStreamImage into VoxelStreamHeightmap 2020-01-21 22:41:55 +00:00
Marc Gilleron
2c4c4f3288 Fix stupid bugs 2020-01-21 21:17:15 +00:00
Marc Gilleron
83e8c22539 Comments 2020-01-21 20:00:29 +00:00
Marc Gilleron
091cde0794 Re-implemented Rect3i::clip_range(), size was wrong (still unused but found it while drafting something) 2020-01-21 20:00:17 +00:00
Marc Gilleron
6a417bf657 Abstracted some of the heightmap SDF algorithm, WIP 2020-01-21 19:51:05 +00:00
Marc Gilleron
e76e4d2b49 Fix bad discarding code when block management threads are told to exit
In short, std::remove_if does NOT remove anything
2020-01-19 18:13:00 +00:00
Marc Gilleron
3263001c5f Optimized VoxelStreamNoise with finer height range and noise shaping 2020-01-19 00:43:56 +00:00
Marc Gilleron
c493aec343 Use StringNames when applicable 2020-01-17 20:43:28 +00:00
Marc Gilleron
0b4860b40d Use MAX_LOD global constant 2020-01-15 21:40:35 +00:00
Marc Gilleron
87afb8f96c Fix split scale not being clamped properly. Also reorganized debug functions a bit 2020-01-15 21:04:23 +00:00
Marc Gilleron
5f83b36deb Merge branch 'master' of https://github.com/Zylann/godot_voxel 2020-01-13 23:29:56 +00:00
Marc Gilleron
a4707f8943 Use integer math to interpolate cell corners, instead of floats, and untangle padding from places it didn't need to be 2020-01-13 00:43:07 +00:00
Marc
7bdd920dd4
Merge pull request #101 from blockspacer/gitignore_bc
gitignore: .bc (html5 builds)
2020-01-12 19:20:31 +01:00
Den
145c5b4d28 gitignore: .bc (html5 builds) 2020-01-12 11:31:22 +03:00
Marc
56b5113f9b
Merge pull request #95 from tinmanjuggernaut/fix_blocky_noise
Enables 3D Noise on Blocky VoxelTerrain
2020-01-10 20:44:30 +01:00
Cory Petkovsek
1b19bbee8e Enable 3D noise on VoxelTerrain. Defaults 3D noise to blocky - must specify for smooth terrain. 2020-01-10 22:46:59 +08:00
Cory Petkovsek
9129016567 Fix invisible VoxelTerrain 2020-01-10 19:57:49 +08:00
Marc Gilleron
9e87a522d7 Merge branch 'visibility_as_being_in_world' 2020-01-09 23:46:59 +00:00
Marc Gilleron
ad163e6a73 Temporary fix: persistent streams not working due to missing use of VoxelMemoryPool 2020-01-07 21:24:14 +00:00
Marc Gilleron
9dc09618be ZProfiler is now usable from anywhere including threads 2020-01-07 20:32:36 +00:00
Marc Gilleron
badf3876c3 When a block is not visible, remove it from world instead 2020-01-07 02:04:24 +00:00
Marc Gilleron
051034fc51 Improve transition mask calculation on world borders.
It fixes a case where a block at world border would remain with
a transition mask of 0 when a neighbor block of lower LOD becomes visible.
Now a block side bordered by an empty area will assume transition.
2020-01-07 00:22:58 +00:00
Marc Gilleron
a06de157bf Tweaked calculation to better ensure no null normals will be produced 2020-01-06 21:48:07 +00:00
Marc Gilleron
b1c38a40c0 Fix something that prevented GCC from compiling 2020-01-06 20:08:51 +00:00
Marc Gilleron
dacd18b772 Added function to debug pointed blocks 2020-01-05 23:27:43 +00:00
Marc Gilleron
3ead96f06e Added option to tweak how VoxelStreamImage samples the heightmap 2020-01-05 22:42:02 +00:00
Marc Gilleron
462e453cf4 Fix thin cracks caused by pooled material params not being reset when reused 2020-01-05 04:57:40 +00:00
Marc Gilleron
ebe62cde69 Forgot this 2020-01-04 23:30:51 +00:00
Marc Gilleron
8056f7e679 Fix transition meshes not being scaled with LOD, provide LOD in mesher API 2020-01-04 23:24:33 +00:00
Marc Gilleron
716b820599 Remove VoxelIsoSurfaceTool, superseded by VoxelTool 2020-01-02 21:07:23 +00:00
Marc Gilleron
a11a95bcce Renamed CHANNEL_ISOLEVEL => CHANNEL_SDF 2020-01-02 21:03:44 +00:00
Marc Gilleron
3c3fe017d8 Remove channel enum from Voxel, it was redundant with VoxelBuffer 2020-01-02 20:46:27 +00:00
Marc Gilleron
a4b806a9f2 Optimize uniform buffers generated by VoxelStreamImage 2020-01-02 20:31:43 +00:00
Marc Gilleron
f2975e517a Add memory pool for VoxelBuffer channels 2020-01-02 20:31:05 +00:00
Marc Gilleron
d8677cd663 Fix heavy stuttering caused by ShaderMaterial 2020-01-02 20:29:40 +00:00
Marc Gilleron
31f588c1a1 Add profiling scopes to VoxelLodTerrain, also fix usage in VoxelStream 2020-01-02 20:29:02 +00:00
Marc Gilleron
68e35744b2 Rewrite profiler dump to not use Godot API, also allow to use a singleton 2020-01-02 20:24:20 +00:00
Marc Gilleron
d4986489cf Fix rare bug with vertex sharing causing long spiky artifacts
Basically we were checking case code of the ReuseCell to know if we can
re-use a vertex from it, but sometimes the associated cell did not write
a re-usable vertex, and we were not resetting such vertex indices.
So in some cases, we were accessing a very old index.
The case code doesn't need to be remembered, we just reset the first vertex.
No need to check if the ReuseCell was empty, we can read the vertex directly,
as it will be -1 anyways if it isn't re-usable. At least, this fixed the bug
and did not reproduce after testing a lot of noise data sets.
2020-01-01 00:41:21 +00:00
Marc Gilleron
ee8a70bc75 Attempt to tweak normals calculation to avoid some cases of null normals 2019-12-31 20:00:39 +00:00
Marc Gilleron
ebc6be35d1 Implement LOD transitions in VoxelLodTerrain
- VoxelBlock contains 6 optional transition meshes
- VoxelLodTerrain calculates transition masks when block visibility changes
- VoxelMesher can now specify different min and max paddings
- Fix Cube::SIDE_POSITIVE/NEGATIVE_X/Y/Z enum not matching Cube::g_side_normals
- Convert transition masks to make up for the Cube:: inconsistency for now
2019-12-31 16:48:46 +00:00
Marc Gilleron
44f84a9422 Template max() so places using int don't have to go through float 2019-12-31 16:37:40 +00:00
Marc Gilleron
2d32eebed5 Remove VoxelStreamNoise buffering optimization, it was introducing LOD cracks 2019-12-31 16:32:16 +00:00