[vtkusers] Shaders for VTK

Sankhesh Jhaveri sankhesh.jhaveri at kitware.com
Tue Dec 5 13:38:40 EST 2017


Hi,

VTK generates shaders at runtime and there are hooks in place that allow
you to modify the generated shader code.

Take a look a https://www.vtk.org/Wiki/Shaders_In_VTK for some information.
There are some tests that exercise this functionality

   - TestUserShader
   <https://gitlab.kitware.com/vtk/vtk/blob/2fe1f778ecdab89cab7b3c5b1d8c23e7ddc5015a/Rendering/OpenGL2/Testing/Cxx/TestUserShader.cxx>
   - TestUserShader2
   <https://gitlab.kitware.com/vtk/vtk/blob/2fe1f778ecdab89cab7b3c5b1d8c23e7ddc5015a/Rendering/OpenGL2/Testing/Cxx/TestUserShader2.cxx>
   - TestGPURayCastUserShader
   <https://gitlab.kitware.com/vtk/vtk/blob/2fe1f778ecdab89cab7b3c5b1d8c23e7ddc5015a/Rendering/Volume/Testing/Cxx/TestGPURayCastUserShader.cxx>
   - TestGPURayCastUserShader2
   <https://gitlab.kitware.com/vtk/vtk/blob/2fe1f778ecdab89cab7b3c5b1d8c23e7ddc5015a/Rendering/Volume/Testing/Cxx/TestGPURayCastUserShader2.cxx>

Hope this helps.

Best,
Sankhesh
​

On Tue, Dec 5, 2017 at 1:27 PM PhD Andrea Vitali <andrea.vitali1 at unibg.it>
wrote:

> Dear All,
>
> Which is the best way to use shaders in VTK?
>
> I need to add several vertex attributes to the existent ones. I'm using
> vtkOpenGLPolyDataMapper as the starting point, but I'm not able to
> understand how to use shaders as usually done by classic OpenGL.
>
> Are there any examples of tutorials about it?
>
> Thank you in advance,
>
> Andrea
>
>
>
> --
> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
> _______________________________________________
> 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
>
-- 
Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware
<http://www.kitware.com/> | (518) 881-4417
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20171205/89f15ea4/attachment.html>


More information about the vtkusers mailing list