OptiPainting
优化画作渲染
这个模组有什么作用?
- 本模组通过不渲染永远不会被看到的画作侧面来优化画作的渲染。
- 在 24w18a 版本中,Mojang 添加了数据驱动的画作(data-driven paintings),这使得可以向游戏中添加自定义画作,最大尺寸可达 16x16。
本模组移除了该限制,允许你使用任意尺寸的画作。
它是如何优化的?
如果你仔细观察一幅画作,你会发现其侧面有一个 2px 的凹陷框架,使其从墙壁上凸出。在原版 Minecraft 中,画作所包含的每个方块都会渲染这些侧面。
这是一种资源浪费,因为这些面永远不可见。本模组通过不再渲染这些面来解决这个问题。
这看起来可能是一个微小的优化,但这些微小的面等同于完整的方块面,因此:
- 前面 - 4 个顶点
- 后面 - 4 个顶点
上面 - 4 个顶点
下面 - 4 个顶点
左面 - 4 个顶点
右面 - 4 个顶点
在原版中,每个方块总共有 24 个顶点。而在 OptiPainting 中,每个方块只有 8 个顶点。
顶点数量减少了 66%!
- 如果你有一幅 16x16 的画作,那就是 256 个方块,在原版中是 6144 个顶点,而在 OptiPainting 中是 2048 个顶点。
- 如果你有一幅超大的 64x64 的画作,那就是 4096 个方块,在原版中是 98304 个顶点,而在 OptiPainting 中是 32768 个顶点。
| 使用 OptiPainting |
未使用 OptiPainting |
 |
 |
此示例在未渲染背面的情况下进行渲染,以展示该模组的作用。
你可以看到原版和该模组下的画作背面。(暂时如此!!)
显然,如果你的世界中偶尔才有一幅画作,你不会注意到太大的差异,但这仍然是免费的优化!
OptiPainting
Optimized painting rendering
What's this mod do?
- This mod optimizes the rendering of paintings, by not rendering the sides of the painting that are never visible.
- In 24w18a, Mojang added data-driven paintings, which allows for custom paintings to be added to the game, up to 16x16 in size.
This mod removes that limit and allows you to have paintings of any size.
How's it optimized?
If you have a look at a painting, you'll notice that on the sides there is a 2px indented frame,
so it sticks out from the wall. In vanilla, these faces are rendered for every single block that the painting is made of.
This is a waste of resources, as the faces are never visible. This mod fixes that by not rendering these faces.
This may seem like a small optimization, but these tiny faces are equivalent to the full block face, so:
- Front - 4 vertices
- Back - 4 vertices
Top - 4 vertices
Bottom - 4 vertices
Left - 4 vertices
Right - 4 vertices
Makes a total of 24 vertices per block on vanilla. And 8 vertices per block on OptiPainting.
That's a 66% reduction in vertices!
- If you have a 16x16 painting, that's 256 blocks, which is 6144 vertices in vanilla, and 2048 vertices in OptiPainting.
- If you have a super-large 64x64 painting, that's 4096 blocks, which is 98304 vertices in vanilla, and 32768 vertices in OptiPainting.
| With OptiPainting |
Without OptiPainting |
 |
 |
This example is rendered without the back face to demonstrate what the mod does.
You can see the back of the painting in vanilla and with the mod. (For now!!)
Obviously, if you only have the occasional painting in your world, you won't notice much of a difference, but it
is free optimization none-the-less!
评论 0
登录后参与评分
还没有评论,来抢沙发吧