赞
踩
渲染光线追踪
Along with package 7.2.0 of the High Definition Render Pipeline (HDRP), we’re delivering a preview version of real-time ray tracing.
连同 高清渲染管道 (HDRP)的 7.2.0软件包一起 ,我们将提供实时射线追踪的预览版。
HDRP is used for creating high-definition and photorealistic visuals. The render pipeline is out of Preview starting with package version 7.2.0 in 2019.3 and Unity version 2019.3.2f1 (required for real-time ray tracing). You can find more details about HDRP here, but this blog post will focus specifically on the ray tracing features that HDRP offers.
HDRP用于创建高清和逼真的视觉效果。 从2019.3中的7.2.0版和Unity 2019.3.2f1版( 实时光线跟踪 所需)开始,渲染管道已退出Preview版本 。 您可以 在此处 找到有关HDRP的更多详细信息 ,但此博客文章将特别关注HDRP提供的光线跟踪功能。
HDRP follows physically based rendering rules, but it has limitations in its lighting processing due to the nature of the rasterization pipeline. Real-time ray tracing allows you to unlock greater visual fidelity since it doesn’t have the same visibility issues related to screen space approximation use in HDRP. It also allows you to avoid relying on pre-baking steps for lighting, which improves artists’ workflows.
HDRP遵循基于物理的渲染规则,但是由于光栅化管道的性质,其在光照处理方面存在局限性。 实时光线追踪使您可以释放更大的视觉保真度,因为它不存在与HDRP中使用的屏幕空间近似相关的可见性问题。 它还使您可以避免依赖预烘烤步骤进行照明,从而改善了艺术家的工作流程。
There are two different uses of ray tracing in HDRP:
HDRP中有两种不同的射线跟踪用法:
A mix of real-time ray tracing techniques and rasterization, which we call the hybrid pipeline
实时射线追踪技术和光栅化的混合,我们称之为混合管线
A progressive path tracer
渐进路径跟踪器
The hybrid pipeline targets real-time applications. It relies on standard rasterization techniques – specifically, the HDRP pipeline – but it allows you to replace various effects with a ray-traced version. This increases the final image quality since ray tracing doesn’t suffer from the screen space approximation issues or other hard-to-solve problems that accompany the rasterization approach.
混合管道针对实时应用程序。 它依赖于标准的栅格化技术,特别是HDRP管道,但是它允许您使用光线跟踪的版本替换各种效果。 由于光线跟踪不会受到屏幕空间逼近问题或光栅化方法所带来的其他难以解决的问题的困扰,因此可以提高最终图像质量。
The effects that support ray tracing have a corresponding ray tracing effects setting in HDRP. It is controlled either with a ray tracing flag on an existing effect or a new volume setting dedicated to it. The following section outlines the ray tracing effects available in HDRP. These effects are compatible with Lit.shader, Unlit.shader, and LayeredLit.shader, as well as the Shader Graph versions of Unlit, Lit and Fabric.
支持光线 跟踪的效果 在HDRP中 具有相应的 光线跟踪效果 设置。 它可以通过现有效果上的光线跟踪标记或专用于它的新音量设置来控制。 以下部分概述了HDRP中可用的光线跟踪效果。 这些效果与Lit.shader,Unlit.shader和LayeredLit.shader以及Unlit,Lit和Fabric的Shader Graph版本兼容。
HDRP offers several options for reflections: Screen Space Reflection, Reflection Probe, Planar reflection, and Sky reflection. Ray Traced Reflection adds a new choice to this list with higher visual fidelity. It’s accessible through the Screen Space Reflection volume component.
HDRP提供了几种反射选项:“屏幕空间反射”,“反射探针”,“平面反射”和“天空反射”。 光线追踪反射以更高的视觉保真度为该列表添加了新选择。 可通过“屏幕空间反射”体积组件进行访问。
Screen Space Ambient Occlusion (SSAO) is a great trick to simulate the complexity of indirect lighting in a scene. SSAO gives strong results, but it relies entirely on the data available onscreen, so it can have visible limitations that can be improved by its ray tracing variant: Ray Traced Ambient Occlusion. This feature is available through the Ambient Occlusion volume component.
屏幕空间环境光遮蔽(SSAO)是模拟场景中间接照明的复杂性的绝妙技巧。 SSAO给出了很强的结果,但是它完全依赖于屏幕上可用的数据,因此它可以具有可见的局限性,可以通过其射线跟踪变体(射线跟踪环境光遮挡)来改善它。 可通过“环境光遮挡”体积组件使用此功能。
Ray Traced Shadows can replace regular shadows in HDRP. This setup has a few advantages: in addition to avoiding any issues related to shadow map resolution and bias, Ray Traced Shadows allow you to control the shadow penumbra (Point, Spot and Directional), and they support colored (Directional) or semi-transparent shadows (Point and Spot). View-dependent shadows for rectangular light are also supported. These options are available on the lights themselves.
光线跟踪阴影可以替换HDRP中的常规阴影。 此设置具有一些优点:除了避免与阴影贴图分辨率和偏差有关的任何问题外,“光线跟踪阴影”还允许您控制阴影半影(“点”,“点”和“定向”),并且它们支持彩色(定向)或半透明阴影(点和点)。 还支持矩形光的与视图相关的阴影。 这些选项在灯本身上可用。
Sometimes shadow maps have trouble capturing details, such as the contact between an object and its occluder due to low-resolution render targets or various bias issues. HDRP offers an option to improve this situation without increasing the shadow map resolution, called Contact Shadows. Contact Shadows rely on ray marching of the depth buffer, which can cause some screen space artifacts to display. Using Ray Traced Contact Shadows instead avoids the appearance of these artifacts. This option is available on the lights themselves.
有时,阴影贴图难以捕获细节,例如由于分辨率较低的渲染目标或各种偏差问题而导致的对象与其遮挡物之间的接触。 HDRP提供了一种在不增加阴影贴图分辨率的情况下改善这种情况的选项,称为“接触阴影”。 接触阴影依赖于深度缓冲区的光线行进,这会导致显示某些屏幕空间伪像。 相反,使用射线跟踪接触阴影可以避免这些伪像的出现。 该选项在灯本身上可用。
Rendering multiple layers of refractive transparent materials can be a tricky thing to do with the rasterization pipeline. HDRP only offers the option of a single refractive interface, and ray tracing offers an accurate way to do it. The Recursive Rendering volume component allows you to perform multiple reflections and refractions for transparent objects. It requires that the object’s material uses the ray-tracing setting in Rendering Pass.
渲染多层折射透明材料对于光栅化管线可能是一件棘手的事情。 HDRP仅提供单个折射界面的选项,而光线追踪则提供了一种精确的方法。 使用“递归渲染”体积组件,可以对透明对象执行多次反射和折射。 它要求对象的材质使用 Rendering Pass中 的光线跟踪 设置 。
Translucent surface rendering is a very complex problem that has only partially been solved in HDRP. The volume component Subsurface Scattering allows you to enable ray tracing to simulate this effect.
半透明表面渲染是一个非常复杂的问题,在HDRP中仅得到部分解决。 体积分量“次表面散射”使您能够启用光线跟踪以模拟这种效果。
Real-time ray tracing is very intensive in GPU usage. Each ray has a cost that needs to be considered in the final frame rate of the application. With the current state of hardware, enabling all of these ray tracing effects at the same time will result in a slow frame rate. We recommend choosing which effects to enable with care. For games in particular, it’s advisable to enable only one or two effects at a time to avoid excessively high frame time.
实时光线跟踪在GPU使用中非常密集。 每条射线的成本都需要在应用程序的最终帧速率中考虑。 使用当前的硬件状态,同时启用所有这些光线跟踪效果将导致帧速率降低。 我们建议谨慎选择要启用的效果。 特别是对于游戏,建议一次仅启用一种或两种效果,以避免过长的帧时间。
For many ray tracing effects, HDRP offers two modes: Quality and Performance.
对于许多光线跟踪效果,HDRP提供两种模式:质量和性能。
There are additional options available depending on the chosen mode. Quality usually allows multiple bounce options for lighting effects (such as Reflection or Global Illumination) and uses less approximation in the shading model, which can increase graphic fidelity but is more GPU-intensive. For these reasons, this setting is not recommended for games. Performance is the mode to use when targeting game frame rate, applying complex optimizations under the hood. You can learn more about the details of optimization performance in the talk “Leveraging Real-time Ray Tracing To Build A Hybrid Game Engine,” presented at SIGGRAPH 2019. Some effects don’t offer choices in mode settings because they only support Quality mode, such as the Recursive Rendering effect.
根据所选模式,还有其他选项可用。 质量 通常会为照明效果(例如“反射”或“全局照明”)提供多个反射选项,并在阴影模型中使用较少的逼近度,这可以提高图形保真度,但会占用更多GPU。 由于这些原因,不建议在游戏中使用此设置。 性能 是目标游戏帧速率时使用的模式,在后台进行复杂的优化。 您可以 在SIGGRAPH 2019上发表 的演讲“ 利用实时光线追踪来构建混合游戏引擎 ”中 了解有关优化性能的详细信息。 某些效果在模式设置中无法提供选择,因为它们仅支持质量模式,例如“递归渲染”效果。
Ray Traced Global Illumination and Recursive Rendering aren’t recommended for a high frame rate target because they are quite expensive. It is useful to generate reference screenshots. You should also use the Ray Trace Subsurface Scattering feature economically, as its cost can increase quickly.
对于高帧频目标,建议不要使用光线跟踪的全局照明和递归渲染,因为它们非常昂贵。 生成参考屏幕截图很有用。 您还应该经济地使用“光线跟踪次表面散射”功能,因为它的成本会Swift增加。
For games, it is recommended to restrict ray traced effects to Shadow, Contact Shadow, Ambient Occlusion, and reflections in Performance mode. Other effects can be used for interactive non-game applications in Performance mode when they are available, while any effects without a Performance mode setting should be used sparingly to stay in real-time.
对于游戏,建议在“性能”模式下将光线跟踪效果限制为“阴影”,“接触阴影”,“环境光遮挡”和“反射”。 其他效果可以在“性能”模式下用于交互式非游戏应用程序(如果可用),而没有“性能”模式设置的任何效果都应谨慎使用以保持实时。
Another option to help with performance is reducing the amount of work that occurs while performing ray tracing effects. The Shader Graph comes with a dedicated node for ray tracing that allows you to lower the cost of a material when it is rendered with ray tracing.
有助于提高性能的另一种方法是减少执行光线跟踪效果时发生的工作量。 Shader Graph带有一个专用于光线追踪的节点,当您使用光线追踪渲染材质时,它可以降低材料的成本。
The progressive path tracer pipeline targets high-quality image rendering, often for interactive applications. Unlike the hybrid pipeline, it doesn’t rely on the rasterization pipeline for shading, but it still does for post-processing. Lighting in this mode is very accurate, similar to what can be achieved in the movie industry, but it requires some time to be processed. As such, this method generates a noisy image for a few frames until the image converges to its final result.
渐进路径跟踪程序管道通常针对交互式应用程序,以高质量图像渲染为目标。 与混合流水线不同,它不依赖栅格化流水线进行着色,但仍然进行后处理。 此模式下的照明非常准确,类似于电影行业中可以实现的照明,但是需要一些时间来处理。 这样,此方法会生成几帧的噪点图像,直到图像收敛到其最终结果为止。
A Path Tracing volume component is available and replaces any other ray tracing or regular pipeline effect in the HDRP when enabled. This can also be useful to produce a reference comparison.
启用了“路径跟踪”体积组件,它将替换HDRP中的任何其他光线跟踪或常规管道效果。 这对于进行参考比较也很有用。
Progressive rendering of the frame with Path tracer
使用路径跟踪器逐步渲染框架
Final result after full convergence of the image
图像完全融合后的最终结果
Ray tracing in HDRP 7.2.0 is in Preview. It relies on DX12 and DXR low-level APIs that are both in Preview in Unity 2019.3.2f1 and are thus missing some functionality. Ray tracing in Preview means that some functionalities, user interfaces, performance, tools, and data formats could evolve with new versions, and data migration isn’t guaranteed. It is not recommended to use Preview features in production.
HDRP 7.2.0中的光线跟踪位于“预览”中。 它依赖于DX12和DXR低级API,它们都在Unity 2019.3.2f1中的Preview中,因此缺少某些功能。 预览中的光线跟踪意味着某些功能,用户界面,性能,工具和数据格式可能随新版本一起发展,并且不能保证数据迁移。 不建议在生产中使用预览功能。
HDRP ray tracing in Unity 2019.3 has the following limitations:
Unity 2019.3中的HDRP射线跟踪具有以下限制:
There is no support for ray tracing on platforms other than DX12, where only D3D12_RAYTRACING_TIER 1.0 is supported.
除DX12之外,在仅 支持D3D12_RAYTRACING_TIER 1.0的 平台上不支持射线跟踪 。
It does not support deformers (skin, vertex animation).
它不支持变形器(皮肤,顶点动画)。
It does not support VFX and Terrain.
它不支持VFX和Terrain。
It does not support several of HDRP’s materials, includingHair, StackLit, Eye, and AxF materials.
它不支持多种HDRP材料,包括头发,StackLit,Eye和AxF材料。
It does not have correct culling for shadows. It uses frustum culling instead.
它没有正确剔除阴影。 相反,它使用视锥剔除。
Full ray tracing hardware acceleration is available on following GPUs:
以下GPU提供了全光线跟踪硬件加速:
NVIDIA GeForce RTX 2060, RTX 2080 Super, RTX 2070, RTX 2070 Super, RTX 2080, RTX 2080 Super, RTX 2080 Ti
NVIDIA GeForce RTX 2060,RTX 2080超级,RTX 2070,RTX 2070超级,RTX 2080,RTX 2080超级,RTX 2080 Ti
NVIDIA TITAN RTX
NVIDIA TITAN RTX
NVIDIA Quadro RTX 3000 (laptop only), RTX 4000, RTX 5000, RTX 6000, RTX 8000
NVIDIA Quadro RTX 3000(仅限笔记本电脑),RTX 4000,RTX 5000,RTX 6000,RTX 8000
NVIDIA also provides a ray tracing fallback for some previous generation graphics cards:
NVIDIA还为某些上一代显卡提供了光线追踪回退:
NVIDIA GeForce GTX
NVIDIA GeForce GTX
Pascal generation: GTX 1060, GTX 1070, GTX 1080, GTX 1080 Ti
帕斯卡一代:GTX 1060,GTX 1070,GTX 1080,GTX 1080 Ti
NVIDIA GeForce GTX
NVIDIA GeForce GTX
NVIDIA TITAN V
NVIDIA TITAN V
NVIDIA Quadro: P4000, P5000, P6000, V100
NVIDIA Quadro:P4000,P5000,P6000,V100
If your computer has one of these graphics cards, it can run ray tracing in Unity. Before you open Unity, make sure to update your NVIDIA drivers to the latest version. Use NVIDIA Quadro or Studio Drivers for the optimal creation experience, and make sure that your Windows version is at least 1809.
如果您的计算机装有这些图形卡之一,则可以在Unity中运行光线跟踪。 打开Unity之前,请确保将NVIDIA驱动程序更新为最新版本。 使用 NVIDIA Quadro或Studio驱动程序 以获得最佳的创建体验,并确保Windows版本至少为1809。
To get started with HDRP ray tracing, check out the introductory documentation. It includes a detailed explanation of all of the ray tracing effects that were mentioned in this post.
要开始使用HDRP射线跟踪,请查看介绍性 文档 。 它包括这篇文章中提到的所有射线追踪效果的详细说明。
The best and simplest way to get started with ray tracing in HDRP is to explore the sample project provided, called SmallOfficeRayTracing. It is already set up for ray tracing, with effects enabled and configured properly, and it’s available here.
在HDRP中开始光线追踪的最好,最简单的方法是浏览提供的示例项目,称为 SmallOfficeRayTracing 。 已经为光线跟踪设置了它,并且启用并正确配置了效果,并且可以 在此处使用 。
In the sample project, three scenes are available, and they exhibit three different use cases of real-time ray tracing.
在示例项目中,可以使用三个场景,它们展示了实时光线跟踪的三个不同用例。
Ray Tracing Performance Scene
光线追踪表演场景
This scene is set up to have several ray-tracing effects enabled with good performance in mind (~60 fps on an Nvidia 2080). The following effects are enabled:
该场景设置为具有多种光线跟踪效果,并具有良好的性能(在Nvidia 2080上约为60 fps)。 启用了以下效果:
Ray Traced Reflections
光线追踪反射
Ray Traced Global Illumination
光线追踪的全局照明
Ray Traced Directional Shadow
射线追踪的定向阴影
Ray Traced Area Light Stochastic Shadow
光线追踪区域光随机阴影
Ray Traced Ambient Occlusion
光线追踪环境光遮挡
Ray Tracing Quality Scene
光线追踪质量场景
This scene contains the same effects as the Performance scene with one additional effect, Recursive Rendering. These effects are configured with Quality mode (when this mode is available), and this increases the number of bounce for reflection.
该场景包含与“表演”场景相同的效果,并带有一个附加效果,即“递归渲染”。 这些效果是使用“质量”模式配置的(当此模式可用时),这会增加反射的反射次数。
Ray Tracing Path Tracing Scene
光线追踪路径追踪场景
This scene is set up to be rendered using the progressive path tracer.
该场景设置为使用渐进路径跟踪器进行渲染。
To help you on your journey when starting a new project from scratch and ensure that you have the right setup for your ray tracing, we offer an HDRP Wizard. The Wizard validates your settings in the HDRP + DXR tab and can fix them if they are incorrect.
为了帮助您从头开始新项目,并确保您具有正确的光线跟踪设置,我们提供了HDRP向导 。 该向导会在HDRP + DXR选项卡中验证您的设置,如果设置不正确,则可以对其进行修复。
Otherwise, to manually set up ray tracing projects, please refer to Unity’s documentation.
否则,要手动设置光线跟踪项目,请参考 Unity的文档 。
Future development for real-time ray tracing includes more support for
实时光线跟踪的未来发展包括对以下内容的更多支持:
HDRP materials (StackLit, Hair, etc.)
HDRP材料(StackLit,Hair等)
Geometry (Terrain, Particles, etc.)
几何(地形,粒子等)
Virtual Reality
虚拟现实
Better fallback to get improved scalability between configurations
更好的回退以提高配置之间的可伸缩性
In Unity 2020.1, skinning, blend shape, and alembic deformation are supported.
在Unity 2020.1中,支持蒙皮,混合形状和Alembic变形。
You can start taking advantage of HDRP ray tracing in your projects today – but remember, this feature is not yet production-ready. You can also refer to presentations by the Unity team at events such as Unite, SIGGRAPH or GDC and our blog posts Reality vs lllusion and Ray Tracing – What does it mean for you? There is a starter presentation from SIGGRAPH, and if you want to go deeper and learn more about the architecture of HDRP ray tracing, you can watch the talk Leveraging Ray Tracing Hardware Acceleration In The Unity Game Engine.
您现在可以在项目中开始使用HDRP射线追踪功能-但是请记住,此功能尚未投入生产。 您还可以参考Unity团队在Unite,SIGGRAPH或GDC等活动上的演讲,以及我们的博客文章 Reality vs lllusion 和 Ray Tracing –对您来说意味着什么 ? SIGGRAPH 有一个 入门演示 ,如果您想更深入地了解HDRP射线跟踪的体系结构,可以观看有关 在Unity Game Engine中利用射线跟踪硬件加速 的演讲 。
Our team is just getting started, and development continues. Please share any feedback about your experience in the HDRP RayTracing forum!
我们的团队才刚刚起步,并且发展仍在继续。 请在 HDRP RayTracing论坛中 分享有关您的体验的任何反馈 !
渲染光线追踪
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。