Earthcomputer / PolyDungeons

ModFest 1.16 entry
MIT License
2 stars 2 forks source link

Optimisations for SolidEndPortalBlockEntityRenderer #12

Closed comp500 closed 4 years ago

comp500 commented 4 years ago

There seem to be several areas in the vanilla rendering of End Portals that cause severe issues when many end portal decorative blocks are placed. This PR aims to resolve several of the inefficiencies by culling invisible faces and introducing custom BufferBuilders to enable batching of render calls - as the majority of the time is spent switching between the 16 different render layers that end portal rendering uses. In order to do this, an injection into WorldRenderer.render is used to render these BufferBuilders to the render layers after all BERs have been run.

Do note that this PR renders the mod incompatible with Canvas, however Grondag has suggested implementing a callback in FREX which can be conditionally used instead of WorldRendererMixin.

Before: image After: image

comp500 commented 3 years ago

Note that when https://github.com/FabricMC/Fabric/pull/1182 is merged, I'll be able to fix canvas compatibility - I'll make a separate PR when it's merged.