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.
Hello,
I’m not aware of any simple VTK switch to turn on glow effect. But I can think of two approaches:
- 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
- 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