Unity memory optimization Shu articles

Tip: Select the right side of the directory, you can quickly find what you need

This series of blog links: Portal

 

First, the resource settings

1, audio settings

The audio stream format: (streaming) are streaming audio, in exchange for memory (memory performance machine is recommended to turn bad) with CPU power consumption

 

2, the model set

Close unnecessary Read / Write Enabled.

Open Read / Write Enabled Mesh usually modify vertex data for the runtime, open this option causes Mesh memory footprint doubled. Therefore, if the project does not need to modify these Mesh data at run time, it is recommended to turn off this option.

 

3, image textures import settings

Close 2DUI the Generate Mipmaps on, reduce the memory footprint. Generate Mipmaps necessary to turn on 3D objects.

20200227: Note that the screenshot code to generate a new Texture2D, mipmap to set limits to false , avoid using mipmap, leading to see screenshot is not clear.

Of 3D objects, close Mipmap will lead to a sense of texture flickering in the distance, and lower rendering performance, and therefore open textures on 3D objects Mipmap. The disadvantage of open Mipmap will lead to greater texture memory footprint. Of 2D objects, Mipmap does not cause flickering and performance problems, it is recommended to close Mipmap option on the UI 2D and texture.

After using the Mipmap, based on the distance maps of the distance from the camera, choosing different precision map.

  • Disadvantages: takes up memory because mipmap will generate a map corresponding to eight cameras depending on the distance, so be sure account for memory!

  • Advantages: reduces the GPU memory bandwidth and reduce the rendering, since according to the actual situation, may choose to render the texture, the farther from the camera, the lower the texture pixels of the display, on the contrary, the higher the pixel!

发布了320 篇原创文章 · 获赞 77 · 访问量 17万+

Guess you like

Origin blog.csdn.net/weixin_38239050/article/details/104560915
Recommended