Sodium

Sodium

52M Downloads

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

Puhpine4915 opened this issue ยท 2 comments

commented

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

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

commented

Similar problem

Patches of water not rendered consistently (some more reflexive / shinny than others)
Image

Main rendering mods

  • sodium 0.6.5+mc1.21.4
  • iris 1.8.4-snapshot+mc1.21.4-build.5506
  • distanthorizons 2.3.0-b-dev

Log file

latest.log

commented

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:
https://github.com/IrisShaders/Iris/blob/d2038d159054b07aedd93f173de3ce52130fea82/common/src/main/java/net/irisshaders/iris/compat/dh/LodRendererEvents.java#L325

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.

Sodium specific notes:

At this point I don't think Sodium is at fault. I think this is an issue with how Iris and DH are changing the GL state.