<div dir="ltr">You can use mapper->MapDataArrayToVertexAttribute() to hand over specific data arrays of your choice to your custom shaders.<div><br><div><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>David E DeMarle<br>Kitware, Inc.<br>Principal Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, Jun 8, 2018 at 5:14 PM, Jonathan Borduas <span dir="ltr"><<a href="mailto:jonathan.borduas@caboma.com" target="_blank">jonathan.borduas@caboma.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-CA" link="#0563C1" vlink="#954F72">
<div id="m_-2750301439424192360compose-container" style="direction:ltr">
<span><span></span></span>
<div>
<div style="direction:ltr">Never play with that, but you specify “user” shader like this:</div>
<div><br>
</div>
<div style="direction:ltr"><a href="https://gitlab.kitware.com/vtk/vtk/blob/v7.0.0.rc2/Rendering/OpenGL2/Testing/Cxx/TestUserShader.cxx" target="_blank">https://gitlab.kitware.com/<wbr>vtk/vtk/blob/v7.0.0.rc2/<wbr>Rendering/OpenGL2/Testing/Cxx/<wbr>TestUserShader.cxx</a></div><span class="">
<div><br>
</div>
<div style="direction:ltr">Jonathan Borduas</div>
<div><br>
</div>
<div class="m_-2750301439424192360acompli_signature">Get <a href="https://aka.ms/o0ukef" target="_blank">Outlook for iOS</a></div>
</span></div>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_-2750301439424192360divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Patrick Bergeron <<a href="mailto:pbergeron@spiria.com" target="_blank">pbergeron@spiria.com</a>><br>
<b>Sent:</b> Friday, June 8, 2018 4:43:21 PM<br>
<b>To:</b> Jonathan Borduas; <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><div><div class="h5"><br>
<b>Subject:</b> Re: [vtkusers] Questions about vtkPolyData</div></div></font>
<div> </div>
</div><div><div class="h5">
<div>
<div class="m_-2750301439424192360WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Yep, I got that.
</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">My question “</span><span style="font-size:11.0pt">Do these values make it into vertex shaders?</span><span lang="EN-US" style="font-size:11.0pt">“ was meant so that I’d like to know that, if
they DO get into shaders, how would they be names, and what would the shader script look like, because I need to do custom GLSL shading stuff with scalar/vector attributes that are sent on a per-vertex basis.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">(in fact, I want data to be sent on a per-vertex basis to the VTK vertex shader, so that I can make them a varying variable in the fragment shader).</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Thanks!</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Patrick</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:black">From: </span></b><span style="color:black">Jonathan Borduas <<a href="mailto:jonathan.borduas@caboma.com" target="_blank">jonathan.borduas@caboma.com</a>><br>
<b>Date: </b>Friday, June 8, 2018 at 2:03 PM<br>
<b>To: </b>Patrick Bergeron <<a href="mailto:pbergeron@spiria.com" target="_blank">pbergeron@spiria.com</a>>, "<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>" <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
<b>Subject: </b>RE: [vtkusers] Questions about vtkPolyData</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt">Hi Patrick,<br>
<br>
You can do per-vertex and per-cell coloring. </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><a href="https://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/TriangleColoredPoints" target="_blank">https://www.vtk.org/Wiki/VTK/<wbr>Examples/Cxx/PolyData/<wbr>TriangleColoredPoints</a><br>
<a href="https://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColorCellsWithRGB" target="_blank">https://www.vtk.org/Wiki/VTK/<wbr>Examples/Cxx/PolyData/<wbr>ColorCellsWithRGB</a></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
For UV texture shading:</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><a href="https://www.vtk.org/Wiki/VTK/Examples/Cxx/Texture/TexturedSphere" target="_blank">https://www.vtk.org/Wiki/VTK/<wbr>Examples/Cxx/Texture/<wbr>TexturedSphere</a></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><a href="http://scylardor.fr/2013/05/06/making-multi-texturing-work-with-vtk/" target="_blank">http://scylardor.fr/2013/05/<wbr>06/making-multi-texturing-<wbr>work-with-vtk/</a></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">To try some of the possibilities of VTK, you want to use ParaView. This application is heavily based on VTK and can give you a good sense of what is feasible with VTK.
</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><a href="https://www.paraview.org/download/" target="_blank">https://www.paraview.org/<wbr>download/</a></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Best</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Jonathan </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt">From:</span></b><span style="font-size:11.0pt"> Patrick Bergeron <<a href="mailto:pbergeron@spiria.com" target="_blank">pbergeron@spiria.com</a>>
<br>
<b>Sent:</b> Friday, June 08, 2018 12:58 PM<br>
<b>To:</b> Jonathan Borduas <<a href="mailto:jonathan.borduas@caboma.com" target="_blank">jonathan.borduas@caboma.com</a>>; <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Subject:</b> Re: [vtkusers] Questions about vtkPolyData</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks. Do these values make it into vertex shaders?
</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:black">From: </span></b><span style="color:black">Jonathan Borduas <</span><a href="mailto:jonathan.borduas@caboma.com" target="_blank">jonathan.borduas@caboma.com</a><span style="color:black">><br>
<b>Date: </b>Thursday, June 7, 2018 at 7:18 PM<br>
<b>To: </b>Patrick Bergeron <</span><a href="mailto:pbergeron@spiria.com" target="_blank">pbergeron@spiria.com</a><span style="color:black">>, "</span><a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><span style="color:black">" <</span><a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><span style="color:black">><br>
<b>Subject: </b>Re: [vtkusers] Questions about vtkPolyData</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span></p>
</div>
<div id="m_-2750301439424192360compose-container">
<div>
<div>
<div>
<p class="MsoNormal"><a name="m_-2750301439424192360__MailOriginalBody"><span style="font-size:11.0pt">Hey</span></a></p>
</div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt"> </span></span></p>
</div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt">All these examples may help.</span></span></p>
</div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt"> </span></span></p>
</div>
<div>
<p class="MsoNormal"><span></span><a href="https://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColoredPoints" target="_blank"><span><span style="font-size:11.0pt">https://www.vtk.org/Wiki/VTK/<wbr>Examples/Cxx/PolyData/<wbr>ColoredPoints</span></span><span></span></a><span></span></p>
</div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt"> </span></span></p>
</div>
<div>
<p class="MsoNormal"><span></span><a href="https://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/FieldData" target="_blank"><span><span style="font-size:11.0pt">https://www.vtk.org/Wiki/VTK/<wbr>Examples/Cxx/PolyData/<wbr>FieldData</span></span><span></span></a><span></span></p>
</div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt"> </span></span></p>
</div>
<div>
<p class="MsoNormal"><span></span><a href="https://www.vtk.org/Wiki/VTK/Examples/Cxx/VTKConcepts/Scalars" target="_blank"><span><span style="font-size:11.0pt">https://www.vtk.org/Wiki/VTK/<wbr>Examples/Cxx/VTKConcepts/<wbr>Scalars</span></span><span></span></a><span></span></p>
</div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt"> </span></span></p>
</div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt">Best,</span></span></p>
</div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt"> </span></span></p>
</div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt">Jonathan Borduas</span></span></p>
</div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt"> </span></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt"> </span></span></p>
</div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt">Get </span></span><a href="https://aka.ms/o0ukef" target="_blank"><span><span style="font-size:11.0pt">Outlook for iOS</span></span><span></span></a><span></span></p>
</div>
</div>
</div>
<div class="MsoNormal" align="center" style="text-align:center"><span><span style="font-size:11.0pt">
<hr size="2" width="98%" align="center">
</span></span></div>
<div id="m_-2750301439424192360divRplyFwdMsg">
<p class="MsoNormal"><span><b><span style="font-size:11.0pt;color:black">From:</span></b></span><span><span style="font-size:11.0pt;color:black"> vtkusers <</span></span><a href="mailto:vtkusers-bounces@public.kitware.com" target="_blank"><span><span style="font-size:11.0pt">vtkusers-bounces@public.<wbr>kitware.com</span></span><span></span></a><span><span style="font-size:11.0pt;color:black">>
on behalf of Patrick Bergeron <</span></span><a href="mailto:pbergeron@spiria.com" target="_blank"><span><span style="font-size:11.0pt">pbergeron@spiria.com</span></span><span></span></a><span><span style="font-size:11.0pt;color:black">><br>
<b>Sent:</b> Thursday, June 7, 2018 7:08:43 PM<br>
<b>To:</b> </span></span><a href="mailto:vtkusers@vtk.org" target="_blank"><span><span style="font-size:11.0pt">vtkusers@vtk.org</span></span><span></span></a><span><span style="font-size:11.0pt;color:black"><br>
<b>Subject:</b> [vtkusers] Questions about vtkPolyData</span></span><span><span style="font-size:11.0pt">
</span></span></p>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt"> </span></span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt">Hi everyone.</span></span></p>
<p class="MsoNormal"><span><span style="font-size:11.0pt"> </span></span></p>
<p class="MsoNormal"><span><span style="font-size:11.0pt">How would I go about specifying multiple sets of user attributes on a per-vertex basis on a polydata?</span></span></p>
<p class="MsoNormal"><span><span style="font-size:11.0pt"> </span></span></p>
<p class="MsoNormal"><span><span style="font-size:11.0pt">For example, hlet’s say I would like multiple sets of uv coordinates, normal, colors, int attributes, etc?</span></span></p>
<p class="MsoNormal"><span><span style="font-size:11.0pt"> </span></span></p>
<p class="MsoNormal"><span><span style="font-size:11.0pt">Thanks</span></span></p>
</div>
</div>
</div>
</div>
</div></div></div>
<br>______________________________<wbr>_________________<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/<wbr>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_<wbr>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=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>