轻量级渲染管线

Update: LWRP is now out of preview and production-ready. Get more info in our 2019.1 release post.

更新:LWRP现在已经过预览,无法投入生产。 在我们的2019.1版本发布中获取更多信息。

In a recent blog post we introduced the concept of Scriptable Render Pipelines. In short, SRP allow developers to control how Unity renders a frame in C#. We will release two built-in render pipelines with Unity 2018.1: the Lightweight Pipeline and HD Pipeline. In this article we’re going to focus on the Lightweight Pipeline or LWRP.

在最近的博客文章中,我们介绍了可脚本渲染管道的概念。 简而言之,SRP允许开发人员控制Unity如何在C#中渲染框架。 我们将使用Unity 2018.1发布两个内置渲染管道:轻量级管道和HD管道。 在本文中,我们将重点介绍轻量级管道或LWRP。

By exposing the rendering pipelines to C# our goal is to make Unity less of a black box and enable developers to explicitly control what is happening during rendering. Developers can use the built-in pipelines we’re providing, develop their own pipeline from scratch or start by modifying  one of the provided pipelines to meet their specific requirements.

通过将渲染管线暴露给C#,我们的目标是使Unity不再是黑盒子,并使开发人员能够显式控制渲染过程中发生的事情。 开发人员可以使用我们提供的内置管道,从头开始开发自己的管道,也可以通过修改提供的管道之一来满足他们的特定要求。

We’ve released a video which provides a short overview of the Scriptable Render Pipeline concept including some footage of projects using the various pipelines:

我们发布了一个视频,其中简要介绍了可脚本渲染管道概念,其中包括一些使用各种管道的项目的素材:

演示地址

The goal of the LWRP is to provide optimized real time performance on performance constrained platforms by making some tradeoffs with regard to lighting and shading.

LWRP的目标是通过在照明和阴影方面做出一些折衷,在性能受限的平台上提供优化的实时性能。

The target audience for LWRP is developers targeting a broad range of mobile platforms, VR and those that develop games with limited realtime lighting needs. The LWRP performs single-pass forward rendering with one real time shadow light and light culling per-object with the advantage that all lights are shaded in a single pass. Compared to the legacy pipeline forward rendering, which performs an additional pass per pixel light within range, using the LW pipeline will result in less draw calls. This is at the expense of some additional shader complexity due to more lights per pass.  The LWRP is also supported by our Shader Graph tool, which will provide some additional benefits with regard to shader authoring workflow.

LWRP的目标受众是面向各种移动平台,VR以及那些开发实时照明需求有限的游戏的开发商。 LWRP使用一个实时阴影光和每个对象进行光剔除来执行单遍正向渲染,其优点是所有光都在单遍中被着色。 与传统流水线正向渲染相比,传统流水线正向渲染对范围内的每个像素光执行额外的传递,使用LW流水线将减少绘制调用。 由于每次通过更多的光,这以一些额外的着色器复杂性为代价。 我们的Shader Graph工具也支持LWRP,这将在着色器创作工作流程方面提供一些其他好处。

轻量级着色器 (Lightweight Shaders)

The LWRP has its own process for rendering and therefore requires shaders which are written with it in mind. We have developed a new set of Standard Shaders that are located under the Lightweight Pipeline group in the material’s shader selection dropdown. These include a Standard PBR shader, a Non PBR Standard shader with a simplified lighting model, a Standard Terrain shader and a Standard Unlit shader.  It’s worth noting that all Unity’s unlit stock shaders work already with LWRP. This includes legacy particles, UI, skybox, and sprite shader.

LWRP具有自己的渲染过程,因此需要考虑到着色器。 我们已经开发了一套新的标准着色器,它们位于材质的着色器选择下拉列表的“轻量级管道”组下。 其中包括标准PBR着色器,具有简化照明模型的非PBR标准着色器,标准地形着色器和标准非照明着色器。 值得注意的是,Unity的所有未照明的股票着色器都已与LWRP一起使用。 这包括旧粒子,UI,天空盒和精灵着色器。

The Lightweight Pipeline also provides material upgraders to upgrade Unity’s stock lit shaders to shaders compatible with the pipeline. In order to upgrade materials go to Edit -> Render Pipeline -> Upgrade -> Lightweight. You can choose to either upgrade all material in a project, or selected materials.

轻量级管道还提供了材质升级程序,以将Unity的库存照明着色器升级到与管道兼容的着色器。 为了升级材料,请转到编辑->渲染管道->升级->轻量化 。 您可以选择升级项目中的所有材料或选定的材料。

Material Upgraders

物料升级员

渲染管道资产 (The Render Pipeline Asset)

The currently selected render pipeline is selected by assigning a pipeline asset in the Scriptable Render Pipeline Settings of the Graphics Settings window. It can also be assigned from script via the GraphicsSettings.renderPipelineAsset property.

通过在“图形设置”窗口的“可脚本绘制的渲染管线设置”中分配管线资产,可以选择当前选定的渲染管线。 也可以通过GraphicsSettings.renderPipelineAsset属性从脚本中分配它。

In addition to selecting a pipeline to define the overall rendering approach of your project at the outset, it’s possible to store multiple quality settings within different instances of the same type of render pipeline. The pipeline asset controls the global rendering quality settings and is responsible for creating the pipeline instance. The pipeline instance contains intermediate resources and the render loop implementation.

除了从一开始就选择管道定义项目的整体渲染方法外,还可以在同一类型的渲染管道的不同实例中存储多个质量设置。 管道资产控制全局渲染质量设置,并负责创建管道实例。 管道实例包含中间资源和渲染循环实现。

轻量级渲染 (Lightweight Rendering)

The rendering features of LWRP are mainly a subset of the built-in renderer. In order to improve performance on performance limited platforms, certain functionality has been deliberately excluded. Unity provides developers with a wide array of tools and techniques to apply to their games. The risk in this is that sometimes the wrong technique is applied to a game which doesn’t have the performance resources to support it.  The goal of providing specialized rendering pipelines as templates is to mitigate the possibility for users to make certain potentially costly mistakes in terms of performance. Deploying inappropriate post processing effects for a target platform for example may make the game slow on a device, even though those effects are supported in Unity and might perform appropriately on the appropriate target platform.

LWRP的渲染功能主要是内置渲染器的子集。 为了提高性能受限平台上的性能,已故意排除某些功能。 Unity为开发人员提供了适用于其游戏的多种工具和技术。 这样做的风险是,有时将错误的技术应用于没有性能资源来支持该游戏的游戏。 提供专门的渲染管道作为模板的目的是减轻用户在性能方面犯某些潜在的代价高昂的错误的可能性。 例如,为目标平台部署不合适的后处理效果可能会使游戏在设备上变慢,即使Unity支持这些效果并可能在适当的目标平台上正常执行。

Realtime global illumination is another example of a feature which is rarely used on the LW RP target platforms and has therefore been removed. The single supported rendering path is single-pass forward, which is another decision which privileges performance over rendering complexity. The table below provides further detail about which techniques are supported in the Built-In Pipeline, and which are supported in Lightweight.

实时全局照明是该功能的另一个示例,该功能很少在LW RP目标平台上使用,因此已被删除。 支持的单一渲染路径是单向前进,这是另一个决定性能而不是渲染复杂性的决定。 下表提供了有关内置管道支持哪些技术以及轻量级支持哪些技术的更多详细信息。

Unity Built-In Pipeline Lightweight Pipeline
Platform Coverage All All
Rendering Paths Multi-pass Forward

Multi-pass Deferred

Single-pass Forward
Lighting Attenuation  Separate precomputed attenuation textures for Point and Spot

Vertex light attenuation does not reach 0 intensity at range boundary.

Attenuation computed in the shader smoothly fading to light range. Inner and outer angle for spot lights.
Color Space Linear with sRGB light intensity

sRGB

Linear preferred, Gamma supported

Linear light intensities

Realtime Lights Directional, Spot and Point

Amount of pixel lights controlled by Quality Settings

Forward path limited to 8 pixel lights.

Supports up to 4 vertex point lights.

Directional, Spot and Point

Amount of pixel lights controlled by Pipeline Asset

Limited to 8 pixel lights.

Supports up to 4 vertex point lights.

Light Modes Baked

Mixed

Baked Indirect

Shadow Mask

Distance Shadowmask

Subtractive

Realtime

Baked

Mixed

Baked Indirect

Realtime

Global Illumination Directional, Spot, Point and Rectangular Area Lights

Baked

Lightmap (Non-Directional and Directional)

Light Probes

Realtime

Dynamic Lightmap

Realtime Lightprobes

Directional, Spot, Point and Rectangular Area Lights

Baked

Lightmap (Non-Directional and Directional)

Light Probes

Realtime GI Not Supported.

Light Culling Per-Object. No Compute. Per-Object. No Compute.
Shader Library Dozens of non physically based shaders specializations

Unified Standard PBS Shaders:

Metallic workflow

Specular workflow

Roughness workflow

Unified Standard non physically based Shader (covers most legacy and mobile lit shaders)

Unified Standard Shader (Metallic or Specular workflow)

Physically Based Shading Disney Diffuse + Cook Torrance (GGX, Smith, Schlick) Specular

Lambertian Diffuse + Simplified Cook Torrance (GGX, Simplified KSK and Schlick) Specular

Lambertian Diffuse + Non-Microfaceted LUT Specular

Lambertian Diffuse + Simplified Cook Torrance (GGX, Simplified KSK and Schlick) Specular
Light Cookies Monochrome Not supported in V1
Light Probes Modes One interpolated probe

LPPV

One interpolated probe
Reflection Probes Sorted per-object, blend between at most 2 probes Sorted per-object, no blending
Shadows Features PSSM Stable and Close Fit

Filtering: PCF

No depth clip. Pancaking done in vertex.

PSSM Stable Fit

Filtering: PCF

No depth clip. Pancaking done in vertex.

Shadow Modes Light Space

Screen Space

Screen Space
Shadow Casting Lights Directional, Spot, Point

Multiple shadow light casters, one per-pass.

Directional and Spot

Single shadow light caster supported as main light.

General
Camera Sorts camera by depth value

Stack Management

Groups by common camera state

Handles depth state between cameras

Sorts camera by depth value

No stack management

RenderTarget scale supported

Game renders at scaled resolution

UI renders at native resolution

Anti-Aliasing MSAA, TAA MSAA
Pipeline Additional Data Motion Vectors None
Post-Processing Legacy Post-Processing stack

new Post-Processing Stack

Subset of the new Post-Processing Stack FX

No support for: TAA, Motion Blur, SSR

Debug option Display GBuffer

Display various bake lighting view mode

Sky lighting Procedural Sky

Cubemap/LatLong Sky

Ambient Lighting

Procedural Sky

Cubemap

Ambient Lighting

Unity内置管道 轻量级管道
平台覆盖 所有 所有
渲染路径 多遍转发

多次递延

单遍转发
照明衰减 针对点和点的单独的预先计算的衰减纹理

顶点光衰减在范围边界处未达到0强度。

在着色器中计算出的衰减会平滑地衰减到光照范围。 聚光灯的内角和外角。
色彩空间 线性与sRGB光强度

RGB

首选线性,支持伽玛

线性光强度

实时灯 定向,点和点

由“质量设置”控制的像素光量

前向路径限制为8个像素灯。

支持多达4个顶点照明。

定向,点和点

受管线资产控制的像素光量

仅限8像素灯。

支持多达4个顶点照明。

灯光模式

混合的

间接烤制

阴影面具

距离荫罩

减法

即时的

混合的

间接烤制

即时的

全球照明 定向,聚光,点和矩形区域灯

光照贴图(非定向和定向)

光探头

即时的

动态光照贴图

实时光探头

定向,聚光,点和矩形区域灯

光照贴图(非定向和定向)

光探头

不支持实时GI。

轻选 每个对象。 没有计算。 每个对象。 没有计算。
着色器库 数十种非基于物理的着色器专业知识

统一标准PBS着色器:

金属工作流程

镜面工作流程

粗糙度工作流程

非基于物理的统一标准着色器(涵盖大多数旧式和移动式照明着色器)

统一标准明暗器(金属或镜面工作流程)

基于物理的阴影 迪士尼Diffuse + Cook Torrance(GGX,Smith,Schlick)镜面

Lambertian漫反射+简化的Cook Torrance(GGX,简化的KSK和Schlick)高光

朗伯扩散+非微面LUT镜面反射

Lambertian漫反射+简化的Cook Torrance(GGX,简化的KSK和Schlick)高光
轻饼干 单色 V1不支持
光探头模式 一个内插探针

低压PV

一个内插探针
反射探头 按对象排序,最多2个探针之间混合 按对象排序,不融合
阴影功能 PSSM稳定贴身

过滤:PCF

没有深度剪辑。 Pancaking在顶点完成。

PSSM稳定贴合

过滤:PCF

没有深度剪辑。 Pancaking在顶点完成。

阴影模式 光空间

屏幕空间

屏幕空间
影子投光灯 定向,点,点

多个阴影光脚轮,每个通道一次。

定向和现货

支持单阴影光脚轮作为主光源。

一般
相机 按深度值对摄像机排序

堆栈管理

按常见相机状态分组

处理相机之间的深度状态

按深度值对摄像机排序

没有堆栈管理

支持RenderTarget比例

游戏以缩放的分辨率渲染

UI以本机分辨率呈现

抗锯齿 MSAA,TAA MSAA
管道附加数据 运动向量 没有
后期处理 旧版后处理堆栈

新的后处理堆栈

新的后处理堆栈FX的子集

不支持:TAA,运动模糊,SSR

调试选项 显示缓冲区

显示各种烘烤照明查看模式

天空照明 程序天空

Cubemap / LatLong天空

环境照明

程序天空

立方体贴图

环境照明

自定义轻量级管道 (Customizing The Lightweight Pipeline)

The incredible potential of the Scriptable Render Pipeline architecture is that it’s more open and customizable than rendering in Unity ever has been. If you want to have access to Lightweight Pipeline source, take a look at the Scriptable Render Pipeline github page. There you can grab the C# source for the LW RP and begin making modifications to create a pipeline which is uniquely suited to your project. If you run into any issues, we’d love to hear about them via our github page. We’re also looking forward to hearing from you on the beta forum.

可脚本化渲染管道架构的惊人潜力是,它比Unity中的渲染更加开放和可定制。 如果您想访问轻量级管道源,请查看Scriptable Render Pipeline github页面 。 在那里,您可以获取LW RP的C#源代码,并开始进行修改以创建特别适合您的项目的管道。 如果您遇到任何问题,我们很乐意通过github页面来了解有关它们的信息。 我们也期待在Beta论坛上收到您的来信 。

翻译自: https://blogs.unity3d.com/2018/02/21/the-lightweight-render-pipeline-optimizing-real-time-performance/

轻量级渲染管线

轻量级渲染管线_轻量级渲染管道:优化实时性能相关推荐

  1. java轻量级框架_轻量级的Java 开发框架 Spring

    Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java 开发框架,由Rod Johnson 在其著作Expert One-On-One J2EE Development a ...

  2. react 当前时间_如何使用 useRef 优化 React 性能问题

    原文:How to useRef to Fix React Performance Issues 原文作者:Sidney Alcantara 译文出自:掘金翻译计划 本文永久链接:https://gi ...

  3. 3D 引擎 Unity 2019.1 正式发布,引入新的轻量级渲染管道

    百度智能云 云生态狂欢季 热门云产品1折起>>>   流行的游戏开发引擎 Unity 已于 2019 年 4 月发布新版本,即 2019.1 版.Unity 旨在让游戏开发者的生活变 ...

  4. unity 可视化渲染管线_如何为高端可视化设置Unity的高清渲染管道

    unity 可视化渲染管线 Prior to Unite Copenhagen in September 2019, Unity collaborated with Lexus and its age ...

  5. 三.Unity2019轻量级渲染管线(LWRP)深入学习

    一.轻量级渲染管线资产 要使用轻量级渲染管线(LWRP),必须创建LWRP资产并在"Graphics"设置中分配资产. LWRP资产控制轻量级渲染管线的一些图形功能和质量设置.这是 ...

  6. unity绘制管道_【译文】unity可编程渲染管道#1——自定义管道

    前言 Scriptable Render Pipeline定制流水线控制渲染创建管道资产和实例.剔除,过滤,排序,渲染.保持记忆清洁.提供良好的编辑体验.这是涵盖Unity可编写脚本的渲染系列教程的第 ...

  7. div自动滚动_从手机滚动丢帧问题,学习浏览器合成与渲染层优化

    一个 CSS 属性引发的血案 Web 页面性能是前端开发特别需要关注的重点,评判前端 Web 页面性能的指标有很多,页面的流畅度是其中的一种,如何让页面变得 "柔顺丝滑",要讨论起 ...

  8. 华为手表开发:WATCH 3 Pro(11)存储数据_轻量级存储_到本地

    华为手表开发:WATCH 3 Pro(11)存储数据_轻量级存储_到本地 初 环境与设备 文件夹: 文件 开发步骤 新增一个文本输入框 index.hml index.css 存储数据的逻辑 inde ...

  9. 阿里云轻量级GPU计算型实例规格族vgn5i配置性能详解

    阿里云轻量级GPU计算型实例规格族vgn5i配置性能CPU.内存.适用场景.vgn5i实例规格族,InstanceTypes分享轻量级GPU计算型实例规格族vgn5i实例详解: 轻量级GPU计算型实例 ...

最新文章

  1. codeblocks使用指南
  2. 美团北京,今日起无人驾驶送外卖
  3. nacos 集群_Nacos 常见问题及解决方法
  4. iOS开发基础-九宫格坐标(4)
  5. Spring表单的initBinder:绑定表单复杂属性
  6. matlab dmodce,吧里有没有大神可以教我怎么改dmodce函数,用的matlab2012a版本
  7. leetcode-136-只出现一次的数字
  8. Java黑皮书课后题第4章:*4.23(金融应用:酬金)编写一个程序,读取下面信息,然后输出一个酬金声明
  9. 5 压缩上传图片_推荐一个干净纯粹的网站,专注图片压缩、pdf相关操作
  10. 如何提升大规模Transformer的训练效果?Primer给出答案
  11. 调用方法try起来的好处_Java:一个重要的停止线程方法——interrupt
  12. 旅游管理系统设计图; 毕业论文概述
  13. 科技文献检索(八)——检索技术
  14. ureport2报表详细使用(二)-报表基础配置
  15. PID公式的推导过程及实现代码
  16. wincc工程组态论文_仪表人零基础学系统组态,必备知识!2020.12.12
  17. GCD中dispatch_group的使用方法
  18. 网路学员面试常见问题:
  19. 2015CDAS中国数据分析师行业峰会:R语言量化投资数据分析应用
  20. SAP FICO资产卡片批导开发说明书(包括测试样例、程序代码仅作参考,不保证一定可以运行)

热门文章

  1. EEROM和FRAM写入速度比较
  2. 计算机在会计中的应用英语论文,计算机在会计中应用期刊文章参考文献 计算机在会计中应用英语参考文献哪里找...
  3. 项目:C++在线测评系统
  4. 开源在线评测/考试系统 xzs
  5. Copyright 格式
  6. 用户信息管理的功能开发
  7. 第四章 web前端开发工程师--JavaScript京东商城项目开发 4-2 京东商城导航栏
  8. 艾伟:一个让人遗忘的角落--Exception(一)
  9. dirty cow的一点理解
  10. Java项目:JSP在线水果销售商城