From 7e0e02bafc2fcdd366adfd11de52b45f41eb1603 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 1 Oct 2024 22:02:45 -0500 Subject: [PATCH] Add dithered DH fading, double pass fading, and fix LOD clouds --- coreSubProjects | 2 +- .../fabric/FabricClientProxy.java | 28 ++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/coreSubProjects b/coreSubProjects index 72607a4fc..fbaff8d85 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 72607a4fc9f7119908d714e56afccd8ae87a161d +Subproject commit fbaff8d85053083db964ca5d8e5c641a876b9b4c diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricClientProxy.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricClientProxy.java index 18fbeabee..104bc97c3 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricClientProxy.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricClientProxy.java @@ -236,6 +236,31 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy ); }); + + // TODO add to forge and neo + WorldRenderEvents.AFTER_ENTITIES.register((renderContext) -> + { + Mat4f projectionMatrix = McObjectConverter.Convert(renderContext.projectionMatrix()); + + Mat4f modelViewMatrix; + #if MC_VER < MC_1_20_6 + modelViewMatrix = McObjectConverter.Convert(renderContext.matrixStack().last().pose()); + #else + modelViewMatrix = McObjectConverter.Convert(renderContext.positionMatrix()); + #endif + + this.clientApi.renderFadeOpaque( + modelViewMatrix, + projectionMatrix, + #if MC_VER < MC_1_21_1 + renderContext.tickDelta() + #else + renderContext.tickCounter().getGameTimeDeltaTicks(), + #endif + ClientLevelWrapper.getWrapper(renderContext.world()) + ); + }); + // TODO add to forge and neo WorldRenderEvents.LAST.register((renderContext) -> { @@ -254,8 +279,9 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy #if MC_VER < MC_1_21_1 renderContext.tickDelta() #else - renderContext.tickCounter().getGameTimeDeltaTicks() + renderContext.tickCounter().getGameTimeDeltaTicks(), #endif + ClientLevelWrapper.getWrapper(renderContext.world()) ); });