80 Commits

Author SHA1 Message Date
Marc Gilleron
abc7653b88 Fixed wrong condition 2022-08-15 21:07:06 +01:00
Marc Gilleron
4034734c5c Workaround shader uniforms incorrectly reported as missing 2022-08-15 21:06:28 +01:00
Marc Gilleron
83d2facf13 Fix configuration warning formatting issues 2022-08-15 20:50:04 +01:00
Marc Gilleron
5943b1d549 Moved VirtualTextureOutput out of VoxelMesher 2022-08-14 22:34:27 +01:00
Marc Gilleron
92b3c25292 Moved distance_normalmaps to engine/ since it doesn't depend on meshers 2022-08-14 21:53:59 +01:00
Marc Gilleron
bab04748b3 Make normalmap baking more independent
- The baking code no longer depends on Transvoxel
- Moved usage out of the Transvoxel mesher, but still uses its fastpath
  for cells. There is still no "generic" path because there is no need yet.
- Moved settings on VoxelLodTerrain.
2022-08-14 19:15:55 +01:00
Marc Gilleron
a930a6ae11 Only update virtual textures if they are not updating already 2022-08-13 21:59:46 +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
4f5b0b6983 Added a bunch of configuration warnings related to shader 2022-08-10 20:02:36 +01:00
Marc Gilleron
2d2c9d7951 Comments 2022-08-09 23:50:38 +01:00
Marc Gilleron
d7994dfd4d More occurrences of shader_param renamed to shader_uniform 2022-08-07 23:43:26 +01:00
Marc Gilleron
d7642599c6 Merge branch 'master' into smooth_normalmaps 2022-08-07 23:32:37 +01:00
Marc Gilleron
a9752362cd shader_param occurrences were renamed shader_uniform 2022-08-07 23:31:20 +01:00
Marc Gilleron
af324c7d9f Added configuration warning when using distance normals with an incompatible generator 2022-08-07 17:58: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
b1f4aee78b ResourceSaver::save arguments were swapped 2022-08-01 00:08:21 +01:00
Marc Gilleron
9cde2e94ac Bound check 2022-07-24 00:44:24 +01:00
Marc Gilleron
1c8ecc1b89 Fix debug drawing of edited data blocks showing non-edited data blocks 2022-07-23 00:05:25 +01:00
Marc Gilleron
01328fb905 Allow to configure debug draw while the terrain is not in the tree 2022-07-22 23:08:43 +01:00
Marc Gilleron
7004ce5816 Auto-assign a mesher in editor for convenience 2022-07-17 20:24:49 +01:00
Marc Gilleron
5ca09d712e Renamed VoxelServer => VoxelEngine 2022-07-16 23:59:06 +01:00
Marc Gilleron
c13303b464 Fix material properties were listing unsupported types 2022-07-16 17:37:22 +01:00
Marc Gilleron
e7018dd0ef Unused variable 2022-07-10 22:53:19 +01:00
Marc Gilleron
173ee3e198 Fix variable shadowing 2022-07-10 22:53:08 +01:00
Marc Gilleron
6327b31320 Improved LOD fading
- Cracks no longer appear at seams when transitions change
- Fading is no longer applied to blocks behind the camera
2022-07-10 16:57:09 +01:00
Marc Gilleron
f0da2d041e Fixed lod_fade_duration property was not accepting decimal numbers 2022-07-10 16:46:10 +01:00
Marc Gilleron
e6ffc0ad77 Assign collision hint for VoxelLodTerrain mesh requests.
That wasn't required so far, but is for correctness.
2022-07-03 21:36:07 +01:00
Marc Gilleron
5321b0dc68 Fixed shapes not built properly when deferred collision is enabled 2022-07-03 03:26:31 +01:00
Marc Gilleron
dac0af3a04 Build mesh resource on the task thread now the Vulkan renderer supports it 2022-07-02 23:01:49 +01:00
Marc Gilleron
2b94c2968d Missing return value in release builds 2022-06-26 19:51:18 +01:00
Marc Gilleron
01ce2e4fbd Unused function 2022-06-26 19:33:00 +01:00
Marc Gilleron
a4722c4b12 Merge branch 'master' into transition_mesh_tweaks 2022-06-26 18:45:51 +01:00
Marc Gilleron
d9b74359f8 Provide a default material for VoxelMesherTransvoxel with variable-lod 2022-06-26 17:21:05 +01:00
Marc Gilleron
a7934b9e2c Exposed debug drawing options on VoxelLodTerrain 2022-06-26 14:04:12 +01:00
Marc Gilleron
fd59ed7d2a Fix unused variable 2022-06-26 01:00:48 +01:00
Marc Gilleron
c072ff4db5 Fix GCC warning about shadowing a previous local 2022-06-26 01:00:23 +01:00
Marc Gilleron
90a03d29e7 Added debug viewing of edit boxes (not exposed yet) 2022-06-26 00:34:43 +01:00
Marc Gilleron
392c335956 Fix crashing/not working edition in VoxelLodTerrain 2022-06-25 22:48:39 +01:00
Marc Gilleron
ff082c5f2b Undo deferred transition mesh tasks, superseded by combined transitions 2022-06-25 20:44:41 +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
c7d8c2557c Attempting to give priority to main mesh building over transition meshes.
This effectively creates them after ALL main meshes have been built,
resulting in a seemingly faster convergence of LOD, however when moving
around it causes some cracks to appear briefly. This can be bad if the
terrain is dark and the underlying skybox is bright. Might need to be
optional, or find a different approach.
2022-06-22 22:05:25 +01:00
Marc Gilleron
65e31f181b Comment about optimization 2022-06-20 19:50:03 +01:00
Marc Gilleron
86ba74ce3a Some changes and fixes related modifiers
- VoxelLodTerrain no longer caches generated voxels by default, so
  generating on the fly is no longer exclusive to full load mode.
  Might add an option later, but not for now (VoxelTerrain is still
  unaffected and keeps caching them)
- The "Cached" state is represented with blocks having no voxel data,
  so it needs extra checks in some areas to avoid null access
- Fix generate task was not including modifiers after the base generator
- The "save_generator_output" option on streams now means such blocks are
  considered edited
- Modifying modifiers now clears cached generated blocks
  intersecting with them.
- Fix "re-generate" was erasing the internal stack of modifiers
- Added docs
2022-06-18 23:14:18 +01:00
Marc Gilleron
0e12e6dbf1 Initial WIP for SDF non-destructive voxel modifiers. Support is incomplete.
Some voxel queries and operations will not take modifiers into account.
It needs to be worked on, might involve some refactoring.
2022-06-09 20:35:29 +01:00
Marc Gilleron
1e1b6904f3 Small scope change 2022-06-09 20:11:50 +01:00
Marc Gilleron
2098ca36d9 Added debug gizmos to see mesh updates 2022-06-05 23:26:17 +01:00
Marc Gilleron
abdcb4c7d5 Storing position on VoxelDataBlock isn't necessary 2022-06-04 02:44:00 +01:00
Marc Gilleron
f34d87d305 Simplified data VoxelDataMap structure 2022-06-04 02:23:56 +01:00
Marc Gilleron
6ab6f4a8b6 Unnecessary includes 2022-06-03 19:02:03 +01:00
Marc Gilleron
2ce4b92225 Fix changing mesh size not remeshing the terrain 2022-06-03 18:30:42 +01:00