28 Commits

Author SHA1 Message Date
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
f631d8880c Added configuration warnings to resources 2022-03-06 01:10:47 +00:00
Marc Gilleron
0137ca3036 Namespaced VoxelBuffer in gd:: because it is actually a wrapper 2022-02-15 21:49:20 +00:00
Marc Gilleron
50555bdedc Use a typed array of materials for build_mesh() API 2022-02-13 17:30:12 +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
b67ca3d903 Namespaced every registered class 2022-01-09 22:16:44 +00:00
Marc Gilleron
5aa64f464e Re-namespaced Cube 2022-01-09 03:27:30 +00:00
Marc Gilleron
9c653b8a9f Namespaced FixedArray 2022-01-09 02:53:21 +00:00
Marc Gilleron
38baeae2d9 Namespaced VoxelBufferInternal 2022-01-08 22:49:59 +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
6f09523fd2 Added option to import colors as textures to improve greedy meshing 2021-08-02 19:03:35 +01:00
Marc Gilleron
c5e0d8fe02 Comments 2021-07-11 16:27:17 +01:00
Marc Gilleron
efe8bcf9c0 Show a configuration warning when a mesher does not support LOD 2021-05-15 23:41:19 +01:00
Marc Gilleron
76ec90fe34 Moved constants and tables under a folder 2021-02-21 23:58:00 +00:00
Marc Gilleron
24c2d88e8e Comments 2021-01-18 18:47:37 +00:00
Marc Gilleron
791bdafff1 Meshers are now resources assigned on terrain nodes 2020-12-18 21:01:50 +00:00
Marc Gilleron
6c80da0425 Moved VoxelBuffer and VoxelMemoryPool under storage/ directory 2020-09-14 19:33:02 +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
845fa465b8 Put model information within a struct 2020-08-11 20:29:27 +01:00
Marc Gilleron
aa2300866d Fix usage of standalone meshers to build meshes from voxels 2020-08-04 23:55:40 +01:00
Marc Gilleron
b1c38a40c0 Fix something that prevented GCC from compiling 2020-01-06 20:08: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
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
a9952179a7 Transition meshes WIP and bug fixes
- Allow meshers to specify compression flags
- Use uncompressed COLOR to fit extra vertex data for transition meshes
- Simplify a few interpolations
- Fix a few buffer overruns which were not detected by the debugger
- Use array wrappers to better detect overrun mistakes
2019-12-26 20:29:55 +00:00
Marc Gilleron
f59b34f1a0 Fix material assignments being shifted if one of the surfaces has no vertex 2019-09-10 20:04:08 +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
faefde721a Add base class to all meshers, gather common things in it 2019-04-28 20:48:59 +01:00