43 Commits

Author SHA1 Message Date
Marc Gilleron
1310112f25 Fix face culling issue with transparent voxels of different IDs 2020-07-30 18:00:12 +01:00
Marc Gilleron
905dbee563 Explain Voxel ID may not be set again 2020-07-30 17:57:48 +01:00
Marc Gilleron
08e328e786 Fix voxel name lookup 2020-07-28 21:21:23 +01:00
Marc Gilleron
0cdf5ea550 Added random tick API for blocky voxels 2020-07-28 20:32:33 +01:00
Marc Gilleron
a24b33eca1 Formatting 2020-07-26 18:44:46 +01:00
Marc Gilleron
e3abe2f7c0 Fix crash when custom mesh is empty 2020-07-26 18:38:39 +01:00
Marc Gilleron
fd9122a0de Use StringName for voxel names 2020-07-26 18:37:34 +01:00
Marc Gilleron
f9e2d9cc12 Stop using NULL 2020-07-25 23:19:08 +01:00
Marc Gilleron
1a08cd31d6 Use a macro to print debug stuff only in verbose mode 2020-07-08 20:48:52 +01:00
Marc Gilleron
e96677622a Fix Voxel erroring when set an ID larger than 255 2020-07-08 19:57:04 +01:00
Marc Gilleron
800febfab6 Implement duplicate() on Voxel 2020-05-08 17:57:00 +01:00
Cory Petkovsek
d407d6201a Fix build warnings on other platforms 2020-04-03 20:46:29 +08:00
Marc Gilleron
9f7a081dd4 Non-cube voxels don't contribute to AO for now 2020-02-23 01:29:32 +00:00
Marc Gilleron
f5001fdc07 Merge branch 'master' into custom_blocky_mesh
# Conflicts:
#	util/array_slice.h
2020-02-22 22:55:50 +00:00
Cory Petkovsek
24841e9a18 fix gcc warnings 2020-02-13 21:49:11 +08:00
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
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
Marc Gilleron
b2f7d23f7f Clang-format 2020-02-06 18:52:18 +00: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
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
4b52d8fd18 get_channel_raw returns an ArraySlice instead of a pointer 2020-01-25 23:26:55 +00:00
Marc Gilleron
1e1385c86c VoxelMesherBlocky supports 16-bit voxels 2020-01-18 19:51:21 +00:00
Marc Gilleron
5e066fa7cd Fix compilation 2020-01-06 00:46:58 +00:00
Marc Gilleron
04d15fe843 Merge branch 'master' into depth
# Conflicts:
#	meshers/blocky/voxel_mesher_blocky.cpp
#	meshers/transvoxel/voxel_mesher_transvoxel.cpp
2020-01-05 23:40:44 +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
a8f8a03439 Added customizable bit depth to VoxelBuffer. UNTESTED 2020-01-04 19:20:49 +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
cef43e4087 Take voxel color into account in blocky mesher 2019-09-11 20:10:08 +01:00
Marc Gilleron
959f4432dd A bit of code grooming 2019-09-10 20:42:07 +01:00
Marc Gilleron
026fa96654 Fix mesh corruption when using two different materials 2019-09-10 20:40:42 +01: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
dc73977a1a Changed profiler to be more like a stack-based one, also made it super light (CPU-wise) 2019-08-18 23:13:12 +01:00
Cory Petkovsek
f6a9c5761a Fix gcc sign comparison warnings 2019-06-18 14:24:56 +09:00
Cory Petkovsek
5ad555c439 Fix gcc multiline comments, uninitialized vars, unused vars warnings 2019-06-18 12:38:44 +09:00
Marc Gilleron
9d2c491fe9 Remove some comments 2019-05-25 15:53:36 +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
38062b32fe Code style 2019-05-19 18:24:03 +01:00
Marc Gilleron
66d4a913bd Use std::vector for speed 2019-04-28 21:02:42 +01:00
Marc Gilleron
faefde721a Add base class to all meshers, gather common things in it 2019-04-28 20:48:59 +01:00
Marc Gilleron
12a97cca5a Reorganize all files and rename a few things 2019-04-28 17:58:29 +01:00