From 091653756ae97bdaed6bca39839f63202cf5bd93 Mon Sep 17 00:00:00 2001 From: austin Date: Wed, 28 May 2025 13:04:29 -0400 Subject: [PATCH] fix structure foundations --- docs/src/progress/renderertodo.md | 1 + .../terrain/generation/ProceduralChunkGenerator.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index d22ad77a..aeb4951b 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -2018,6 +2018,7 @@ Server entities without collidables deactivate gravity trees Fix texture map for lod human model Properly show loading state when waiting on character list Fix standard uniform buffer interaction with actor panel +Fix foundation generation for structures in chunkgen diff --git a/src/main/java/electrosphere/server/physics/terrain/generation/ProceduralChunkGenerator.java b/src/main/java/electrosphere/server/physics/terrain/generation/ProceduralChunkGenerator.java index 8bb97868..92e7869f 100644 --- a/src/main/java/electrosphere/server/physics/terrain/generation/ProceduralChunkGenerator.java +++ b/src/main/java/electrosphere/server/physics/terrain/generation/ProceduralChunkGenerator.java @@ -298,7 +298,11 @@ public class ProceduralChunkGenerator implements ChunkGenerator { double vertDist = aabb.minY - realY; if(vertDist > 0 && vertDist < VIRTUAL_STRUCTURE_FOUNDATION_WIDTH){ voxel.type = 1; - voxel.weight = 1; + voxel.weight = 0.95f; //not setting it to 1 to combat z-fighting being caused by the terrain mesh perfectly overlapping the structure mesh + rVal = true; + } else if(vertDist < 0){ + voxel.type = 0; + voxel.weight = -1; rVal = true; } }