[1.13]How to use Mixin for forge modding? in Modder Support Posted May 8 · Report reply 41 minutes ago, Cadiboo said: I've talked to the developer of OptiFine about doing just this and a coremod is likely not required or it will be a 1 line coremod. From our conversation: I was thinking of making an API and/or PRing a Forge hook for this since there are already mods that do this (not very well IMO) such as the Portal Gun Mod and the TARDIS mod. I'd be happy to work towards this with you. I am happy to accept collaboration. I am planning to put the code to github after making my code more readable. And I think the main obstacle of being compatible with optifine is that rendering portal content needs culling. The actual rendering process is different from what sp164x said. I directly render portal content into MC frame buffer, without involving other buffer. The portal rendering happens before vanilla world rendering and before hand rendering. It firstly renders the triangles that represent portal area. If no sample is passed, it will not render the world inside portal. This could increase performance. Rendering portal area also increases the stencil value by one. Then change the player position and dimension to render the world inside portal. I use a special shader to render portal content, what this shader do is to cull all pixels behind the portal. For example, if some triangles are between the teleported position and the world inside portal: It will render incorrectly like this: To avoid this, it should cull all pixels behind that plane Then it will render correctly. So it will not be compatible with optifine's fancy shaders.