iPortalTeam/ImmersivePortalsModForForge

Lucent Mod Compat

Opened this issue · 5 comments

According to your testing, does the issue occur with ONLY Immersive Portals mod installed?

Yes

Forge Version

40.2.0

ImmersivePortals Version

1.4.16-1.18.2

Latest Log

https://gist.github.com/Darkosto/749bb8e48566dfd294c455e378574595 https://gist.github.com/Darkosto/cd300d383d45a8e1dbc07d89b557384d

Crash Report (if applicable)

No response

Steps to Reproduce

  1. Install both ImmersivePortals and Lucent mod
  2. Travel to a darker location underground and build a Nether Portal
  3. Hold a torch in hand for the emissive lighting to occur
  4. Once the portal is lit, the lighting and the torch in-hand should start flashing and/or flickering

What You Expected

I would expect having no screen flashes when a portal is opened

What Happened Instead

After opening a portal, the lighting will quickly flash and flicker

Additional Details

I tried disabling rendering options in both mod configs with no luck, the flashing still occurs

Please Read and Confirm The Following

  • I have confirmed this bug can be replicated without the use of Optifine.
  • I have confirmed the details provided in this report are concise as possible and does not contained vague information (ie. Versions are properly recorded, answers to questions are clear).
  • I have confirmed this does not happen on the fabric version (If it does please report to here instead).
  • I have confirmed I'm not using a hybrid server (Magma, Cauldron) or a different (non official) Forge Server release.
  • I have confirmed this issue is unique and has not been reported already.

I was able to reduce the flickering by a fair amount, but it's still not gone and comes with a reduced light propagation speed. Still have to do a lot on this issue...

I unfortunately have to inform you that this issue will not be fixed due to the complexity of all potential fixes I'm currently aware of.
Lucent's light engine runs on a separate thread, and assumes some things (e.g. single client dimension, single dimension renderer), that are simply not true when having a ImmersivePortals portal near. The second issue is relatively easy to work around, but requires patching Lucents code in ~40 places, which is not feasible to maintain in the long term. The first issue though is the real problem that needs to be solved, and I currently don't think this is possible without a complete rewrite of Lucent's engine. The problem here is that we need to only tick their engine if the fields they access have the expected references. So we have to either skip their engine ticks or drastically pause them during execution (because they run on a different thread, the references can be swapped a bunch of times during their tick). Another way would be to move their logic onto the main thread, though that will neglect all benefits of the engine being parallel in the first place, likely causing huge frame drops.~~
So fixing this issue is not feasible, taking into consideration the enormous amount of work it would take, that ModdingLegacy does not support older versions than the latest and that I need to finish other projects.
However I'll leave this issue open, and I'm open for discussion if someone has some ideas on how to fix this.

Note: Other messages were deleted as they contained broken builds

Can you try with this build? (Rename from .zip to .jar, Github is stupid)

immersive-portals-1.4.16-mc1.18.2-forge.zip

The flickering is fixed. There are still some limitations. This opens a few long term goals that I'll also track in this issue:

  • Porting this fix to newer versions
  • Cross-Portal dynamic lighting for global portals only (others aren't reasonably doable)
  • Rubidium / Oculus Support (they currently break the dynamic lighting)
  • Smoothing out some internal details

You can expect a build with the current fix on Curseforge within the next days.

Can you please test if this build works with rubidium?
immersive-portals-1.4.17-mc1.18.2-forge.zip