FxMorin / MoreCulling

Stop rendering things you can't see. A mod that changes how multiple types of culling are handled in order to improve performance
https://modrinth.com/mod/moreculling
GNU General Public License v3.0
151 stars 31 forks source link

Make glass panes/iron bars cull each other properly when stacked vertically #153

Open muzikbike opened 1 year ago

muzikbike commented 1 year ago

Vanilla issue https://bugs.mojang.com/browse/MC-50349 - this has been the case for glass panes since 1.7 and for iron bars since 1.8.

In vanilla, glass panes on top of other glass panes don't cull the other glass panes, and likewise for iron bars. This results in some rather obvious stripes in large sheets formed of the blocks when seen at the correct angles, especially for iron bars. 2023-03-30_06 31 15

It's possible to manually add in cullface arguments to the models in order to have faces be culled, however a perfect solution cannot be reached through this alone. If we assign cullface only to the "post" element, we get this: 2023-03-30_06 32 09

This is obviously incomplete, so we'd want to have the parts extending off of the post also have their tops and bottoms culled. If we add cullface accordingly, they get culled, but another issue arises: they're culled regardless, with no regard for the geometry actually above them, resulting in faces disappearing that we don't want to disappear. 2023-03-30_06 34 33

In the worst case, one single post can cause four adjacent panes to not render their tops if positioned atop a cross: 2023-03-29_19 26 01 2023-03-29_19 26 02 2023-03-29_19 26 25

Continuity has a built-in resource pack which implements cullface for panes, however since it's just a resource pack it's subject to all of the same issues (https://github.com/PepperCode1/Continuity/issues/74). A resource pack cannot fix this issue alone - there needs to be something that takes the actual shape of blocks above it into account, rather than simply their presence.

Here are two resource packs for testing - one which only adds cullface to posts, and another that adds it to the rest of the pane: pane-post-cull-only.zip pane-all-cull.zip

FxMorin commented 1 year ago

I'll attempt to add the ability to modify this cullface ;)

muzikbike commented 1 year ago

I haven't tested this in OptiFine yet. It may already be fixed there, or may previously have been at one point according to this issue: https://github.com/sp614x/optifine/issues/193

muzikbike commented 1 year ago

Indeed, OptiFine for 1.19.4 gets rid of this issue: we can clearly see the top plane of that pane still exists. This happens for Fast and Fancy connected textures. Fixing this is entirely possible. 2023-03-30_15 30 28

Note: the weirdness of the side textures is due to multiple separate issues.

FxMorin commented 1 year ago

Ya I believe I know how to fix this without the optifine jank, ill try to make some time to fix it

muzikbike commented 1 year ago

This specific issue is now reported under https://bugs.mojang.com/browse/MC-264676.

FxMorin commented 10 months ago

Don't have enough time to do this, however I think if you split the top part into multiple pieces and only give a cullface to one it might work. Not sure tho