<div dir="ltr">Hello Fernando,<div><br></div><div>Making sure that I understand the issue. Essentially you have defined scalars/colors on the points of a triangle. With phong shading the colors interpolate across the triangle. With flat shading on the old backend, the system takes the color of the first point and uses that for the entire triangle. On the new backend the colors are still interpolated across the triangle.  Is that the issue you see?</div><div><br></div><div>If so, then the issue is that on the new backend I am interpreting shading to only mean lighting and normal calculations while in the old backend it seems to include vertex color properties (but not other properties such as tcoords, hmm wonder what happens with flat shading and texture based coloring) In modern OpenGL (version 3.2 ) you can specify flat versus smooth interpolation by attribute. So normals could be flat while colors are smooth. Without requiring OpenGL 3.2 we would need to rebuild the VBO each time you switch between flat and smooth, basically treating flat shading as if you had cell colors instead of point colors.</div><div><br></div><div>If backward compatibility was not an issue :-) I would suggest moving to require OpenGL 3.2 and then modifying vtkProperty so that people can independently specify if they want normals/colors/etc to be flat/smooth/perspective.</div><div><br></div><div>One stopgap, you could use vtkPointDataToCellData to essentially accomplish what you want in either back end. </div><div><br></div><div>Thanks</div><div>Ken</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 18, 2016 at 10:14 AM, Fernando Nellmeldin <span dir="ltr"><<a href="mailto:f.nellmeldin@open-engineering.com" target="_blank">f.nellmeldin@open-engineering.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello friends.<div><br><div>In our application, we want to allow the user to alternate between a flat and a smooth shading of the colors in an actor. To do this, we have a option that allows the user to call setInterpolationToFlat() or setInterpolationToPhong() in the property of the vtkactor. </div><div><br></div><div>The problem is that the call to set flat is not working, there is no change and the actor is always rendered smooth.</div><div><br></div><div>I've tried with VTK 6.3.0 and VTK 7.0.0 under OpenGL2 backend. In VTK 5.10 (using the old opengl), this works as expected. </div><div><br></div><div>And please note that in the three cases, the code is exactly the same. Well, except the connection between the ugrid and the geometry filter that I have the usual if:</div><div><div><span style="white-space:pre-wrap">  </span>#if VTK_MAJOR_VERSION <= 5</div><div><span style="white-space:pre-wrap">            </span>geometryFilter->SetInputConnection(m_model->GetProducerPort());</div><div><span style="white-space:pre-wrap">    </span>#else</div><div><span style="white-space:pre-wrap">            </span>geometryFilter->SetInputData(m_model);</div><div><span style="white-space:pre-wrap">        </span>#endif</div></div><div><br></div><div>Therefore, is the support of flat interpolation dropped, or I have to add something to make it work under OpenGL2 backend?</div><div><div><br></div><div>Thank you!</div><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><div style="font-size:12.8px"><b><font color="#cc0000"><span style="font-family:'arial black',sans-serif;font-size:12.8px"><br></span></font></b></div></div></div></div></div></div></div>
</div></div></div>
<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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br>518 371 3971<div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">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.</span></div></div></div>
</div>