Unity3D高级手册0700:减少文件大小

2014-09-04 18:58:22|?次阅读|上传:huigezrx【已有?条评论】发表评论

关键词:游戏, 虚拟现实, Unity3D|来源:唯设编程网

计算出纹理大小总计:宽*高*bpp曾记33% 如果你有Mipmaps。

By default Unity compressed all textures when importing. This can be turned off in the Preferences for faster workflow. But when building a game, all not-yet-compressed textures will be compressed.

到导入时,Unity默认压缩所有的纹理。这可以在参数选择里关闭为加快工作流程。但当编译一个游戏时,所有没有压缩的纹理将被压缩。

Optimizing mesh and animation size 优化网格和动画大小

Meshes and imported Animation Clips can be compressed so they take up less space in your game file. Compression can be turned on in Mesh Import Settings.

网格和导入的动画剪辑可以被压缩因此它们占去少的空间在你的游戏文件里。压缩可以开启在网格导入设置里。

Mesh and Animation compression uses quantization, which means it takes less space but the compression can introduce some inaccuracies. Experiment with what level of compression is still acceptable for your models.

网格和动画压缩使用量化,这意味着它占用少的空间但压缩可能引入一些不准确度。为你的模型实验什么样的压缩级别是可以接受的。

Note that mesh compression only produces smaller data files, and does not use less memory at run time. Animation Keyframe reduction produces smaller data files and uses less memory at run time, and generally you should always use keyframe reduction.

请注意,网格压缩只处理小型数据文件,并不在运行时使用较少的内存。动画关键帧还原生成较小的数据文件和在运行时使用较少的内存,通常你应该总是使关键帧减少。

Additionally, you can choose not to store normals and/or tangents in your Meshes, to save space both in the game builds and memory at run time. This can be set in Tangent Space Generation drop down in Mesh Import Settings. Rules of thumb:

此外,你可以选择不要在你的网格平均和/或切线,既节省空间,在游戏中建立和内存在运行时。这可以在导入设置里里切线空间生成里设置下降。经验法则:

  • Tangents are used for bump-mapping. If you don't use bump-mapping, you probably don't need to store tangents in those meshes.
  • 切线用于凹凸映射。如果你不使用凹凸映射,你可能并不需要存储在这些网格切线。
  • Normals are used for lighting. If you don't use realtime lighting on some of your meshes, you probably don't need to store normals in them.
  • 正常用于照明。如果你不使用你的网格一些实时照明,你可能不需要存储正常在它们里。

Reducing included dlls in the Web Player 减少包含的dllsweb播放器里

When building a Web player it is important to not depend on System.dll or System.Xml.dll. Unity does not include System.dll or System.Xml.dll in the web player installation. That means, if you want to use Xml or some Generic containers which live in System.dll then the required dlls will be included in the web player. This usually adds 1mb to the download size, obviously this is not very good for the distribution of your web player and you should really avoid it. If you need to parse some Xml files, you can use a smaller xml library like this one Mono.Xml.zip. While most Generic containers are contained in mscorlib, Stack<> and few others are in System.dll. So you really want to avoid those.

发表评论0条 】
网友评论(共?条评论)..
Unity3D高级手册0700:减少文件大小