29 Commits

Author SHA1 Message Date
Marc Gilleron
9cdaf1fd45 Switch to 2D textures instead of texture arrays due to layer count limitation 2022-08-18 21:29:09 +01:00
Marc Gilleron
54a4782618 Use band-based task priorities, where higher means higher 2022-08-16 21:12:10 +01:00
Marc Gilleron
dbbab6a81d Separate normalmap baking from meshing, so meshes don't have to wait.
- The option for having it separate is hardcoded and both code paths still
  exist. Not sure if that will be exposed or removed entirely.
- Still need to limit the frequency at which normalmaps are updated
- Would be nice to make this mesher-independent,
  Transvoxel is just a fastpath
- Task priority might need improvement, it's a bit messy. Maybe use bands?
2022-08-13 16:40:46 +01:00
Marc Gilleron
2d2c9d7951 Comments 2022-08-09 23:50:38 +01:00
Marc Gilleron
c15ded67f6 Vary tile size with LOD and integrate to VoxelLodTerrain 2022-08-07 16:40:27 +01:00
Marc Gilleron
fcddf4da61 WIP normalmaps for Transvoxel.
Adds enough stuff to test the approach. It is not correct at the
moment, probably needs to project to triangles to make cells line up,
currently it's using planes. There might be incorrect coordinates too,
did that with bit of guessing. A grid-like pattern is also showing, so
might have to make tiles a bit larger to account for filtering.
2022-07-31 16:14:36 +01:00
Marc Gilleron
97e4101234 Show voxel bounds as min/max instead of pos/size 2022-07-10 22:04:20 +01:00
Marc Gilleron
ce91b3890c Combine regular and transition meshes together.
- Less draw calls
- Much faster rendering updates (about 5x),
  although colliders are still the biggest bottleneck so when collision is
  enabled this improvement isn't noticeable
- A shader is now always required to render Transvoxel properly.
  TODO: integrate a default one when no material is assigned?
2022-06-25 16:47:09 +01:00
Marc Gilleron
868ae90fbe Added VoxelMeshSDF and VoxelToolLodTerrain.stamp_sdf() 2022-05-02 19:14:12 +01:00
Marc Gilleron
adb2cd2fe9 Return a ref, pointer must not be null 2022-04-09 15:15:22 +01:00
Marc Gilleron
99e688e52c Detect and log an error when a script tries to set the same data block on different positions 2022-03-20 18:47:51 +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
59dd544ff3 Namespaced VoxelStringNames 2022-01-09 03:38:39 +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
e53dcf7c84 Re-namespaced VoxelConstants 2022-01-09 03:06:58 +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
325406ede1 Decrease MAX_LOD to avoid potential integer overflows
I preferred doing this instead of using 64-bit integers,
because I tink there are no use cases for LOD blocks that big
2021-10-28 23:55:46 +01:00
Marc Gilleron
6faf5b29f3 Allow to configure main thread time limit 2021-09-25 02:13:03 +01:00
Marc Gilleron
36b8031ef6 Added option to change pivot mode in vox mesh importer 2021-08-14 18:01:28 +01:00
Marc Gilleron
d5dc24d6fe Added option to import vox meshes with the option "use in baked lighting" enabled 2021-08-07 23:23:50 +01:00
Marc Gilleron
b7d6a6afb8 Added scale parameter to vox importer 2021-08-07 23:04:47 +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
8c17a1cf20 Added property to configure collision margin 2021-07-10 22:14:17 +01:00
Marc Gilleron
758e3bd227 Allow to use block size 32 for mesh blocks while using 16 for data blocks
Still hardcoded but a config should be added
2021-04-03 20:39:37 +01:00
Marc Gilleron
c86feda259 Replace lod_split_scale with lod_distance for better clarity 2021-03-27 16:38:20 +00:00
Marc Gilleron
fb952ef119 Allow lower split scale 2021-03-12 23:32:02 +00:00
Marc Gilleron
cf81f83382 Re-implemented lod fade 2021-03-02 22:49:42 +00:00
Marc Gilleron
76ec90fe34 Moved constants and tables under a folder 2021-02-21 23:58:00 +00:00