Incompatible with Canvas
qouteall opened this issue ยท 4 comments
i'd really love to see a compatibility between these two mods, has there been any progress on fixing this?
The obstacles are:
- Canvas uses off-thread visible region list building and do CPU-side occlusion culling. But every portal rendering requires rebuilding the visible region list. This can be solved by disabling occlusion culling during portal rendering and build visible region list on render thread.
- Client multiworld awareness. Static dimension-specific rendering things need to be changed
- Canvas changes framebuffer management and may be incompatible with stencil buffer
- Front clipping. This can be done by changing the main vertex shader and set
gl_ClipDistance
and use an event hook to get clip equation from IP. It probably won't affect performance. It requires glsl version 130 but canvas uses version 110. A special case treatment is needed - Canvas has its own frustum culling which overwrites IP's frustum culling injection. Can be solved by adding an event hook.
There are two ways of portal rendering within deferred rendering system
- Avoid touching the rendering inner mechanics. Portal rendering takes the final rendered image and stitch it. It has many drawbacks (duplicated unnecessary final composite rendering, more unnecessary framebuffer copying, water/rain distortions look abnormal, translucent triangles in front of portal cannot be rendered correctly) but it's the easiest way. IP's compatibility with optifine is done in that way.
- Portal rendering only touches gBuffer and does not do composite rendering. This is faster but more complex. (But I am not sure whether deferred rendering works with stencil buffer.) It applies more limitations to the shaders: the dimension specific things (fog color) should be shaded in forward rendering and cannot be shaded in deferred rendering