Unite 2017 dry Finishing Optimization article _unity

Source: Internet
Author: User
Unite 2017 dry Finishing Optimization article
May 16, 2017
Some of the speeches of Unite 2017 were sorted out.
This article has memory, CPU, GC, UI, rendering performance indicators, tips a few bars.
The content continues to organize.


Memory:
1.Model Import Setting:read/write Enable
2.FBX Import setting:animation Type Generic->none
3.Texture Import setting:generate MipMap
4.Audio import Setting:ios-> mp3, Android->vorbis (Force to Mono)
5.Animation Clip fps->30 fps
6.Audio Clip Sampling rate:40k->20k
7. Small audio files using decompress on Load
8.Model Import setting:normals & tangents-> None
9. Remove unnecessary alpha channels
10. Table Binary


11.String using intern processing
12. Delete the same key frame and automatically compress the key frame
13. Avoid some temporary resources to be repeatedly created, such as Www.texture
14. Split Alpha, size compression for alpha graphs without excessive gradients
15. Control the use of the object pool, LRU algorithm
16. Android must use Etc,ios (PVRTC)
17. Sound cut sampling, use mono or Ogg format as much as possible
18.ETC1 is not supported with alpha channel compression texture, split into 2 pieces etc
19. Model Compression


Cpu:
1. Pre-compiling Shader:Shader.WarmupAllShader using API (Shader Variant Collection)
2. Reduce the update
Unity Animator Optimize Game object
• Stop unnecessary update in time
· Animator
· Particlesystem
• Reduce update operations for Billboard and animation
3. Loading
• Using load queues
• Character frame asynchronous loading
• Balance preload and immediate load quantity and size
4. Time-consuming operation dispersed to each frame
5. Actively hide the animated object that is not in the lens


Gc
1. Reduce new as much as possible
2. Optimize the unsuitable new
3. Using the object Pool
4. Custom array allocation pool, overriding container class
5. Reduce Memory Fragmentation
6. Reduce memory allocations on the C # language feature
foreach
• Reusing functions Delegate
string Combine/split
• Reduce the use of reflection
• Package Unpacking operations
7. GC recommendation per frame within 100k


Ui
1. Optimize panel, static and dynamic separation, reduce draw call
2. Make special optimization for the floating word
• Control Frequency
• Control Quantity
3. Appropriately reduce the frequency of certain UI updates
4.UI can be multi-threaded batches, performance and mobile phone core number of related
5.UICanvas Division general guidelines
• A canvas contains all the static and unchanged UI components
• Another canvas holds all dynamic UI components and can continue to subdivide if the number of dynamic UIs is large


6. X-ray (raycast) optimization
• Necessary UI components to open "Raycast Target"
• The fewer UI components that turn on "Raycast Targets", the lighter the hierarchy, the better the performance
• For complex components, try to open "Raycast Targets" at the root node
· The Overridesorting property interrupts the rays, reducing the cost of hierarchy traversal


7. Font optimization
• Set aside enough space to avoid font out of the box (affect experience)
• Avoid font interrupt batch processing
• Generally do not recommend the use of best fit


Rendering:
1. Reduce shader map size (custom implementation)
2. Reduce the number and size of RT needed after processing, etc.
3. Override default shader on demand
4. Optimize the complex shader
• Shader of complex effects requires special optimizations (removal of cutout, merging of blend, optimization of instructions)
• Use of mathematical means
• Use shader LOD to display different effects, using vertex light and pixel by model light
5. Avoid using alphatest
6. Increase the number of surfaces appropriately to minimize reprocessing
7. Reduce PS instruction number, transfer to VS
8. Note the rendering order of opaque objects


9.PC platform recommendation Select deferred rendering mode
10. If the mobile platform does not pursue the extreme quality, it is recommended to select forward rendering mode
11. If the mobile platform to pursue quality, we recommend the choice of delay rendering mode
• Attention to mobile device resolution impact
• Write a rendering line for the low-distribution machine
12.IOS reading device model, Android read the video card model determines the rendering quality level (configurable table can be established)
• Unknown model set up the rendering level judgment scheme (CPU frequency, memory, FPS)
• Shader and effects can be rendered based on this level


13. Process all particles with one atlas
14. Control the number of Semitransparent objects
15. Multi-channel shader will not be eligible for approval
16. Remember to remove unnecessary back drawing
17.Zwrite will consume bandwidth
18. Mixing (Blend) may cause overdraw problems
19. Write your own shader as much as possible
20. Control Bandwidth
• Texture filtering options
· Mipmap
• Map Size
• Custom Buffer


21. Merging Full-screen Filters
22. Try to use Unity macros
23. Pre-loading shader
24. Transparent
25. Write out your own code
26. Make a shadow of yourself
27. No longer recommends the use of grab pass


Performance Index
1.android 2g Low-end model 20-25 fps memory no more than 350MB
2.iOS 1g low-end model run 20-25fps memory no more than 300MB
3. Start the scene speed as far as possible within 5 seconds


Tips:
1. Output 2800*2000 above resolution game screenshot
void Capturescreenshot (string filename,int supersize = 0)


2. Not on the PBR will be better than before
3. To have a good effect requires art and procedures to sit together carefully debugging
4.PBR need fine arts to adjust art production process
5.PBR does not significantly increase hardware overhead


6. Configuration by the smooth (light source direction of their own)
7. Reflect the source (environment light own calculation)
8. Adjust the shader LOD API:
Shader.globalmaximumlod
Shader.maximumlod


9. Optimizing Code with Static analyzer
• Use Method (VS2015 later version)
1.tools->nuget Package Manager->manage NuGet Packages for Solution
2.Browse-> Unityengineanalyzer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.