37 Commits

Author SHA1 Message Date
Marc Gilleron
48081faf03 Use real_t in most utils, use 32-bit floats in meshers.
This is a first step to supporting double-precision floats in Godot.
Meshers don't need doubles because vertices, normals and UVs should
never span large enough areas while needing such amount of precision.
Besides, it costs a lot more memory and processing.
2022-02-14 00:11:41 +00:00
Marc Gilleron
b67ca3d903 Namespaced every registered class 2022-01-09 22:16:44 +00:00
Marc Gilleron
20c85e65a7 Re-namespaced OctreeTables and moved to dmc/, it's only used there 2022-01-09 03:34:02 +00:00
Marc Gilleron
38baeae2d9 Namespaced VoxelBufferInternal 2022-01-08 22:49:59 +00:00
Marc Gilleron
b66861eb0e Re-namespaced dmc 2022-01-03 23:38:47 +00:00
Marc Gilleron
e20684ce69 Namespaced math funcs 2022-01-03 23:14:18 +00:00
Marc Gilleron
35018adbf2 Namespace ObjectPool 2022-01-03 01:19:18 +00:00
Marc Gilleron
4d2fe30661 Use Time singleton 2021-12-29 17:06:24 +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
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
76ec90fe34 Moved constants and tables under a folder 2021-02-21 23:58:00 +00:00
Marc Gilleron
f1e2ea9ad4 Update to latest Godot's threading primitives 2021-02-19 01:30:22 +00:00
Marc Gilleron
d1207bdd96 Reorganized some utility files 2021-02-17 20:34:35 +00:00
Marc Gilleron
791bdafff1 Meshers are now resources assigned on terrain nodes 2020-12-18 21:01:50 +00:00
Marc Gilleron
89abb37e0f consts 2020-12-18 20:52:09 +00:00
Marc Gilleron
6c80da0425 Moved VoxelBuffer and VoxelMemoryPool under storage/ directory 2020-09-14 19:33:02 +01:00
Cory Petkovsek
d407d6201a Fix build warnings on other platforms 2020-04-03 20:46:29 +08: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
a11a95bcce Renamed CHANNEL_ISOLEVEL => CHANNEL_SDF 2020-01-02 21:03:44 +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
28d45fa758 Was using wrong triangle table for marching squares. Didn't see any difference tho. 2019-12-16 19:55:35 +00:00
Marc Gilleron
28cb74e9b1 Fix invalid normals causing occasional shading artifacts 2019-12-14 21:32:30 +00:00
Marc Gilleron
a0c7201fcd Rename get_stats() => get_statistics() 2019-08-25 17:40:19 +01:00
Cory Petkovsek
9c56f75c60 Fix gcc build 2019-08-10 03:31:38 +09:00
Cory Petkovsek
f6a9c5761a Fix gcc sign comparison warnings 2019-06-18 14:24:56 +09:00
Marc Gilleron
d01b00a29b Renamed VoxelMesherDMC::OctreeMode => SimplifyMode 2019-05-25 15:00:22 +01:00
Marc Gilleron
d15d54eb95 Renamed HermiteValue.value => sdf 2019-05-25 14:53:43 +01:00
Marc Gilleron
e242950cb2 Increased a bit marching squares skirts threshold 2019-05-20 20:25:52 +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
1065aa40ef Useless comment 2019-05-12 16:17:57 +01:00
Marc Gilleron
81eeb48ac6 Reduce amount of marching squares generated as skirts 2019-05-09 19:11:40 +01:00
Marc Gilleron
4e9880fb8c Fix bad value fetch 2019-05-05 17:01:40 +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
7c6d4f3242 Moved ObjectPool to util/ and moved OctreeTables to root 2019-04-29 21:31:08 +01:00
Marc Gilleron
faefde721a Add base class to all meshers, gather common things in it 2019-04-28 20:48:59 +01:00
Marc Gilleron
12a97cca5a Reorganize all files and rename a few things 2019-04-28 17:58:29 +01:00