Skip to content

Commit

Permalink
deploy: c0979c0
Browse files Browse the repository at this point in the history
  • Loading branch information
FuXiii committed Oct 21, 2023
1 parent 66df94c commit 48013f5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2444,7 +2444,8 @@ <h2>15 拓展延伸<a class="headerlink" href="#id39" title="Link to this headin
<li class="toctree-l1"><a class="reference internal" href="extensions/RayQuery.html">光线查询</a><ul>
<li class="toctree-l2"><a class="reference internal" href="extensions/RayQuery.html#id4">教程</a></li>
<li class="toctree-l2"><a class="reference internal" href="extensions/RayQuery.html#id5">清除</a></li>
<li class="toctree-l2"><a class="reference internal" href="extensions/RayQuery.html#id8">片元着色器相关配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="extensions/RayQuery.html#id8">激活扩展</a></li>
<li class="toctree-l2"><a class="reference internal" href="extensions/RayQuery.html#id9">片元着色器相关配置</a></li>
</ul>
</li>
</ul>
Expand Down
24 changes: 17 additions & 7 deletions Literature/NVIDIAVulkanRayTracingTutorial/extensions/RayQuery.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,14 @@ <h1>光线查询<a class="headerlink" href="#id1" title="Link to this heading">#
<li><p class="sd-card-text">2023/10/21 增加 <code class="docutils literal notranslate"><span class="pre">着色器</span></code> 章节</p></li>
<li><p class="sd-card-text">2023/10/21 增加 <code class="docutils literal notranslate"><span class="pre">片元着色器相关配置</span></code> 章节</p></li>
<li><p class="sd-card-text">2023/10/21 增加 <code class="docutils literal notranslate"><span class="pre">片元着色器</span></code> 章节</p></li>
<li><p class="sd-card-text">2023/10/21 增加 <code class="docutils literal notranslate"><span class="pre">激活扩展</span></code> 章节</p></li>
</ul>
</div>
</details><p><a class="reference external" href="https://github.com/nvpro-samples/vk_raytracing_tutorial_KHR/tree/master/ray_tracing_rayquery">文献源</a></p>
<figure class="align-default" id="id10">
<figure class="align-default" id="id11">
<img alt="../../../_images/rayquery.png" src="../../../_images/rayquery.png" />
<figcaption>
<p><span class="caption-text">光线查询结果示意图</span><a class="headerlink" href="#id10" title="Link to this image">#</a></p>
<p><span class="caption-text">光线查询结果示意图</span><a class="headerlink" href="#id11" title="Link to this image">#</a></p>
</figcaption>
</figure>
<section id="id4">
Expand Down Expand Up @@ -322,7 +323,15 @@ <h3>着色器<a class="headerlink" href="#id7" title="Link to this heading">#</a
</section>
</section>
<section id="id8">
<h2>片元着色器相关配置<a class="headerlink" href="#id8" title="Link to this heading">#</a></h2>
<h2>激活扩展<a class="headerlink" href="#id8" title="Link to this heading">#</a></h2>
<p>在激活加速结构扩展后面增加对于 <code class="docutils literal notranslate"><span class="pre">VK_KHR_ray_query</span></code> 扩展的激活:</p>
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="n">VkPhysicalDeviceRayQueryFeaturesKHR</span><span class="w"> </span><span class="n">rayQueryFeatures</span><span class="p">{</span><span class="n">VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR</span><span class="p">};</span>
<span class="n">contextInfo</span><span class="p">.</span><span class="n">addDeviceExtension</span><span class="p">(</span><span class="n">VK_KHR_RAY_QUERY_EXTENSION_NAME</span><span class="p">,</span><span class="w"> </span><span class="nb">false</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">rayQueryFeatures</span><span class="p">);</span>
</pre></div>
</div>
</section>
<section id="id9">
<h2>片元着色器相关配置<a class="headerlink" href="#id9" title="Link to this heading">#</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">HelloVulkan::createDescriptorSetLayout</span></code> 中增加在加速结构描述符中增加片元着色器的访问配置。</p>
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="c1">// 顶层加速结构</span>
<span class="n">m_descSetLayoutBind</span><span class="p">.</span><span class="n">addBinding</span><span class="p">(</span><span class="n">eTlas</span><span class="p">,</span><span class="w"> </span><span class="n">VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="n">VK_SHADER_STAGE_FRAGMENT_BIT</span><span class="p">);</span>
Expand All @@ -343,8 +352,8 @@ <h2>片元着色器相关配置<a class="headerlink" href="#id8" title="Link to
<span class="n">writes</span><span class="p">.</span><span class="n">emplace_back</span><span class="p">(</span><span class="n">m_descSetLayoutBind</span><span class="p">.</span><span class="n">makeWrite</span><span class="p">(</span><span class="n">m_descSet</span><span class="p">,</span><span class="w"> </span><span class="n">eTlas</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">descASInfo</span><span class="p">));</span>
</pre></div>
</div>
<section id="id9">
<h3>片元着色器<a class="headerlink" href="#id9" title="Link to this heading">#</a></h3>
<section id="id10">
<h3>片元着色器<a class="headerlink" href="#id10" title="Link to this heading">#</a></h3>
<p>最后需要修改片元着色器,我们将增加光线与加速结构的相交查询用于追踪生成阴影的光线。</p>
<p>首先。着色器的版本需要升级到 <code class="docutils literal notranslate"><span class="pre">460</span></code></p>
<div class="highlight-glsl notranslate"><div class="highlight"><pre><span></span><span class="cp">#version 460</span>
Expand Down Expand Up @@ -469,8 +478,9 @@ <h3>片元着色器<a class="headerlink" href="#id9" title="Link to this heading
<li><a class="reference internal" href="#id7">着色器</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id8">片元着色器相关配置</a><ul>
<li><a class="reference internal" href="#id9">片元着色器</a></li>
<li><a class="reference internal" href="#id8">激活扩展</a></li>
<li><a class="reference internal" href="#id9">片元着色器相关配置</a><ul>
<li><a class="reference internal" href="#id10">片元着色器</a></li>
</ul>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* 2023/10/21 增加 ``着色器`` 章节
* 2023/10/21 增加 ``片元着色器相关配置`` 章节
* 2023/10/21 增加 ``片元着色器`` 章节
* 2023/10/21 增加 ``激活扩展`` 章节

`文献源`_

Expand Down Expand Up @@ -67,6 +68,16 @@ hello_vulkan (源文件)

您可以直接移除所有名为 ``raytrace.*`` 的着色器。

激活扩展
####################

在激活加速结构扩展后面增加对于 ``VK_KHR_ray_query`` 扩展的激活:

.. code:: c++

VkPhysicalDeviceRayQueryFeaturesKHR rayQueryFeatures{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR};
contextInfo.addDeviceExtension(VK_KHR_RAY_QUERY_EXTENSION_NAME, false, &rayQueryFeatures);

片元着色器相关配置
####################

Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 48013f5

Please sign in to comment.