Commit Graph

595 Commits (b26fd944a8b65047a6226dd6b6be4c6907495879)

Author SHA1 Message Date
Marc Gilleron 8c16424af1 Fix usage of SDF on VoxelTerrain
It causes the blocky mesher to be called potentially with uniform blocks,
which is actually a valid case to handle better in the future.
2020-02-12 21:16:29 +00:00
Marc Gilleron 197c6c71bc Use a pattern matrix to determine side culling, so it can be baked more precisely 2020-02-11 21:20:05 +00:00
Marc Gilleron b1dc8d3762 More fixes to file streams:
- Assign channel formats before saving for the first time
- Always try to load meta file if not loaded, rather than saving it over
2020-02-09 18:41:39 +00:00
Marc Gilleron 6851818733 Fix non-initialized default metadata in VoxelStreamBlockFiles 2020-02-09 18:29:47 +00:00
Marc Gilleron 3c9e63b633 Merge branch 'master' of https://github.com/Zylann/godot_voxel 2020-02-09 17:08:12 +00:00
Marc Gilleron a8c5fed29d File streams fixes:
- Uniform compression now supports more than 8-bit depth (compat implementation)
- Fix buffers not being set to correct depth before loading from file
- Check if we save correct buffer depths in region files
- Fix inverted check when reading region meta file
- Fix version check not working in JSON meta file because it's float
2020-02-09 17:07:53 +00:00
Marc a3bfcbc6c7
Merge pull request #115 from Caellian/master
Added missing semicolons on line endings
2020-02-09 02:53:00 +00:00
Marc Gilleron 7aa33267a8 Culling masks improvements:
- Use a 64-bit mask instead of 8-bit
- Fix face separation when a custom mesh is used
- Automatically generate culling masks using raster approximation
2020-02-08 23:05:44 +00:00
Tin Švagelj e67ec6f207
Added missing semicolons on line endings 2020-02-07 04:52:06 +01:00
Marc Gilleron b2f7d23f7f Clang-format 2020-02-06 18:52:18 +00:00
Marc Gilleron ac370f0e71 Fix edition, LOD downsampling was taking source voxels from wrong position 2020-02-05 21:25:11 +00:00
Marc Gilleron bb97d7a614 Add debug method to VoxelLodTerrain to print a 2D top-down image of the SDF 2020-02-05 21:09:14 +01:00
Marc Gilleron 618257b570 Code style 2020-02-05 21:08:23 +01:00
Marc Gilleron 3604184d1e Fixed wrong marshalling when getting a 64-bit value as float 2020-02-05 16:37:39 +01:00
Marc Gilleron e9d431360b Fix case where a block gets saved but is requested for loading very shortly after
When a block gets saved, a thread event comes back to confirm it,
but that event can be mistaken for a loading event because nothing was
explicitely checking for it. It worked so far because the "loading blocks"
check was luckily taking "care" of it, except in that edge case.
2020-02-04 15:37:52 +01:00
Marc Gilleron 8eae71e1cb Added face culling masks to customize when blocky sides are getting culled 2020-02-03 16:03:44 +01:00
Marc Gilleron 6c6bd52a68 Can add custom collision AABBs to blocky voxels, for use with VoxelBoxMover 2020-02-03 10:29:25 +01:00
Marc Gilleron 9a296952b7 A blocky voxel can be defined with a custom mesh. Needs a few improvements 2020-01-31 17:53:34 +01:00
Marc Gilleron 88d170adff Fix wrong method bind 2020-01-30 14:58:19 +01:00
Marc Gilleron 3ec2275ffb Moved Voxel and VoxelLibrary under the blocky mesher directory, since that's what they are actually used for 2020-01-27 00:04:13 +00:00
Marc Gilleron aec06b214b Merge branch 'master' into depth 2020-01-26 23:34:08 +00:00
Marc Gilleron 54e5e31245 Expose blur option in VoxelGeneratorImage 2020-01-26 23:06:21 +00:00
Marc Gilleron b937020d16 Rename files to match class names 2020-01-26 22:43:47 +00:00
Marc Gilleron 8879d9b2e7 Moved all generators under their own base class and folder 2020-01-26 22:34:26 +00:00
Marc Gilleron 87a9766442 voxel_raycast is now template 2020-01-26 20:43:40 +00:00
Marc Gilleron 0ac1b7e6dc Moved edition-related classes to a sub-folder 2020-01-26 20:29:44 +00:00
Marc Gilleron 20dc0008f4 Removed legacy marching cubes mesher 2020-01-26 20:18:21 +00:00
Marc Gilleron 4626b4d7a3 Added iso_scale parameter to heightmap generators, which eliminates terracing. As a result, sdf_mode is now useless and was removed. 2020-01-26 20:08:25 +00:00
Marc Gilleron 21f3f36b86 Merge branch 'master' into depth
# Conflicts:
#	voxel_buffer.cpp
2020-01-26 02:01:23 +00:00
Marc Gilleron 7161942ee1 Fix memory leak in VoxelBuffer::fill() 2020-01-26 01:59:53 +00:00
Marc Gilleron f530daaf03 Check data sizes properly 2020-01-26 01:33:45 +00:00
Marc Gilleron 4b52d8fd18 get_channel_raw returns an ArraySlice instead of a pointer 2020-01-25 23:26:55 +00:00
Marc Gilleron 8224346846 Added depth info to VoxelStreamBlockFiles. No versionning for this one, it's not a recommended stream anyways. 2020-01-25 22:54:49 +00:00
Marc Gilleron 2d5775f233 Removed 1-bit and 24-bit depths, will add them back if they are really needed 2020-01-25 20:45:47 +00:00
Marc Gilleron 7723988b15 Merge branch 'master' into depth
# Conflicts:
#	meshers/transvoxel/voxel_mesher_transvoxel.cpp
2020-01-25 19:46:53 +00:00
Marc Gilleron b1b7d4ba03 Merge branch 'heightmap_generators' 2020-01-24 00:00:47 +00:00
Marc Gilleron 4f9b05dfc0 Bake LOD into Transvoxel instead of scaling afterwards 2020-01-23 23:33:48 +00:00
Marc Gilleron a751b0ca63 Fix edited block producing a hole when going away from it 2020-01-23 23:20:23 +00:00
Marc Gilleron 73491cd1ff Fix LOD getting stuck if you teleport far away
Now the octree is always allowed to merge nodes even if the parent block isn't available.
Also removed unused userdata from LodOctree::Node,
merged callbacks into one struct,
removed some old debug code
2020-01-23 00:37:13 +00:00
Marc Gilleron df719187b7 Added optional curve to VoxelStreamNoise2D 2020-01-22 00:32:58 +00:00
Marc Gilleron 01b3201689 Rename height_base to be height_start, for consistency 2020-01-21 23:57:22 +00:00
Marc Gilleron df3a649e18 Added VoxelStreamNoise2D 2020-01-21 23:52:25 +00:00
Marc Gilleron b90e6b8207 Abstract most of VoxelStreamImage into VoxelStreamHeightmap 2020-01-21 22:41:55 +00:00
Marc Gilleron 2c4c4f3288 Fix stupid bugs 2020-01-21 21:17:15 +00:00
Marc Gilleron 83e8c22539 Comments 2020-01-21 20:00:29 +00:00
Marc Gilleron 091cde0794 Re-implemented Rect3i::clip_range(), size was wrong (still unused but found it while drafting something) 2020-01-21 20:00:17 +00:00
Marc Gilleron 6a417bf657 Abstracted some of the heightmap SDF algorithm, WIP 2020-01-21 19:51:05 +00:00
Marc Gilleron e76e4d2b49 Fix bad discarding code when block management threads are told to exit
In short, std::remove_if does NOT remove anything
2020-01-19 18:13:00 +00:00
Marc Gilleron 2fe83ce154 Fix wrong return values 2020-01-19 01:22:48 +00:00
Marc Gilleron 3263001c5f Optimized VoxelStreamNoise with finer height range and noise shaping 2020-01-19 00:43:56 +00:00