[vtkusers] How to use SetGeometryShaderCode

Ken Martin ken.martin at kitware.com
Mon Jul 9 08:54:49 EDT 2018

Using your own shader code is a bit advanced as there are a few moving
parts. If you specify geometry shader code then you also have to make sure
the right uniforms/arrays are being set for that shader code. That would be
my guess as to the issue with your attempt to manually specify wide lines.
Maybe the code is fine but some uniforms are not properly set and so are
defaulting to 0.0 etc.

I agree an example of geometry replacements would be good. If you get
something working let me know and I'll add it to the wiki page on custom

On Wed, Jul 4, 2018 at 9:11 AM, Kumar Ashutosh <kumar.ashutosh.ee at gmail.com>

> I want to add custom Geometry Shader to my mapper. From the source code, I
> concluded that in vtkOpenGLPolyDataMapper we can inject custom Shader Code.
> Also, the code has WideLineGS as the default Geometry Shader. I tried to
> mimic the same behaviour by injecting the same code as given here
> <https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OpenGL2/glsl/vtkPolyDataWideLineGS.glsl> (source
> code of WideLinesGS)  using the function SetGeometryShaderCode. The
> resulting screen is a blank screen with no errors raised.
> Can someone please guide me on how to inject Geometry Shader Code. This is
> specific to Geometry Shader only as I have successfully tried with Frag
> Shader and Vertex Shader.
> A simple example of this would be great.
> Regards,
> Kumar Ashutosh
> _______________________________________________
> Powered by www.kitware.com
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Search the list archives at: http://markmail.org/search/?q=vtkusers
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtkusers

Ken Martin PhD
Distinguished Engineer
Kitware Inc.
101 East Weaver Street
Carrboro, North Carolina
27510 USA

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: <https://public.kitware.com/pipermail/vtkusers/attachments/20180709/d987e1c1/attachment.html>

More information about the vtkusers mailing list