{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/",
  "atlas": "https://www.pystone.net/?node=unity-graphics-tier-quality-level#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/unity-graphics-tier-quality-level.md",
  "context": "https://www.pystone.net/notes/unity-graphics-tier-quality-level.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:unity-graphics-tier-quality-level",
  "slug": "unity-graphics-tier-quality-level",
  "title": "Graphics - Tier Settings & Quality Level",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "Graphics Tier Settings & Quality Level 创建时间：2020/9/27 12:07",
  "contentRole": "unspecified",
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "unspecified",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "63ca8d4dc401cee52e7b865a2bf8b0d1f094b77f27817c49331570d021378544",
  "assets": [],
  "headings": [
    {
      "depth": 1,
      "text": "Graphics - Tier Settings & Quality Level",
      "anchor": "graphics---tier-settings-quality-level",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#graphics---tier-settings-quality-level"
    },
    {
      "depth": 2,
      "text": "Graphics - Tier Settings & Quality Level",
      "anchor": "graphics---tier-settings-quality-level-1",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#graphics---tier-settings-quality-level-1"
    },
    {
      "depth": 2,
      "text": "Graphics Tier Settings",
      "anchor": "graphics-tier-settings",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#graphics-tier-settings"
    },
    {
      "depth": 3,
      "text": "常用设置项及其含义",
      "anchor": "常用设置项及其含义",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#%E5%B8%B8%E7%94%A8%E8%AE%BE%E7%BD%AE%E9%A1%B9%E5%8F%8A%E5%85%B6%E5%90%AB%E4%B9%89"
    },
    {
      "depth": 3,
      "text": "How is this selection done?",
      "anchor": "how-is-this-selection-done",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#how-is-this-selection-done"
    },
    {
      "depth": 4,
      "text": "Tier 1",
      "anchor": "tier-1",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#tier-1"
    },
    {
      "depth": 4,
      "text": "Tier 2",
      "anchor": "tier-2",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#tier-2"
    },
    {
      "depth": 4,
      "text": "Tier 3",
      "anchor": "tier-3",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#tier-3"
    },
    {
      "depth": 3,
      "text": "Scripting API",
      "anchor": "scripting-api",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#scripting-api"
    },
    {
      "depth": 2,
      "text": "Quality Level",
      "anchor": "quality-level",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#quality-level"
    },
    {
      "depth": 3,
      "text": "Scripting API",
      "anchor": "scripting-api-1",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#scripting-api-1"
    },
    {
      "depth": 2,
      "text": "两者的区别",
      "anchor": "两者的区别",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#%E4%B8%A4%E8%80%85%E7%9A%84%E5%8C%BA%E5%88%AB"
    },
    {
      "depth": 2,
      "text": "Ref",
      "anchor": "ref",
      "citation": "https://www.pystone.net/notes/unity-graphics-tier-quality-level/#ref"
    }
  ],
  "claims": [],
  "outgoing": [],
  "incoming": [
    {
      "id": "note:game-graphics-and-runtime",
      "title": "游戏图形与运行时",
      "url": "https://www.pystone.net/notes/game-graphics-and-runtime/",
      "atlas": "https://www.pystone.net/?node=game-graphics-and-runtime#knowledge-atlas",
      "label": "游戏图形与运行时",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "Unity中的“Graphics - Tier Settings & Quality Level”导航项",
      "citation": "https://www.pystone.net/notes/game-graphics-and-runtime/#unity"
    }
  ],
  "contentMarkdown": "# Graphics - Tier Settings & Quality Level\n> 创建时间：2020/9/27 12:07\n\n## Graphics - Tier Settings & Quality Level\n\n  * Graphics - Tier Settings & Quality Level\n    * Graphics Tier Settings\n      * 常用设置项及其含义\n      * How is this selection done?\n        * Tier 1\n        * Tier 2\n        * Tier 3\n      * Scripting API\n    * Quality Level\n      * Scripting API\n    * 两者的区别\n    * Ref\n\n> 优化中经常提到，根据机型配置的高低，进行不同的设置，使用不同性能的资源，那么这个究竟如何实现的，Unity使用什么样的机制支持这件事？\n\n## Graphics Tier Settings\n\n通过图形API或者设备的版本确定一些 **全局的Graphics设置** 以及所加载的 **Shader脚本内容** 。从而达到目的:\n\n  * 兼容不同版本的图形API、显示设备\n\n  * 根据设备的性能调整项目质量的高低，在性能上适应不同的设备。\n\n> Use the Graphics settings (main menu: Edit > Project Settings, then select the Graphics category) to apply global settings for Graphics.\n\nThese settings allow you to make platform-specific adjustments to rendering and shader compilation, by tweaking built-in defines.\n\n### 常用设置项及其含义\n\n### How is this selection done?\n\n默认：Unity根据设备的版本或图形API自动选择。\n\n#### Tier 1\n\nAndroid - all devices that have support for OpenGL ES 2 only\n\niOS - all devices before iPhone 5S (not including 5S, but including 5C), iPods up to and including 5th generation, iPads up to 4th generation, iPad mini first generation\n\nDesktops: DirectX 9, HoloLens\n\n#### Tier 2\n\nAndroid - all devices with OpenGL ES 3 support\n\niOS - all devices starting from iPhone 5S, iPad Air, iPad mini 2nd generation, iPod 6th generation\nAppleTV\n\nWeb\n\nVulkan on Android is Tier 2.\n\n#### Tier 3\n\nDesktops: OpenGL, Metal, DirectX 11+ , Vulkan\n\nfor desktops is in Tier 3\n\n### Scripting API\n\n自定义：使用脚本在Runtime强行设置。\n\n```csharp\nstring s1 = &quot;Hello &quot;;\nstring s2 = s1;\ns1 += &quot;World&quot;;\n\nSystem.Console.WriteLine(s2);\n//Output: Hello\n\n```\n\nInitially this value is auto-detected from the hardware in use.\n**Changing this value affects any subsequently loaded shaders. (So you have to do that before any shaders are loaded.)**\nTierN corresponds to shader define UNITY_HARDWARE_TIERN\n\nRuntime根据机型自定义Tier\n\n```csharp\nstring s1 = &quot;Hello &quot;;\nstring s2 = s1;\ns1 += &quot;World&quot;;\n\nSystem.Console.WriteLine(s2);\n//Output: Hello\n\n```\n\n**set it once when you app starts.**\n\n## Quality Level\n\n设置方法：menu: Edit > Project Settings, then select the Quality category\n\nSet the level of graphical quality it attempts to render.\nGenerally speaking, quality comes at the expense of framerate and so it may be best not to aim for the highest quality on mobile devices or older hardware since it tends to have a detrimental effect on gameplay.\n\n有Unity默认的Levels，也可以自己添加Levels，自己命名。\n\n### Scripting API\n\nRuntime设置Level\n\n```csharp\nstring s1 = &quot;Hello &quot;;\nstring s2 = s1;\ns1 += &quot;World&quot;;\n\nSystem.Console.WriteLine(s2);\n//Output: Hello\n\n```\n\n> Note that: changing the quality level can be an expensive operation if the new level has different anti-aliasing setting. It’s fine to change the level when applying in-game quality options, but if you want to dynamically adjustquality level at runtime, pass false to applyExpensiveChanges so that expensive changes are not always applied.\n>  When building a player quality levels that are not used for that platform are stripped. You should not expect a given quality setting to be at a given index. It’s best to query the available quality settings and use the returned index.\n\n## 两者的区别\n\nGraphics Tier Settings一般是在真机上运行时自动选择，由于涉及到Grapics API的兼容性，开发者或用户一般不自己改Tier。\n\nQuality Level比较常用，开发者可以根据场景或设备的性能设置Level。或者以UI的形式把设置Level的接口开放给用户，让用户根据自己的情况选择游戏质量。\n\n判断设备高低端的方法：\n不同的游戏厂商有不同的方法。\n\n  * 粗糙一点的可能根据CPU的频率判断。\n\n  * SystemInfo的API可以获取CPU等型号，根据型号判断等等。\n\n## Ref\n\n<https://forum.unity.com/threads/tiers-in-graphicsettings.485408/>\n"
}
