Immersive Portals

Immersive Portals

5M Downloads

Rendering Refactor Plan

qouteall opened this issue ยท 0 comments

commented

Currently, this mod does not alter the rendering of the outmost world. To make the teleportation seamless, it teleports before every frame of rendering instead of on ticking. This causes collision issues on the tick of teleporting.
The refactor will

  1. Wrap game rendering arguments. Rendering states will be passed as arguments instead of separating in different global variables. The rendering arguments consists of
    -dimension
    -camera position(take view bobbing into count)
    -camera transformation (rotation and mirror)
    -projection matrix (fov, hurt bobbing)
    -culling plane (for front culling)
    -cull face state(for mirror)
    -frustum culling state
    -fog state
    -should render game effects (glowing entities, suffocation overlay)
    -should sort transparency
    -should reduce chunk update to reduce lag
    -should render fewer chunk (in fast graphic)
    -sky rendering redirect
    -manage with optifine's built chunk neighbor and dynamic light
    -should skip initial frame buffer clear (when using stencil renderer)
    -some callbacks to do recursive rendering and manage stencil states
    It will still use hacky context switching to implement in internal
  2. Make the teleportation happen on ticking
    This will solve collision issues.
  3. The outmost rendering dimension may not be player's dimension
    If the teleportation happens on ticking, without this the teleportation will flash.
    After that, it's easy to implement that in third person view the camera could be in nether and view the player in overworld through portal