Possibly fix some weirdness on screen resize and with MiB

This commit is contained in:
mcrcortex
2025-07-28 13:08:22 +10:00
parent 454a5a0e11
commit ff8e96e293
2 changed files with 9 additions and 1 deletions

View File

@@ -82,6 +82,7 @@ public class ChunkBoundRenderer {
this.depthBuffer.free(); this.depthBuffer.free();
this.depthBuffer = new GlTexture().store(GL_DEPTH_COMPONENT24, 1, viewport.width, viewport.height); this.depthBuffer = new GlTexture().store(GL_DEPTH_COMPONENT24, 1, viewport.width, viewport.height);
this.frameBuffer.bind(GL_DEPTH_ATTACHMENT, this.depthBuffer).verify(); this.frameBuffer.bind(GL_DEPTH_ATTACHMENT, this.depthBuffer).verify();
glClearNamedFramebufferfv(this.frameBuffer.id, GL_DEPTH, 0, new float[]{0});
} }
if (this.chunk2idx.isEmpty() && this.addQueue.isEmpty()) return; if (this.chunk2idx.isEmpty() && this.addQueue.isEmpty()) return;

View File

@@ -94,7 +94,14 @@ public class MixinRenderSectionManager {
if (system == null) { if (system == null) {
return true; return true;
} }
long pos = ChunkSectionPos.asLong(instance.getChunkX(), instance.getChunkY(), instance.getChunkZ()); int x = instance.getChunkX(), y = instance.getChunkY(), z = instance.getChunkZ();
//Do some very cheeky stuff for MiB
if (false) {
int sector = (x+512)>>10;
x-=sector<<10;
y+=16+(256-32-sector*30);
}
long pos = ChunkSectionPos.asLong(x,y,z);
if (wasBuilt) {//Remove if (wasBuilt) {//Remove
system.chunkBoundRenderer.removeSection(pos); system.chunkBoundRenderer.removeSection(pos);
} else {//Add } else {//Add