-
Notifications
You must be signed in to change notification settings - Fork 33
BlockState Culling
Blockstate culling is how the game culls faces of blocks that you can't see. Although the game only supports culling non-full block faces against full blocks. Leading to many of the block faces not being culled, slowing down your render time.
There are many places in the game that naturally have many of these non-full block culling issues, a couple of examples would be: Bamboo forest (bamboo), end islands (chorus plants), and many decoration structures (villages, mansions).
MoreCulling is able to cull these faces without a performance loss allowing you to get better frame rates.
Results may vary drastically!
Without MoreCulling, I get around ~136 frames
With MoreCulling, I get around ~210 frames
Don't mind that bar, it was a screenshot.
Do not expect these results all the time. Bamboo renders 2 extra faces for each block without MoreCulling, which is why the results are so drastic here!
W.I.P. - More performance examples are needed here
This is done by running voxel face checks against both blocks and checking if they overlap. If one fully overlaps a face, we can prevent that face from rendering.
We do this exactly how Mojang does normal face culling against solid blocks except by comparing both faces together.
There is one good reason why Mojang has not done this themselves. Some faces use transparency in their textures.
That may not sound that bad although it is, without this check trapdoors can be used to xray through the world. The game does not have any way of knowing that the trapdoors face isn't solid so it culls its back.
MoreCulling runs a transparency check on all block faces when the game starts (unnoticeable) that gets cached as a boolean in BakedModels. This gives the game a way to very quickly check if the block can use MoreCulling's aggressive culling to remove extra faces.