渲染管线_高清渲染管线:关注视觉质量

渲染管线

In a recent blog post, we introduced the concept of Scriptable Render Pipelines. In short, SRP allows 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 High Definition Render Pipeline. In this article, we’re going to focus on the High Definition Render Pipeline or HDRP.

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

HDRP aims to provide developers with tools to achieve high definition visuals.

HDRP旨在为开发人员提供实现高清视觉效果的工具。

Its design follows three principles:

其设计遵循三个原则:

    Physically based rendering relies on three pillars: Lighting, Material, and Camera. Lighting and material rely on physical interaction and there should be a clear decoupling between them to get a coherent result under various lighting conditions. The camera interprets how the resulting lighting will be displayed on the screen. The goal is to make it easier for the artists to achieve a plausible result.

    基于物理的渲染依赖于三个Struts:照明,材质和相机。 照明和材料依赖于物理相互作用,它们之间应该有明确的去耦关系,以在各种照明条件下获得一致的结果。 摄像机解释如何将最终的照明显示在屏幕上。 目的是使艺术家更容易获得合理的结果。

    Unified lighting means that all objects and participating media in the scene should receive the same lighting. There shouldn’t be any distinction between opaque, transparent or volumetric materials. Coherent lighting means that a material must interact correctly with the lighting produced by any light sources (reflection probe, area lights…), even when modified by a Decal for example. This results in a more coherent look.

    统一照明意味着场景中的所有对象和参与媒体都应使用相同的照明。 不透明,透明或体积材料之间不应有任何区别。 相干照明意味着材料必须与任何光源(反射探针,区域照明……)产生的照明正确相互作用,即使例如经过贴花装饰也是如此。 这使外观更加连贯。

    There are various rendering passes used in real-time rendering: Deferred/Forward, SinglePass/Multipass, Tile/Cluster… It is common in game development that the selection of a rendering path limits the set of graphics features. For HDRP we have tried to get the same set of graphics features whatever the rendering path. The result is that the choice of a rendering path is solely based on performance and not on which features are required for a game.

    实时渲染中使用了各种渲染过程:“递延/前进”,“单遍/多遍”,“平铺/群集”…在游戏开发中,常见的是,选择渲染路径会限制图形功能集。 对于HDRP,无论渲染路径如何,我们都试图获得相同的图形功能。 结果是渲染路径的选择仅基于性能,而不取决于游戏所需的功能。

    During the development of HDRP, we have followed this principle as closely as possible.

    在HDRP的开发过程中,我们尽可能遵循了这一原则。

    是给谁用的? (Who is it for?)

    The HDRP targets high-end PCs and consoles and prioritizes stunning, high definition visuals. We wanted to bring AAA graphics features in the hands of smaller teams. It assumes at least a DX11 level features set and makes heavy use of compute shaders. The tradeoff here is that the HDRP will not work on less powerful platforms. The target supported APIs are D3D11, D3D12, GNM (PlayStation 4), Metal and Vulkan. VR support is planned, but not implemented in the currently available preview.

    HDRP面向高端PC和控制台,并优先提供令人惊叹的高清视觉效果。 我们希望将AAA图形功能引入较小的团队。 它至少假定了DX11级别的功能集,并大量使用了计算着色器。 这里的权衡是HDRP无法在功能较弱的平台上运行。 支持的目标API是D3D11,D3D12,GNM(PlayStation 4),Metal和Vulkan。 VR支持已计划,但当前可用的预览中未实现。

    Moreover, HDRP comes with a full new set of features and behaviors and there will be learning and re-tooling required. We’re providing a conversion tool to upgrade a project from Built-in Unity to HDRP, but it only helps you to quickly re-setup materials and textures. All the lighting, all the post-processing, scene settings, graphics settings and custom shaders will need to be re-worked.

    此外,HDRP具有一整套全新的功能和行为,并且需要学习和重新配置工具。 我们提供了一种转换工具,可将项目从内置Unity升级到HDRP,但它只能帮助您快速重新设置材质和纹理。 所有照明,所有后处理,场景设置,图形设置和自定义着色器都需要重新设计。

    Example of Viking Village project upgrade.

    维京村项目升级示例。

    Lastly, HDRP is in Preview state, which means that it’s currently not suitable for production.

    最后,HDRP处于预览状态,这意味着它目前不适合生产。

    照明改善 (Lighting improvement)

    HDRP comes with a new lighting architecture: It uses a hybrid Deferred / Forward – Tile / Cluster renderer. These words mean that it scales way better than built-in Unity rendering with the number of lights in the scene. This new lighting architecture is focused on performance.

    HDRP带有新的照明体系结构:它使用混合的Deferred / Forward – Tile / Cluster渲染器。 这些话意味着,根据场景中的灯光数量,它的缩放方式要比内置Unity渲染好。 这种新的照明架构专注于性能。

    Debug mode to visualize tiled light list.

    调试模式以可视化平铺的灯光列表。

    Additionally, HDRP comes with various additional light properties and a new light editor: It is possible to fade the light, affect only diffuse or specular lighting or use color temperature to set up the color of the light. Spotlights have now control on inner angles and can have different shapes (cone, box or pyramid). Colored cookies are supported.

    此外,HDRP还具有各种附加的灯光属性和新的灯光编辑器:可以淡化灯光,仅影响漫反射或镜面照明或使用色温设置灯光的颜色。 现在,聚光灯可以控制内角,并且可以具有不同的形状(圆锥形,盒子形或金字塔形)。 支持彩色cookie。

    HDRP allows the use of real-time area lights (no shadow or baking currently), like rectangle light.

    HDRP允许使用实时区域光(当前没有阴影或烘烤),例如矩形光。

    Finally, the light follows physical inverse square attenuation and uses physical light Unit. The lighting and the control of the light are fully linear, there is no Built-in Unity ‘Gamma mode’ anymore. The Sun Light intensity is defined in term of lux at the ground level and point and spot are defined in Lumen.

    最后,光遵循物理平方反比衰减,并使用物理光单位。 照明和灯光控制完全是线性的,不再有内置Unity'Gamma模式'。 太阳光强度以地面的勒克斯为单位定义,点和点的定义为流明。

    On image based lighting side, reflection probes get a big upgrade in HDRP. It is now possible to use oriented bounding box or sphere shape, the proxy shape (area approximating the scene geometry) and influence shape (an area where pixels are affected) are separated, there is various influence fading option (per face, based on normal orientation…).

    在基于图像的照明方面,反射探针在HDRP方面有了很大的升级。 现在可以使用定向的边界框或球形形状,将代理形状(近似于场景几何的区域)和影响形状(影响像素的区域)分开,有各种影响衰落选项(每面,基于法线)方向…)。

    材质渲染 (Material Rendering)

    HDRP has its own version of the Standard Shader called Lit Shader. The Lit Shader comes with a good amount of features and allows richer material than what is possible with Built-in Unity rendering. A double-sided option is available and connected to Global Illumination automatically and various mapping options are now possible like planar and tri-planar. Advanced effects like parallax occlusion mapping or tessellation are now available in one click!

    HDRP有自己的标准着色器版本,称为Lit Shader。 Lit Shader具有许多功能,并且可以提供比内置Unity渲染更丰富的材质。 提供了一个双面选项并自动连接到“全局照明”,并且现在可以使用各种映射选项,例如平面和三平面。 一键即可获得视差遮挡贴图或镶嵌等高级效果!

    But the strongest addition to material rendering is its lighting model. HDRP uses the following BRDF: Isotropic multi scattering GGX for specular Layer and Disney Diffuse for diffuse Layer. The difference with Built-in Unity is the multi-scattering part.

    但是,材质渲染中最强大的功能是其照明模型。 HDRP使用以下BRDF:各向同性多散射GGX用于镜面反射层,而Disney Diffuse用于漫反射层。 内置Unity的不同之处在于多散射部分。

    Gold metallic ball going from Smooth (Left) to Rough (right):

    从光滑(左)到粗糙(右)的金色金属球:

    Isotropic single scattering GGX (Similar to Built-in Unity)

    各向同性单散射GGX(类似于内置Unity)

    Isotropic multi scattering GGX of HDRP means that rougher materials are not darker but more saturated.

    HDRP的各向同性多散射GGX意味着较粗糙的材料不会更暗,而是更饱和。

    The default parametrization is Metallic/Smoothness, but it is possible to switch to SpecularColor/Smoothness within the same shader.

    默认参数化为“金属/平滑度”,但可以在同一着色器中切换到“ SpecularColor /平滑度”。

    HDRP allows us to enhance or replace this initial model. Various options are available to:

    HDRP允许我们增强或替换此初始模型。 各种选项可用于:

      This variation of the lighting model helps us achieve various complex looks.

      照明模型的这种变化有助于我们获得各种复杂的外观。

      Mushroom picture relying on transmission and subsurface scattering (courtesy of Laurent Harduin).

      蘑菇图像依赖于透射和地下散射(由Laurent Harduin提供)。

      HDRP also allows a new set of options for transparent materials, like backface then front face rendering to help sorting, Depth post pass to help with depth of field effect on transparent and more.

      HDRP还为透明材料提供了一组新的选项,例如背面,正面渲染以帮助分类,深度通过传递以帮助对透明材料进行景深效果等等。

      Example of iridescence effect with double-sided transparent render back face then front face.

      双面透明渲染背面然后是正面的虹彩效果示例。

      Base on the Lit shader, HDRP provides a Layered Lit shader allowing to mix various Lit shaders together. Read this full blog post to get more information on Layered Lit.

      基于Lit着色器,HDRP提供了分层Lit着色器,允许将各种Lit着色器混合在一起。 阅读完整的博客文章,以获取有关分层点燃的更多信息。

      Another addition to HDRP is Decal support. Decals are supported on both opaque and transparent material (and are still in development) and correctly affect the sampling of Global Illumination (lightmap/light probe).

      HDRP的另一个新增功能是Decal支持。 不透明和透明材料上均支持贴花(并且仍在开发中),并且可以正确影响全局照明(光照贴图/光探针)的采样。

      Example of a chalk drawing on a floor with Decal.

      粉笔画的示例在一个楼层上的与贴花。

      除错 (Debug)

      The most important feature added to HDRP is its debugging tool. Debugging is extremely important to understand data authoring and performance problems.

      HDRP最重要的功能是其调试工具。 调试对于了解数据创作和性能问题极为重要。

      HDRP comes with a new customizable debug window that allows to control debug view mode and render pipeline settings. This debug window can be used both in the Unity Editor or in any Player. Yes, it is now possible to have all the debug functionality on any of the target devices like PlayStation 4.

      HDRP带有一个新的可自定义调试窗口,该窗口可控制调试视图模式和渲染管道设置。 此调试窗口可在Unity编辑器或任何播放器中使用。 是的,现在可以在任何目标设备(如PlayStation 4)上具有所有调试功能。

      Example of debug window in Unity Editor with normal property display.

      具有正常属性显示的Unity Editor中的调试窗口示例。

      The debug windows allow to display any material properties for both opaque and transparent materials, either with deferred or forward render path.

      调试窗口允许显示不透明和透明材质的任何材质属性,包括延迟或正向渲染路径。

      It allows lighting debug view: Diffuse lighting only, Specular lighting only. It also allows you to override properties for the whole scene like normal, albedo, smoothness. It can display intermediate render targets like motion vector, depth buffer. It can highlight properties like objects using lightmap or tessellation, having a NaN checker and many more.

      它允许照明调试视图:仅扩散照明,仅镜面照明。 它还允许您覆盖整个场景的属性,例如法线,反照率,平滑度。 它可以显示中间渲染目标,例如运动矢量,深度缓冲区。 它可以使用光照贴图或镶嵌来突出显示诸如对象之类的属性,并具有NaN检查器等等。

      Example of a debug windows in Player with diffuse lighting mode and albedo override.

      具有扩散照明模式和反照率覆盖的Player中调试窗口的示例。

      One interesting mode is also a color picker mode to read the current on-screen value or HDR value before postprocessing is applied.

      一种有趣的模式是拾色器模式,用于在应用后处理之前读取当前的屏幕值或HDR值。

      The debug window can easily be extended to support any debug tool that your game may request like AI or Animation debugging tool.

      调试窗口可以轻松扩展以支持游戏可能要求的任何调试工具,例如AI或Animation调试工具。

      新行为 (New behavior)

      HDRP comes with a new behavior that is different from Built-in Unity rendering pipeline.

      HDRP具有与内置Unity渲染管道不同的新行为。

      Deferred and rendering path support the same set of features. Subsurface scattering, Screen space ambient occlusion, Decals work the same for both paths. There is no need to choose a specific rendering path for using a particular feature.

      延迟和渲染路径支持相同的功能集。 地下散射,屏幕空间环境光遮挡,贴花对于这两个路径都相同。 无需选择使用特定功能的特定渲染路径。

      HDRP uses camera relative rendering. This means that there is a good rendering precision even far away from the origin of the world. This has an impact on all the shaders used with HDRP.

      HDRP使用摄像机相对渲染。 这意味着即使远离世界起源,也具有良好的渲染精度。 这会影响与HDRP一起使用的所有着色器。

      Your camera can control which lighting architecture is used (It is possible to mix deferred and forward renderer path in a scene) and which features are enabled for this rendering. It is possible to disable fog, shadow, post-processing etc.

      您的相机可以控制使用哪种照明体系结构(可以在场景中混合延迟和前向渲染器路径)以及为此渲染启用了哪些功能。 可以禁用雾,阴影,后处理等。

      To setup scene settings, there is a whole new system based on volume settings similar to what is available for post processing. The scene settings (Sky, Sunlight cascade shadow, Screen space shadow contact etc…) can now be set per volume and the parameters can be interpolated to have a smooth transition between volume.

      要设置场景设置,有一个基于音量设置的全新系统,类似于后处理可用的设置。 现在可以按体积设置场景设置(“天空”,“阳光”级联阴影,“屏幕空间”阴影接触等),并且可以对参数进行插值以在各个体积之间进行平滑过渡。

      There is also a new option available for Sky and Fog, like height based fog or fog tinted by the sky color. And the fog affects both opaque and transparent materials.

      天空和雾还提供了一个新选项,例如基于高度的雾或由天空颜色着色的雾。 雾影响不透明和透明的材料。

      Lastly, HDRP uses a dedicated render target allocation system that avoids recurrent reallocation when resizing the screen. This avoids extra render target allocation when doing dynamic resolution for example.

      最后,HDRP使用专用的渲染目标分配系统,该系统可以在调整屏幕大小时避免重新分配。 例如,在进行动态解析时,这避免了额外的渲染目标分配。

      局限性 (Limitations)

      We are still working on HDRP, so several of its features are in progress, buggy or incomplete. It will be released as Preview with 2018.1 and it’s not ready for production.

      我们仍在开发HDRP,因此它的一些功能仍在进行中,存在错误或不完整。 它将作为预览版与2018.1一起发布,尚未准备好投入生产。

      One of the current important limitations is that HDRP isn’t compatible with Lit Particles authored with Unity’s particle system, only Unlit Particles are compatible.

      当前的重要限制之一是HDRP与Unity粒子系统创作的Lit Particles不兼容,只有Unlit Particles兼容。

      Also, the built-in terrain system has various artifacts.

      而且,内置的地形系统具有各种伪影。

      As for all SRP, anything previously rendered in the Overlay layer like lens flares on light isn’t supported. Grabpass doesn’t exist anymore.

      至于所有SRP,不支持先前在“叠加”层中渲染的任何东西,例如镜头上的光斑。 Grabpass不再存在。

      未来发展 (Future development)

      Our team currently focuses on stabilization and platform support. But there are still shiny features to come like volumetric lighting.

      我们的团队目前专注于稳定性和平台支持。 但是,仍然存在像体积照明这样的闪亮功能。

      Area lights will be improved based on the research of Unity Labs team.

      根据Unity Labs团队的研究,区域照明将得到改善。

      Physically based camera is also the next step to get more coherent lighting and postprocessing.

      基于物理的相机也是下一步,以获得更连贯的照明和后处理。

      We also have several prototypes of character rendering tools in the works.

      我们也有一些角色渲染工具的原型。

      Windup project with girl character rendering.

      与女孩角色渲染的结束项目

      结论 (Conclusion)

      HDRP is coming with a fully new render pipeline for Unity that tries to push visual quality as far as possible for the current generation of games.

      HDRP附带了一个全新的Unity渲染管道,该管道试图尽可能提高当前游戏的视觉质量。

      The downside is that there is quite a learning curve because there are significant differences from the current Built-In rendering pipeline. All these features come with complexity. Unified and coherent lighting is extremely hard to achieve, having great debugging tools can be intrusive, relying on camera relative requires more thinking.. Writing custom shaders for HDRP is possible, but it now requires way more knowledge. But the benefit is worth it!

      不利之处是学习曲线相当多,因为它与当前的“内置”渲染管道存在显着差异。 所有这些功能都具有复杂性。 统一和连贯的照明非常难实现,拥有出色的调试工具可能是侵入式的,依赖于相机的相对要求需要更多的思考。编写HDRP的自定义着色器是可能的,但是现在需要更多的知识。 但是好处是值得的!

      Join the Unity beta program to get early access to new features. You can also follow the development of HDRP on GitHub. We’re looking forward to talking to you about HDRP on the Graphics Experimental Previews section of the Unity Forums!

      加入Unity beta计划 ,尽早使用新功能。 您也可以在GitHub上关注HDRP的开发。 我们期待在Unity论坛的“ 图形实验预览”部分与您讨论HDRP!

      Example of stylized game environment with HDRP and complex materials.

      具有HDRP和复杂材质的程式化游戏环境示例。

      翻译自: https://blogs.unity3d.com/2018/03/16/the-high-definition-render-pipeline-focused-on-visual-quality/

      渲染管线

      • 0
        点赞
      • 1
        收藏
        觉得还不错? 一键收藏
      • 0
        评论

      “相关推荐”对你有帮助么?

      • 非常没帮助
      • 没帮助
      • 一般
      • 有帮助
      • 非常有帮助
      提交
      评论
      添加红包

      请填写红包祝福语或标题

      红包个数最小为10个

      红包金额最低5元

      当前余额3.43前往充值 >
      需支付:10.00
      成就一亿技术人!
      领取后你会自动成为博主和红包主的粉丝 规则
      hope_wisdom
      发出的红包
      实付
      使用余额支付
      点击重新获取
      扫码支付
      钱包余额 0

      抵扣说明:

      1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
      2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

      余额充值