diff --git a/src/main/java/me/cortex/voxy/client/core/VoxelCore.java b/src/main/java/me/cortex/voxy/client/core/VoxelCore.java index bff604e1..d9a44d3b 100644 --- a/src/main/java/me/cortex/voxy/client/core/VoxelCore.java +++ b/src/main/java/me/cortex/voxy/client/core/VoxelCore.java @@ -152,8 +152,8 @@ public class VoxelCore { this.renderer.renderFarAwayOpaque(viewport); - //Compute the SSAO of the rendered terrain, TODO: fix it breaking depth - //this.postProcessing.computeSSAO(projection, matrices); + //Compute the SSAO of the rendered terrain, TODO: fix it breaking depth or breaking _something_ am not sure what + this.postProcessing.computeSSAO(projection, matrices); //We can render the translucent directly after as it is the furthest translucent objects this.renderer.renderFarAwayTranslucent(viewport); diff --git a/src/main/java/me/cortex/voxy/common/world/SaveLoadSystem.java b/src/main/java/me/cortex/voxy/common/world/SaveLoadSystem.java index de0a1fb5..c688f305 100644 --- a/src/main/java/me/cortex/voxy/common/world/SaveLoadSystem.java +++ b/src/main/java/me/cortex/voxy/common/world/SaveLoadSystem.java @@ -125,7 +125,7 @@ public class SaveLoadSystem { } int nonEmptyBlockCount = 0; - for (int i = 0; i < section.data.length; i++) { + for (int i = 0; i < WorldSection.SECTION_VOLUME; i++) { long state = lut[MemoryUtil.memGetShort(ptr)]; ptr += 2; if (VERIFY_MEMORY_ACCESS && data.size<=(ptr-data.address)) throw new IllegalStateException("Memory access OOB"); nonEmptyBlockCount += Mapper.isAir(state)?0:1; section.data[z2lin(i)] = state; diff --git a/src/main/java/me/cortex/voxy/common/world/WorldSection.java b/src/main/java/me/cortex/voxy/common/world/WorldSection.java index 1b614457..141bdec7 100644 --- a/src/main/java/me/cortex/voxy/common/world/WorldSection.java +++ b/src/main/java/me/cortex/voxy/common/world/WorldSection.java @@ -15,6 +15,7 @@ import java.util.concurrent.atomic.AtomicBoolean; //Represents a loaded world section at a specific detail level // holds a 32x32x32 region of detail public final class WorldSection { + public static final int SECTION_VOLUME = 32*32*32; public static final boolean VERIFY_WORLD_SECTION_EXECUTION = VoxyCommon.isVerificationFlagOn("verifyWorldSectionExecution"); diff --git a/src/main/resources/assets/voxy/shaders/lod/gl46/quads2.vert b/src/main/resources/assets/voxy/shaders/lod/gl46/quads2.vert index 5a322270..daee8e84 100644 --- a/src/main/resources/assets/voxy/shaders/lod/gl46/quads2.vert +++ b/src/main/resources/assets/voxy/shaders/lod/gl46/quads2.vert @@ -41,7 +41,9 @@ vec4 uint2vec4RGBA(uint colour) { vec4 getFaceSize(uint faceData) { float EPSILON = 0.001f; + vec4 faceOffsetsSizes = extractFaceSizes(faceData); + //Expand the quads by a very small amount faceOffsetsSizes.xz -= vec2(EPSILON); faceOffsetsSizes.yw += vec2(EPSILON);