[vtkusers] Swapping Fragment shaders correctly.

Seun Odutola seun at rogue-research.com
Fri Feb 16 14:36:03 EST 2018


Hi all,

   I was wondering if anyone could shed some light on how to replace shaders. I have a vtkActor with its fragment shader customized, basically I have a vtkPolyDataMapper connected as a Mapper to my vtkActor, this is casted down as a vtkOpenGLPolyDataMapper in order to access the customization via AddShaderReplacement et al. The problem I have is that although this works fine (as I do see the shader effect) the issue arises when I want to swap the current fragment shader to another custom shader i.e: I have both retina and non retina display and would like the mapper to use a custom shader designated for each display when I move between screens. I tried to ClearAllShaderReplacement(s) and still no noticeable change. Is there something am missing or how does one go about this?

Regards,
   Seun


More information about the vtkusers mailing list