[vtk-developers] passing vertex attributes to custom shader (Ken Martin)

Ken Martin ken.martin at kitware.com
Mon Mar 14 15:53:38 EDT 2016


Hmmm, no, there isn't.  I was just looking at vtkOpenGLHelper, I'm not sure
if that class could be wrapped or if it has to be a subclass of vtkObject.
If it could be wrapped then we can just do that. You can try it by removing
it from the WRAP_EXCLUDE_PYTHON section of Rendering/OpenGL2/CMakeLists.txt

I also noticed the class exposes the vtkVertexArrayObject, with that you
might actually be able to provide your own attributes. I have not tried
that but I it might work.

On Tue, Mar 8, 2016 at 1:42 PM, Brad Hollister <behollis at sci.utah.edu>
wrote:

> Thanks, Ken. I'm using the VTK Python bindings. It looks like
> vtkOpenGLHelper isn't wrapped.
>
> Is there another way to set the uniforms besides of the method given in
> the C++ test program?
>
> Regards,
> Brad
>
> Date: Sat, 5 Mar 2016 08:05:40 -0500
>> From: Ken Martin <ken.martin at kitware.com>
>> To: Brad Hollister <behollis at sci.utah.edu>
>> Cc: VTK Developers <vtk-developers at vtk.org>
>> Subject: Re: [vtk-developers] passing vertex attributes to custom
>>         shader
>> Message-ID:
>>         <CANXz0SY+P=YuTQFcWg+5=
>> 9pd9RiCxPNYQjrrMKERLPhm2ooFsg at mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Currently you can pass uniforms (see
>>
>> https://gitlab.kitware.com/vtk/vtk/blob/v7.0.0.rc2/Rendering/OpenGL2/Testing/Cxx/TestUserShader2.cxx
>> for an example). You currently cannot pass your own attributes without
>> subclassing, only work with the default ones that are passed
>> (position/scalars/normals/tcoords)
>>
>> Thanks
>> Ken
>>
>> On Fri, Mar 4, 2016 at 7:47 PM, Brad Hollister <behollis at sci.utah.edu>
>> wrote:
>>
>> Hi,
>>>
>>> I've been using vtkOpenGLPolyDataMapper() to set custom vertex / fragment
>>> shaders. I'd also like to provide user-defined vertex attributes
>>> accessible
>>> in the shader code. I assumed from the documentation that
>>> MapDataArrayToVertexAttributes() is the proper way to do this.
>>>
>>> However, I get the ERROR: vtkOpenGLPolyDataMapper (0x2872160): Not
>>> implemented at this level...
>>>
>>> There doesn't appear to be a derived class of vtkOpenGLPolyDataMapper
>>> available for my needs (which is that I'm specifying polygons via a
>>> vtkPolyData object).
>>>
>>> Is it possible to pass vertex attributes and custom uniforms using
>>> vtkOpenGLPolyDataMapper? Is there a different way from the one I've been
>>> trying that makes this possible?
>>>
>>> Regards,
>>> Brad
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Search the list archives at:
>>> http://markmail.org/search/?q=vtk-developers
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/vtk-developers
>>>
>>>
>>> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>


-- 
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/vtk-developers/attachments/20160314/f7617f63/attachment.html>


More information about the vtk-developers mailing list