<div dir="ltr"><div class="markdown-here-wrapper" style="font-family:"Lucida Sans",Cantarell,Verdana,sans-serif;color:rgb(11,83,148)"><p style="margin:0px 0px 1.2em!important">Hi,</p>
<p style="margin:0px 0px 1.2em!important">VTK generates shaders at runtime and there are hooks in place that allow you to modify the generated shader code.</p>
<p style="margin:0px 0px 1.2em!important">Take a look a <a href="https://www.vtk.org/Wiki/Shaders_In_VTK">https://www.vtk.org/Wiki/Shaders_In_VTK</a> for some information.<br>There are some tests that exercise this functionality</p>
<ul style="margin:1.2em 0px;padding-left:2em">
<li style="margin:0.5em 0px"><a href="https://gitlab.kitware.com/vtk/vtk/blob/2fe1f778ecdab89cab7b3c5b1d8c23e7ddc5015a/Rendering/OpenGL2/Testing/Cxx/TestUserShader.cxx">TestUserShader</a></li>
<li style="margin:0.5em 0px"><a href="https://gitlab.kitware.com/vtk/vtk/blob/2fe1f778ecdab89cab7b3c5b1d8c23e7ddc5015a/Rendering/OpenGL2/Testing/Cxx/TestUserShader2.cxx">TestUserShader2</a></li>
<li style="margin:0.5em 0px"><a href="https://gitlab.kitware.com/vtk/vtk/blob/2fe1f778ecdab89cab7b3c5b1d8c23e7ddc5015a/Rendering/Volume/Testing/Cxx/TestGPURayCastUserShader.cxx">TestGPURayCastUserShader</a></li>
<li style="margin:0.5em 0px"><a href="https://gitlab.kitware.com/vtk/vtk/blob/2fe1f778ecdab89cab7b3c5b1d8c23e7ddc5015a/Rendering/Volume/Testing/Cxx/TestGPURayCastUserShader2.cxx">TestGPURayCastUserShader2</a></li>
</ul>
<p style="margin:0px 0px 1.2em!important">Hope this helps.</p>
<p style="margin:0px 0px 1.2em!important">Best,<br>Sankhesh</p>
<div title="MDH:SGksPGRpdj48YnI+PC9kaXY+PGRpdj5WVEsgZ2VuZXJhdGVzIHNoYWRlcnMgYXQgcnVudGltZSBh
bmQgdGhlcmUgYXJlIGhvb2tzIGluIHBsYWNlIHRoYXQgYWxsb3cgeW91IHRvIG1vZGlmeSB0aGUg
Z2VuZ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+KTwvZGl2PjxkaXY+
PGJyPjwvZGl2PjxkaXY+SG9wZSB0aGlzIGhlbHBzLjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+
QmVzdCw8L2Rpdj48ZGl2PlNhbmtoZXNoPC9kaXY+" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0"></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 5, 2017 at 1:27 PM PhD Andrea Vitali <<a href="mailto:andrea.vitali1@unibg.it">andrea.vitali1@unibg.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear All,<br>
<br>
Which is the best way to use shaders in VTK?<br>
<br>
I need to add several vertex attributes to the existent ones. I'm using<br>
vtkOpenGLPolyDataMapper as the starting point, but I'm not able to<br>
understand how to use shaders as usually done by classic OpenGL.<br>
<br>
Are there any examples of tutorials about it?<br>
<br>
Thank you in advance,<br>
<br>
Andrea<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html</a><br>
_______________________________________________<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/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_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=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/mailman/listinfo/vtkusers</a><br>
</blockquote></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div class="inbox-inbox-inbox-markdown-here-wrapper" style="font-family:"proza libre",sans-serif;color:rgb(0,56,107)"><h5 id="inbox-inbox-inbox-sankhesh-jhaveri" style="margin:1.3em 0px 1em;padding:0px;font-size:1.1em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);font-weight:bold;color:rgb(11,65,148)">Sankhesh Jhaveri</h5>
<h6 id="inbox-inbox-inbox--sr-research-development-engineer-kitware-http-www-kitware-com-518-881-4417" style="margin:1.3em 0px 1em;padding:0px;font-size:1em;color:rgb(11,83,148);font-family:"open sans",sans-serif;font-weight:normal"><em>Sr. Research & Development Engineer</em> | <a href="http://www.kitware.com/">Kitware</a> | (518) 881-4417</h6>
<div title="MDH:PGIgc3R5bGU9ImZvbnQtZmFtaWx5OiB2ZXJkYW5hLCBzYW5zLXNlcmlmOyBjb2xvcjogcmdiKDEx
LCA4MywgMTQ4KTsiPjxmb250IHNpemU9IjIiPiMjIyMjU2Fua2hlc2ggSmhhdmVyaTwvZm9udD48
L2I+PGRpdj48Zm9udCBjb2xvcj0iIzBiNTM5NCIgZmFjZT0idmVyZGFuYSwgc2Fucy1zZXJpZiIg
c2l6ZT0iMiI+PGI+PGJyPjwvYj48L2ZvbnQ+PGRpdj48c3BhbiBzdHlsZT0iZm9udC1mYW1pbHk6
IGFyaWFsLCBzYW5zLXNlcmlmOyBjb2xvcjogcmdiKDExLCA4MywgMTQ4KTsiPjxzcGFuIHN0eWxl
PSJmb250LWZhbWlseTogdmVyZGFuYSwgc2Fucy1zZXJpZjsiPjxpPiMjIyMjIypTci4gUmVzZWFy
Y2ggJmFtcDsgRGV2ZWxvcG1lbnQgRW5naW5lZXIqPC9pPiZuYnNwO3wmbmJzcDs8L3NwYW4+PC9z
cGFuPjxzcGFuIHN0eWxlPSJmb250LWZhbWlseTogdmVyZGFuYSwgc2Fucy1zZXJpZjsgY29sb3I6
IHJnYigxMSwgODMsIDE0OCk7Ij48YSBocmVmPSJodHRwOi8vd3d3LmtpdHdhcmUuY29tLyIgdGFy
Z2V0PSJfYmxhbmsiIHN0eWxlPSJjb2xvcjogcmdiKDE3LCA4NSwgMjA0KTsiPktpdHdhcmU8L2E+
Jm5ic3A7fCZuYnNwOzwvc3Bhbj48c3BhbiBzdHlsZT0iZm9udC1mYW1pbHk6IHZlcmRhbmEsIHNh
bnMtc2VyaWY7IGNvbG9yOiByZ2IoMTEsIDgzLCAxNDgpOyI+KDUxOCkgODgxLTQ0MTc8L3NwYW4+
PGJyPjwvZGl2PjxkaXY+PGRpdj48ZGl2PjxzcGFuIHN0eWxlPSJmb250LWZhbWlseTogdmVyZGFu
YSwgc2Fucy1zZXJpZjsgY29sb3I6IHJnYigxMSwgODMsIDE0OCk7Ij48L3NwYW4+PC9kaXY+PC9k
aXY+PC9kaXY+PC9kaXY+" style="height:0px;width:0px;max-height:0px;max-width:0px;overflow:hidden;font-size:0em;padding:0px;margin:0px"></div></div></div></div>