Version: 2023.1
Editor
Package Manager

Graphics

使用 Graphics 设置(主菜单:Edit > Project Settings,然后选择 Graphics 类别)可应用全局图形设置。

本节提供有关以下属性组的文档说明:

Scriptable Render Pipeline Settings

Allows you to set the default render pipeline that Unity uses to render your project. To set a render pipeline based on the Scriptable Render Pipeline, assign the desired Render Pipeline Asset here.

For more information, see How to get, set, and configure the active render pipeline.

Camera Settings

这些属性控制各种渲染设置。

属性 功能
Transparency Sort Mode 定义按对象在特定轴上的距离渲染对象的顺序。Unity 中的渲染器按几个条件排序,例如图层编号或与摄像机的距离。这通常仅适用于 2D 开发;例如,按高度或沿 Y 轴来对精灵进行排序。
Default 根据摄像机模式将对象进行排序。
Perspective 根据透视图将对象进行排序。
Orthographic 根据正交视图将对象进行排序。
Custom Axis 根据使用 Transparency Sort Axis 定义的排序模式来排序对象。
Transparency Sort Axis 自定义__透明度排序模式 (Transparency Sort Mode)__。

Tier Settings

Player 设置中显示的 Tier Settings
Player 设置中显示的 Tier Settings

In the Built-in Render Pipeline, you can use Tier settings to change rendering and shader compilation settings for different types of hardware. For more information, see Graphics tiers.

属性 功能
Standard Shader Quality 标准着色器 (Standard Shader) 的质量设置为 HighMediumLow
Reflection Probes Box Projection 反射探针上的反射 UV 贴图启用投影。
Reflection Probes Blending 启用反射探针上的混合
Detail Normal Map 启用细节法线贴图 (Detail Normal Map) 采样(如果已分配)。
Enable Semitransparent Shadows 启用半透明阴影。
此选项可添加或删除 UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS 着色器编译器定义。
Enable Light Probe Proxy Volume 允许渲染插值光照探针的 3D 网格。
Cascaded Shadows 启用级联阴影贴图。
此选项可添加或删除 UNITY_NO_SCREENSPACE_SHADOWS 着色器编译器定义。
Prefer 32 bit shadow maps Enable 32-bit float shadow map when you are targeting platforms that use DX11 or DX12.
Most platforms have a fixed shadow map format that you can’t adjust. These vary in format, and can be 16-bit, 24-bit, or 32-bit, and can also be either float- or integer-based. 32-bit shadow maps give higher quality shadows than 16-bit, but use increased memory and bandwidth on the GPU.
Note: To use 32-bit shadow maps, make sure the depth buffer is also set to 32-bit.
Use HDR 为此层启用高动态范围渲染
HDR Mode 选择为当前图形层启用 HDR 时用于 HDR 缓冲区的格式。默认情况下,此设置为 FP16
FP16 颜色渲染纹理格式,每通道 16 位浮点值。
R11G11B10 颜色渲染纹理格式。R 和 G 通道为 11 位浮点值,B 通道为 10 位浮点值。
Rendering Path 选择 Unity 应如何渲染图形。不同的渲染路径会影响游戏的性能以及光照和阴影的计算方式。有些路径比其他路径更适合不同的平台和硬件。
使用正交投影时不支持_延迟 (Deferred)_ 渲染。如果摄像机的投影模式设置为正交模式,则会覆盖这些值,并且摄像机始终使用_前向 (Forward)_ 渲染。有关更多信息,请参阅渲染路径
Forward 传统的渲染路径。此渲染路径支持所有典型的 Unity 图形功能(法线贴图、每像素光照、阴影等)。但是,在默认设置下,仅少量最亮的光线才在每像素光照模式下渲染。其余光线是在对象顶点上或每个对象上计算的。
Deferred Deferred shading has the most lighting and shadow fidelity, and is best suited if you have many real-time lights. It requires a certain level of hardware support.
Legacy Vertex Lit 旧版顶点光照 (Legacy Vertex Lit) 是具有最低光照保真度且不支持实时阴影的渲染路径。它是_前向 (Forward)_ 渲染路径的一个子集。
Realtime Global Illumination CPU Usage The CPU budget you allow Enlighten Realtime Global Illumination to use for lighting calculations at runtime. Increasing this makes the system react faster to changes in lighting at a cost of using more CPU time.
Note: Some platforms allow all CPUs to be occupied by worker threads whereas some enforce maximums. For example, some gaming consoles allow a maximum of 4 CPU cores. For Android devices, if it is a bigLittle architecture, only the little CPUs are used; otherwise the maximum is one less than the total number of CPUs.
If you use the URP or HDRP render pipelines, you can configure this property in the quality settings.
Low 将可用 CPU 线程的 25% 用作工作线程。
Medium 将可用 CPU 线程的 50% 用作工作线程。
High 将可用 CPU 线程的 75% 用作工作线程。
Unlimited 将可用 CPU 线程的 100% 用作工作线程。

Built-in shader settings

Use these settings to specify which shader to use for each of the listed features in the Built-in Render Pipeline.

渲染路径 要使用的着色器
Deferred 延迟着色结合使用。
Deferred Reflection Use with Reflection Probes in deferred shading.
Screen Space shadows 与 PC/游戏主机平台上的方向光的级联阴影贴图结合使用。
Motion vectors 用于基于对象的运动矢量计算。
Lens Flare 镜头光晕结合使用。
Light Halo 光环结合使用。

对于每个功能,可以选择要使用的着色器类型:

  • No Support disables this calculation. Use this setting if you are not using deferred shading. This will save some space in the built game data files.
  • Built-in Shader 使用 Unity 的内置着色器进行计算。此为默认值。
  • Custom Shader 使用自己的兼容着色器进行计算。这样可以对延迟渲染进行深度自定义。

选择 Custom shader 时,在特征属性下方会出现 Shader 参考属性,您可以在此处设置对需要使用的着色器的引用。

Always Included Shaders

This is a list of shaders for which Unity includes all possible variants in every build. This can be useful if you want to use shaders or variants at runtime that would not otherwise be included in the build; for example, if you use AssetBundles or Addressables that rely on those shaders or variants, or if you use shader keywords to change variants at runtime.

Warning: This feature is not recommended for shaders that have a large number of variants, such as the Standard Shader; it can lead to significant runtime and build time performance problems. You should instead create shader variant collections that contain only the variants you need, and include those in your build.

Note: This setting overrides shader keyword declaration settings. For each shader in the list, Unity includes all sets of all keywords, even if you use the “shader feature” declaration type.

To add a shader to the list, increase the value in the Size property. To remove the last shader in the list, decrease the Size property. To remove a shader which is not the last one in the list, you can set the value to None.

Shader stripping

These properties allow you to configure shader variant stripping in your build.

By default, Unity examines the scenes in the build and automatically strips shader variants that are not used in those scenes. However, this can cause problems if you want to use shaders or variants at runtime that would not otherwise be included in the build; for example, if you use AssetBundles or Addressables that rely on those shaders or variants, or if you use shader keywords to change variants at runtime.

属性 功能
Lightmap Modes Determine the shader variant stripping behavior for lightmap-related shaders.
Automatic Unity examines the scenes in the build and automatically strips variants that are not used in those scenes. This is the default setting.
Custom Choose to manually include or exclude variants for the following lightmap modes:

* Baked Non-Directional
* Baked Directional
* Realtime Non-Directional
* Realtime Directional
* Baked Shadowmask
* Baked Subtractive
Fog Modes Determine the shader variant stripping behavior for shaders that relate to Unity’s built-in fog effect.
Automatic Unity examines the scenes in the build and automatically strips variants that are not used in those scenes. This is the default setting.
Custom Choose to manually include or exclude variants for the following fog modes:

* Linear
* Exponential
* Exponential Squared
Instancing Variants Determine the shader variant stripping behavior for shaders that relate to GPU instancing.
Strip Unused Unity only includes variants for GPU instancing for a given shader if at least one material that uses that shader has Enable instancing enabled. This is the default setting.
Strip All Strip all variants for GPU instancing, even if they are being used.
Keep All Include all variants for GPU instancing, even if they are being used.

Shader loading

These properties allow you to configure how Unity “prewarms” shader variant collections in your application.

For information on prewarming, including important information about graphics API support, see Shader loading: Prewarming shader variants.

属性 功能
Renderer Light Probe Selection Choose the type of probe Unity uses when a Renderer receives global illumination from Light Probes but is not within the volume of influence (the tetrahedron) of any group of Light Probes. The default, Find closest Light Probe, means Unity searches for the nearest Light Probe, which consumes significant system resources. Renderer Light Probe Selection provides an alternative. Select Use Ambient Probe to make Unity fall back to the Ambient Probe in these situations, which conserves system resources.
Options:
  • Find closest Light Probe
  • Use Ambient Probe
Preloaded shaders The shader variant collections to prewarm on application start.
Preload shaders after showing first scene When Unity prewarms the shader variants specified in Preloaded shaders.

If enabled, Unity loads and prewarms them after the first scene has fully loaded. Otherwise, Unity loads and prewarms them before showing the first scene.
Preloaded shaders How Unity prewarms the shader variants specified in Preloaded shaders, if Preload shaders after showing first scene is enabled.

If the value is 0, Unity preloads all shader variants on the next frame after it shows the first scene.

Otherwise, Unity preloads new shader variants over multiple frames after it shows the first scene. In a given frame, it prewarms shader variants until it reaches that time limit set here. After that, it does not begin prewarming new shader variants until the next frame.

跟踪的着色器变体

The Unity Editor can track which shader variants your application uses when it runs. You can use this information to build shader variant collections.

控件 功能
Create asset 使用当前跟踪的着色器变体创建新的着色器变体集合资源。
Clear 清除跟踪的着色器变体。

Culling settings

属性 功能
Camera-Relative Culling Determines whether Unity uses the camera position as the reference point for culling.
Lights Use the camera position as the reference point to cull lights instead of the world space origin. Enable Lights to reduce flickering if lights are far away from the camera. Refer to Understanding the View Frustum for more information.
Shadows Use the camera position as the reference point to cull shadows instead of the world space origin. Enable Shadows to reduce flickering if shadows are far away from the camera. Refer to Understanding the View Frustum for more information.

GraphicsSettings

Editor
Package Manager