This commit is contained in:
mcrcortex
2024-12-03 21:22:39 +10:00
parent c6fe0a1bed
commit 812342b4da
4 changed files with 6 additions and 3 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -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");

View File

@@ -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);