How to get shader source for an actor

Hi All,

Pardon this for its length. There are a few things to address.

First, thanks to all the responders.

I couldn’t get the dynamic_cast to work in Paulo’s suggesting because I had declared the mapper as: vtkNew<vtkOpenGLPolyDataMapper> zMapper
But, I was able to work around it by using
char *szFragShaderCode = zMapper->GetFragmentShaderCode();
I’ll attribute this to the old way of dong things vs the new way (please somebody correct me if this is wrong).

Simon’s tip was kind of cool. Got to see the code!

Will explore renderdoc when I get a minute. Thanks Steve.

I can appreciate that VTK is doing a lot with shaders under the hood, setting things with C++ code, etc. The reason I started looking at the shaders is that I have them working the way I wanted in some other OpenGL code that I wrote. But, I ran into some problems with trying to get VTK to do what I consider to be a very simple thing. I posted this as a bug on VTK discourse development. I wanted to do the backfaces with a different color and it was taking the outside of a sphere as the backfaces and not the inside. However, if I use culling on the sphere, the backfaces ARE the inside. See: Backface bug in vtkActor
Am totally confused on this and would appreciate any help.

BK