Giter VIP home page Giter VIP logo

Comments (4)

Mari023 avatar Mari023 commented on July 17, 2024

seems to be a bug since at least 1.20.1 (#7880)

from applied-energistics-2.

Mithi83 avatar Mithi83 commented on July 17, 2024

Position changes (x, y, z) affect the overlay rendering, changes in rotation/angles of the camera (yaw and pitch) do not. My guess is that somehow the rotation must be part of the poseStack. All lines in x/y direction are thus always parallel to the screen edges.

from applied-energistics-2.

Mithi83 avatar Mithi83 commented on July 17, 2024

In src/main/java/appeng/client/render/overlay/OverlayManager.java I've added a line that might fix the problem.

diff --git a/src/main/java/appeng/client/render/overlay/OverlayManager.java b/src/main/java/appeng/client/render/overlay/OverlayManager.java
index c0d718d8f..4a346459e 100644
--- a/src/main/java/appeng/client/render/overlay/OverlayManager.java
+++ b/src/main/java/appeng/client/render/overlay/OverlayManager.java
@@ -60,6 +60,7 @@ public void renderWorldLastEvent(RenderLevelStageEvent event) {
         poseStack.pushPose();

         Vec3 projectedView = minecraft.gameRenderer.getMainCamera().getPosition();
+        poseStack.mulPose(minecraft.gameRenderer.getMainCamera().rotation().invert());
         poseStack.translate(-projectedView.x, -projectedView.y, -projectedView.z);

         for (OverlayRenderer handler : overlayHandlers.entrySet().stream()

I'm still not entirely convinced because to me in my super flat test world it seems kinda odd because of the way the overlay goes beyond the floor all the way down to bedrock which is only a few block down in a super flat world.

from applied-energistics-2.

Mithi83 avatar Mithi83 commented on July 17, 2024

It gets weirder every time. I have one normal test world where clipping the overlay works and another where it doesn't. The one where it works started out as not working as well and I have no idea what fixed it. And just as I was typing this message it broke again while doing nothing at all.

The code change I posted earlier seems to work for me, I'll make a PR out of this. The clipping issue is due to the fact that BLOCK_HIGHLIGHT_FACE and BLOCK_HIGHLIGHT_LINE have setDepthTestState(NO_DEPTH_TEST) rather than setDepthTestState(RenderStateShard.LEQUAL_DEPTH_TEST). I'm not sure if that is intentional or not, thus I'll make a separate commit out of this in the same PR.

from applied-energistics-2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.