[vtkusers] Using an OpenGL texture in VTK

Hamza Chouh hchouh at gmail.com
Thu Sep 3 07:12:38 EDT 2015


Just compiled VTK with OpenGL2 backend.

The vtkTextureObject class looks to be the one I need but I don't
understand the way it works. According to the documentation, it is a way to
create a VTK texture while using already loaded data. Which is exactly what
I need but I have questions:

   1. How do I properly initialize such a texture?
   2. How do I get the OpenGL texture ID from a vtkTextureObject?
   3. How should I link it to a vtkActor?

Anyway, if there was a good example of vtkTextureObject use, it would
greatly help me.

To answer your question about my need in terms of interoperability: I am
generating data on the GPU memory using CUDA. I have no problem setting
this data inside an OpenGL texture to display it inside an OpenGL context.
However, I need to be able to use such a texture on a VTK actor.

2015-09-02 17:35 GMT+02:00 Aashish Chaudhary <aashish.chaudhary at kitware.com>
:

> I would suggest you use OpenGL2 backend if not using directly. Also, look
> into vtkTextureObject class. What exactly you need in  terms of
> interoperability?
>
> - Aashish
>
> On Wed, Sep 2, 2015 at 9:27 AM, Hamza <hchouh at gmail.com> wrote:
>
>> Hi everybody,
>>
>> I'm looking for a way of interoperability between CUDA and VTK. More
>> exactly, what I need to do is display in VTK an image I compute with CUDA.
>> To do so, I thought about using the CUDA/OpenGL interoperability.
>> However, I
>> have not found a way to modify a VTK texture outside VTK. I read the
>> documentation about the vtkOpenGLTexture class but did not understand how
>> that could help me.
>> Any idea?
>>
>> Thanks,
>> Hamza
>>
>>
>>
>> --
>> View this message in context:
>> http://vtk.1045678.n5.nabble.com/Using-an-OpenGL-texture-in-VTK-tp5733711.html
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> 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
>>
>
>
>
> --
>
>
>
> *| Aashish Chaudhary | Technical Leader         | Kitware Inc.            *
> *| http://www.kitware.com/company/team/chaudhary.html
> <http://www.kitware.com/company/team/chaudhary.html>*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150903/b173458a/attachment.html>


More information about the vtkusers mailing list