Complex Leaf Culling
一款面向 Minecraft 1.21.1(Fabric + Sodium)的多层级树叶剔除模组,专为整合包设计,适用于包含来自 William Wyther's Overhauled Overworld (WWOO) 等模组的茂密植被的场景,因为原版剔除机制会留下显著的性能损失。
注意:
我已在本地重度整合包(300+ 模组)实例中进行了测试,也有其他拥有不同电脑配置的成员参与测试。截至目前运行无误,但这并不意味着不会出现问题。我已尽力实现最大程度的兼容性,但如果您比我更擅长代码,您可以 Fork 该项目并根据需要进行修改。作为一名新手爸爸,我可能无法迅速修复问题或扩展其兼容性。
功能说明
Complex Leaf Culling 应用了三种相互补充的独立剔除策略:
标准树叶剔除(Tier 1 - 所有渲染器)
在网格构建期间,将相邻树叶方块之间的共享面标记为不可见。适用于所有树叶方块,并直接与 Sodium 的遮挡系统协作。这是大多数剔除模组所做的操作。
扩展树叶剔除(Tier A - 仅限 Sodium)
完全取消被其他树叶完全包围的内部树叶方块的渲染。这些方块不生成任何几何体。在茂密的 WWOO 树冠和其他标准剔除无法识别的模组森林中效果最为显著。
边缘通道降级(Tier B - 仅限 Sodium)
位于树冠边缘且部分符合条件的树叶方块(下方邻居数量低于取消阈值一个单位),将从昂贵的半透明渲染降级为更廉价的镂空渲染。树叶形状完全保留——仅改变渲染通道。在使用 Iris 等光影包时最为明显,因为半透明几何体的渲染成本不成比例地高昂。
依赖项
- Minecraft 1.21.1
- Fabric Loader >= 0.16.0
- Fabric API
- Sodium - 注意: 已使用 0.6.13 版本进行测试。如果内部钩子发生移动或更改,较新或较旧的版本可能无法工作。
推荐项
配置
通过 ModMenu 打开配置界面,或在游戏内使用 /clc 命令:
/clc status
/clc reload
/clc set enabled true|false
/clc set mode CONSERVATIVE|BALANCED|AGGRESSIVE
/clc set threshold 0-6 (0 = 根据模式自动设置)
/clc set standardCulling true|false
/clc set extendedCulling true|false
/clc set passDemotion true|false
/clc set extendedDetect true|false
剔除模式
| 模式 |
所需邻居数 |
描述 |
| CONSERVATIVE |
6/6 |
仅完美埋藏的方块。视觉效果最安全。 |
| BALANCED |
5/6 |
性能与外观的良好平衡。默认值。 |
| AGGRESSIVE |
4/6 |
最大性能。可能会出现轻微的边缘变薄。 |
扩展树叶检测 - 启用后,注册表路径中包含 leaf、leaves 或 foliage 的方块将被视为树叶,即使它们没有打上 minecraft:leaves 标签。这对于完整的 WWOO 兼容性是必需的。
兼容性
| 模组 |
状态 |
| Sodium 0.6.x |
必需 |
| Iris |
完全兼容,Tier B 在此处效果最佳 |
| Distant Horizons |
无交互(DH 处理自己的 LOD 几何体) |
| C2ME |
兼容 |
| EntityCulling |
独立关注点,无冲突 |
| MoreCulling |
互补 - 覆盖不同的方块类型 |
| SodiumLeafCulling |
冗余 - 两者都针对同一管线。二选一即可。 |
| WWOO |
主要用例 |
性能说明
所有剔除工作均在 Sodium 的工作线程上进行区块网格构建时完成——而非在渲染期间进行。不存在每帧 CPU 开销。性能收益体现在区块构建或重建时(世界加载、方块变化、F3+A 或保存设置)。
从源码构建
git clone https://github.com/YOUR_GITHUB_HERE/complex-leaf-culling
cd complex-leaf-culling
# 将 sodium-fabric-0.6.x+mc1.21.1.jar 放入 libs/ 目录
./gradlew build
构建好的 jar 文件将位于 build/libs/ 中。
许可证
MIT - 允许自由 Fork、修改和重新分发,需署名。详见 LICENSE。
Complex Leaf Culling
A multi-tier leaf culling mod for Minecraft 1.21.1 (Fabric + Sodium), designed for modpacks with dense foliage from mods like William Wyther's Overhauled Overworld (WWOO) where vanilla culling leaves significant performance on the table.
NOTE:
I've tested this locally on a heavily modded (300+ mods) instance, and have had others with differing computer specs test it as well. It has thusfar worked without issue, but that doesn't mean there may not be some problems. This has been made as compatible as I can personally manage, but for those with bigger brains than I have they can fork it and modify it as needed. I'm a new dad, so I may not be the one to swiftly fix issues or extend its compatibility.
What it does
Complex Leaf Culling applies three independent culling strategies that complement each other:
Standard Leaf Culling (Tier 1 - all renderers)
Marks shared faces between adjacent leaf blocks as invisible during mesh building. Works for all leaf blocks and cooperates directly with Sodium's occlusion system. This is what most culling mods do.
Extended Leaf Culling (Tier A - Sodium only)
Cancels rendering entirely for interior leaf blocks that are fully surrounded by other leaves. Zero geometry is generated for these blocks. Most effective in dense WWOO canopies and other modded forests where standard culling misses blocks it doesn't recognise.
Edge Pass Demotion (Tier B - Sodium only)
Leaf blocks on the edge of a canopy that partially qualify (one neighbour below the cancel threshold) are demoted from expensive translucent rendering to cheaper cutout rendering. Leaf shapes are fully preserved - only the render pass changes. Most noticeable with shader packs like Iris where translucent geometry is disproportionately expensive.
Requirements
- Minecraft 1.21.1
- Fabric Loader >= 0.16.0
- Fabric API
- Sodium - NOTE: Tested with version 0.6.13. Newer/older versions may not work if hooks have moved/changed internally.
Recommended
- Iris Shaders - Tier B pass demotion gives the most visible benefit with shaders active
- ModMenu - provides access to the in-game config screen
Configuration
Open the config screen via ModMenu, or use the /clc command in-game:
/clc status
/clc reload
/clc set enabled true|false
/clc set mode CONSERVATIVE|BALANCED|AGGRESSIVE
/clc set threshold 0-6 (0 = auto from mode)
/clc set standardCulling true|false
/clc set extendedCulling true|false
/clc set passDemotion true|false
/clc set extendedDetect true|false
Culling Modes
| Mode |
Neighbours Required |
Description |
| CONSERVATIVE |
6/6 |
Only perfectly buried blocks. Safest visuals. |
| BALANCED |
5/6 |
Good balance of performance and appearance. Default. |
| AGGRESSIVE |
4/6 |
Maximum performance. Slight edge thinning possible. |
Extended Leaf Detection - when enabled, blocks whose registry path contains leaf, leaves, or foliage are treated as leaves even if not tagged minecraft:leaves. Required for full WWOO compatibility.
Compatibility
| Mod |
Status |
| Sodium 0.6.x |
Required |
| Iris |
Full compatibility, Tier B most effective here |
| Distant Horizons |
No interaction (DH handles its own LOD geometry) |
| C2ME |
Compatible |
| EntityCulling |
Separate concern, no conflict |
| MoreCulling |
Complementary - covers different block types |
| SodiumLeafCulling |
Redundant - both target the same pipeline. Use one or the other. |
| WWOO |
Primary use case |
Performance notes
All culling work happens during chunk mesh building on Sodium's worker threads - not during rendering. There is no per-frame CPU cost. The performance benefit is realised when chunks are built or rebuilt (world load, block changes, F3+A, or saving settings).
Building from source
git clone https://github.com/YOUR_GITHUB_HERE/complex-leaf-culling
cd complex-leaf-culling
# Place sodium-fabric-0.6.x+mc1.21.1.jar in libs/
./gradlew build
The built jar will be in build/libs/.
License
MIT - free to fork, modify, and redistribute with attribution. See LICENSE.
评论 0
登录后参与评分
还没有评论,来抢沙发吧