<div dir="ltr"><div>You might be able to scrounge some ideas from Accelerators/Piston.<br>Back then we did the direct handoff from cuda to GL via glinterop.<br><br>See: <a href="https://gitlab.kitware.com/vtk/vtk/blob/master/Accelerators/Piston/vtkPistonMapper.cu">https://gitlab.kitware.com/vtk/vtk/blob/master/Accelerators/Piston/vtkPistonMapper.cu</a><br></div><div></div><div><br>Warning that project is long deprecated and won't build with anything recent. In particular that was written before Rendering/OpenGL2 existed. <br><br>I expect that vtk-m will have an entirely revamped version of the concept when it lands in VTK in a couple of months.<br></div><div><br><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div>
<br><div class="gmail_quote">On Wed, Oct 26, 2016 at 12:21 PM, Ken Martin <span dir="ltr"><<a href="mailto:ken.martin@kitware.com" target="_blank">ken.martin@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The shaders can be updated ala <a href="http://www.vtk.org/Wiki/Shader_In_VTK" target="_blank">http://www.vtk.org/Wiki/<wbr>Shader_In_VTK</a><div><br></div><div>In terms of getting the VBO I believe it has been done, not by me. I think you have to setup your data and render it to get the VBO built. Then you can get it's handle and pass that to cuda or something like that.</div><div><br></div><div>setup input data with the right size, num points, even if the values are dummy positions</div><div>polydatamapper->Render()</div><div>vbo = polydatamapper->GetVBO()</div><div>handle = vbo->GetHandle()</div><div><br></div><div>would be nice to have an example.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Oct 26, 2016 at 10:27 AM, Reza Faieghi <span dir="ltr"><<a href="mailto:mfaieghi@westerneng.ca" target="_blank">mfaieghi@westerneng.ca</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><p class="MsoNormal">Hello,<span></span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal">My code generates a massive polygonal data through an openCL kernel. For rendering purposes, this data copies from GPU memory to host memory. Afterward, there are regular VTK codes to create an unstructured grid, passing data into the renderer and display them. However, the data transfers between device and host memories are time-consuming.<span></span></p><p class="MsoNormal"><br></p>
<p class="MsoNormal">In order to speed up the code, I want to pass the polygonal data directly from the openCL kernel to vertex buffer object. I am wondering is there any way that I can bridge between openCL and openGL part of the VTK renderer?<span></span></p>
<p class="MsoNormal">I assume that I will need to make few changes in openGL commands like glDrawArrays. I also need to make a few changes in vertex shader just to make sure that the renderer works fine with my data. Other than, the rest of shaders should remain unchanged. Is it possible to access the shaders and make the above changes?<span></span></p><p class="MsoNormal"><br></p>
<p class="MsoNormal">I would really appreciate it if you could help me with this.<span></span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal">Best Regards,<span></span></p>
<p class="MsoNormal">Reza Faieghi</p></div>
</div>
<br></div></div>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_-3390980215379522999gmail_signature" data-smartmail="gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br><a href="tel:518%20371%203971" value="+15183713971" target="_blank">518 371 3971</a><div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee. Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message.
Thank you.</span></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>