# Runtime control for object factory overrides

**URL:** https://discourse.vtk.org/t/runtime-control-for-object-factory-overrides/16253
**Category:** Development
**Tags:** proposal
**Created:** [January 23, 2026, 3:05pm UTC](https://discourse.vtk.org/t/runtime-control-for-object-factory-overrides/16253 "2026-01-23T15:05:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [January 23, 2026, 3:05pm UTC](https://discourse.vtk.org/t/runtime-control-for-object-factory-overrides/16253/1 "2026-01-23T15:05:37Z")

</div>

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](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/12682) (resolving [Issue #17218](https://gitlab.kitware.com/vtk/vtk/-/issues/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](https://vtk.org/doc/nightly/html/classvtkObjectFactory.html#abcff88c612cb3421e05a7687ce959301).
- **env var:** `VTK_FACTORY_PREFER="RenderingBackend=WebGPU"`
- **command line args:** `./exename --vtk-factory-prefer "RenderingBackend=WebGPU"` See documentation for [InitializePreferencesFromCommandLineArgs](https://vtk.org/doc/nightly/html/classvtkObjectFactory.html#ad038efeed449265f5fd6ad75b69c56db)

I am currently iterating on the naming convention for these attributes in [MR !12665](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/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.

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [January 23, 2026, 3:07pm UTC](https://discourse.vtk.org/t/runtime-control-for-object-factory-overrides/16253/2 "2026-01-23T15:07:20Z")

</div>

I forgot to mention: this feature is NOT in 9.6

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [July 27, 2026, 7:08pm UTC](https://discourse.vtk.org/t/runtime-control-for-object-factory-overrides/16253/3 "2026-07-27T19:08:33Z")

</div>

This feature is in 9.7.0.
