From 1c23394415c4568990ffd659e93c9260fc55c930 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Sat, 22 Mar 2025 11:34:06 +1000 Subject: [PATCH] Disable partial non opaque meshing --- .../voxy/client/VoxyClientInstance.java | 3 +- .../building/RenderDataFactory45.java | 45 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/cortex/voxy/client/VoxyClientInstance.java b/src/main/java/me/cortex/voxy/client/VoxyClientInstance.java index cbf60dcf..a8f8514c 100644 --- a/src/main/java/me/cortex/voxy/client/VoxyClientInstance.java +++ b/src/main/java/me/cortex/voxy/client/VoxyClientInstance.java @@ -1,5 +1,6 @@ package me.cortex.voxy.client; +import me.cortex.voxy.client.config.VoxyConfig; import me.cortex.voxy.client.core.WorldImportWrapper; import me.cortex.voxy.client.saver.ContextSelectionSystem; import me.cortex.voxy.common.world.WorldEngine; @@ -13,7 +14,7 @@ public class VoxyClientInstance extends VoxyInstance { public WorldImportWrapper importWrapper; public VoxyClientInstance() { - super(14); + super(VoxyConfig.CONFIG.serviceThreads); } @Override diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/building/RenderDataFactory45.java b/src/main/java/me/cortex/voxy/client/core/rendering/building/RenderDataFactory45.java index 81d6d0df..4eed7ce2 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/building/RenderDataFactory45.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/building/RenderDataFactory45.java @@ -356,6 +356,51 @@ public class RenderDataFactory45 { } this.blockMesher.doAuxiliaryFaceOffset = true; } + + + if (false) {//Non fully opaque geometry + //Note: think is ok to just reuse.. blockMesher + this.blockMesher.axis = axis; + for (int layer = 0; layer < 32; layer++) { + this.blockMesher.auxiliaryPosition = layer; + for (int other = 0; other < 32; other++) {//TODO: need to do the faces that border sections + int pidx = axis == 0 ? (layer * 32 + other) : (other * 32 + layer); + + int msk = this.nonOpaqueMasks[pidx]; + + if (msk == 0) { + this.blockMesher.skip(32); + continue; + } + + + int cIdx = -1; + while (msk != 0) { + int index = Integer.numberOfTrailingZeros(msk);//Is also the x-axis index + int delta = index - cIdx - 1; + cIdx = index; //index--; + if (delta != 0) this.blockMesher.skip(delta); + msk &= ~Integer.lowestOneBit(msk); + + { + int idx = index + (pidx * 32); + + //TODO: swap this out for something not getting the next entry + long A = this.sectionData[idx * 2]; + + //Example thing thats just wrong but as example + this.blockMesher.putNext((long) (false ? 0L : 1L) | + ((A & 0xFFFFL) << 26) | + (((0xFFL) & 0xFF) << 55) | + ((A&(0x1FFL<<24))<<(46-24)) + ); + } + } + this.blockMesher.endRow(); + } + this.blockMesher.finish(); + } + } } }