Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.20.4] Fix GUI far plane calculation to match vanilla #507

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

XFactHD
Copy link
Member

@XFactHD XFactHD commented Jan 14, 2024

This PR fixes the screen-layer-aware GUI far plane calculation to fully match the vanilla GUI far plane again and adjusts the layer rendering the actually make use of the increased per-layer depth.

This fixes the VanillaTweaks "No Spyglass Overlay" resource pack not working on NeoForge.
It is worth noting though that, while it fixes this RP in an almost-vanilla environment (i.e. only NeoForge installed), there's no guarantee that it will work when other mods are involved as they can trivially insert a custom HUD component under the spy glass overlay and offset its depth such that the shader's detection doesn't work anymore or even breaks other HUD components. There is nothing NeoForge can do about this other than entirely removing a very valuable feature, which is not a viable solution, especially considering mods can achieve the RP's effect in a trivial and clean way as well.

The test mod used to test screen layering was also adjusted to match how screens are now supposed to be drawn and was used to test that layering to absurd levels still works fine.

Fixes #445

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Jan 14, 2024

  • Publish PR to GitHub Packages

Last commit published: 56fc0e4f720110a4a573c0517049f2b055c7f024.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #507' // https://github.com/neoforged/NeoForge/pull/507
        url 'https://prmaven.neoforged.net/NeoForge/pr507'
        content {
            includeModule('net.neoforged', 'neoforge')
        }
    }
}

MDK installation

In order to setup a MDK using the latest PR version, run the following commands in a terminal.
The script works on both *nix and Windows as long as you have the JDK bin folder on the path.
The script will clone the MDK in a folder named NeoForge-pr507.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr507
cd NeoForge-pr507
curl -L https://prmaven.neoforged.net/NeoForge/pr507/net/neoforged/neoforge/20.4.100-beta-pr-507-gui_far_plane/mdk-pr507.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip

To test a production environment, you can download the installer from here.

@XFactHD XFactHD added bug A bug or error 1.20 Targeted at Minecraft 1.20 rendering Related to rendering labels Jan 14, 2024
Copy link
Member

@TheCurle TheCurle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good. Verified the original value, and yeah. We just had it wrong. Weird.

@TheCurle TheCurle added the last call Planned to be resolved by the end of the week, awaiting any last-minute comments label Jan 15, 2024
@Technici4n Technici4n merged commit 39661d9 into neoforged:1.20.x Jan 16, 2024
5 checks passed
@XFactHD XFactHD deleted the gui_far_plane branch January 16, 2024 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.20 Targeted at Minecraft 1.20 bug A bug or error last call Planned to be resolved by the end of the week, awaiting any last-minute comments rendering Related to rendering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VanillaTweaks "No Spyglass Overlay" is incompatible with NeoForge
4 participants