|
9 | 9 | import com.llamalad7.mixinextras.injector.ModifyReturnValue; |
10 | 10 | import com.llamalad7.mixinextras.sugar.Local; |
11 | 11 | import com.mojang.blaze3d.systems.RenderSystem; |
| 12 | +import meteordevelopment.meteorclient.MixinPlugin; |
12 | 13 | import meteordevelopment.meteorclient.MeteorClient; |
13 | 14 | import meteordevelopment.meteorclient.events.render.GetFovEvent; |
14 | 15 | import meteordevelopment.meteorclient.events.render.Render3DEvent; |
@@ -121,21 +122,25 @@ private void onRenderWorld(RenderTickCounter tickCounter, CallbackInfo ci, @Loca |
121 | 122 | if (depthRenderer == null) depthRenderer = new Renderer3D(MeteorRenderPipelines.WORLD_COLORED_LINES_DEPTH, MeteorRenderPipelines.WORLD_COLORED_DEPTH); |
122 | 123 | Render3DEvent event = Render3DEvent.get(matrixStack, renderer, depthRenderer, tickDelta, camera.getCameraPos().x, camera.getCameraPos().y, camera.getCameraPos().z); |
123 | 124 |
|
124 | | - // Call utility classes |
125 | | - |
126 | | - RenderUtils.updateScreenCenter(projection, position); |
127 | | - NametagUtils.onRender(position); |
128 | | - |
129 | 125 | // Update model view matrix |
130 | 126 |
|
131 | 127 | RenderSystem.getModelViewStack().pushMatrix().mul(position); |
132 | 128 |
|
133 | 129 | matrices.push(); |
134 | 130 | tiltViewWhenHurt(matrices, camera.getLastTickProgress()); |
135 | | - if (client.options.getBobView().getValue()) bobView(matrices, camera.getLastTickProgress()); |
136 | | - RenderSystem.getModelViewStack().mul(matrices.peek().getPositionMatrix().invert()); |
| 131 | + if (client.options.getBobView().getValue()) |
| 132 | + bobView(matrices, camera.getLastTickProgress()); |
| 133 | + |
| 134 | + Matrix4f inverseBob = new Matrix4f(matrices.peek().getPositionMatrix()).invert(); |
| 135 | + RenderSystem.getModelViewStack().mul(inverseBob); |
137 | 136 | matrices.pop(); |
138 | 137 |
|
| 138 | + // Call utility classes (apply bob correction when Iris shaders are active) |
| 139 | + |
| 140 | + Matrix4f correctedPosition = MixinPlugin.isIrisPresent && RenderUtils.isShaderPackInUse() ? new Matrix4f(position).mul(inverseBob) : position; |
| 141 | + RenderUtils.updateScreenCenter(projection, correctedPosition); |
| 142 | + NametagUtils.onRender(position); |
| 143 | + |
139 | 144 | // Render |
140 | 145 |
|
141 | 146 | renderer.begin(); |
|
0 commit comments