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

Bright patches using iris, sodium 0.6.3+ and DH 2.3.0 (nightly build) #2582

Open
Puhpine4915 opened this issue Dec 29, 2024 · 1 comment
Open

Comments

@Puhpine4915
Copy link

Puhpine4915 commented Dec 29, 2024

(Copy of CaffeineMC/sodium#2945, since it's not clear which mod is causing the issue)

Bug Description

With a combination of iris, sodium 0.6.3+ and DH 2.3 (nightly build, found in the DH discord in #links-and-downloads), the water gets very bright patches. The related conversation can be found in the DH discord at https://discord.com/channels/881614130614767666/1314395125329166376
Image

Reproduction Steps

Use the mods in the image, go to a large area of water, set render distance to more than 6 to see it better.
Image

Log File

https://mclo.gs/32Mymut

Crash Report

unrelated crash report for system specs and such: https://mclo.gs/zX44AOK

Operating System

Windows, linux

What is your GPU?

Nvidia 3070

Related DH issue: https://gitlab.com/distant-horizons-team/distant-horizons/-/issues/887

@jeseibel
Copy link
Contributor

jeseibel commented Jan 1, 2025

Having done a bit more digging I think this issue may be caused due to undefined behavior between Iris and DH, specifically DH may have previously been reverting a GL state change that Iris was doing during DH's transparent rendering pass that is now no longer being reverted.

Long Story Short:

The problem appears to have started with Iris 1.8 (1.7.5 renders correctly) and when I changed DH to use MC's GlStateManager instead of directly tracking and reverting the GL state.

To fix the problem I'm guessing the GL state may be incorrect once Iris/Sodium's transparent rendering pass starts and it just needs to be rectified.

Long Story Long:

If Iris fires DH's DhApiBeforeRenderPassEvent during DH's transparent rendering pass, the normals for some chunks are incorrect.
If I comment out DH's DhApiBeforeRenderPassEvent in the transparent pass (Line 443), the normals render correctly.

With event

DH Tester shader
Image
BLOOP shader
Image

event commented out

DH Tester shader
Image
BLOOP shader
Image

Problematic Iris code:

if (event.value.renderPass == EDhApiRenderPass.TRANSPARENT) {

Problematic DH commits:
DH's interface for with GlStateManager (DH file MinecraftGLWrapper):
https://gitlab.com/distant-horizons-team/distant-horizons/-/commit/04ed5b2e03c340c18fd3eb701122c27dcbc85561
DH's commit for implementing said GlStateManager (this is a long and large commit, I'm sorry):
https://gitlab.com/distant-horizons-team/distant-horizons-core/-/commit/821fa086e66531dec7ca8dfff66a1ca605957161

I attempted to make a new branch reverting DH's MinecraftGLWrapper so it would directly track and change the GL state again, however it became a more difficult task than I am willing to do right now. However, if it needs to be done so Iris/Sodium can be properly tested, please let me know and I can take another crack at it.

Iris specific notes

@IMS212 I originally added this GlStateManager interface on your prompting. Am I using it incorrectly or is this just changing assumptions Iris made?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants