iPortalTeam / ImmersivePortalsMod

Non-Euclidean in Minecraft. See through portals and teleport seamlessly.
https://qouteall.fun/immptl/
Apache License 2.0
454 stars 115 forks source link

Incompatibility with Create/Flywheel (Fabric versions) #967

Open AeiouEnigma opened 2 years ago

AeiouEnigma commented 2 years ago

Copy of https://github.com/Fabricators-of-Create/Create/issues/53

Extraordinary rendering issues occur when looking through an Immersive Portal while the Fabric version of Create is installed. This issue is presumably caused by interaction with Create's rendering dependency, Flywheel (which is included in builds of Create for Fabric).

Example:

image

Although sodium/indium/other mods were in use when capturing this screenshot, the issue is reproducible with only Create (which again includes Flywheel), Fabric API, and Immersive Portals.

AeiouEnigma commented 2 years ago

Link to Flywheel's fabric branch on GitHub, for convenience

qouteall commented 2 years ago

Can you explain the screenshot? Are you in overworld in the screenshot? Is the nether fog color normal? Does it render normal when you are not looking any portal?

AeiouEnigma commented 2 years ago

I'm in a snowy slopes biome in the overworld. This rendering issue occurs when a portal is being rendered. Everything is normal when a portal isn't in view.

qouteall commented 2 years ago

Are you having night vision or things that affect nether sky color? Is the nether sky color normal?

AeiouEnigma commented 2 years ago

Yes, I did have night vision on for unrelated reasons when capturing the screenshot. Please disregard that 🙃

qouteall commented 2 years ago

Try using command /imm_ptl_client_debug render_mode_compatibility and report what happens

AeiouEnigma commented 2 years ago

Rendering greatly improves, with some very slight, hard to describe glitchiness about how far away chunks will render on the other side of the portal

2022-01-20_21 14 45

AeiouEnigma commented 2 years ago

The problem persists after https://github.com/qouteall/ImmersivePortalsMod/commit/aae537317b984ccf529cbc8dfcc37e9f7840f51b

Also, here's another, better screenshot of the issue:

2022-01-22_16 00 06

The differing effects for water vs solid blocks in the player's current dimension probably means... something 😕

qouteall commented 2 years ago

I cannot reproduce the issue with only flywheel without create Maybe because it's not rendering any create thing

qouteall commented 2 years ago

With another testing, it crashes. Possibly because that it destroy all GL resources when ImmPtl create another client world

https://github.com/Jozufozu/Flywheel/blob/1.18%2Ffabric%2Fdev/src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java#L92

https://github.com/Jozufozu/Flywheel/blob/1.18%2Ffabric%2Fdev/src/main/java/com/jozufozu/flywheel/FlywheelClient.java#L47

This cannot be fixed on ImmPtl's side. Flywheel can make that event triggered in Minecraft.clearLevel so that it won't trigger when ImmPtl creates secondary client world and secondary world renderer.

You can open an issue on Flywheel

AeiouEnigma commented 2 years ago

Thanks for investigating! I'll bring it up with Flywheel.

Specimen-420 commented 2 years ago

try "/flywheel backend off"

AeiouEnigma commented 2 years ago

try "/flywheel backend off"

That has no effect of any kind on the problem whatsoever.

The Flywheel backend is disabled in the original screenshot of the issue.

qouteall commented 2 years ago

In immptl 1.3.7 the crash and portal rendering issue is fixed. but the create things in remote dimensions may still not get rendered correctly until F3+A.

ProGoofster commented 2 years ago

for me it's just outright crashing

hakanai commented 2 years ago

I wasn't getting this particular rendering issue, but I do get this thing (v1.4.8), which just makes portal-in-portal not render:

[10:43:34] [Render thread/ERROR]: uniform imm_ptl_ClippingEquation not found in transformed iris shader

I assume this is something along the lines of Flywheel changing the names of shaders, so that now Immersive Portal doesn't do its transformation magic to those shaders?

I did some investigation adding more debugging to try and figure out which shader it is, but whatever it is, it isn't going via MixinProgram.compileShaderInternal.

[13:11:09] [Render thread/INFO]: Shader Transform Skipping shadow_text_intensity
[13:11:09] [Render thread/INFO]: Created transformed shader id 389 name = shadow_text_intensity
[13:11:09] [Render thread/INFO]: Shader Transform Skipping shadow_text_intensity
[13:11:09] [Render thread/INFO]: Created transformed shader id 390 name = shadow_text_intensity
[13:11:09] [Render thread/ERROR]: uniform imm_ptl_ClippingEquation not found in transformed iris shader id = 394
[13:11:09] [Render thread/ERROR]: uniform imm_ptl_ClippingEquation not found in transformed iris shader id = 397

Reading Flywheel's code, it seems that they have their own shader compilation code, and maybe these aren't being hooked yet.

https://github.com/Jozufozu/Flywheel/blob/af11d1e78b0b5753bcdd2e87a9875a48d8f52138/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlShader.java#L19