Physics 2D
Graphics

Quality

Unity allows you to set the level of graphical quality it attempts to render. Generally 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. Use the Quality settings (menu: Edit > Project Settings, then select the Quality category) to select the quality level in the Editor for the chosen device. It is split into two main areas: the Quality matrix appears at the top; and below it, the settings for the selected quality level appear.

Unity lets you assign a name to a given combination of quality options for easy reference. The rows of the matrix let you choose which of the different platforms each quality level applies to. The Default row at the bottom of the matrix is not a quality level in itself but rather sets the default quality level used for each platform (a green checkbox in a column denotes the level currently chosen for that platform). Unity comes with six quality levels pre-enabled but you can add your own levels.

Quality settings levels for each platform
Quality settings levels for each platform

To delete an unwanted quality level, use the trashcan icon (the rightmost column).

To select a quality level for editing, click on its name in the matrix. Its definitions appear in the panel below the settings and you can modify any settings you need to:

Edit the settings for a specific Quality level
Edit the settings for a specific Quality level

To define a new Quality level, click the Add Quality Level button and type the name for the new level in the Name property box.

Then you can choose which of the quality options documented in the following sections you need to update or set:

Rendering

Property Function
Pixel Light Count Set the maximum number of pixel lights when Unity uses Forward Rendering.
Texture Quality Choose whether to display Textures at maximum resolution or at a fraction of this (lower resolution has less processing overhead). The options are Full Res, Half Res, Quarter Res and Eighth Res.
Anisotropic Textures Choose if and how Unity uses anisotropic Textures. The options are Disabled, Per Texture and Forced On (that is, always enabled).
AntiAliasing Choose the level of antialiasing that Unity uses. The options are Disabled, 2x Multi Sampling, 4x Multi Sampling and 8x Multi Sampling.
Soft Particles Enable this option to use soft blending for particles? See Soft Particles for more information.
Realtime Reflection Probes Enable this option to update reflection probes during gameplay.
Billboards Face Camera Position Enable this option to force billboards to face the camera while rendering instead of the camera plane. This produces a better, more realistic image, but is more expensive to render.
Resolution Scaling Fixed DPI Factor Downscales the device’s screen resolution below its native resolution. For more details, see Android Player settings and iOS Player settings.
Texture Streaming
Enable this checkbox to use Texture Streaming. If you are not planning to use Texture Streaming, disable this feature to avoid any CPU memory overhead.
  Add All Cameras Enable this checkbox to make Unity calculate Texture Streaming for all active Cameras in the Project. This is enabled by default. This is the quickest way to migrate an existing Project to Texture Streaming. If you want to exclude a specific Camera, add a Streaming Controller component to that Camera and then disable it.

If you disable this property, Unity only calculates Texture Streaming for GameObjects with Streaming Controller components. Use this for finer-grained control of Texture Streaming. See documentation on Texture Streaming API: Control Cameras for Texture Streaming for more details.
  Memory Budget Set the total amount of memory you want to assign to all loaded Textures (in MB). When the capacity is full, Unity discards mipmaps it’s not using, to make room for those it needs to use. The default memory budget is 512MB.

Streaming textures pick the smallest mipmap level possible to try to hit the memory budget. Unity always loads non-streaming textures at full resolution, even if that exceeds the budget.

The Memory Budget includes non-streaming Textures. For example, if your budget is 100MB and you have 90MB of non-streaming Textures, The Texture Streaming system tries to fit all the streaming Textures in the remaining 10MB. If it can’t, it loads the mipmaps at a lower resolution.

Unity prioritises the Max Level Reduction over the Memory Budget. The Texture Streaming system never discards more mipmaps than the Max Level Reduction, even if the lack of reduction causes the memory to exceed the Texture Streaming Memory Budget.
  Renderers Per Frame This controls the CPU processing overhead for the main thread and associated jobs. This is 512 by default (that is, processing 512 Mesh renderers per frame). Lower values reduce processing time, but increase delays to Unity loading the mipmaps.
  Max Level Reduction Set the maximum number of mipmaps that the Texture Streaming system can discard if the Texture Streaming system reaches the Memory Budget. This is set to 2 by default (which means that the system discards no more than two mipmaps).

The Texture Streaming system never discards more mipmaps than this value, even if the lack of reduction causes the memory to exceed the Texture Streaming Memory Budget.

This value is also the mipmap level that the Texture Streaming system initially loads at startup. For example, when this is set to 2, Unity skips the two highest mipmaps on first load.
  Max IO Requests Set the maximum number of Texture file in/out (IO) requests from the Texture Streaming system that are active at any one time. This is set to 1024 by default. This default is set high enough to prevent any IO cap beyond what is already active due to the Async Upload pipeline or file system itself.

If the Scene Texture content changes significantly and rapidly, the system might attempt to load more Texture mipmaps than the file IO can keep up with. Lowering this value reduces the IO bandwidth that the Texture Streaming system generates. The result is a more rapid response to changing mipmap requirements.

Anti-aliasing

Anti aliasing improves the appearance of polygon edges, so they are not “jagged”, but smoothed out on the screen. However, it incurs a performance cost for the graphics card and uses more video memory (there’s no cost on the CPU though). The level of anti-aliasing determines how smooth polygon edges are (and how much video memory it consumes).

Without anti-aliasing, polygon edges are jagged.
Without anti-aliasing, polygon edges are “jagged”.
With 4x anti-aliasing, polygon edges are smoothed out.
With 4x anti-aliasing, polygon edges are smoothed out.

However, built-in hardware anti-aliasing does not work with Deferred Shading or HDR rendering. For these cases, you’ll need to use Antialiasing Image Effect.

Soft Particles

Soft Particles fade out near intersections with other Scene geometry. This looks much nicer, but it’s more expensive to compute (more complex pixel shaders), and only works on platforms that support depth textures. Furthermore, you have to use Deferred Shading or Legacy Deferred Lighting rendering path, or make the camera render depth textures from scripts.

Without Soft Particles - visible intersections with the scene.
Without Soft Particles - visible intersections with the scene.
With Soft Particles - intersections fade out smoothly.
With Soft Particles - intersections fade out smoothly.

Shadows

Property: Function:
Shadowmask Mode Choose the shadowmask behavior when using the Shadowmask Mixed lighting mode. Use the Lighting window (menu: Window > Rendering > Lighting Settings) to set this up in your Scene.
Distance Shadowmask Unity uses real-time shadows up to the Shadow Distance, and baked shadows beyond it.
Shadowmask Static GameObjects that cast shadows always cast baked shadows.
Shadows Choose which type of shadows to use. The available options are Hard and Soft Shadows, Hard Shadows Only and Disable Shadows.
Shadow Resolution Choose which resolution to render shadows at. The available options are Low Resolution, Medium Resolution, High Resolution and Very High Resolution. The higher the resolution, the greater the processing overhead.
Shadow Projection Choose which method to use for projecting shadows from a directional light.
Close Fit Renders higher resolution shadows but they can sometimes wobble slightly if the camera moves.
Stable Fit Renders lower resolution shadows but they don’t wobble with camera movements.
Shadow Distance Enter the maximum distance from the Camera at which shadows are visible. Unity does not render shadows that fall beyond this distance.
Shadow Near Plane Offset Enter the offset shadow near plane to account for large triangles being distorted by shadow pancaking.
Shadow Cascades Choose the number of shadow cascades to use. The available options are No Cascades, Two Cascades, or Four Cascades. A higher number of cascades gives better quality but at the expense of processing overhead (see Directional Light Shadows for further details).
Cascade splits Adjust the cascade shadow split(s) by moving the vertical line between each cascade left or right.
Depending on what value you chose for the Shadow Cascades setting, you can see two or four different colors. If Shadow Cascades is set to No Cascades, then this entire control is hidden.

Other

Property Function
Blend Weights Choose the number of bones that can affect a given vertex during an animation. The available options are 1 Bone, 2 Bones and 4 Bones.
V Sync Count Choose to synchronize rendering with vertical blanks or not to synchronize at all. Unity can synchronize rendering with the refresh rate of the display device to avoid tearing artifacts. The available options are Every V Blank, Every Second V Blank, or Don’t Sync.
Lod Bias Set the level-of-detail (LOD) bias.
LOD levels are chosen based on the onscreen size of an object. When the size is between two LOD levels, the choice can be biased toward the less detailed or more detailed of the two Models available. This is set as a fraction from 0 to +infinity. When it is set between 0 and 1 it favors less detail. A setting of more than 1 favors greater detail. For example, setting LOD Bias to 2 and having it change at 50% distance, LOD actually only changes on 25%.
Maximum LOD Level Set the highest LOD that the game uses. See Maximum LOD level for more information.
Particle Raycast Budget Set the maximum number of raycasts to use for approximate particle system collisions (those with Medium or Low quality). See Particle System Collision Module.
Async Upload Time Slice Set the amount of CPU time in milliseconds per frame to spend uploading buffered textures to the GPU. See Async Texture Upload.
Async Upload Buffer Size Set the size in MB for the Async Upload buffer. See Async Texture Upload.

Maximum LOD level

Unity does not use Models which have a LOD below the MaximumLOD level and omits them from the build (which saves storage and memory space). Unity uses the smallest LOD value from all the MaximumLOD values linked with the Quality settings for the target platform. If an LOD level is included, then Models from that LODGroup are included in the build and always loaded at runtime for that LODGroup, regardless of the Quality setting being used. As an example, if LOD level 0 is used in any Quality setting then all the LOD levels are included in the build and all the referenced Models load at runtime.

Tearing

The picture on the display device is not continuously updated, but rather the updates happen at regular intervals much like frame updates in Unity. However, Unity’s updates are not necessarily synchronized with those of the display, so it is possible for Unity to issue a new frame while the display is still rendering the previous one. This results in a visual artifact called “tearing” at the position onscreen where the frame change occurs.

Simulated example of tearing. The shift in the picture is clearly visible in the magnified portion.
Simulated example of tearing. The shift in the picture is clearly visible in the magnified portion.

It is possible to get Unity to switch frames only during the period where the display device is not updating, the so-called “vertical blank”. The V Sync Count option in Quality settings synchronizes frame switches with the device’s vertical blank or optionally with every other vertical blank. The latter may be useful if the game requires more than one device update to complete the rendering of a frame.



Physics 2D
Graphics
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961