因为Unity版本为2020.3.20,推荐使用Universal RP 10.6.0,所以去看了这个版本的文档。

而unity.cn也未对此部分做中文解释:

所以只能去看外文网站了,蹩脚的英文水平,加上蹩脚的翻译软件,勉强读吧。

1、版本支持

Package version Minimum Unity version Maximum Unity version
10.6.x 2020.3.4f1 2020.3.x

2、与Built-in Render Pipeline的功能比较

与Unity内置渲染管道相比,下表概述了通用渲染管道(URP)支持的当前功能。

注意:如果被标记为In research,URP团队仍在研究如何以及何时实现该功能。如果一个特性被标记为Not supported,那是因为Unity不打算在任何版本中支持它。

Feature Built-in Render Pipeline
Unity 2018.x, 2019.x, 2020.x.
Universal Render Pipeline
Camera
HDR rendering Yes Yes
HDR output Yes In research
MSAA Yes Yes
Physical Camera Yes Yes
Dynamic Resolution Yes Yes
Multi Display Yes Yes
Stacking Yes Yes
Flare Layer Yes Not supported
Depth Texture Yes Yes
Depth + Normals Texture Yes Not supported
Color Texture Not supported Yes
Motion vectors Yes In research
Batching
Static Batching (By Shader) Not supported Yes
Static Batching (By Material) Yes Yes
Dynamic Batching Yes Yes
Dynamic Batching (Shadows) Yes Not supported
GPU Instancing Yes Yes
Color Space
Linear Yes Yes
Gamma Yes Yes
Realtime Lights
Light Types
Directional
Spot
Point
Area

Yes
Yes
Yes
Rectangle (Baked)

Yes
Yes
Yes
Rectangle (Baked)
Inner Spot Angle Not supported Yes
Shading Multiple Passes Single Pass
Culling
Per-Object
Per-Layer

Yes
Yes

Yes
Yes
Light Limits
Main Directional Light
Per Object

Per Camera


1
Unlimited

Unlimited


1
8 (4 for GLES2). Can be point, spot, and directional Lights.
256 (16 for GLES 3.0 or lower, 32 on other mobile platforms)
Attenuation Legacy InverseSquared
Vertex Lights Yes Yes
SH Lights Yes In research
Realtime Shadows
Light Types
Directional
Spot
Point
Area

Yes
Yes
Yes
Not supported

Yes - only 1
Yes
In research
Not supported
Shadow Projection
Stable Fit
Close Fit

Yes
Yes

Yes
In research
Shadow Cascades
Number of Cascades
Control by Percentage
Control by Distance

1, 2 or 4
Yes
Not supported

1–4
Yes
Yes
Shadow Resolve Type
Lighting Pass
Screen Space Pass

Yes
Yes

Yes
No
Shadow Bias Constant clip space offset + normal bias Offsets shadowmap texels in the light direction + normal bias
Lightmapping
Enlighten Yes Not supported
Progressive Lightmapper, CPU Yes Yes
Progressive Lightmapper, GPU Yes Yes
Realtime Global Illumination
Enlighten Yes Not supported
Mixed Lighting Mode
Subtractive Yes Yes
Baked Indirect Yes Yes
Shadowmask Yes Yes (Forward Rendering Path)
Distance Shadowmask Yes Yes (Forward Rendering Path)
Light Probes
Blending Yes Yes
Proxy Volume (LPPV) Yes Not supported
Custom Provided Yes Yes
Occlusion Probes Yes Yes
Reflection Probes
Realtime Yes Yes
Baked Yes Yes
Sampling
Simple
Blend Probes
Blend Probes and Skybox

Yes
Yes
Yes

Yes
In research
In research
Box Projection Yes In research
Lightmap Modes
Non-Directional Yes Yes
Directional Yes Yes
Environmental lighting
Source
Skybox
Gradient
Color

Yes
Yes
Yes

Yes
Yes
Yes
Ambient Mode
Realtime
Baked

Yes
Yes

In research
Yes
Skybox
Procedural Yes Yes
6 Sided Yes Yes
Cubemap Yes Yes
Panoramic Yes Yes
Fog
Linear Yes Yes
Exponential Yes Yes
Exponential Squared Yes Yes
Visual Effects Components
Halo Yes Not supported
Lens Flare Yes Not supported
Trail Renderer Yes Yes
Billboard Renderer Yes Yes
Projector Yes Not supported
Shaders (General)
Shader Graph Not supported Yes
Surface Shaders Yes Not supported
Camera-relative Rendering Not supported In research
Built-in Lit Uber Shader
Metallic Workflow
Specular Workflow
Standard Shader
Yes
Yes
Lit Shader
Yes
Yes
Surface Type and Blend Mode
Opaque
Faded (Alpha Blend)
Transparent
Cutout
Additive
Multiply

Yes
Yes
Yes
Yes
Not supported
Not supported

Yes
Yes
Yes
Yes
Yes
Yes
Surface Inputs
Albedo (Base Map)
Specular
Metallic
Smoothness
Ambient Occlusion
Normal Map
Detail Map
Detail Normal Map
Heightmap

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Light Cookies Yes In research
Parallax Mapping Yes Yes
Light Distance Fade Not supported In research
Shadow Distance Fade Yes In research
Shadow Cascade Blending Not supported In research
GPU Instancing Yes Yes
Double Sided GI Yes Yes
Two Sided Not supported Yes
Order In Layer Not supported Yes
Render Pipeline Hooks
Camera.RenderWithShader Yes Not supported
Camera.AddCommandBuffer
(Camera.Remove[All]CommandBuffer)
Yes Not supported
Camera.Render Yes Not supported
Light.AddCommandBuffer
(LightRemove[All]CommandBuffer)
Yes Not supported
OnPreCull Yes Not supported
OnPreRender Yes Not supported
OnPostRender Yes Not supported
OnRenderImage Yes Not supported
OnRenderObject Yes Yes
OnWillRenderObject Yes Yes
OnBecameVisible Yes Yes
OnBecameInvisible Yes Yes
Camera Replacement Material Not supported Yes, with a custom Pass
RenderPipeline.BeginFrameRendering Not supported Yes
RenderPipeline.EndFrameRendering Not supported Yes
RenderPipeline.BeginCameraRendering Not supported Yes
RenderPipeline.EndCameraRendering Not supported Yes
UniversalRenderPipeline.RenderSingleCamera Not supported Yes
ScriptableRenderPass Not supported Yes
Custom Renderers Not supported Yes
Post-processing Uses Post-Processing Version 2 package Uses integrated post-processing solution
Ambient Occlusion (MSVO) Yes In research
Auto Exposure Yes Not supported
Bloom Yes Yes
Chromatic Aberration Yes Yes
Color Grading Yes Yes
Depth of Field Yes Yes
Grain Yes Yes
Lens Distortion Yes Yes
Motion Blur
Camera
Object

Yes
Not supported

Yes
In research
Screen Space Reflections Yes Not supported
Vignette Yes Yes
Particles
VFX Graph (GPU) Not supported Yes
Particles System (CPU) Yes Yes
Shaders
Physically Based
Simple Lighting (Blinn Phong)
Unlit

Yes
Yes
Yes

Yes (Particles Lit)
Yes (Particles Simple Lit)
Yes (Particles Unlit)
Soft Particles Yes Yes
Distortion Yes Yes
Flipbook Blending Yes Yes
Terrain
Shaders
Physically Based
Simple Lighting (Blinn-Phong)
Unlit
Speed Tree
Vegetation
Detail

Yes
Yes
Not supported
Yes
Yes
Yes

Yes
In research
In research
Yes
Yes
Yes
Wind Zone Yes Yes
Number of Layers Unlimited 8
GPU Patch Generation Yes Yes
Surface Mask Not supported In research
2D
Sprite Yes Yes
Tilemap Yes Yes
Sprite Shape Yes Yes
Pixel-Perfect Yes - using the 2D Pixel Perfect Package Yes
2D Lights Not supported Yes
UI (Canvas Renderer)
Screen Space - Overlay Yes Yes
Screen Space - Camera Yes Yes
World Space Yes Yes
Text Mesh Pro Yes Yes
VR
Multipass Yes Yes
Single Pass Yes Yes
Single Pass Instanced Yes Yes
Post-processing
Oculus Rift
Oculus Quest
PSVR
HoloLens
WMR
Magic Leap One

Yes
Yes
Yes
Yes
Yes
Yes

Yes
Yes
Yes
Yes
Yes
Yes
AR
AR Foundation Yes Yes
Debug
Scene view modes Yes In research

3、Rendering in the Universal Render Pipeline(通用渲染管道中的渲染)

通用渲染管道(URP)使用以下命令渲染场景:

  • Renderer. URP contains the following Renderers:

    • Forward Renderer.
    • 2D Renderer.
  • Shading models for shaders shipped with URP
  • Camera
  • UniversalRP Asset

在前向渲染器中,URP实现了一个渲染循环,告诉Unity如何渲染帧。

当渲染管道在图形设置中处于活动状态时,Unity将使用URP渲染项目中的所有摄影机,包括游戏和场景视图摄影机、反射探测器以及检查器中的预览窗口。

URP渲染器为每个摄影机执行摄影机循环,执行以下步骤:

  • Culls rendered objects in your Scene(剔除场景中的渲染对象)
  • Builds data for the renderer(为渲染器生成数据)
  • Executes a renderer that outputs an image to the framebuffer(执行将图像输出到帧缓冲区的渲染器)

在RenderPipelineManager类中,URP提供事件,可用于在渲染帧之前和之后以及渲染每个摄影机循环之前和之后执行代码。活动包括:

  • beginCameraRendering
  • beginFrameRendering
  • endCameraRendering
  • endFrameRendering

摄影机循环执行以下步骤:

Step Description
Setup Culling Parameters

Configures parameters that determine how the culling system culls Lights and shadows. You can override this part of the render pipeline with a custom renderer.

配置用于确定消隐系统如何消隐灯光和阴影的参数。可以使用自定义渲染器覆盖渲染管道的这一部分。

Culling

Uses the culling parameters from the previous step to compute a list of visible renderers, shadow casters, and Lights that are visible to the Camera. Culling parameters and Camera layer distances affect culling and rendering performance.

使用上一步中的消隐参数计算摄影机可见的可见渲染器、阴影投射器和灯光的列表。消隐参数和摄影机层距离会影响消隐和渲染性能。

Build Rendering Data

Catches information based on the culling output, quality settings from the URP Asset, Camera, and the current running platform to build the RenderingData. The rendering data tells the renderer the amount of rendering work and quality required for the Camera and the currently chosen platform.

基于剔除输出、URP资源的质量设置、相机和当前运行平台捕获信息,以构建渲染数据。渲染数据告诉渲染器渲染工作量和相机和当前所选平台所需的质量。

Setup Renderer

Builds a list of render passes, and queues them for execution according to the rendering data. You can override this part of the render pipeline with a custom renderer.

生成渲染过程的列表,并根据渲染数据将其排队以供执行。可以使用自定义渲染器覆盖渲染管道的这一部分。

Execute Renderer

Executes each render pass in the queue. The renderer outputs the Camera image to the framebuffer.

执行队列中的每个渲染过程。渲染器将相机图像输出到帧缓冲区。

4、如何使用渲染对象渲染器功能创建自定义渲染效果

例子见Unity官方文档:

Example: How to create a custom rendering effect using the Render Objects Renderer Feature | Universal RP | 10.6.0

5、通用渲染管道中的光照

使用通用渲染管道(URP),可以实现适用于一系列艺术样式的真实照明。Unity的所有渲染管道都共享公共照明功能,但每个渲染管道都有一些重要的区别。

通用渲染管道(URP)与Unity的通用照明功能不同的地方有:

  • The Light component inspector, which displays some URP-specific controls(inspector面板,显示一些特定于URP的控件).
  • The Universal Additional Light Data component, which allows Unity to store Light-related data that is specific to URP(Universal Additional Light Data,允许Unity存储特定于URP的灯光相关数据).
  • Realtime Global Illumination using Enlighten is not supported in URP. Enlighten is deprecated, and 2020 LTS is the last version of Unity that will support any Enlighten functionality. For more information on Enlighten support, see this Unity blog post(URP中不支持使用Enlighten的实时全局照明。Enlighten已被弃用,2020 LTS是Unity的最后一个版本,将支持任何Enlighten功能).

6、Camera差异

URP中的Camera与标准Unity摄像头最显著的区别在于: 

  • The Universal Additional Camera Data component, which extends the Camera component's functionality and allows URP to store additional Camera-related data(Universal Additional Camera Data组件,它扩展了摄像头组件的功能,并允许URP存储与摄像头相关的附加数据)
  • The Render Type setting, which defines the two types of Camera in URP: Base and Overlay(“渲染类型”设置,用于定义URP中的两种摄影机类型:Base和Overlay)
  • The Camera Stacking system, which allows you to layer the output of multiple Cameras into a single combined output(摄影机堆叠系统,允许您将多个摄影机的输出分层为单个组合输出)
  • The Volume system, which allows you to apply post-processing effects to a Camera based on a given Transform's position within your Scene(体积系统,允许您基于场景中给定变换的位置将后处理效果应用于摄影机)
  • The Camera component, which exposes URP-specific properties in the Inspector(Camera组件,用于在检查器中显示特定于URP的特性)

7、通用渲染管道中的后处理

通用渲染管道(URP)包括后处理效果的集成实现。如果使用URP,则无需安装额外的软件包来实现后期处理效果。 URP和Post Processing Stack v2不兼容。

7.1 后处理效果

下面的图像显示了一个场景,有URP后处理和没有URP后处理。

没有后处理:

有后处理:

注意:URP不支持OpenGL ES 2.0上的后期处理。

7.2 如何使用后处理

要在新场景中配置后处理,请执行以下操作:

(1)选择相机,然后选中“后处理”复选框。

(2) 在场景中添加带有Volume组件的游戏对象。添加一个Global Volume(选择GameObject > Volume > Global Volume)。

(3)选中Global Volume物体,在Volume组件中,点New按钮。

(4)添加post-processing effects

要配置location-based后处理效果,请参阅如何使用本地卷( How to use Local Volumes)。

7.3 移动设备URP中的后处理

后处理效果可能会占用大量的帧时间。如果将URP用于移动设备,默认情况下,这些效果是最适用于移动端的:

  • Bloom (with High Quality Filtering disabled)
  • Chromatic Aberration
  • Color Grading
  • Lens Distortion
  • Vignette

注意:对于景深,Unity建议对低端设备使用高斯景深。对于控制台和桌面平台,请使用Bokeh景深。

注意:对于移动平台上的抗锯齿,Unity建议您使用FXAA。

7.4 VR中URP的后处理

在VR应用程序和游戏中,某些后处理效果会导致恶心和迷失方向。要在快节奏或高速应用程序中减少晕车,请在VR中使用渐晕效果,并避免镜头失真、色差和运动模糊对VR的影响。

7.5 Volumes

通用渲染管道(URP)使用Volumes框架。Volumes可以覆盖或扩展场景属性,具体取决于相对于每个体积的摄影机位置。

URP使用Volumes框架进行后期处理效果。

将Mode设置为Global时,Volumes会影响场景中所有位置的摄影机。设置为Local时,如果摄影机位于碰撞器的边界内,则Volumes会影响摄影机。

可以将Volume组件添加到任何游戏对象中,一个场景可以包含多个具有Volume组件的游戏对象,也可以向一个游戏对象添加多个Volume组件。

Volume组件可以引用包含场景属性的Volume Profile,Volume Profile包含每个特性的默认值,并在默认情况下隐藏它们。Volume Overrides允许我们更改或Volume Profile中的默认特性。

在运行时,URP将遍历场景中连接到活动游戏对象的所有已启用的Volume组件,并确定每个Volume对最终场景设置的影响。URP使用非零贡献对所有体积的值进行插值,以计算最终特性值。

        Volume组件包含的属性控制它们如何影响摄影机以及它们如何与其他Volume交互。

Property Description(描述)
Mode Use the drop-down to select the method that URP uses to calculate whether this Volume can affect a Camera(使用下拉列表选择URP用于计算此体积是否会影响摄影机的方法):
Global: Makes the Volume have no boundaries and allow it to affect every Camera in the Scene(使Volume 没有边界,并允许其影响场景中的每个摄影机).
Local: Allows you to specify boundaries for the Volume so that the Volume only affects Cameras inside the boundaries. Add a Collider to the Volume's GameObject and use that to set the boundaries(允许我们为Volume指定边界,以便Volume仅影响边界内的摄影机。将碰撞器添加到Volume的游戏对象,并使用该碰撞器设置边界).
Blend Distance

The furthest distance from the Volume’s Collider that URP starts blending from. A value of 0 means URP applies this Volume’s overrides immediately upon entry.

URP开始混合的距离Volume的碰撞器的最远距离。值为0表示URP在输入时立即应用此Volume的overrides。

This property only appears when you select Local from the Mode drop-down.

仅当从Mode下拉列表中选择Local时,此属性才会显示。

Weight

The amount of influence the Volume has on the Scene. URP applies this multiplier to the value it calculates using the Camera position and Blend Distance.

Volume对场景的影响量。URP将此乘数应用于使用摄影机位置和混合距离计算的值。

Priority

URP uses this value to determine which Volume it uses when Volumes have an equal amount of influence on the Scene. URP uses Volumes with higher priorities first.

URP使用此值确定当体积对场景的影响量相等时使用的体积。URP首先使用优先级较高的卷。

Profile

A Volume Profile Asset that contains the Volume Components that store the properties URP uses to handle this Volume.

URP使用此值确定当Volume对场景的影响量相等时使用的Volume。URP首先使用优先级较高的Volumes。

7.6 Volume Profiles

        Profile字段存储Volume ProfileVolume Profiles是一种资源,包含URP用于渲染场景的特性。我们可以编辑Volume Profile,或将其他Volume Profile指定给Profile字段。还可以分别单击NewClone按钮来创建Volume Profile或克隆当前Volume Profile

7.7 How to use Local Volumes

在本例中,当摄影机位于某个长方体碰撞器内时,URP应用后处理效果。

(1)在场景中,创建新的Box Volume(GameObject > Volume > Box Volume)。

(2)选择Box Volume,Inspector面板Volume组件中,Profile字段点击New

(3)如果场景中有其他的Volume,修改Priority属性的值,以确保当前Volume优先级高于其他的Volume。

(4)点击Add Override,在Volume Overrides对话框中,选择后处理效果。

(5)在Collider组件中,调整大小和中心属性,使Collider占据您希望本地后期处理效果的Volume(确保选中“Is Trigger”复选框)。

现在,当Camera在Volume Box Collider的范围内,URP使用Box Volume中的Volume Overrides.

7.8 Volume Profile

Volume Profile是一个可脚本对象,它包含了Volumes用来确定如何为其影响的相机渲染场景环境的属性。Volume Profile引用了其Profile字段中的Volume Profile,并使用它引用的Volume Profile中的值。

Volume Profile将其属性组织为控制不同环境设置的结构。这些结构都有可以使用的默认值,但您可以使用Volume Override来重写这些值并自定义环境设置。

更多说明见官方文档:Volume Profile | Universal RP | 10.6.0

7.9 Volume Overrides

Volume Overrides允许我们更改或扩展Volume Profile中的默认属性。

URP作为Volume Override实现后期处理效果.例如,下图显示了URP模板样框中Vignette后期处理的效果.

在Volume Override中,每个属性左侧的复选框允许您启用或禁用特定属性。如果禁用属性,则URP将使用Volume对该属性的默认值。关闭所有属性,使用属性列表上方的全部或无快捷方式。

7.10 Effect List

这些是在通用渲染管道(URP)中可用的后期处理效果:

  • Bloom

  • Channel Mixed

  • Chromatic Aberration

  • Color Adjustments

  • Color Curves

  • Depth of Field

  • Film Grain

  • Lens Distortion

  • Lift Gamma Gain

  • Motion Blur

  • Panini Projection

  • Shadows Midtones Highlights

  • Split Toning

  • Tonemapping

  • Vignette

  • White Balance

8、Shaders and Materials

通用渲染管道使用的阴影方法与内置的统一渲染管道不同.因此,内置Lit和自定义Lit Shaders与URP不工作.相反,URP有一套新的标准Shaders.URP为最常见的用例场景提供以下Shaders:

  • Complex Lit
  • Lit
  • Simple Lit
  • Baked Lit
  • Unlit
  • Particles Lit
  • Particles Simple Lit
  • Particles Unlit
  • SpeedTree
  • Autodesk Interactive
  • Autodesk Interactive Transparent
  • Autodesk Interactive Masked

8.1 Choosing a Shader

使用URP,我们可以使用物理基础阴影(PBS)和非物理基础渲染(PBR)实时照明。

对于PBS,使用Lit Shader。我们可以在所有平台上使用。阴影质量量表取决于平台,但在所有平台上保持基于物理的呈现。这给了我们在硬件上的真实图形。Unity Standard Shader和Standard (Specular setup) Shaders都映射到URP中的Lit Shader。有关Shader映射的列表,请参阅Shader mappings。

8.2 SRP Batcher compatibility

确保Shader是SRP Batcher可兼容的:

  • Declare all Material properties in a single CBUFFER called UnityPerMaterial.
  • Declare all built-in engine properties, such as unity_ObjectToWorld or unity_WorldTransformParams, in a single CBUFFER called UnityPerDraw.

更多关于SRP的信息,参阅Scriptable Render Pipeline (SRP) Batcher。

8.3 Upgrading your Shaders

如果项目使用的uilt-in render,我们想把项目改为使用URP,必须将这些Shaders转换为URP Shaders。这是因为built-in Lit shaders不兼容RP Shaders。有关built-in shaders和URP Shaders之间映射的概述,请参阅Shader mappings。

要升级built-in Shaders:Edit > Render Pipeline > Universal Render Pipeline,根据需求选择Materials to URP Materials或者Upgrade Selected Materials to URP Materials

注意:这些更改无法撤消。在升级项目之前备份项目。

提示:如果项目视图中的预览缩略图在升级后不正确,尝试右键单击Project View窗口中的任何地方,然后选择Reimport All

对于SpeedTree Shaders,当重新导入时,Unity不会重新生成Materials,除非点击Generate Materials或Apply & Generate Materials按钮。

下表显示Unity built-in shaders在升级Shader转换为URP shaders。

Unity built-in shader Universal Render Pipeline shader
Standard Universal Render Pipeline/Lit
Standard (Specular Setup) Universal Render Pipeline/Lit
Standard Terrain Universal Render Pipeline/Terrain/Lit
Particles/Standard Surface Universal Render Pipeline/Particles/Lit
Particles/Standard Unlit Universal Render Pipeline/Particles/Unlit
Mobile/Diffuse Universal Render Pipeline/Simple Lit
Mobile/Bumped Specular Universal Render Pipeline/Simple Lit
Mobile/Bumped Specular(1 Directional Light) Universal Render Pipeline/Simple Lit
Mobile/Unlit (Supports Lightmap) Universal Render Pipeline/Simple Lit
Mobile/VertexLit Universal Render Pipeline/Simple Lit
Legacy Shaders/Diffuse Universal Render Pipeline/Simple Lit
Legacy Shaders/Specular Universal Render Pipeline/Simple Lit
Legacy Shaders/Bumped Diffuse Universal Render Pipeline/Simple Lit
Legacy Shaders/Bumped Specular Universal Render Pipeline/Simple Lit
Legacy Shaders/Self-Illumin/Diffuse Universal Render Pipeline/Simple Lit
Legacy Shaders/Self-Illumin/Bumped Diffuse Universal Render Pipeline/Simple Lit
Legacy Shaders/Self-Illumin/Specular Universal Render Pipeline/Simple Lit
Legacy Shaders/Self-Illumin/Bumped Specular Universal Render Pipeline/Simple Lit
Legacy Shaders/Transparent/Diffuse Universal Render Pipeline/Simple Lit
Legacy Shaders/Transparent/Specular Universal Render Pipeline/Simple Lit
Legacy Shaders/Transparent/Bumped Diffuse Universal Render Pipeline/Simple Lit
Legacy Shaders/Transparent/Bumped Specular Universal Render Pipeline/Simple Lit
Legacy Shaders/Transparent/Cutout/Diffuse Universal Render Pipeline/Simple Lit
Legacy Shaders/Transparent/Cutout/Specular Universal Render Pipeline/Simple Lit
Legacy Shaders/Transparent/Cutout/Bumped Diffuse Universal Render Pipeline/Simple Lit
Legacy Shaders/Transparent/Cutout/Bumped Specular Universal Render Pipeline/Simple Lit

8.4 Shader Stripping

Unity从一个Shader源文件中编译许多Shader变量。Shader变量的数量取决于Shader中包含了多少关键词。在默认Shader中,URP使用一组关键字来光照和阴影。URP可以排除哪些Shader变体,取决于URP Asset中活跃的哪些特性。

当我们禁用URP Asset中的某些特性时,管线从构建中“剥离”相关的Shader变体。剥离Shaders给我们更小的构建大小和更短的构建时间。如果项目永远不会使用某些特性或关键字,这是很有用的。

例如,可能有一个项目,我们directional lights永远不会使用阴影。没有Shader剥离,有定向阴影支持的Shader变体仍在构建中。如果我们知道根本不会使用这些阴影,就可以在URP Asset中取消direction light的投影阴影,然后URP从构建中剥离这些Shader变量。

有关Unity中剥离阴影变量的详细信息,请参阅这篇博客:Stripping scriptable shader variants | Unity Blog。

8.5 URP Pass tags: LightMode

此标记的值允许管线确定在执行Render Pipeline的不同部分时使用哪个传递。

如果你没有将Light Mode标签设置为Pass,URP使用SRPDefault Unlit t Unlit标记值。

在URP中,Light Mode标签可以有以下值:

Property Description
UniversalForward

The Pass renders object geometry and evaluates all light contributions. URP uses this tag value in the Forward Rendering Path.

该通道渲染对象几何和评价所有光贡献.URP在前向渲染中使用此标签值。

UniversalGBuffer

The Pass renders object geometry without evaluating any light contribution. URP uses this tag value in the Deferred Rendering Path.

该通道在不评估任何光贡献的情况下呈现物体的几何形状.URP在延迟渲染路径中使用此标签值.

UniversalForwardOnly

The Pass renders object geometry and evaluates all light contributions, similarly to when LightMode has the UniversalForward value. The difference from UniversalForward is that URP can use the Pass for both the Forward and the Deferred Rendering Paths.

该通道渲染物体的几何形状并评估光的贡献,类似于Light Mode具有Universalforward值的时候。与Universalforward的区别在于,URP可以同时为转发和延迟渲染路径使用通道。

Use this value if a certain Pass must render objects with the Forward Rendering Path when URP is using the Deferred Rendering Path. For example, use this tag if URP renders a Scene using the Deferred Rendering Path and the Scene contains objects with shader data that does not fit the GBuffer, such as Clear Coat normals.

当URP使用递延渲染通道时,如果某个传递必须使用转发渲染通道渲染对象,则使用此值。例如,如果URP使用延迟渲染通道渲染场景,并且场景包含不适合GBuffer的着色数据的对象,例如清除Coat常态,则使用此标签。

If a shader must render in both the Forward and the Deferred Rendering Paths, declare two Passes with the UniversalForward and UniversalGBuffer tag values. If a shader must render using the Forward Rendering Path regardless of the Rendering Path that the URP Renderer uses, declare only a Pass with the LightMode tag set to UniversalForwardOnly.

如果着色器必须同时呈现在转发和延迟渲染通道中,用Universalforward和Universal GBuffer标记值声明两个Passes。如果着色器必须使用“转发渲染通道”渲染,无论URP渲染器使用的渲染通道如何,只向Universal Forward Only声明带有Light Mode标签的通道。

Universal2D

The Pass renders objects and evaluates 2D light contributions. URP uses this tag value in the 2D Renderer.

该通道染对象和评价2D光贡献,URP在2DRenderer中使用此标签值。

ShadowCaster

The Pass renders object depth from the perspective of lights into the Shadow map or a depth texture.

通过将物体的深度从光线的角度呈现到阴影图或深度纹理。

DepthOnly

The Pass renders only depth information from the perspective of a Camera into a depth texture.

该通道仅从相机的角度呈现深度信息到深度纹理。

Meta Unity executes this Pass only when baking lightmaps in the Unity Editor. Unity strips this Pass from shaders when building a Player.
SRPDefaultUnlit

Use this LightMode tag value to draw an extra Pass when rendering objects. Application example: draw an object outline. This tag value is valid for both the Forward and the Deferred Rendering Paths.

使用这个Light Mode标签值在绘制对象时绘制额外的通道。应用示例:绘制物体描边。此标签值对于转发和延迟渲染通道都有效。

URP uses this tag value as the default value when a Pass does not have a LightMode tag.

当通道没有Light Mode标签时,URP将此标签值作为默认值。

注意:URP不支持以下Light Mode标签:

Always, ForwardAdd, PrepassBase, PrepassFinal, Vertex, VertexLMRGBM, VertexLM.

Unity-TA 成长之路(三)URP-Universal Render Pipeline相关推荐

  1. Unity手游之路三 基于Unity+Java的聊天室源码

    http://blog.csdn.net/janeky/article/details/17233199 项目介绍 这是一个简单的Unity项目,实现最基本的聊天室群聊功能.登录聊天室后,用户可以输入 ...

  2. 十年互联网项目实战经验分享:项目经理成长之路的三个层次

    网易项目管理专家雷蓓蓓老师,结合十年互联网项目摸爬滚打的实战经验,首次披露了从业多年来的诸多干货.项目经理要想在升职加薪路上走的更顺,核心要解决的是什么呢?就是怎么样去提升自己的核心竞争力,也就是升& ...

  3. 三十八载,Oracle伴我同行—记我的职业成长之路

    2015年7月19日 三十八载 Oracle伴我同行 --记我的职业成长之路 2015,今年是Oracle公司38周年:2015,今年我已然38岁.在Oracle庆祝38岁生日之际,仅以此文作为回 ...

  4. CISSP的成长之路(三):怎样获得CISSP认证

    在51CTO安全频道特别策划的CISSP的成长之路系列的上一篇< 为什么要获得CISSP认证>里,J0ker介绍了为什么要获得CISSP认证和CISSP的职业发展情况.那需要通过怎样的流程 ...

  5. python大神的成长之路普通话三分钟_我的成长之路普通话考试说话三分钟范文

    我的成长之路普通话考试说话三分钟范文 时间一颗甜蜜的糖果,越吃越觉得有味道.时间是一种药,有点 苦,有点涩.时间是一块木糖醇,偶尔会让你清醒.我的人生就像 糖果,药,木糖醇.正因为它们,我的人生成长路 ...

  6. python大神的成长之路普通话三分钟_三分钟普通话说话30篇-我的成长之路 - 希赛网...

    我的成长之路 每一个人都有自己的成长之路,每个人的成长都有她们自己的故事.我的成长也和大多数的孩子一样是在学习中度过的.有人说,成长是痛苦的.因为它把一个人从天真无邪.无忧无虑的世界,带入了一个充满世 ...

  7. unity 角度限制_喵的Unity游戏开发之路 推球:游戏中的物理

    前言很多童鞋没有系统的Unity3D游戏开发基础,也不知道从何开始学.为此我们精选了一套国外优秀的Unity3D游戏开发教程,翻译整理后放送给大家,教您从零开始一步一步掌握Unity3D游戏开发. 本 ...

  8. 喵的Unity游戏开发之路 - 推球:游戏中的物理

    很多童鞋没有系统的Unity3D游戏开发基础,也不知道从何开始学.为此我们精选了一套国外优秀的Unity3D游戏开发教程,翻译整理后放送给大家,教您从零开始一步一步掌握Unity3D游戏开发. 本文不 ...

  9. 一个独立开发者的逆袭成长之路

    什么是独立开发者 对于独立开发者并没有一个严格的定义,既没有人数的限制,也没有具体工作内容的说明,不过一般大家都认可的观点就是,独立开发者是指那些通过单独地开发应用而养活自己的程序员,他们没有正式工资 ...

最新文章

  1. python08-类与对象
  2. python中格式符的应用%s,%d,%f以及format()的实例以及输出格式
  3. 将SVN与BUG跟踪管理集成
  4. Spring源码导入IDEA
  5. java的三大特性,封装,继承,多态
  6. Babel 7 基础入门学习(详细版)
  7. 文件管理系统_Python学习第170节--Linux文件管理系统实际操作和具体介绍
  8. 太阳能灯_【产品中心】太阳能野营灯
  9. 西门子v90伺服说明书_西门子V90伺服驱动器的的EPOS控制模式
  10. 移动网流量用户身份识别系统的源代码_真武庙车辆识别系统安装效果图
  11. 国美零售带货直播 重构本地零售数字化生产力
  12. Script Control 组件Win7 X64平台运行问题及示例
  13. Linux网络设备驱动程序设计----刘文涛
  14. nvm 管理 node 版本
  15. 固定表格第一行(表头固定),其他行可以上下滚动
  16. 1183: 【入门】判断能否构成三角形
  17. SQL Server之查询检索操作
  18. IT大牛的数据挖掘算法到架构师等的职业进化
  19. html千年之恋的图片,HTML+CSS+JavaScript项目6 “千年之恋”注册页面制作_0525_连蕊.pptx...
  20. 前端面试题汇总(含答案)(JS篇)

热门文章

  1. android8 home键反应慢,安卓手机反应慢的解决方法
  2. MySQL5.7中英对照文档_用户变量 User-Defined Variables
  3. 使用mybatis实现递归查询,mybatis递归查询
  4. 「内容管理系统」34个无头CMS应该在你的技术雷达上
  5. router和route的区别?
  6. 2023中国大学排名,软科发布
  7. R语言:时序图和自相关图
  8. JS无形装逼,最为致命
  9. win10一直正在检查更新_IT之家安卓/iOS版 7.15 更新:手机短信快捷登录/海外用户支持...
  10. SPL工业智能:原料与产品的拟合