Version: 2021.3
Editor
Package Manager

Graphics

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

Graphics 设置
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 目标设备是 PS4 或使用 DX11 或 DX12 的平台时,启用 32 位浮点阴影贴图。
大多数平台采用的是定点阴影贴图格式,无法进行调整。这些平台的格式多种多样,可以是 16 位、24 位或 32 位,也可以基于浮点数或整数。32 位阴影贴图提供的阴影质量要高于 16 位阴影贴图,但会在 GPU 上占用更多的内存和带宽。
注意:要使用 32 位阴影贴图,请确保深度缓冲区也设置为 32 位。
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)_ 渲染路径的一个子集。
Legacy Deferred (light prepass) 旧版延迟 (Light Prepass) 类似于延迟着色,只是采用不同的技术并进行不同的折中。不支持 Unity 5 基于物理的标准着色器。
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.
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 反射探针及延迟光照结合使用。
Screen Space shadows 与 PC/游戏主机平台上的方向光的级联阴影贴图结合使用。
Legacy deferred 旧版延迟光照结合使用。
Motion vectors 用于基于对象的运动矢量计算。
Lens Flare 镜头光晕结合使用。
Light Halo 光环结合使用。

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

  • No Support 禁用此计算。如果不使用延迟着色或光照,请使用此设置。这样可以节省构建的游戏数据文件中的一些空间。
  • 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.

属性 功能
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 清除跟踪的着色器变体。
Editor
Package Manager