iPortalTeam / ImmersivePortalsMod

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

Blocks in front of target plane get rendered if far away from portal #1369

Closed QuImUfu closed 1 year ago

QuImUfu commented 1 year ago

Is it a mod compatibility issue?

No

Minecraft version

1.20

Describe the issue

If you place a thin block in front of the remote location (e.g. Trapdoor), then move quite far away from the portal, the block will appear in front of the current Portal.

I debugged it a bit, and always setting doCompensate to false in qouteall.imm_ptl.core.render.FrontClipping.getClipEquationInner(…) seems to fix the issue.
I imagine there is some reason that flag exists, but it does cause these rendering issues. Especially annoying with my Colourful Portals Reimagined mod, where, after a short (~8 blocks) distance, the plane gets rendered twice, making it look half as transparent.

qouteall commented 1 year ago

The doCompensate is originally used for avoiding z-fighting of world wrapping portal which is aligned to block grid.

Can you provide screenshots?

QuImUfu commented 1 year ago

Close, rendered correctly:
close (correct) ~8 blocks away, planes start rendering (twice):
medium distance (plans bugged) ~105 blocks away, trapdoor starts rendering through portal:
far away (zoomed, trapdoor bugged)

qouteall commented 1 year ago

I made the clipping compensation always 0.01. This should fix the issue.

QuImUfu commented 1 year ago

That fixes the issue.
Thank you!