Is it possible to achieve bloom/glow effect in VTK?

I have some points and lines in my scene, and I want to get a glow effect displayed for those lines and points. If there are no builtin classes in VTK to achieve this, what are the alternate options to achieve this? Any help in this direction is much appreciated.
Screenshot 2023-01-13 100759

Hello,

I’m not aware of any simple VTK switch to turn on glow effect. But I can think of two approaches:

  1. Working with the OpenGL buffers to post-process your rendered scene:

You can try this: https://learnopengl.com/Advanced-Lighting/Bloom . These are, of course, direct OpenGL calls which, of course, require an OpenGL render window.

To use lower level OpenGL API with a VTK application, you can refer to: https://discourse.vtk.org/t/how-to-use-original-opengl-in-vtk-program/4636

  1. Writing a shader code and assigning it to your vtkMapper:

There is a simple example of a glow effect shader here: https://lettier.github.io/3d-game-shaders-for-beginners/bloom.html .

To set a custom shader to a vtkMapper you can refer to this: https://vtk.org/Wiki/Shaders_In_VTK.

best,

Paulo

2 Likes