Summarize the dependency of Sodium internals in Immersive Portals mod
qouteall opened this issue ยท 0 comments
Request Description
Currently, Immersive Portals (iPortal) does these things to Sodium
- Swap the
renderLists
andrenderDistance
inRenderSectionManager
when rendering portal. https://github.com/iPortalTeam/ImmersivePortalsMod/blob/1.20.4/src/main/java/qouteall/imm_ptl/core/compat/mixin/sodium/MixinSodiumRenderSectionManager.java#L29 https://github.com/iPortalTeam/ImmersivePortalsMod/blob/1.20.4/src/main/java/qouteall/imm_ptl/core/compat/sodium_compatibility/SodiumInterface.java#L64 - Disable entity culling using section's frame counter when rendering portal (because portal rendering interferes with the frame counter) https://github.com/iPortalTeam/ImmersivePortalsMod/blob/1.20.4/src/main/java/qouteall/imm_ptl/core/compat/mixin/sodium/MixinSodiumRenderSectionManager.java#L48
- iPortal replaces vanilla's client chunk manager and changed it to a map, so manually update
ChunkTrackerHolder
https://github.com/iPortalTeam/ImmersivePortalsMod/blob/1.20.4/src/main/java/qouteall/imm_ptl/core/compat/sodium_compatibility/SodiumInterface.java#L84 - Mark sprite active when rendering nether portal overlay (could be an API) https://github.com/iPortalTeam/ImmersivePortalsMod/blob/1.20.4/src/main/java/qouteall/imm_ptl/core/render/OverlayRendering.java#L150
- To implement clipping, transform Sodium's shader code https://github.com/iPortalTeam/ImmersivePortalsMod/blob/1.20.4/src/main/java/qouteall/imm_ptl/core/compat/mixin/sodium/MixinSodiumShaderLoader.java#L17 and maintain the uniform of clipping equation https://github.com/iPortalTeam/ImmersivePortalsMod/blob/1.20.4/src/main/java/qouteall/imm_ptl/core/compat/mixin/sodium/MixinSodiumChunkShaderInterface.java
- Call
FlawlessFrames.isActive
to make MiniScaled wrapping/unwrapping animation seamless https://github.com/iPortalTeam/ImmersivePortalsMod/blob/1.20.4/src/main/java/qouteall/imm_ptl/core/compat/mixin/sodium/MixinSodiumFlawlessFrames.java - Sodium's each
RenderRegion
has only oneChunkRenderList
which is not enough because iPortal can do portal-in-portal rendering to the same location. Change it to multipleChunkRenderList
s per portal layer. https://github.com/iPortalTeam/ImmersivePortalsMod/blob/1.20.4/src/main/java/qouteall/imm_ptl/core/compat/mixin/sodium/MixinSodiumRenderRegion.java - Apply portal's extra frustum culling https://github.com/iPortalTeam/ImmersivePortalsMod/blob/1.20.4/src/main/java/qouteall/imm_ptl/core/compat/mixin/sodium/MixinSodiumViewport.java#L19 https://github.com/iPortalTeam/ImmersivePortalsMod/blob/1.20.4/src/main/java/qouteall/imm_ptl/core/compat/mixin/sodium/MixinSodiumWorldRenderer.java#L25
- Use a hacky way to modify the start point of visible section iteration, for scale box rendering (this is new and may get changed in the future) https://github.com/iPortalTeam/ImmersivePortalsMod/blob/1.20.4/src/main/java/qouteall/imm_ptl/core/compat/mixin/sodium/MixinSodiumOcclusionCuller.java