Unity optimized texture model

texture

texture properties

  • Aplha Source For opaque textures, turn off its apha channel

  • Read/Write Enable: If you do not need to read the pixel information of the image at runtime, disable it , otherwise the memory consumption of the texture will double after enabling it.

  • Streaming MipMaps: If it is not a 3D model texture, disable it , otherwise there will be about 33% more memory overhead. Mipmaps mainly generate clearer small textures for distant objects, reducing the loss of image quality caused by rendering. Like UI textures, they are not used at all.

  • Override for iOS/Android: Enable to make differentiated configurations for specific platforms.

  • Max Size: It depends on the situation. The default maximum texture size is limited to 2048. For example, the special effect texture is limited to 512, or even smaller depending on the effect

  • Format:

ASTC is recommended for iOS. ASTC generally recommends ASTC 6x6. If the resolution does not meet the requirements, it can be set to ASTC 4x4. Note: ASTC is only supported on devices after iPhone 6. If you need to support devices before iPhone 6, you can set it to PVRTC.

Android recommends using ETC. If it has a transparent channel, you can choose ETC2. Note: ETC2 is only supported by devices that support OpenGLES 3.0. If you consider old devices, you can choose ETC and check Split Alpha Channel. If there is no transparent channel, ETC is a no-brainer choice. At present, most Android phones already support ASTC, and you can consider using it.

We can see the compression format of the texture and the actual memory size at the bottom of the preview. We need to pay attention to this information frequently to see whether the settings take effect.

Model

Model
  • Import BlendShapes (often used for facial expressions) Also off if Blendshapes are not used.

  • Mesh Compression:压缩比越高模型文件越小,需要根据游戏内的实际效果决定,一般可以设置为Medium。可能会不成熟,如果发现动画出错,可以把这里属性关闭看看效果。

  • Read/Write Enable:如果你不需要运行时修改模型的话,禁用,否则启用后模型的内存消耗会增加一倍。

  • Optimize Mesh:推荐启用,可以提升GPU性能。

  • Normals:如果你的模型没有法线信息,将其设为None,可以减小模型大小。

Rig
  • Animation Type:如果你的模型没有骨骼,将其设为None。Humanoid:人型骨骼动画会生成一份骨骼绑点,增加内存。

  • Optimize Game Objects:启用,可以将暴露在Hierarchy的子节点移除,极大的减少了模型的层级和Children数量,从而提升运行时性能。如果有挂载点需求,在Extra Transforms to Expose里添加需要暴露的子节点即可。

Animation
  • Import Animation:如果你的模型没有动画,将其解除勾选。

  • Resample Curves(根据项目实际CPU和内存瓶颈考虑,建议不勾选)

将动画中的 Euler 数据转换为 Quaternion,动画更新时使用 Quaternion,减少了计算转换,插值更平滑,较少的性能提升,10%-20%左右的内存增加。

  • Anim. Compression:推荐使用Optimal,经过测试Optimal比Keyframe Reduction节省约50%的大小,从而可以提升加载速度。如果觉得动画质量太差,则可以退回到Keyframe Reduction甚至到Off。

Guess you like

Origin blog.csdn.net/st75033562/article/details/129548692