BetterPortals

BetterPortals

1M Downloads

Consider using stencil buffer when rendering views

Johni0702 opened this issue ยท 0 comments

commented

We're already limiting MC's clipping helper to what's visible through the portal and we can probably save a bit more by using the stencil buffer during rendering of portal views.

Given the vanilla pixel shader isn't too complex (fixed function pipeline), I wouldn't expect much gain just from that but it might be significantly more helpful for having more accurate occlusion queries in views (especially for tests and skipping occluded portals).

When implementing, be sure to check compatibility with other mods which are using the stencil buffer (e.g. portal gun) and try to be as defensive as possible (best to disable our use of the stencil buffer when someone's interfering than just rendering a black screen).