<div dir="ltr"><div><div><div>Hi,<br><br></div>Mathieu and I were facing a tricky situation when adding a new VTK test.<br></div><br>We basically tried to render a piece of a RTAnalyticSource. We generated the baseline image with the legacy backend and tests were failing with the OpenGL 2 backend. Attached are the images we obtained with the two backends - you can see that the color spots have not the same orientation.<br><br></div><div>We finally found the origin of the problem: as the grid is made of hexahedron, the geometry filter generates a surface made of quads.<br>For the legacy backend, rendering quads is not an issue as OpenGL allows to render (non-convex) polygons directly, so the legacy painter-mapper directly sends the quad to OpenGL for rendering.<br>With the new backend, only triangles are transferred to the graphic board and a triangulation is implicitly performed by the mapper (actually by vtkglVBOHelper.cxx:338 - vtkgl::AppendTriangleIndexBuffer function). Note that this function respects the order of the triangulation performed by vtkQuad::Triangulate() but it seems like it is not the one implicitly performed by OpenGL (or some OpenGL implementations at least) when you render quad primitives.<br></div><div>To fix the issue we inserted a vtkTriangleFilter between the GeometryFilter and the Mapper so that both mapper implementations end up with the same triangulated mesh to render.<br></div><div><br></div><div>I think this behaviour should be documented somewhere (may be it is already? anyway now at least it is here) as I am sure this should cause problems later.<br></div><div><br></div><div>Best,<br></div><div><div><div><br clear="all"><div><div><div><div><div class="gmail_signature"><div dir="ltr"><b>Joachim Pouderoux</b><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font size="1"><i>PhD, Technical Expert</i></font><br><b><font size="1"><a href="http://www.kitware.fr" target="_blank">Kitware SAS</a></font></b><br></blockquote>
</div></div></div>
</div></div></div></div></div></div></div>