From 38128321c2adf61542ac7f3c0c850f8c8e93eb21 Mon Sep 17 00:00:00 2001 From: fayer3 Date: Sun, 7 Jul 2024 15:23:23 +0200 Subject: [PATCH] 1.19.4 fixes --- .../client_vr/render/helpers/RenderHelper.java | 4 ++-- .../client_vr/render/helpers/VRPassHelper.java | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/common/src/main/java/org/vivecraft/client_vr/render/helpers/RenderHelper.java b/common/src/main/java/org/vivecraft/client_vr/render/helpers/RenderHelper.java index daac81eb6..b3e7dc854 100644 --- a/common/src/main/java/org/vivecraft/client_vr/render/helpers/RenderHelper.java +++ b/common/src/main/java/org/vivecraft/client_vr/render/helpers/RenderHelper.java @@ -233,8 +233,8 @@ public static void drawScreen(float f, Screen screen, PoseStack poseStack) { Matrix4f guiProjection = (new Matrix4f()).setOrtho( 0.0F, (float) (mc.getWindow().getWidth() / mc.getWindow().getGuiScale()), (float) (mc.getWindow().getHeight() / mc.getWindow().getGuiScale()), 0.0F, - 1000.0F, 21000.0F); - RenderSystem.setProjectionMatrix(guiProjection, VertexSorting.ORTHOGRAPHIC_Z); + 1000.0F, 3000.0F); + RenderSystem.setProjectionMatrix(guiProjection); RenderSystem.blendFuncSeparate( GlStateManager.SourceFactor.SRC_ALPHA, diff --git a/common/src/main/java/org/vivecraft/client_vr/render/helpers/VRPassHelper.java b/common/src/main/java/org/vivecraft/client_vr/render/helpers/VRPassHelper.java index 5bb494aee..ac9590f03 100644 --- a/common/src/main/java/org/vivecraft/client_vr/render/helpers/VRPassHelper.java +++ b/common/src/main/java/org/vivecraft/client_vr/render/helpers/VRPassHelper.java @@ -7,7 +7,6 @@ import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.Util; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiGraphics; import net.minecraft.util.Mth; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Blocks; @@ -244,7 +243,7 @@ public static void renderAndSubmit(boolean renderLevel, long nanoTime, float act PoseStack poseStack = RenderSystem.getModelViewStack(); poseStack.pushPose(); poseStack.setIdentity(); - poseStack.translate(0.0f, 0.0f, -11000.0f); + poseStack.translate(0.0f, 0.0f, -2000.0f); RenderSystem.applyModelViewMatrix(); int x = (int) (Minecraft.getInstance().mouseHandler.xpos() * (double) Minecraft.getInstance().getWindow().getGuiScaledWidth() / (double) Minecraft.getInstance().getWindow().getScreenWidth()); @@ -270,13 +269,11 @@ public static void renderAndSubmit(boolean renderLevel, long nanoTime, float act mc.mainRenderTarget.unbindRead(); mc.getProfiler().popPush("2D Keyboard"); - GuiGraphics guiGraphics = new GuiGraphics(mc, mc.renderBuffers().bufferSource()); if (KeyboardHandler.Showing && !dataHolder.vrSettings.physicalKeyboard) { mc.mainRenderTarget = KeyboardHandler.Framebuffer; mc.mainRenderTarget.clear(Minecraft.ON_OSX); mc.mainRenderTarget.bindWrite(true); - RenderHelper.drawScreen(actualPartialTicks, KeyboardHandler.UI, guiGraphics); - guiGraphics.flush(); + RenderHelper.drawScreen(actualPartialTicks, KeyboardHandler.UI, new PoseStack()); } mc.getProfiler().popPush("Radial Menu"); @@ -284,8 +281,7 @@ public static void renderAndSubmit(boolean renderLevel, long nanoTime, float act mc.mainRenderTarget = RadialHandler.Framebuffer; mc.mainRenderTarget.clear(Minecraft.ON_OSX); mc.mainRenderTarget.bindWrite(true); - RenderHelper.drawScreen(actualPartialTicks, RadialHandler.UI, guiGraphics); - guiGraphics.flush(); + RenderHelper.drawScreen(actualPartialTicks, RadialHandler.UI, new PoseStack()); } mc.getProfiler().pop(); checkGLError("post 2d ");