Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ org.gradle.daemon = false

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=26.2
loader_version=0.19.3
loom_version=1.16-SNAPSHOT
minecraft_version=26.3
loader_version=0.19.5
loom_version=1.17-SNAPSHOT

# Fabric API
fabric_api_version=0.152.2+26.2
sodium_version_modrinth=mc26.2-0.9.2-fabric
fabric_api_version=0.161.0+26.3
sodium_version_modrinth=mc26.3-0.9.2-fabric
#sodium_version=0.9.0-beta.3+mc26.2r1
sodium_extra_allows=0.9.1
sodium_extra_allows=0.9.4


#Following modifiers are accepted: compileOnly, runtime

modmenu_version=20.0.0
lithium_version=mc26.2-0.25.1-fabric
lithium_version=mc26.3-0.26.1-fabric

compileOnly.iris_version=1.11.2+26.2-fabric
compileOnly.iris_version=1.11.6+26.3-fabric

chunky_version=DCgX52a5
vivecraft_version=26.2-1.3.12-fabric
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.cortex.voxy.client.core;

import com.mojang.blaze3d.pipeline.DepthStencilState;
import com.mojang.blaze3d.platform.CompareOp;
import com.mojang.renderpearl.api.pipeline.DepthStencilState;
import com.mojang.renderpearl.api.pipeline.CompareOp;
import com.mojang.blaze3d.systems.RenderSystem;
import me.cortex.voxy.client.core.gl.shader.Shader;
import me.cortex.voxy.client.core.util.IrisUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.cortex.voxy.client.core;

import com.mojang.blaze3d.opengl.GlConst;
import com.mojang.blaze3d.opengl.GlStateManager;
import com.mojang.renderpearl.backend.opengl.GlConst;
import com.mojang.renderpearl.backend.opengl.GlStateManager;
import me.cortex.voxy.client.TimingStatistics;
import me.cortex.voxy.client.VoxyClient;
import me.cortex.voxy.client.config.VoxyConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ public ReuseVertexConsumer setUv2(int u, int v) {
return this;
}

@Override
public ReuseVertexConsumer setUv3(float u, float v) {
return this;
}

@Override
public ReuseVertexConsumer setNormal(float x, float y, float z) {
return this;
Expand All @@ -104,7 +109,7 @@ public ReuseVertexConsumer quad(BakedQuad quad, boolean forceSolid) {
}

public ReuseVertexConsumer quad(BakedQuad quad, int metadata) {
this.anyShaded |= quad.materialInfo().shade();
this.anyShaded |= quad.materialInfo().lightEmission() == 0;
this.anyDarkendTex |= quad.materialInfo().sprite().contents().mipmapStrategy == MipmapStrategy.DARK_CUTOUT;
this.ensureCanPut();
for (int i = 0; i < 4; i++) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.cortex.voxy.client.core.model.bakery;

import com.mojang.blaze3d.GpuFormat;
import com.mojang.blaze3d.opengl.GlTexture;
import com.mojang.renderpearl.api.GpuFormat;
import com.mojang.renderpearl.backend.opengl.GlTexture;
import com.mojang.blaze3d.vertex.PoseStack;
import me.cortex.voxy.client.core.model.ModelFactory;
import me.cortex.voxy.common.util.UnsafeUtil;
Expand Down Expand Up @@ -293,9 +293,9 @@ public int renderToOutput(BlockState state, long outputBuffer, boolean rasterAsU
private static void addView(int i, float pitch, float yaw, float rotation, int flip) {
var stack = new PoseStack();
stack.translate(0.5f,0.5f,0.5f);
stack.mulPose(makeQuatFromAxisExact(new Vector3f(0,0,1), rotation));
stack.mulPose(makeQuatFromAxisExact(new Vector3f(1,0,0), pitch));
stack.mulPose(makeQuatFromAxisExact(new Vector3f(0,1,0), yaw));
stack.rotate(makeQuatFromAxisExact(new Vector3f(0,0,1), rotation));
stack.rotate(makeQuatFromAxisExact(new Vector3f(1,0,0), pitch));
stack.rotate(makeQuatFromAxisExact(new Vector3f(0,1,0), yaw));
stack.mulPose(new Matrix4f().scale(1-2*(flip&1), 1-(flip&2), 1-((flip>>1)&2)));
stack.translate(-0.5f,-0.5f,-0.5f);
var mat = new Matrix4f(stack.last().pose());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public static void bind(int lightingIndex) {
}

public static int getLightmapTextureId() {
return ((com.mojang.blaze3d.opengl.GlTexture)(Minecraft.getInstance().gameRenderer.levelLightmap().texture())).glId();
return ((com.mojang.renderpearl.backend.opengl.GlTexture)(Minecraft.getInstance().gameRenderer.levelLightmap().texture())).glId();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package me.cortex.voxy.client.mixin.iris;

import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.renderpearl.api.buffers.GpuBufferSlice;
import com.mojang.blaze3d.resource.GraphicsResourceAllocator;
import me.cortex.voxy.client.core.IVoxyRenderSystemHolder;
import me.cortex.voxy.client.core.util.IrisUtil;
Expand Down Expand Up @@ -30,7 +30,7 @@ public class MixinLevelRenderer {
private GameRenderer gameRenderer;

@Inject(method = "render", at = @At("HEAD"), order = 100)
private void voxy$injectIrisCompat(GraphicsResourceAllocator resourceAllocator, DeltaTracker deltaTracker, boolean renderOutline, CameraRenderState cameraState, Matrix4fc modelViewMatrix, GpuBufferSlice terrainFog, Vector4f fogColor, boolean shouldRenderSky, CallbackInfo ci) {
private void voxy$injectIrisCompat(GraphicsResourceAllocator resourceAllocator, boolean renderOutline, CameraRenderState cameraState, GpuBufferSlice terrainFog, Vector4f fogColor, boolean shouldRenderSky, boolean flag2, CallbackInfo ci) {
if (IrisUtil.irisShaderPackEnabled()) {
var renderer = IVoxyRenderSystemHolder.getNullableHolder();
if (renderer != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.cortex.voxy.client.mixin.minecraft;


import com.mojang.blaze3d.systems.GpuDevice;
import com.mojang.renderpearl.api.device.GpuDevice;
import com.mojang.blaze3d.systems.RenderSystem;
import me.cortex.voxy.client.VoxyClient;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.mojang.blaze3d.opengl.GlDebug;
import com.mojang.renderpearl.backend.opengl.GlDebug;
import me.cortex.voxy.client.core.gl.Capabilities;
import org.slf4j.Logger;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -16,14 +16,14 @@
public class MixinGlDebug {
@WrapOperation(method = "printDebugLog", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;info(Ljava/lang/String;Ljava/lang/Object;)V", remap = false))
private void voxy$wrapDebug(Logger instance, String base, Object msgObj, Operation<Void> original) {
if (msgObj instanceof GlDebug.LogEntry msg) {
var throwable = new Throwable(msg.toString());
if (msgObj != null) {
var throwable = new Throwable(msgObj.toString());
if (isCausedByVoxy(throwable.getStackTrace())) {
if (!isCausedByShaderCompileTest(throwable.getStackTrace())) {
original.call(instance, base + "\n" + getStackTraceAsString(throwable), throwable);
}
} else {
original.call(instance, base, msg);
original.call(instance, base, msgObj);
}
} else {
original.call(instance, base, msgObj);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.cortex.voxy.client.mixin.nvidium;

import com.mojang.blaze3d.opengl.GlTextureView;
import com.mojang.blaze3d.textures.GpuSampler;
import com.mojang.renderpearl.backend.opengl.GlTextureView;
import com.mojang.renderpearl.api.textures.GpuSampler;
import me.cortex.nvidium.RenderPipeline;
import me.cortex.voxy.client.core.IVoxyRenderSystemHolder;
import net.caffeinemc.mods.sodium.client.render.chunk.ChunkRenderMatrices;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package me.cortex.voxy.client.mixin.sodium;

import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.opengl.GlTextureView;
import com.mojang.blaze3d.textures.GpuSampler;
import com.mojang.renderpearl.api.buffers.GpuBuffer;
import com.mojang.renderpearl.api.buffers.GpuBufferSlice;
import com.mojang.renderpearl.backend.opengl.GlTextureView;
import com.mojang.renderpearl.api.textures.GpuSampler;
import com.mojang.renderpearl.api.commands.RenderPass;
import me.cortex.voxy.client.VoxyClient;
import me.cortex.voxy.client.core.IVoxyRenderSystemHolder;
import me.cortex.voxy.client.core.rendering.Viewport;
Expand All @@ -17,6 +18,7 @@
import net.caffeinemc.mods.sodium.client.render.chunk.vertex.format.ChunkVertexType;
import net.caffeinemc.mods.sodium.client.render.viewport.CameraTransform;
import net.caffeinemc.mods.sodium.client.util.FogParameters;
import net.minecraft.client.renderer.oit.OitStage;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -31,17 +33,17 @@ public MixinDefaultChunkRenderer(ChunkVertexType vertexType) {
}

@Inject(method = "render", at = @At(value = "HEAD"), cancellable = true)
private void voxy$cancelThingie(ChunkRenderMatrices matrices, ChunkRenderListIterable renderLists, TerrainRenderPass renderPass, CameraTransform camera, FogParameters parameters, boolean indexedRenderingEnabled, GpuSampler terrainSampler, GpuBufferSlice uniformData, GpuBuffer sectionTimeInfo, CallbackInfo ci) {
private void voxy$cancelThingie(ChunkRenderMatrices matrices, ChunkRenderListIterable renderLists, TerrainRenderPass renderPass, CameraTransform camera, FogParameters parameters, boolean indexedRenderingEnabled, RenderPass renderPassCmd, GpuSampler terrainSampler, GpuBufferSlice uniformData, GpuBuffer sectionTimeInfo, OitStage oitStage, CallbackInfo ci) {
if (VoxyClient.disableSodiumChunkRender()) {
super.begin(renderPass, parameters, terrainSampler);
super.begin(renderPass, parameters, terrainSampler, oitStage);
this.doRender(matrices, renderPass, camera, parameters);
super.end(renderPass);
ci.cancel();
}
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/caffeinemc/mods/sodium/client/render/chunk/ShaderChunkRenderer;end(Lnet/caffeinemc/mods/sodium/client/render/chunk/terrain/TerrainRenderPass;)V", shift = At.Shift.BEFORE))
private void voxy$injectRender(ChunkRenderMatrices matrices, ChunkRenderListIterable renderLists, TerrainRenderPass renderPass, CameraTransform camera, FogParameters parameters, boolean indexedRenderingEnabled, GpuSampler terrainSampler, GpuBufferSlice uniformData, GpuBuffer sectionTimeInfo, CallbackInfo ci) {
private void voxy$injectRender(ChunkRenderMatrices matrices, ChunkRenderListIterable renderLists, TerrainRenderPass renderPass, CameraTransform camera, FogParameters parameters, boolean indexedRenderingEnabled, RenderPass renderPassCmd, GpuSampler terrainSampler, GpuBufferSlice uniformData, GpuBuffer sectionTimeInfo, OitStage oitStage, CallbackInfo ci) {
this.doRender(matrices, renderPass, camera, parameters);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import com.sun.jna.platform.win32.COM.COMInvoker;
import com.sun.jna.platform.win32.*;
import com.sun.jna.ptr.PointerByReference;
import org.lwjgl.glfw.GLFWNativeWin32;
import org.lwjgl.sdl.SDLProperties;
import org.lwjgl.sdl.SDLVideo;

public class WindowsTaskbar extends COMInvoker implements Taskbar.ITaskbar {
private final WinDef.HWND hwnd;
Expand All @@ -20,7 +21,8 @@ public class WindowsTaskbar extends COMInvoker implements Taskbar.ITaskbar {
}

this.setPointer(itaskbar3res.getValue());
this.hwnd = new WinDef.HWND(new Pointer(GLFWNativeWin32.glfwGetWin32Window(windowId)));
long hwndPtr = SDLProperties.SDL_GetPointerProperty(SDLVideo.SDL_GetWindowProperties(windowId), SDLVideo.SDL_PROP_WINDOW_WIN32_HWND_POINTER, 0L);
this.hwnd = new WinDef.HWND(new Pointer(hwndPtr));

this.invokeNative(3); // HrInit
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"depends": {
"minecraft": "${allowed_mc_version}",
"fabricloader": ">=0.14.22",
"fabric-api": ">=0.91.1",
"fabric-api": ">=0.161.0",
"sodium": "${allowed_sodium_versions}"
},
"breaks": {
Expand Down
6 changes: 0 additions & 6 deletions src/main/resources/voxy.accesswidener
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
accessWidener v1 official

accessible class net/minecraft/client/multiplayer/ClientChunkCache$Storage
accessible class com/mojang/blaze3d/opengl/GlDebug$LogEntry

accessible class com/mojang/blaze3d/opengl/GlRenderPass
accessible method com/mojang/blaze3d/opengl/GlCommandEncoder trySetup (Lcom/mojang/blaze3d/opengl/GlRenderPass;Ljava/util/Collection;)Z
accessible method com/mojang/blaze3d/opengl/GlCommandEncoder applyPipelineState (Lcom/mojang/blaze3d/pipeline/RenderPipeline;)V

accessible field com/mojang/blaze3d/opengl/GlBuffer handle I
accessible field net/minecraft/client/renderer/texture/TextureAtlas maxMipLevel I
accessible field net/minecraft/client/gui/components/BossHealthOverlay events Ljava/util/Map;
accessible field net/minecraft/client/multiplayer/MultiPlayerGameMode connection Lnet/minecraft/client/multiplayer/ClientPacketListener;
Expand Down