问题描述
通常认为,使用包含许多较小纹理(例如字体表)的大纹理图像"比将每个纹理分开要快.性能提升有多大?它会明显更快还是会有所改善?
It's generally regarded that using a big texture 'image' full of many smaller textures (think font sheets) is faster than having each texture separate. How big is the improvement in performance? Would it be noticeably faster or will it be a minor improvement?
推荐答案
这取决于您使用的纹理数量.如果纹理很少,可以使用单独的纹理.如果您要制作一个包含很多纹理(真的很多)的大世界,那么地图集纹理就是一个合适的解决方案.
It depends on how many textures you are using. If you have few textures, you can be fine with separate textures. If you are making a big world containing of lots of textures (really many), then atlas texture is a suitable solution.
全部是因为OpenGL是状态机,并且状态机的每一次更改都需要花费成本.进行许多glBindTexture()
调用比较昂贵,因此只需将其与您拥有的纹理数量进行比较即可.
It is all because OpenGL is a state machine, and every change on the state machine costs. Doing many glBindTexture()
calls are costly, so just compare it with how many textures you have.
这篇关于OpenGL ES中单个纹理和纹理表之间的效率比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!