diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/Gl46FarWorldRenderer.java b/src/main/java/me/cortex/voxy/client/core/rendering/Gl46FarWorldRenderer.java index c0833120..afa491a2 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/Gl46FarWorldRenderer.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/Gl46FarWorldRenderer.java @@ -3,6 +3,7 @@ package me.cortex.voxy.client.core.rendering; import me.cortex.voxy.client.core.gl.GlBuffer; import me.cortex.voxy.client.core.gl.shader.Shader; import me.cortex.voxy.client.core.gl.shader.ShaderType; +import me.cortex.voxy.client.core.rendering.util.DownloadStream; import me.cortex.voxy.client.core.rendering.util.UploadStream; import me.cortex.voxy.client.mixin.joml.AccessFrustumIntersection; import net.minecraft.block.Blocks; @@ -149,15 +150,16 @@ public class Gl46FarWorldRenderer extends AbstractFarWorldRenderer /* - glFinish(); DownloadStream.INSTANCE.download(this.glCommandCountBuffer, 0, 4, (ptr, siz) -> { int cnt = MemoryUtil.memGetInt(ptr); - System.out.println(cnt); + drawCnt = cnt; }); DownloadStream.INSTANCE.commit(); + */ + glMemoryBarrier(GL_PIXEL_BUFFER_BARRIER_BIT | GL_FRAMEBUFFER_BARRIER_BIT); this.cullShader.bind(); diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/building/RenderDataFactory.java b/src/main/java/me/cortex/voxy/client/core/rendering/building/RenderDataFactory.java index 375adc47..77ff4de3 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/building/RenderDataFactory.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/building/RenderDataFactory.java @@ -164,7 +164,7 @@ public class RenderDataFactory { connectedSection.copyDataTo(this.connectedSectionCache); connectedSection.release(); } else { - Arrays.fill(this.connectedSectionCache, 0); + Arrays.fill(this.connectedSectionCache, Mapper.withLight(Mapper.AIR, 15)); } obtainedOppositeSection0 = true; } @@ -190,7 +190,7 @@ public class RenderDataFactory { connectedSection.copyDataTo(this.connectedSectionCache); connectedSection.release(); } else { - Arrays.fill(this.connectedSectionCache, 0); + Arrays.fill(this.connectedSectionCache, Mapper.withLight(Mapper.AIR, 15)); } obtainedOppositeSection31 = true; } diff --git a/src/main/java/me/cortex/voxy/common/world/ActiveSectionTracker.java b/src/main/java/me/cortex/voxy/common/world/ActiveSectionTracker.java index 71df1ae0..dcf3a6b1 100644 --- a/src/main/java/me/cortex/voxy/common/world/ActiveSectionTracker.java +++ b/src/main/java/me/cortex/voxy/common/world/ActiveSectionTracker.java @@ -59,7 +59,7 @@ public class ActiveSectionTracker { } if (status == 1) { //We need to set the data to air as it is undefined state - Arrays.fill(section.data, Mapper.AIR); + Arrays.fill(section.data, Mapper.withLight(Mapper.AIR, 15));//Since lighting is inverted } section.acquire(); holder.obj = section;