Efficient Entities 通过减少渲染生物时的 CPU 开销来加速 Minecraft。它不再单独绘制每个身体部位,而是将每个模型的几何体收集到一个持久的 GPU 缓冲区中,并通过单次绘制调用提交。

要求:
详细说明:
Minecraft 一次只渲染实体模型的一个身体部位。对于屏幕上每个生物的每个部位、每一帧,它都会发出 OpenGL 矩阵压栈、平移、旋转以及显示列表调用。当屏幕上有很多生物时,每帧会产生数千次小型 GL 调用,这使得实体渲染成为显著的 CPU 瓶颈。
该模组在两个层面上工作。在游戏加载时,一个 ASM 转换器会查找每个模型类中连续的身体部位渲染运行序列,并将每个序列标记为一个批次。在渲染期间,一个 Mixin 接管每个身体部位:其骨骼变换(旋转点、角度和偏移量)累积在一个 Java 矩阵堆栈中,而不是通过 OpenGL 的矩阵调用;其顶点直接写入持久映射的 GPU 缓冲区;整个批次通过一次调用进行绘制。几何体来自模型自身的四边形,因此生物的外观与原版完全一致,包括镜像肢体和盔甲层。
兼容性:
- OptiFine: 安装后,该模组会自动退让,以确保光影和自定义实体模型正常工作。
- Mod 添加的生物: 具有自己渲染代码的身体部位由原版渲染器以正确的位置绘制。
- Forge 和 Cleanroom 均支持: 仅使用 LWJGL 2(Forge)和 LWJGL 3(Cleanroom)都提供的 OpenGL 调用,因此该模组不依赖 Cleanroom 的 LWJGL 兼容层,并能在 Cleanroom 更新中继续正常工作。
配置(位于 config/efficiententities.cfg,也可从游戏内模组列表编辑):
enabled(默认 true):关闭此选项可在不重启的情况下与原版渲染进行对比。
statisticsLogPeriod(默认 0):每 N 帧向日志写入一行摘要。设为 0 则关闭统计功能。
开启统计功能后,每行摘要如下所示:
[EfficientEntities] Last 200 frames: D draws, B boxes, S single-part batches, V vanilla parts.
各项数字的含义:
-
Draws - 该时段内模组发出的 GPU 绘制调用次数。
-
Boxes - 写入 GPU 缓冲区的模型方块数量。
-
Single-part batches - 单独绘制而非作为批处理模型一部分的身体部位数量。
-
Vanilla parts - 交还给原版渲染器的身体部位数量。
特别感谢 seeedl1ng 为 Cleanroom 集成特性做出的贡献。
Efficient Entities speeds up Minecraft by reducing the CPU overhead of rendering mobs. Instead of drawing every body part separately, it collects each model's geometry into a persistent GPU buffer and submits it in a single draw call.

Requirements:
Detailed Explanation:
Minecraft renders entity models one body part at a time. For every part of every mob, every frame, it issues OpenGL matrix pushes, translations, rotations and a display list call. With many mobs on screen this adds up to thousands of small GL calls per frame, which makes entity rendering a significant CPU bottleneck.
This mod works at two levels. When the game loads, an ASM transformer finds the runs of consecutive body-part renders in each model class and marks each run as one batch. While rendering, a Mixin takes over each body part: its bone transforms (rotation points, angles and offsets) are accumulated in a Java matrix stack instead of through OpenGL's matrix calls, its vertices are written straight into a persistently mapped GPU buffer, and the whole batch is drawn with one call. The geometry is read from the model's own quads, so mobs look exactly as they do in vanilla, including mirrored limbs and armour layers.
Compatibility:
- OptiFine: when installed, the mod steps aside so shaders and custom entity models keep working.
- Mod Entities: body parts with their own render code are drawn by vanilla, in the correct position.
- Forge and Cleanroom alike: only OpenGL calls that both LWJGL 2 (Forge) and LWJGL 3 (Cleanroom) provide are used, so the mod doesn't depend on Cleanroom's LWJGL compatibility layer and keeps working across Cleanroom updates.
Configuration (config/efficiententities.cfg, also editable from the in-game mod list):
enabled (default true): turn off to compare against vanilla rendering without restarting.
statisticsLogPeriod (default 0): write a summary line to the log every N frames. 0 turns it off.
With statistics turned on, each summary line looks like this:
[EfficientEntities] Last 200 frames: D draws, B boxes, S single-part batches, V vanilla parts.
What each number means:
-
Draws - GPU draw calls the mod issued that period.
-
Boxes - model cubes written into the GPU buffer.
-
Single-part batches - body parts drawn on their own rather than as part of a batched model.
-
Vanilla parts - body parts handed back to vanilla rendering.
Special thanks to seeedl1ng for contributing to the Cleanroom integration features.
评论 0
登录后参与评分
还没有评论,来抢沙发吧