How to Actually optimize your game in Unity - Complete Game Optimization Guide

The Game Guy
19 Jun 202013:10

Summary

TLDRThis tutorial video guides viewers on optimizing Unity scenes for high performance without sacrificing quality. It starts with basic settings adjustments, such as shadow quality and graphics presets, and progresses to more advanced techniques like static batching, UI element raycast disabling, and shader optimization for mobile devices. The video also covers Unity's lighting settings, demonstrating the use of mixed lighting modes and light baking to achieve significant FPS improvements. Additional tips include physics settings, material adjustments, and the use of subjective lighting mode for dynamic shadow effects.

Takeaways

  • 🎥 The video is a tutorial on optimizing performance in Unity without sacrificing visual quality.
  • 🌟 The tutorial uses a nature scene with trees and stones downloaded from the Unity Asset Store.
  • 🔆 Default settings on the directional light are kept for simplicity, with a minor change to the skybox color.
  • 📊 Initial performance metrics show 30-40 FPS, indicating the need for optimization.
  • 🌑 Shadows are optimized by changing the shadow type to 'Hard Shadows' and reducing shadow strength.
  • 🔧 Graphic settings are adjusted to a medium preset to improve performance without significant visual loss.
  • 🗜️ Texture compression and mip maps are utilized to reduce texture size and improve rendering efficiency.
  • 📏 The far plane of the main camera is adjusted to limit the view distance and reduce the number of objects rendered.
  • 🔨 Static batching is applied to static objects in the scene to reduce draw calls.
  • 🛑 UI elements that are not interactive have raycasting disabled to save on processing time.
  • 💡 For mobile devices, vertex lit shaders are recommended for better performance, with the option to include shadows.
  • 🕹️ Physics settings are optimized by setting collision detection to 'Discrete' and disabling auto-sync transforms.
  • 🌄 Lighting is optimized by using mixed or baked lighting, adjusting light map settings, and using GPU for light baking.
  • ✨ Materials are simplified by disabling smoothness, specular highlights, and reflections to reduce rendering complexity.
  • 🛑 GPU instancing is enabled to improve performance by reducing the computational load on the CPU.
  • 🗑️ Unnecessary light maps are disabled for objects not in 3D space to save memory.
  • 🔍 The subjective mode in Unity is highlighted as useful for dynamic objects that require real-time lighting updates.

Q & A

  • What is the main focus of the video?

    -The video focuses on teaching viewers how to optimize their scenes in Unity to improve performance without losing visual quality.

  • What is the nature of the 'nature take light' mentioned in the video?

    -The 'nature take light' is a lighting asset downloaded from the Unity Asset Store, which the tutorial uses to enhance the scene's environment.

  • What is the initial FPS of the scene before optimization?

    -The initial FPS of the scene is around 30 to 40, which is considered low for the scene.

  • How does the video suggest optimizing shadows in Unity?

    -The video suggests changing the shadow type of the directional light to 'Hard Shadows' and reducing the shadow strength to achieve a softer shadow effect.

  • What graphic settings changes are recommended in the video to improve performance?

    -The video recommends using the 'Medium' preset in the graphic settings, disabling anisotropic textures, setting shadow types to 'Hard Shadows Only', adjusting shadow resolution to 'Medium', and disabling VSync.

  • What is the purpose of adjusting texture maps in Unity as suggested in the video?

    -Adjusting texture maps helps in optimizing the scene by enabling only necessary texture maps, playing with the max size, and using grunge compression to reduce overall size whenever possible.

  • Why is adjusting the far plane distance of the main camera suggested in the video?

    -Adjusting the far plane distance reduces the number of objects that need to be rendered, which can improve performance by not rendering objects that are too far away from the camera.

  • What is the benefit of using static batching in Unity as mentioned in the video?

    -Static batching reduces the number of draw calls by combining multiple static objects into a single draw call, which can significantly improve performance.

  • How does the video suggest optimizing UI elements for performance?

    -The video suggests disabling raycasting on UI elements that are not interactive and setting the Canvas to sleep when not in use to reduce unnecessary checks and calculations.

  • What shader is recommended for mobile devices in Unity according to the video?

    -The video recommends using the 'Vertex Lit' shader with 'Mobile' selected for better performance on mobile devices.

  • What is the final FPS achieved after all the optimization steps in the video?

    -After all the optimization steps, the video achieves more than 500 FPS.

  • What is the purpose of the 'Subjective Mode' in Unity lighting?

    -The 'Subjective Mode' in Unity lighting is useful for cases where static objects do not move, and it allows the shadows to stay in place while dynamic objects like players move around, using different lighting calculations.

Outlines

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن

Mindmap

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن

Keywords

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن

Highlights

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن

Transcripts

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن
Rate This

5.0 / 5 (0 votes)

الوسوم ذات الصلة
Unity OptimizationPerformance TipsShadow SettingsGraphics SettingsQuality AdjustmentTexture CompressionCamera SettingsStatic BakingUI OptimizationPhysics SettingsLighting Techniques
هل تحتاج إلى تلخيص باللغة الإنجليزية؟