From 44f045b96183a5e20880bfd71b7bafb177db7c69 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Thu, 15 Aug 2024 17:51:25 -0400 Subject: [PATCH] Fix lighting --- .../impl/event/RenderContextImpl.java | 2 -- .../impl/mixin/fix/FixNormalScalingMixin.java | 36 ------------------- .../main/resources/flywheel.impl.mixins.json | 1 - 3 files changed, 39 deletions(-) delete mode 100644 common/src/main/java/dev/engine_room/flywheel/impl/mixin/fix/FixNormalScalingMixin.java diff --git a/common/src/main/java/dev/engine_room/flywheel/impl/event/RenderContextImpl.java b/common/src/main/java/dev/engine_room/flywheel/impl/event/RenderContextImpl.java index df85a11dd..bf8e7c0c5 100644 --- a/common/src/main/java/dev/engine_room/flywheel/impl/event/RenderContextImpl.java +++ b/common/src/main/java/dev/engine_room/flywheel/impl/event/RenderContextImpl.java @@ -3,8 +3,6 @@ package dev.engine_room.flywheel.impl.event; import org.joml.Matrix4f; import org.joml.Matrix4fc; -import com.mojang.blaze3d.vertex.PoseStack; - import dev.engine_room.flywheel.api.RenderContext; import net.minecraft.client.Camera; import net.minecraft.client.multiplayer.ClientLevel; diff --git a/common/src/main/java/dev/engine_room/flywheel/impl/mixin/fix/FixNormalScalingMixin.java b/common/src/main/java/dev/engine_room/flywheel/impl/mixin/fix/FixNormalScalingMixin.java deleted file mode 100644 index 5ea214dab..000000000 --- a/common/src/main/java/dev/engine_room/flywheel/impl/mixin/fix/FixNormalScalingMixin.java +++ /dev/null @@ -1,36 +0,0 @@ -package dev.engine_room.flywheel.impl.mixin.fix; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.At.Shift; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import com.mojang.blaze3d.vertex.PoseStack; - -@Mixin(PoseStack.class) -abstract class FixNormalScalingMixin { - /** - * Minecraft negates the normal matrix if all scales are equal and negative, but - * does not return afterward. This allows the rest of the method's logic to be - * applied, which negates the matrix again, resulting in the matrix being the - * same as in the beginning. - */ - @Inject(method = "scale(FFF)V", at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;scale(FFF)Lorg/joml/Matrix4f;", shift = Shift.AFTER, remap = false), cancellable = true) - private void flywheel$returnAfterNegate(float x, float y, float z, CallbackInfo ci) { - ci.cancel(); - } - - //fixme not needed anymore? -// /** -// * Minecraft takes the inverse cube root of the product of all scales to provide a -// * rough estimate for normalization so that it does not need to be done later. It -// * does not make sense for this "normalization factor" to be negative though, as -// * that would invert all normals. Additionally, Minecraft's fastInvCubeRoot method -// * does not work for negative numbers. -// */ -// @ModifyArg(method = "scale(FFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Mth;fastInvCubeRoot(F)F")) -// private float flywheel$absInvCbrtInput(float input) { -// return Math.abs(input); -// } -} diff --git a/common/src/main/resources/flywheel.impl.mixins.json b/common/src/main/resources/flywheel.impl.mixins.json index 97dab99a4..a932159b9 100644 --- a/common/src/main/resources/flywheel.impl.mixins.json +++ b/common/src/main/resources/flywheel.impl.mixins.json @@ -15,7 +15,6 @@ "MinecraftMixin", "PoseStackMixin", "fix.FixFabulousDepthMixin", - "fix.FixNormalScalingMixin", "visualmanage.BlockEntityMixin", "visualmanage.LevelChunkMixin", "visualmanage.LevelRendererMixin",