256 Commits

Author SHA1 Message Date
Marc Gilleron
5519054c01 Unify macro prefixes 2022-04-06 23:26:54 +01:00
Marc Gilleron
090d3485e5 Use unique pointers in ExpressionParser 2022-04-06 22:00:32 +01:00
Marc Gilleron
ce4224dce8 Fix VoxelMesherCubes color mode in inspector 2022-04-03 22:58:51 +01:00
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
d4b1178d61 Fix Transvoxel when the surface lines up with integer coordinates 2022-03-19 22:45:12 +00:00
Marc Gilleron
4c68e7b298 Comments 2022-03-15 00:18:44 +00:00
Marc Gilleron
750fbeda53 Fix signedness warning 2022-03-06 01:16:25 +00:00
Marc Gilleron
f631d8880c Added configuration warnings to resources 2022-03-06 01:10:47 +00:00
Marc Gilleron
74ac820846 Remove zero-samples workaround for now.
It created gaps/unshared vertices in the mesh if the isosurface really has
to cross zero because it was done after the early cell rejection.
If we need it again, it will have to be done before the whole
algorithm, but could need more investigation.
2022-02-27 16:54:14 +00:00
Marc Gilleron
284c763a57 Use signed integers when decoding SDF 2022-02-27 04:08:01 +00:00
Marc Gilleron
493b93a051 SDF is now encoded with inorm8 and inorm16 2022-02-26 22:51:29 +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
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
50555bdedc Use a typed array of materials for build_mesh() API 2022-02-13 17:30:12 +00:00
Marc Gilleron
1b03e799ae Fix comparison signedness warning 2022-02-13 17:29:33 +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
08f3786ff6 Use typed code instead of strings in property hints 2022-01-16 16:04:25 +00:00
Marc Gilleron
2a36f3fd1c Make guards match 2022-01-10 22:56:45 +00:00
Marc Gilleron
1fbe9c4731 Rename VoxelBuffer.optimize() => compress_uniform_channels() 2022-01-09 23:40:07 +00:00
Marc Gilleron
f8b8b27ff2 Renamed Voxel => VoxelBlockyModel, VoxelLibrary => VoxelBlockyLibrary 2022-01-09 23:27:38 +00:00
Marc Gilleron
f859ec1922 Share array length macro 2022-01-09 22:50:15 +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
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
09899eef97 Namespaced Color8 2022-01-04 22:30:46 +00:00
Marc Gilleron
1f579cf860 Namespaced blocky and cubes internal functions 2022-01-04 00:17:56 +00:00
Marc Gilleron
c672e21ff3 Re-namespaced Transvoxel 2022-01-04 00:12:42 +00:00
Marc Gilleron
0fee995c0f Namespaced godot utility funcs 2022-01-03 23:52:54 +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
2bab7c39bd Namespace DynamicBitset 2022-01-03 01:23:54 +00:00
Marc Gilleron
35018adbf2 Namespace ObjectPool 2022-01-03 01:19:18 +00:00
Marc Gilleron
2f71b79904 More uses of Time singleton 2021-12-29 17:18:49 +00:00
Marc Gilleron
4d2fe30661 Use Time singleton 2021-12-29 17:06:24 +00:00
Marc Gilleron
c5edb8368a Fix library property not shown in inspector 2021-12-28 04:09:18 +00:00
Marc Gilleron
03d3016ecf Remove some pre-set resource properties to fix a Godot4 warning (sorry) 2021-12-16 01:30:31 +00:00
Marc Gilleron
a374883ba8 Fix Transvoxel vertex arrays 2021-12-15 00:47:02 +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
380e295d94 Merge branch 'master' into full_load_mode
# Conflicts:
#	meshers/transvoxel/transvoxel.h
#	server/voxel_server.cpp
#	terrain/voxel_lod_terrain.cpp
2021-12-11 22:59:24 +00:00
Marc Gilleron
688b8b9a7b Fix inspector properties not refreshed when changing the geometry type of a Voxel resource 2021-12-11 21:37:09 +00:00
Marc Gilleron
148d5e4116 Comments 2021-11-12 21:42:39 +00:00
Marc Gilleron
c17914b2c8 Formatting due to update of Godot's clang-format 2021-11-12 21:42:28 +00:00
Marc Gilleron
0655371078 This comment wasn't accurate 2021-11-06 00:11:43 +00:00
Marc Gilleron
e04091f3cb Added full load mode to VoxelLodTerrain
With this mode enabled, editing anywhere becomes possible.
All edited blocks are loaded at once when the stream is assigned.
The generator is used on the fly to fill the gaps, instead of being
pre-emptively cached only nearby the viewer to allow editing.
Editing is still on the main thread, so this can cause stalls if
the generator is complex. There is also no controlled limit on how
much data gets loaded, so if edited data is larger than RAM, it will
not be playable. The feature is already quite usable, but more work
may be done for wider viability.
2021-10-03 01:48:07 +01: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
2fda5747c6 Comments 2021-09-13 00:19:51 +01:00
Marc Gilleron
026c14fcb5 Added importer to import vox files into a single mesh
- New importer, needs restart to switch but it's a limitation of Godot
- Might blow up if the scene spans a really big area, may be optimized in the future.
- The scene importer remains the default choice
- Promoted some ints to 64-bit to avoid oveflowing with large volumes or distances
- Handle a few cases of malloc failure
2021-08-14 16:49:46 +01:00
Marc Gilleron
f5eaccbb63 Very basic LOD in VoxelMesherCubes. Doesn't handle seams, it's mainly for testing at the moment 2021-08-07 23:07:44 +01:00