159 Commits

Author SHA1 Message Date
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
Marc Gilleron
6f09523fd2 Added option to import colors as textures to improve greedy meshing 2021-08-02 19:03:35 +01:00
Marc Gilleron
b427e2f305 Fix cubes mesher not actually re-using pooled memory 2021-08-01 18:45:10 +01:00
Marc Gilleron
466bc41ab8 Comments 2021-07-25 20:37:47 +01:00
Marc Gilleron
52aa4963ea Fixed some crashes occurring when giving invalid arguments to functions 2021-07-19 19:04:52 +01:00
Marc Gilleron
c5e0d8fe02 Comments 2021-07-11 16:27:17 +01:00
Marc Gilleron
5fcd7f7363 Added mesh optimization option to Transvoxel, using MeshOptimizer 2021-07-11 16:19:49 +01:00
Marc Gilleron
40cd4b3b98 Fix crash in Transvoxel mesher when the input block is not cubic 2021-07-07 00:22:02 +01:00
Marc Gilleron
411be94559 Renamed ArraySlice -> Span 2021-05-31 16:48:49 +01:00
Marc Gilleron
a24c56e064 Fix unused var 2021-05-31 02:11:09 +01:00
Marc Gilleron
f9f7e07b33 Fix unused vars, unhandled cases and shadowing 2021-05-31 01:45:14 +01:00
Marc Gilleron
a4f01b096e Moved some storage functions out of VoxelBuffer 2021-05-29 23:23:18 +01:00
Marc Gilleron
f943339f31 Researching tri-channel weights storage
- No changes made for now, but the code is there if we want to switch
- Renamed functions to be more explicit
2021-05-23 20:28:06 +01:00
Marc Gilleron
16f209780c Merge branch 'master' into smooth_texturing 2021-05-22 22:30:17 +01:00
Marc Gilleron
251d92d9c6 Fix ambiguous calls after upstream change in Godot 3.x 2021-05-22 20:33:56 +01:00
Marc Gilleron
983b7bd83d Merge branch 'master' into smooth_texturing
# Conflicts:
#	util/godot/funcs.h
2021-05-22 19:43:39 +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
bc39743fc9 Fix GCC warning 2021-05-15 20:50:22 +01:00
Marc Gilleron
93cfab7495 Allow to edit VoxelColorPalette in the editor 2021-05-15 20:28:07 +01:00
Marc Gilleron
f5446e3d69 Fix broken vertex sharing when texture mode is enabled 2021-05-03 00:10:24 +01:00
Marc Gilleron
7e905913c9 Unused functions 2021-04-30 01:34:59 +01:00
Marc Gilleron
1f60b9c7e9 Fix used channels when the Transvoxel mesher is set to produce texture info 2021-04-30 01:34:40 +01:00
Marc Gilleron
0e2d7dc596 Comments and format 2021-04-25 20:23:52 +01:00
Marc Gilleron
8b017f460f Basic VoxelTool function to paint textures on buffers 2021-04-25 20:23:14 +01:00
Marc Gilleron
91c469bde5 Unused variable 2021-04-24 21:30:40 +01:00
Marc Gilleron
bbb64a1740 Don't check bounds in release builds 2021-04-24 21:25:45 +01:00
Marc Gilleron
20547241cb Further optimizations and move to new file
- Moved Transvoxel implementation to its own file
- Optimized case where a whole block uses the same textures indices
2021-04-24 21:22:05 +01:00
Marc Gilleron
b75f746ae7 Optimized Transvoxel
- Removed some conditionals using templates
- The hot path skipping empty cells is much faster
- Access to voxels is done more by index instead of position lookup
2021-04-23 22:12:39 +01:00
Marc Gilleron
82fc44d41e Restructured transvoxel logic to prepare templatization 2021-04-21 19:18:08 +01:00
Marc Gilleron
dc2f853b50 First version of texturing for Transvoxel. Needs optimization and tooling. 2021-04-21 18:26:40 +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
55a38957b5 Added SDF scale to VoxelTool. Default value should work best with default bit depth. 2021-01-24 13:54:38 +00:00
Marc Gilleron
1a8cc4380f Fix normalmaps in blocky mesher 2021-01-22 19:18:26 +00:00
Marc
f61758b476
Merge branch 'master' into master 2021-01-21 23:50:59 +00:00
Marc Gilleron
24c2d88e8e Comments 2021-01-18 18:47:37 +00:00
Marc Gilleron
a12144304f Optimized Transvoxel (nearly twice as fast), also allowing 16, 32 and 64 bit precision 2020-12-23 02:27:54 +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
Rathma
8d42c84e1a Added 3x the number of tangents we actually needed 2020-12-14 03:25:28 -05:00
Rathma
fdc14fcd87 Switched tangents to on by default & changed to a passed value to the
bake method rather than being a property of the voxel
2020-11-11 21:58:50 -05:00
Rathma
c9c85ec7cd Tangent baking now optional by toggling in editor under VoxelLibrary 2020-11-09 20:45:56 -05:00
Rathma
c068ad7455 Forgot to clear some tangents in the BakedData class. 2020-11-09 19:51:21 -05:00
Rathma
fd07f76586 Changed real_t => float for all tangent related variables(for real this time) 2020-11-09 01:07:59 -05:00
Rathma
08974daf56 Changed real_t => float for all tangent related variables 2020-11-09 01:03:07 -05:00
Rathma
3aeca4639f Switched to deterministic look-up table for cube uvs.
Changed code to snake case
Changed PoolArrays from real_t to float
Removed tangents from colored cube generator
2020-11-09 00:45:49 -05:00
Rathma
04aaeab615 Somehow missed I redefined a variable on a local build. 2020-11-08 21:43:42 -05:00