先不说java的效率和“卡”的不同类型(fps/tps/ping),预生成的地图和实时演算的地图计算量差距是相当大的,不要想当然的认为像素图MC的地图就比3A大作的难渲染,虽然说Mojang还是要背很大的锅就是了……
有兴趣可以读一下
https://www.reddit.com/r/feedthebeast/comments/40oakm/why_the_hell_does_minecraft_murder_framerate_when/ ,节选其中cpw(forge作者)的话(和不负责任的随性翻译):
========
The number one factor is the size. Few other games have ever rendered as much raw dynamic content on screen. MC also uses very CPU intensive tricks which means the burden is mostly CPU not GPU.
------
首要的原因是尺度上的。几乎没有其他游戏曾在屏幕上渲染如此多的原生动态内容。而且MC使用的是对CPU非常敏感的技巧,这意味着负担主要在CPU上而非GPU上。
------
Consider that the default view is 12 chunks in all directions. That's potentially 256161612128 possible vertices and textures ~75million points, that *could be touched every frame. (It's why the nether is noticeably laggier- the roof double the number of vertices to actually render). Now MC uses a crapton of tricks, mostly notch code, that tried to offset this, and yes there is still a lot more could be done, but when you realize the numbers, its not quite a 'small game' anymore. Lighting all of that isn't cheap either, you have to compute exposure to the sky for all possible ray projections onto the exposed surface, then compute the propagation into unlit areas, every tick.
------
考虑全方向12个区块的默认视距。每一帧可能有256*16*16*12*12*8个顶点与纹理——即7500万个点——会被触及。(这也是为什么下界明显要卡,天花板使得实际要渲染的顶点数量翻倍了)现在MC使用了大量的技巧——大多是Notch编码的——试图抵消这个问题,而且是的仍然有很多能做的事情,但当你意识到这些数字的时候,它就不再是那么个“小游戏”了。计算所有这一切的光照也不是件便宜的事情,你不得不对所有暴露的地表计算光线投射,然后计算它们如何传播到未点亮的区域,每刻都要这样做。
------
Remember also, AAA games usually have precompiled terrain, geometry and lighting, so the GPU doesn't need to be fed all that dynamic data every frame, it can be uploaded to a large extent well before the player encounters it.
------
也要记住,3A游戏通常都会预编译地形,几何形状与光照,所以GPU不需要每一帧都接受所有的动态数据,它可以在玩家遇到前被上载到大片的扩充区域中。
------
In summary, it may appear simple, but the actual complexity- I think the reason it was a crazy person like notch who developed it, was because no sane developer would have believed it was possible..
------
作为总结,这个问题可能看起来简单,但实际上复杂——我认为原因在于开发MC的人是个像Notch一样疯狂的家伙,因为没有哪个明智的开发者可曾相信这种事情是可能做到的。
========