5 光线追踪性能比较

所有现代 API 现在都支持光线追踪。它可在 Windows(D3D12 和 VK)、Linux (VK) 和 macOS (Metal) 上使用。D3D12 和 VK 光线追踪没有区别。Metal API 仅支持光线查询,D3D12 和 VK API 也支持光线查询。主要的光线追踪概念是为几何体创建 BLAS 并将所有几何体组合在单个 TLAS 内。司机对引擎盖下的一切负责。

通过简单的修改,我们的测试应用程序就可以在光线追踪 (RT)、光线查询 (RQ) 和计算着色器 (CS) 渲染模式下工作。我们将渲染 490K 三角形的 81 个相同实例。但这一次,根本不会进行光栅化。每个像素将始终追踪主光线、阴影光线和反射光线。

简单的计算着色器光线查询模式将使用我们的通用 GPU BVH 构建器,每个叶子分区有一个三角形。每个BVH节点消耗12字节。整个模型需要 45 MB BVH 缓冲区。对于光栅化,该模型需要 13 MB 用于 32 字节顶点和 32 位索引缓冲区。

我们先看一下1600×900分辨率的结果:

实时D3D12RT VKRQ D3D12RQVK需求量MTL质量控制系统BLAS尺寸BLAS构建
英伟达精视30800.58毫秒0.54 毫秒0.60毫秒0.55毫秒4.92 毫秒33 MB (15 MB)7 毫秒(18 毫秒)
GeForce 2080 钛1.06 毫秒1.03毫秒0.95毫秒0.97 毫秒7.35 毫秒33 MB (15 MB)7 毫秒(18 毫秒)
英伟达精视1060M34.59 毫秒33.81 毫秒43 MB (37 MB)7 毫秒(18 毫秒)
Radeon 6700 XT2.50 毫秒2.55 毫秒1.71 毫秒2.06 毫秒6.13 毫秒76 MB (65 MB)15 毫秒(> 500 毫秒)
Radeon Vega 56 (macOS)15.84 毫秒15.48 毫秒82MB30毫秒
苹果 M1 (macOS)48.8 毫秒46.4 毫秒82MB100毫秒
苹果 A14(iOS)98.0 毫秒94.3 毫秒82MB
肾上腺素 660(安卓)431 毫秒
  • Nvidia RTX 系列 GPU 具有最佳性能,Ray 查询速度稍快。最棒的是,压缩后的 BLAS 大小仅为 15 MB,这比光栅化的模型表示大几 MB。计算着色器光线追踪比硬件加速慢 7.7 倍。
  • AMD 光线查询 (D3D12) 和光线追踪 (VK) 之间存在 50% 的差异。看起来该驱动程序仅针对 D3D12 光线查询进行了优化。硬件光线追踪比计算着色器实现快 3.5 倍。但主要问题是 BLAS 的大小比其所能容纳的大四倍多。此外,即使启用了快速构建标志,第一代 BLAS 的速度也慢得令人痛苦。
  • 有趣的事实:计算着色器光线追踪在 AMD 上比在 Nvidia 上更快。
  • Metal 上没有硬件光线追踪。当前的实现比简单的计算着色器慢。BLAS 还需要两倍的内存量。有些三角形不相交,因此模型在所有硬件上渲染期间都有
  • 被动冷却的 Apple M1 仅比 GeForce 1060M GPU 慢 33%。
  • 顶点缓存优化也提高了光线追踪性能。

现在,原生 4K 怎么样?

实时D3D12RT VKRQ D3D12RQVK质量控制系统
英伟达精视30803.16 毫秒3.13 毫秒3.25毫秒3.13 毫秒21.00 毫秒
GeForce 2080 钛4.78 毫秒4.77 毫秒4.92 毫秒4.86 毫秒32.21 毫秒
Radeon 6700 XT12.89 毫秒13.35 毫秒8.48 毫秒9.77 毫秒27.94 毫秒
  • AMD 显示光线查询和光线追踪管道之间存在 65% 的差异。AMD 的选择是显而易见的。
  • 对于 Nvidia 来说,使用光线追踪比光线查询更好,但差异只有 3%。
  • 最好的 Radeon 6700 XT 光线查询性能比 GeForce 2080 Ti 慢 70%。最大差距为280%。

有趣的是,拥有更多光线追踪核心的 AMD 将如何表现。AMD 的主要问题是加速结构的大小及其构建时间。特别是对于具有数千个实例的动态 TLAS。

这是计算着色器光线追踪的图像和热图图像。红色通道表示按 128 缩放的 BLAS BVH 相交步骤数。计算着色器光线追踪的主要瓶颈是 Ray-BVH 相交,由于发散和分散的内存访问,无法很好地优化该相交。相比之下,体积-BVH 交集在计算着色器上表现出色。但不幸的是,我们无法将硬件(API)光线追踪加速结构重复用于不同的目的。

更多信息请访问https://www.51garena.com

21 评论

  1. You could definitely see your expertise in the work
    you write. The sector hopes for even more passionate writers like you who are not afraid to mention how they
    believe. At all times go after your heart.

  2. I’m really impressed with your writing skills as well as with the layout on your blog.
    Is this a paid theme or did you modify it yourself?
    Anyway keep up the excellent quality writing, it is
    rare to see a great blog like this one nowadays.

  3. I think this is one of the most significant info for me.
    And i am glad reading your article. But want to
    remark on some general things, The site style is
    perfect, the articles is really great : D. Good job, cheers

  4. We are a bunch of volunteers and opening a brand new scheme in our community.
    Your site provided us with valuable info to work on. You have
    performed a formidable process and our whole group will likely be grateful to you.

  5. Heya this is kind of of off topic but I was wanting to know if
    blogs use WYSIWYG editors or if you have to manually code with HTML.

    I’m starting a blog soon but have no coding knowledge so I wanted to
    get advice from someone with experience. Any help would
    be enormously appreciated!

  6. Just desire to say your article is as astounding. The clearness on your submit is simply spectacular
    and i can suppose you’re an expert in this subject. Well together
    with your permission let me to snatch your feed to keep updated with forthcoming post.
    Thank you 1,000,000 and please continue the enjoyable work.

  7. I’m really loving the theme/design of your web site.
    Do you ever run into any browser compatibility issues?
    A small number of my blog audience have complained about
    my site not operating correctly in Explorer but looks great in Chrome.
    Do you have any tips to help fix this issue?

  8. Can I simply just say what a relief to find somebody who really
    knows what they are discussing on the web.
    You actually understand how to bring a problem to light and make it important.
    A lot more people must check this out and understand this side of the
    story. It’s surprising you are not more popular given that you certainly have the gift.

  9. First off I want to say awesome blog! I had a quick question in which I’d like to ask if you do not mind.

    I was interested to know how you center yourself and clear
    your thoughts before writing. I’ve had difficulty clearing my mind in getting my ideas out.
    I do take pleasure in writing however it just seems like the first 10 to 15
    minutes are generally wasted simply just trying to figure out how to begin.
    Any recommendations or hints? Thanks!

  10. Hi there! This article could not be written any better!
    Going through this post reminds me of my previous roommate!
    He always kept preaching about this. I’ll forward this
    article to him. Fairly certain he’ll have a great read.
    I appreciate you for sharing!

  11. Great post. I was checking continuously this blog and I’m impressed!
    Extremely useful info specially the last part :
    ) I care for such info much. I was looking for this
    particular info for a very long time. Thank you and good
    luck.

留下评论

您的邮箱地址不会被公开。 必填项已用 * 标注