From 560ca9092c8b8eb943d726b766e1f84f44bc1927 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Tue, 25 Mar 2025 11:20:56 +1000 Subject: [PATCH] Things --- .../client/core/rendering/RenderService.java | 2 +- .../core/rendering/VoxyRenderSystem.java | 26 ++++++++++++++++++- .../me/cortex/voxy/commonImpl/VoxyCommon.java | 2 +- .../{selectorOLDDD.comp => selectorold.comp} | 0 4 files changed, 27 insertions(+), 3 deletions(-) rename src/main/resources/assets/voxy/shaders/lod/hierarchical/{selectorOLDDD.comp => selectorold.comp} (100%) diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/RenderService.java b/src/main/java/me/cortex/voxy/client/core/rendering/RenderService.java index 868c9546..42fbd009 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/RenderService.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/RenderService.java @@ -51,7 +51,7 @@ public class RenderService, J extends Vi //Max sections: ~500k //Max geometry: 1 gb - this.sectionRenderer = (T) createSectionRenderer(this.modelService.getStore(),1<<20, (1L<<32)-1024); + this.sectionRenderer = (T) createSectionRenderer(this.modelService.getStore(),1<<20, (1L<<31)-1024); Logger.info("Using renderer: " + this.sectionRenderer.getClass().getSimpleName()); //Do something incredibly hacky, we dont need to keep the reference to this around, so just connect and discard diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/VoxyRenderSystem.java b/src/main/java/me/cortex/voxy/client/core/rendering/VoxyRenderSystem.java index f89c524f..faa6ae48 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/VoxyRenderSystem.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/VoxyRenderSystem.java @@ -4,18 +4,23 @@ import com.mojang.blaze3d.systems.RenderSystem; import me.cortex.voxy.client.config.VoxyConfig; import me.cortex.voxy.client.core.gl.Capabilities; import me.cortex.voxy.client.core.gl.GlBuffer; +import me.cortex.voxy.client.core.model.ColourDepthTextureData; +import me.cortex.voxy.client.core.model.ModelTextureBakery; import me.cortex.voxy.client.core.rendering.post.PostProcessing; import me.cortex.voxy.client.core.rendering.util.DownloadStream; +import me.cortex.voxy.client.core.rendering.util.RawDownloadStream; import me.cortex.voxy.client.core.util.IrisUtil; import me.cortex.voxy.common.Logger; import me.cortex.voxy.common.thread.ServiceThreadPool; import me.cortex.voxy.common.world.WorldEngine; +import net.minecraft.block.Blocks; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.Camera; import net.minecraft.client.render.Frustum; import net.minecraft.client.util.math.MatrixStack; import org.joml.Matrix4f; import org.lwjgl.opengl.GL11; +import org.lwjgl.system.MemoryUtil; import java.util.List; @@ -67,11 +72,30 @@ public class VoxyRenderSystem { public void renderOpaque(MatrixStack matrices, double cameraX, double cameraY, double cameraZ) { /* int allocation = downstream.download(2*4*6*16*16, ptr->{ + ColourDepthTextureData[] textureData = new ColourDepthTextureData[6]; + final int FACE_SIZE = 16*16; + for (int face = 0; face < 6; face++) { + long faceDataPtr = ptr + (FACE_SIZE*4)*face*2; + int[] colour = new int[FACE_SIZE]; + int[] depth = new int[FACE_SIZE]; + + //Copy out colour + for (int i = 0; i < FACE_SIZE; i++) { + //De-interpolate results + colour[i] = MemoryUtil.memGetInt(faceDataPtr+ (i*4*2)); + depth[i] = MemoryUtil.memGetInt(faceDataPtr+ (i*4*2)+4); + } + + textureData[face] = new ColourDepthTextureData(colour, depth, 16, 16); + } + + int a = 0; }); - mtb.renderFacesToStream(Blocks.WHITE_STAINED_GLASS.getDefaultState(), 123456, false, downstream.getBufferId(), allocation); + mtb.renderFacesToStream(Blocks.GRASS_BLOCK.getDefaultState(), 123456, false, downstream.getBufferId(), allocation); downstream.submit(); downstream.tick(); */ + //if (true) return; diff --git a/src/main/java/me/cortex/voxy/commonImpl/VoxyCommon.java b/src/main/java/me/cortex/voxy/commonImpl/VoxyCommon.java index be65a65d..4579b209 100644 --- a/src/main/java/me/cortex/voxy/commonImpl/VoxyCommon.java +++ b/src/main/java/me/cortex/voxy/commonImpl/VoxyCommon.java @@ -30,7 +30,7 @@ public class VoxyCommon implements ModInitializer { } //This is hardcoded like this because people do not understand what they are doing - private static final boolean GlobalVerificationDisableOverride = true;//System.getProperty("voxy.verificationDisableOverride", "false").equals("true"); + private static final boolean GlobalVerificationDisableOverride = false;//System.getProperty("voxy.verificationDisableOverride", "false").equals("true"); public static boolean isVerificationFlagOn(String name) { return (!GlobalVerificationDisableOverride) && System.getProperty("voxy."+name, "true").equals("true"); } diff --git a/src/main/resources/assets/voxy/shaders/lod/hierarchical/selectorOLDDD.comp b/src/main/resources/assets/voxy/shaders/lod/hierarchical/selectorold.comp similarity index 100% rename from src/main/resources/assets/voxy/shaders/lod/hierarchical/selectorOLDDD.comp rename to src/main/resources/assets/voxy/shaders/lod/hierarchical/selectorold.comp