[vtk-developers] Some OpenGL2 Polygonal Updates etc

Ken Martin ken.martin at kitware.com
Wed Jul 15 15:18:57 EDT 2015


It has been a while and I am overdue for updates on the new OpenGL
rendering engine. We are in pretty good shape in terms of the new rendering
engine with VTK. Tests are passing and we are generally ready to make it
the default for the upcoming VTK release.  The old engine will also be
available as a CMake option. Here are some specific changes since the last
update.



1)      Added support in the PointGaussianMapper for rendering points as
points ( /golfclap ).  Sometimes in cosmology distant regions will be
rendered as points while closer regions are rendered as splats.  Now this
mapper can handle both cases. This also makes this mapper an efficient
mapper in VTK for rendering point clouds. It will render vtkPoints with
colors quickly and with minimal memory.



2)      Moved the new backend to OpenGL 3.2. While it still should mostly
work with OpenGL 2.1 our target version is 3.2 which adds some nice
features and yet is still fairly old. One of the big additions is support
for geometry shaders. VTK now supports the use of  geometry shaders and
vtkOpenGLPolyDataMapper has some features to help make writing a geometry
shader easier for all the numerous rendering cases VTK supports.



3)      One of the features OpenGL 3.2 does not always support is rendering
thick lines.  The spec only requires support for thicknesses up to 1.0.  So
we have implemented support in VTK using a geometry shader for thick lines
on systems that do not support them.



4)      Had a chance to work with the Mesa folks to fix an issue in Mesa
that was causing problems with cell coloring and picking. They were great
to work with and as of Mesa version 10.5.5 this is fixed.



5)      Made a large change to how cell coloring and picking was handled.
In the old OpenGL2 code we would duplicate vertices to handle cell coloring
so that each vertex was only used by one cell. This caused a huge explosion
in memory required for those cases. The new approach makes use of
gl_PrimitiveID to lookup cell colors (or cell normals or pick ids) in a
texture map which saves us from having to duplicate vertices. Unfortunately
gl_PrimitiveID is buggy on current Apple systems with AMD hardware so we
had to implement a workaround for those systems which does impact
performance on those systems. Apple is aware of the issue and will
hopefully have a fix in the future.



6)      Many fixes to vtkCompositePolyDataMapper2 to handle complex cases
that ParaView testing exposed.



Thanks

Ken



Ken Martin PhD

Chairman & CFO

Kitware Inc.

28 Corporate Drive

Clifton Park NY 12065

ken.martin at kitware.com

919 869-8871 (w)





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.



*From:* Ken Martin [mailto:ken.martin at kitware.com]
*Sent:* Monday, February 2, 2015 11:26 AM
*To:* 'vtkdev'
*Subject:* Some OpenGL2 Polygonal Updates etc



Here are a few updates to the polygonal work we’ve been doing on the new
OpenGL2 backend in VTK.



1)      Created a vtkPointGaussianMapper [3] class for cosmology for
quickly rendering lots of translucent Gaussian splats.  This class will get
refined a bit as it starts getting used more. Similar in concept to the
PointSprite extensions that were added into Paraview by John Biddiscombe,
Ugo Varetto and Stephane Ploix from CSCS and EDF.



2)      Changed how the transformation matrices were handled in the vertex
shader [7]. It was doing V’ = VCDC * MCVC * V  and a couple tests were
failing. Instead we now compute MCDC on the CPU in double precision and
instead do V’ = MCDC * V in the shader which fixed the test and is
generally a better way to do it. We often need the other two matrices as
well which is why the original code just used those.



3)      Added a rendering timing framework/executable [5] to make it easier
to run test sequences across machines and see the results. Marcus and Rob
have expanded on it and Aashish has added a volume rendering test.



4)      Rewrote the vtkParametricFunctionSource [6] to be significantly
faster (4x) and more memory efficient.  We use this source to generate
surfaces for rendering timings and it was a bit slow.



5)      A bunch of fixes related to getting IceT to work with OpenGL2 [1]
which led to some release graphics resource issues being fixed [2].



6)      “Fixed” a longstanding failing test, TestChartXYZ [4] which was
intermittently failing on some systems.



7)      Marcus and Rob ran some rendering benchmarks showing upwards of 3
billion triangles per second on a 300 million triangle model. That is a big
model and some solid performance.





Currently I am wrapping up a change to the vtkCompositePolyDataMapper2 so
that in some common circumstances it will render significantly faster
(maybe 10x). This is targeted at helping apps that have lots of small
polygonal parts that are not glyphed. Also adding in support for texture
coordinate transformation matrices which are used by the GeoView classes in
VTK. Tim Thirion is fixing up some iOS build issues and David Lonnie is
working on removing an old text mapper that was causing some issues. JC has
been working on updating Slicer to build against the current VTK with
OpenGL2.



Thanks

Ken





[1] http://review.source.kitware.com/#/t/5130/

[2] http://review.source.kitware.com/#/t/5171/

[3] http://review.source.kitware.com/#/t/5198/

[4] http://review.source.kitware.com/#/t/5248/

[5] http://review.source.kitware.com/#/t/5276/

[6] http://review.source.kitware.com/#/t/5302/

[7] http://review.source.kitware.com/#/t/5327/





Ken Martin PhD

Chairman & CFO

Kitware Inc.

28 Corporate Drive

Clifton Park NY 12065

ken.martin at kitware.com

518 881-4901 (w)

518 371-4573 (f)



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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150715/c328b694/attachment.html>


More information about the vtk-developers mailing list