Efficient Entities 图标

Efficient Entities

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 V1
本资源为搬运资源,原资源地址: https://modrinth.com/mod/efficient-entities
资源信息

Minecraft 版本: 1.12.2

平台: forge

标签: optimization

资源介绍

Efficient Entities speeds up Minecraft by reducing the CPU overhead of rendering mobs, collecting each entity's geometry into a persistent GPU buffer and submitting it in one draw call instead of dozens of small ones.

mobs

Requirements: MixinBooter or Cleanroom Relauncher

Detailed Explanation:

Vanilla Minecraft renders entity models using OpenGL display lists one per body part, per mob, per frame. Each part triggers its own GL draw call along with matrix pushes, pops, and state changes. With many mobs on screen this adds up to thousands of individual GPU submissions every frame, which becomes a significant CPU bottleneck.

Efficient Entities fixes this by intercepting the rendering pipeline at two levels before the game even starts. An ASM transformer scans entity model classes at load time and injects batch markers around their render calls. A Mixin then redirects geometry output away from the display list path and into a persistent buffer mapped directly into GPU memory, so the CPU can write vertex data without any allocation or copying overhead.

When a mob renders, each body part's bone transforms rotation points, angles, offsets are accumulated in a Java-side matrix stack rather than going through OpenGL's matrix calls. The transformed vertex positions and packed normals are written directly into the mapped buffer via Unsafe memory operations. Once the whole model is done, everything is submitted in a single glDrawArrays call instead of one per part.

To prevent the CPU from writing into memory the GPU is still reading, the buffer is split into three rotating slices with fence syncs between them. The mod also handles render calls that bypass the normal entity model path the player's hand, held items, and armour pieces by detecting them and wrapping each in its own mini-batch automatically so nothing is missed.

Every 200 rendered frames the mod writes one summary line:

In an empty world with just your hand visible:

[EfficientEntities] Last 200 frames: 12 batches, 84 cubes, 200 auto-wrapped.

Near a group of mobs:

[EfficientEntities] Last 200 frames: 840 batches, 6120 cubes, 0 auto-wrapped.

Near armoured entities:

[EfficientEntities] Last 200 frames: 15000 batches, 90000 cubes, 400 auto-wrapped.

What each number means:

  • Batches - number of entity model render calls processed through the VBO path that period. One model render call equals one batch; a complex entity like a horse may produce several.
  • Cubes - total geometry processed. Grows with both the number of mobs and how complex their models are.
  • Auto-wrapped - render calls caught by the fallback path (hand, held items, armour pieces). Roughly 2 per frame when both hand slots are occupied.
下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
Division Sigil

价格:0 墨喵币
下载量:0

查看详情
HongSZ.CN

价格:0 墨喵币
下载量:0

查看详情
Bingo

价格:0 墨喵币
下载量:0

查看详情
Customize Join Leave

价格:0 墨喵币
下载量:0

查看详情