simvx.core.env_sync_spec¶
Single source of truth for WorldEnvironment → renderer-subsystem field
propagation. Both the Vulkan EnvironmentSync and the web WebApp
_sync_world_environment walk the same spec; new env fields propagate to
both backends by adding one row.
Composites (e.g. camera.exposure × env.tonemap_exposure) and structurally
divergent bridges (sky_mode → clear-colour / skybox) stay imperative in
the calling sync method: only field-to-attribute propagation lives here.
Module Contents¶
Classes¶
One row of the WorldEnvironment → renderer mapping. |
Functions¶
Walk |
Data¶
API¶
- simvx.core.env_sync_spec.__all__¶
[‘EnvField’, ‘ENV_SYNC_SPEC’, ‘ENV_SYNC_COMPOSITES’, ‘apply_spec’]
- class simvx.core.env_sync_spec.EnvField[source]¶
One row of the WorldEnvironment → renderer mapping.
env_attr: name of the attribute onWorldEnvironment.target: logical"subsystem.field"path. The backend resolver maps the subsystem to a concrete object (VulkanRenderer._post_process, webWebRenderer).transform: optional callable applied to the env value before write. Used for enum→int translation, alpha-trim, etc.backends: backends that should propagate this field. Lets the spec reflect today’s reality where some env fields are wired on web but not desktop yet (e.g.ssao_radius).- env_attr: str¶
None
- target: str¶
None
- transform: collections.abc.Callable[[Any], Any] | None¶
None
- backends: tuple[str, ...]¶
(‘vulkan’, ‘web’)
- simvx.core.env_sync_spec.ENV_SYNC_SPEC: tuple[simvx.core.env_sync_spec.EnvField, ...]¶
()
- simvx.core.env_sync_spec.ENV_SYNC_COMPOSITES: frozenset[str]¶
‘frozenset(…)’
- simvx.core.env_sync_spec.apply_spec(env: Any, *, backend: str, resolve: collections.abc.Callable[[str, str, Any], None]) None[source]¶
Walk
ENV_SYNC_SPEC, read each env attr, write viaresolve.resolve(subsystem, attr, value)does the backend-specific dispatch (attribute write, method-kwarg accumulation, etc.). Fields whose backend list excludes the requestedbackendare skipped.