diff --git a/src/main/java/net/coderbot/iris/mixin/entity_render_context/MixinHumanoidArmorLayer.java b/src/main/java/net/coderbot/iris/mixin/entity_render_context/MixinHumanoidArmorLayer.java index e066b3da38..f92e9164fb 100644 --- a/src/main/java/net/coderbot/iris/mixin/entity_render_context/MixinHumanoidArmorLayer.java +++ b/src/main/java/net/coderbot/iris/mixin/entity_render_context/MixinHumanoidArmorLayer.java @@ -1,6 +1,7 @@ package net.coderbot.iris.mixin.entity_render_context; import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; import net.coderbot.iris.block_rendering.BlockRenderingSettings; import net.coderbot.iris.shaderpack.materialmap.NamespacedId; import net.coderbot.iris.uniforms.CapturedRenderingState; @@ -9,6 +10,7 @@ import net.minecraft.client.renderer.entity.RenderLayerParent; import net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer; import net.minecraft.client.renderer.entity.layers.RenderLayer; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; @@ -43,7 +45,7 @@ private void changeId(PoseStack pHumanoidArmorLayer0, MultiBufferSource pMultiBu private int backupValue = 0; @Inject(method = "renderTrim", at = @At(value = "HEAD"), locals = LocalCapture.CAPTURE_FAILHARD) - private void changeTrimTemp(ArmorMaterial pHumanoidArmorLayer0, PoseStack pPoseStack1, MultiBufferSource pMultiBufferSource2, int pInt3, ArmorTrim pArmorTrim4, A pHumanoidModel5, boolean pBoolean6, CallbackInfo ci) { + private void changeTrimTemp(ArmorMaterial pHumanoidArmorLayer0, PoseStack pPoseStack1, MultiBufferSource pMultiBufferSource2, int pInt3, ArmorTrim pArmorTrim4, boolean pBoolean5, A pHumanoidModel6, boolean pBoolean7, float pFloat8, float pFloat9, float pFloat10, CallbackInfo ci) { if (BlockRenderingSettings.INSTANCE.getItemIds() == null) return; backupValue = CapturedRenderingState.INSTANCE.getCurrentRenderedItem(); @@ -51,7 +53,7 @@ private void changeTrimTemp(ArmorMaterial pHumanoidArmorLayer0, PoseStack pPoseS } @Inject(method = "renderTrim", at = @At(value = "TAIL"), locals = LocalCapture.CAPTURE_FAILHARD) - private void changeTrimTemp2(ArmorMaterial pHumanoidArmorLayer0, PoseStack pPoseStack1, MultiBufferSource pMultiBufferSource2, int pInt3, ArmorTrim pArmorTrim4, A pHumanoidModel5, boolean pBoolean6, CallbackInfo ci) { + private void changeTrimTemp2(ArmorMaterial pHumanoidArmorLayer0, PoseStack pPoseStack1, MultiBufferSource pMultiBufferSource2, int pInt3, ArmorTrim pArmorTrim4, boolean pBoolean5, A pHumanoidModel6, boolean pBoolean7, float pFloat8, float pFloat9, float pFloat10, CallbackInfo ci, TextureAtlasSprite lvTextureAtlasSprite12, VertexConsumer lvVertexConsumer13) { if (BlockRenderingSettings.INSTANCE.getItemIds() == null) return; CapturedRenderingState.INSTANCE.setCurrentRenderedItem(backupValue); backupValue = 0; diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/entity_xhfp/CloudVertex.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/entity_xhfp/CloudVertex.java index 662fb21a0c..c7a9f60d95 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/entity_xhfp/CloudVertex.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/entity_xhfp/CloudVertex.java @@ -4,6 +4,7 @@ import me.jellysquid.mods.sodium.client.render.vertex.VertexFormatDescription; import me.jellysquid.mods.sodium.common.util.MatrixHelper; import net.coderbot.iris.vertices.IrisVertexFormats; +import net.coderbot.iris.vertices.NormI8; import net.coderbot.iris.vertices.NormalHelper; import org.joml.Matrix4f; import org.joml.Vector3f; @@ -35,7 +36,7 @@ public static void write(long ptr, Matrix4f matrix, float x, float y, float z, i quad.setup(ptr, STRIDE); NormalHelper.computeFaceNormal(saveNormal, quad); - int normal = NormalHelper.packNormal(saveNormal, 0.0F); + int normal = NormI8.pack(saveNormal); for (long vertex = 0; vertex < 4; vertex++) { MemoryUtil.memPutInt(ptr + 16L - STRIDE * vertex, normal); @@ -56,7 +57,7 @@ public static void write(long ptr, float x, float y, float z, int color) { quad.setup(ptr, STRIDE); NormalHelper.computeFaceNormal(saveNormal, quad); - int normal = NormalHelper.packNormal(saveNormal, 0.0F); + int normal = NormI8.pack(saveNormal); for (long vertex = 0; vertex < 4; vertex++) { MemoryUtil.memPutInt(ptr + 16L - STRIDE * vertex, normal); diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/entity_xhfp/GlyphVertexExt.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/entity_xhfp/GlyphVertexExt.java index 50b46a971a..819dd162ff 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/entity_xhfp/GlyphVertexExt.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/entity_xhfp/GlyphVertexExt.java @@ -9,6 +9,7 @@ import me.jellysquid.mods.sodium.client.util.Norm3b; import net.coderbot.iris.uniforms.CapturedRenderingState; import net.coderbot.iris.vertices.IrisVertexFormats; +import net.coderbot.iris.vertices.NormI8; import net.coderbot.iris.vertices.NormalHelper; import net.minecraft.client.renderer.texture.OverlayTexture; import org.joml.Matrix3f; @@ -83,7 +84,7 @@ private static void endQuad(long ptr) { normalX = saveNormal.x; normalY = saveNormal.y; normalZ = saveNormal.z; - int normal = NormalHelper.packNormal(saveNormal, 0.0F); + int normal = NormI8.pack(saveNormal); int tangent = NormalHelper.computeTangent(normalX, normalY, normalZ, quad); diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/terrain_xhfp/XHFPTerrainVertex.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/terrain_xhfp/XHFPTerrainVertex.java index 18c02135e5..1c2d0a9aba 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/terrain_xhfp/XHFPTerrainVertex.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/terrain_xhfp/XHFPTerrainVertex.java @@ -3,6 +3,7 @@ import me.jellysquid.mods.sodium.client.render.vertex.type.ChunkVertexEncoder; import net.coderbot.iris.compat.sodium.impl.block_context.BlockContextHolder; import net.coderbot.iris.compat.sodium.impl.block_context.ContextAwareVertexWriter; +import net.coderbot.iris.vertices.NormI8; import org.joml.Vector3f; import net.coderbot.iris.vertices.ExtendedDataHelper; import net.coderbot.iris.vertices.NormalHelper; @@ -140,7 +141,7 @@ public long write(long ptr, } else { NormalHelper.computeFaceNormal(normal, quad); } - int packedNormal = NormalHelper.packNormal(normal, 0.0f); + int packedNormal = NormI8.pack(normal); diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/fast_render/MixinModelPart.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/fast_render/MixinModelPart.java index 86891cadf6..7c820096c7 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/fast_render/MixinModelPart.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/fast_render/MixinModelPart.java @@ -11,6 +11,7 @@ import me.jellysquid.mods.sodium.client.util.color.ColorABGR; import net.coderbot.iris.compat.sodium.impl.vertex_format.entity_xhfp.EntityVertex; import net.coderbot.iris.vertices.ImmediateState; +import net.coderbot.iris.vertices.NormI8; import net.coderbot.iris.vertices.NormalHelper; import net.irisshaders.iris.api.v0.IrisApi; import net.minecraft.client.model.geom.ModelPart; @@ -181,6 +182,6 @@ private int getTangent(int normal, float x0, float y0, float z0, float u0, float tangentW = 1.0F; } - return NormalHelper.packNormal(tangentx, tangenty, tangentz, tangentW); + return NormI8.pack(tangentx, tangenty, tangentz, tangentW); } } diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/vertex_format/entity/MixinEntityRenderDispatcher.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/vertex_format/entity/MixinEntityRenderDispatcher.java index ad8e958570..26f81266d3 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/vertex_format/entity/MixinEntityRenderDispatcher.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/vertex_format/entity/MixinEntityRenderDispatcher.java @@ -10,6 +10,7 @@ import me.jellysquid.mods.sodium.common.util.MatrixHelper; import net.coderbot.iris.compat.sodium.impl.vertex_format.entity_xhfp.EntityVertex; import net.coderbot.iris.vertices.ImmediateState; +import net.coderbot.iris.vertices.NormI8; import net.coderbot.iris.vertices.NormalHelper; import net.irisshaders.iris.api.v0.IrisApi; import net.minecraft.client.renderer.LightTexture; @@ -188,7 +189,7 @@ private static int getTangent(int normal, float x0, float y0, float z0, float u0 tangentW = 1.0F; } - return NormalHelper.packNormal(tangentx, tangenty, tangentz, tangentW); + return NormI8.pack(tangentx, tangenty, tangentz, tangentW); } private static float rsqrt(float value) {