sp614x / optifine

1.81k stars 416 forks source link

Astral Sorcery Effects Rendering Breaks on any shader #6213

Open calreveraster opened 3 years ago

calreveraster commented 3 years ago

Description of Issue

Astral sorcery has it's own rendering pipeline, but it seems to be in conflict with the way optifine does things when shaders are involved (except for internal shaders). I suspect it's an optifine/AS incompatibility and not something specific to one shader as it seems to break the same way on multiple shaders.

As of right now I've tested BSL shaders (and the Complementary fork to see if their compatibility settings would impact the issue), and Sildur's shaders.

Specifically, the issue is with the light rays on the collector crystals. Everything else works as intended.

Depending on what angle you're viewing the problem from (and seemingly what the time of day is, perhaps because of global illumination, I'm not sure), it will change. From most angles it does not render at all. However from some angles, it appears to render correctly; from others, it will render in various versions of...well, not correctly.

Steps to Reproduce

  1. Load up forge with Astral sorcery and optifine (or a modpack with AS and optifine added)
  2. Load up a shader (anything other than internal, it seems)
  3. Observe the error by looking at a collector crystal from various angles.

OptiFine Version

1.16.5 HD U G8

Installation Method

JAR file dropped into mods folder.

Fabric/Forge Version

Forge 36.2.2 for Minecraft 1.16.5

(for what it is worth, this also happens on various other versions - the latest and preview versions of the 1.12.2 optifine have also been tested and I see the exact same problem on those as well).

Other Installed Mods

I originally tried this using the ATM6 modpack (list can be found here)

I then tried it with strictly Astral Sorcery and Optifine only and the issue still persists. I wanted to narrow it down to ensure this was not a mod conflict especially since a lot of the modpacks use lighting engine rewrites.

F3 Debug Screenshot

Here are a series of screencaps taken at various viewing angles to capture the problem:

Effect not rendering (this is most of the time. Captured in Sildurs, happens in Complementary too). as_effect_brokengone

One example of broken render (complementary shader): as_effect_brokenred

another example (complementary shader), this one is a different color. So far I've only seen this and red: as_effect_brokenwhite

Broken effect, this one from Sildur: as_effect_brokenwhite_sildur

Example of what is (probably) the correct rendering (complementary), achieved by viewing at a different angle: as_effect_correct_maybe

How internal shaders render the effect: as_effect_internalshader

Prior Testing

This does not happen when using the built-in shaders of optifine, or when the shaders are disabled. It is only on the more complex shaders that the issue seems to occur.

Additional Information

I'll reiterate that on sildurs and BSL/Complementary, this breaks in exactly the same way, as this felt like important information when I noticed it.

I have, thus far, seen it broken with red artifact and white artifacts. I have also managed to see the beams as they look in internal shaders on Complementary one time, but have not seen it happen since and seems to be really hard to find the angle for.

There does not seem to be a correlation between the amount of AS effects and whether or not this breaks, the numerical value varies and does not seem to create a better or worse situation. I have tried intentionally limiting and forcing the value higher to confirm.

Additionally it does not seem to be affected by how many entities are present, etc, but does seem to change based on this number. For example, if E is at 10 and I turn my head, the issue will change as soon as E becomes anything else. However, there is not a limit on how many entities. It just seems to change based on what is getting rendered at the time.

calreveraster commented 3 years ago

Small update:

On one of the shaders (complementary) I forced fustrum culling to false, and although it still does not render at most angles, it seems to have changed it so that instead of the artifacts only the "correct"-ish version renders if it renders at all.

as_effect_nocull

While I can't say for sure, it seems that disabling fustrum culling has also made it easier to find a viewing angle that works.

That said, disabling fustrum culling probaly isnt a "solution" and the issue of it not rendering at all at most angles still persists, but the fact that this affected it at all seemed like valuable information.

calreveraster commented 1 year ago

coming back to this one to point a few things out:

1.) This is still happening in 1.16, and also happens in the 1.12 version of astral sorcery/optifine as well. I imagine that when astral sorcery comes up to 1.18 we will have the same issue there as well.

2.) Oculus, the newer shader mod, does not have this issue and simply does not render the light shafts at all which eliminates the problem entirely. I say this not to compare but to add a reference point of the issue being resolved in case investigating it from this angle helps you narrow the issue down.

So for the time being I've (unfortunately) moved to oculus on 1.16, but if a fix for this is developed and released I'll likely return to optifine as it's simply easier to work with than the 6 mods I needed to get to replace it.