<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>The RTX examples I found (like <a moz-do-not-send="true"
        href="https://iorange.github.io/p01/HappyTriangle.html">https://iorange.github.io/p01/HappyTriangle.html</a>)
      use a VK command (similar to a compute dispatch) to trigger the
      ray tracing:</p>
    <div class="language-c++ highlighter-rouge">
      <div class="highlight">
        <pre class="highlight"><code><span class="kt">void</span> <span class="n">vkCmdTraceRaysNVX</span><span class="p">(</span><span class="n">VkCommandBuffer</span> <span class="n">commandBuffer</span><span class="p">,</span>
                       <span class="n">VkBuffer</span>        <span class="n">raygenShaderBindingTableBuffer</span><span class="p">,</span>
                       <span class="n">VkDeviceSize</span>    <span class="n">raygenShaderBindingOffset</span><span class="p">,</span>
                       <span class="n">VkBuffer</span>        <span class="n">missShaderBindingTableBuffer</span><span class="p">,</span>
                       <span class="n">VkDeviceSize</span>    <span class="n">missShaderBindingOffset</span><span class="p">,</span>
                       <span class="n">VkDeviceSize</span>    <span class="n">missShaderBindingStride</span><span class="p">,</span>
                       <span class="n">VkBuffer</span>        <span class="n">hitShaderBindingTableBuffer</span><span class="p">,</span>
                       <span class="n">VkDeviceSize</span>    <span class="n">hitShaderBindingOffset</span><span class="p">,</span>
                       <span class="n">VkDeviceSize</span>    <span class="n">hitShaderBindingStride</span><span class="p">,</span>
                       <span class="kt">uint32_t</span>        <span class="n">width</span><span class="p">,</span>
                       <span class="kt">uint32_t</span>        <span class="n">height</span><span class="p">);</span>


</code></pre>
      </div>
    </div>
    <p>This function posts the ray tracing command to a VK command
      queue. Finally, the main ray tracing shader "stores" the ray
      tracing result in an image using imageStore.</p>
    <p>I don't know about mixing an OpenGL context and the VK
      counterpart (device, physical device, command queue, images...).
      It is maybe possible but like the CUDA /GL interoperability, it
      may require expansive synchronization mechanisms.</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 21/02/2019 15:19, Chris Hanson
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAGoufmbQMfp7kXhLxDcykgcHQtTJ4xkNtQ7jC6E5AKkVse6kjg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">So, you'd need a shared GL/Vk context in order to
        Vk load the data and then GL trace it, if I understand
        correctly?
        <div><br>
        </div>
        <div>We could probably bring VSG into play to load the data. I
          think there's enough working code there already to do so. Or,
          really, we could just us what VSG has already and compose and
          execute the RTX commands without OSG, but copying
          already-composed scene data over from the OSG side.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Thu, Feb 21, 2019 at 3:15
          PM Lionel Lagarde <<a
            href="mailto:lionel.lagarde@oktal-se.fr"
            moz-do-not-send="true">lionel.lagarde@oktal-se.fr</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div bgcolor="#FFFFFF">
            <p>Hi, <br>
            </p>
            <p> It is a GLSL extension, the ray tracing functions use
              some input data (like the acceleration structure) that can
              only be constructed and uploaded using the vk API.</p>
            <p><br>
            </p>
            <div class="gmail-m_8137870979081223599moz-cite-prefix">On
              21/02/2019 13:34, Chris Hanson wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">One of my guys pointed out this recent
                addition:<br>
                <br>
                <a
href="https://github.com/KhronosGroup/GLSL/blob/master/extensions/nv/GLSL_NV_ray_tracing.txt"
                  target="_blank" moz-do-not-send="true">https://github.com/KhronosGroup/GLSL/blob/master/extensions/nv/GLSL_NV_ray_tracing.txt</a>  <br>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Wed, Feb 20, 2019
                  at 9:47 PM Chris Hanson <<a
                    href="mailto:xenon@alphapixel.com" target="_blank"
                    moz-do-not-send="true">xenon@alphapixel.com</a>>
                  wrote:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">
                  <div dir="ltr"><br>
                    Well, I was wondering if there was an OpenGL RTX API
                    anywhere, but it doesn't seem there is.
                    <div><br>
                    </div>
                    <div>Vulkan would appear to be the way to go for the
                      future, but since that's not ready for the oven
                      yet (don't even have all the mise en place), it
                      might be we just have to make a utility library to
                      shovel OSG data into OptiX and let it do the work
                      for now. There's always going to have to be some
                      kind of bridge from OSG to either Vulkan or
                      something else if no OpenGL support extension ever
                      appears.</div>
                  </div>
                </blockquote>
              </div>
              <br clear="all">
              <div><br>
              </div>
              -- <br>
              <div dir="ltr"
                class="gmail-m_8137870979081223599gmail_signature">
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div dir="ltr">
                        <div style="text-align:center">Chris 'Xenon'
                          Hanson, omo sanza lettere. <a
                            class="gmail-m_8137870979081223599moz-txt-link-abbreviated"
                            href="mailto:Xenon@AlphaPixel.com"
                            target="_blank" moz-do-not-send="true">Xenon@AlphaPixel.com</a>
                          <a href="http://www.alphapixel.com/"
                            target="_blank" moz-do-not-send="true">http://www.alphapixel.com/</a></div>
                        <div style="text-align:center">Training •
                          Consulting • Contracting</div>
                        <div style="text-align:center">3D • Scene Graphs
                          (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 •
                          OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 •
                          OpenCL</div>
                        <div style="text-align:center"><span
                            style="font-size:12.8px">Legal/IP •</span><span
                            style="font-size:12.8px"> </span><span
                            style="font-size:12.8px">Forensics •</span><span
                            style="font-size:12.8px"> </span>Imaging <span
                            style="font-size:12.8px">•</span><span
                            style="font-size:12.8px"> </span><span
                            style="font-size:12.8px">UAVs </span><span
                            style="font-size:12.8px">• GIS • GPS •
                            osgEarth • Terrain • Telemetry •
                            Cryptography • LIDAR • Embedded • Mobile •
                            iPhone/iPad/iOS • Android</span></div>
                        <div style="text-align:center"><a
                            href="https://twitter.com/alphapixel"
                            target="_blank" moz-do-not-send="true">@alphapixel</a>
                          <a href="http://facebook.com/alphapixel"
                            target="_blank" moz-do-not-send="true">facebook.com/alphapixel</a> (775)
                          623-PIXL [7495]<br>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <br>
              <fieldset
                class="gmail-m_8137870979081223599mimeAttachmentHeader"></fieldset>
              <pre class="gmail-m_8137870979081223599moz-quote-pre">_______________________________________________
osg-users mailing list
<a class="gmail-m_8137870979081223599moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org" target="_blank" moz-do-not-send="true">osg-users@lists.openscenegraph.org</a>
<a class="gmail-m_8137870979081223599moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank" moz-do-not-send="true">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
            </blockquote>
          </div>
          _______________________________________________<br>
          osg-users mailing list<br>
          <a href="mailto:osg-users@lists.openscenegraph.org"
            target="_blank" moz-do-not-send="true">osg-users@lists.openscenegraph.org</a><br>
          <a
href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org"
            rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
        </blockquote>
      </div>
      <br clear="all">
      <div><br>
      </div>
      -- <br>
      <div dir="ltr" class="gmail_signature">
        <div dir="ltr">
          <div>
            <div dir="ltr">
              <div dir="ltr">
                <div style="text-align:center">Chris 'Xenon' Hanson, omo
                  sanza lettere. <a class="moz-txt-link-abbreviated" href="mailto:Xenon@AlphaPixel.com">Xenon@AlphaPixel.com</a> <a
                    href="http://www.alphapixel.com/" target="_blank"
                    moz-do-not-send="true">http://www.alphapixel.com/</a></div>
                <div style="text-align:center">Training • Consulting •
                  Contracting</div>
                <div style="text-align:center">3D • Scene Graphs (Open
                  Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
                  GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL</div>
                <div style="text-align:center"><span
                    style="font-size:12.8px">Legal/IP •</span><span
                    style="font-size:12.8px"> </span><span
                    style="font-size:12.8px">Forensics •</span><span
                    style="font-size:12.8px"> </span>Imaging <span
                    style="font-size:12.8px">•</span><span
                    style="font-size:12.8px"> </span><span
                    style="font-size:12.8px">UAVs </span><span
                    style="font-size:12.8px">• GIS • GPS •
                    osgEarth • Terrain • Telemetry • Cryptography •
                    LIDAR • Embedded • Mobile • iPhone/iPad/iOS •
                    Android</span></div>
                <div style="text-align:center"><a
                    href="https://twitter.com/alphapixel"
                    target="_blank" moz-do-not-send="true">@alphapixel</a>
                  <a href="http://facebook.com/alphapixel"
                    target="_blank" moz-do-not-send="true">facebook.com/alphapixel</a> (775)
                  623-PIXL [7495]<br>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
osg-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
    </blockquote>
  </body>
</html>