[vtkusers] How to write into VTK vertex buffer object from an OpenCL kernel

Ken Martin ken.martin at kitware.com
Wed Oct 26 12:21:36 EDT 2016


The shaders can be updated ala http://www.vtk.org/Wiki/Shader_In_VTK

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.

setup input data with the right size, num points, even if the values are
dummy positions
polydatamapper->Render()
vbo = polydatamapper->GetVBO()
handle = vbo->GetHandle()

would be nice to have an example.


On Wed, Oct 26, 2016 at 10:27 AM, Reza Faieghi <mfaieghi at westerneng.ca>
wrote:

> Hello,
>
>
>
> 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.
>
>
> 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?
>
> 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?
>
>
> I would really appreciate it if you could help me with this.
>
>
>
> Best Regards,
>
> Reza Faieghi
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>


-- 
Ken Martin PhD
Chairman & CFO
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
518 371 3971

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161026/a016372e/attachment.html>


More information about the vtkusers mailing list