[vtk-developers] Painters

Ken Martin ken.martin at kitware.com
Thu Sep 17 09:36:25 EDT 2015


Hiya John,



It depends on what the painters/mappers do. I think there are three main
approaches you can use. The first would be to use the functions in
vtkOpenGLPolydataMapper to modify the existing shader code generated by VTK
to do something different (examples in
Rendering/OpenGL2/Testing/Cxx/TestUserShader and TestUserShader2). You
could do this by calling those functions in your application. The other
approach is to subclass off of the mapper and modify the shader code there.
vtkOpenGLPointGaussianMapper and vtkOpenGLSphereMapper are examples of this
approach that provide a generic superclass (without the OpenGL) it can be
quite a bit simpler if you are willing to just go with the OpenGL class.
If you need to pass different data arrays to the shader then subclassing
like that is the current way to go.



The third option is to create a render pass that does something special to
some or all of the props. This is more useful when your painters are being
used to do some sort of rendering technique like shadow maps, or cell
coloring, eye dome lighting etc. Examples of those include
Rendeing/OpenGL2/*Pass* classes.



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:* vtk-developers [mailto:vtk-developers-bounces at vtk.org] *On Behalf
Of *Biddiscombe, John A.
*Sent:* Thursday, September 17, 2015 3:12 AM
*To:* vtk-developers at vtk.org
*Subject:* [vtk-developers] Painters



Dear list,



Did I read somewhere that with the switch to OpenGL2, the support for
painters in VTK was being dropped?



If this is the case, should I rewrite all my custom renderers as plain old
mappers again - or is there some new approach that I should adopt. A link
to any kind of wiki entry would be appreciated if one exists.



thanks



JB



-- 

John Biddiscombe,                        email:biddisco @.at.@ cscs.ch

http://www.cscs.ch/

CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07

Via Trevano 131, 6900 Lugano, Switzerland   | Fax:  +41 (91) 610.82.82
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150917/5be5f810/attachment-0001.html>


More information about the vtk-developers mailing list