I’d like to highlight a new feature that allows applications to control vtkObjectFactory overrides at runtime.
Previously, applications linking to multiple VTK modules such as RenderingOpenGL and RenderingWebGPU(experimental) could not easily select which implementation to instantiate. We have addressed this in MR !12682 (resolving Issue #17218).
If you were not aware of this feature getting merged, I strongly suggest reading Ben’s description in that issue. It will help you better understand how it works.
What Is New The vtkObjectFactory can now prioritize specific overrides via any of these methods:
- Programatically: See documentation for SetPreferences.
- env var:
VTK_FACTORY_PREFER="RenderingBackend=WebGPU" - command line args:
./exename --vtk-factory-prefer "RenderingBackend=WebGPU"See documentation for InitializePreferencesFromCommandLineArgs
I am currently iterating on the naming convention for these attributes in MR !12665.
The proposed format is Feature=Provider (e.g., RenderingBackend=WebGPU to choose WebGPU over OpenGL, WindowSystem=EGL to choose EGL over others).
Please share thoughts on this naming policy or suggestions for alternative approaches.