simvx.graphics.scene_adapter

Adapter to bridge SceneTree nodes to ForwardRenderer submissions.

Module Contents

Classes

SceneAdapter

Bridges SceneTree to ForwardRenderer (Vulkan).

Data

API

simvx.graphics.scene_adapter.__all__

[‘SceneAdapter’]

simvx.graphics.scene_adapter.log[source]

‘getLogger(…)’

class simvx.graphics.scene_adapter.SceneAdapter(engine: Any, renderer: Any)[source]

Bridges SceneTree to ForwardRenderer (Vulkan).

Responsibilities:

  • Register meshes with the GPU

  • Convert materials to Vulkan format

  • Traverse scene tree and submit instances

Initialization

register_mesh(mesh: Any) Any | None[source]

Register mesh with Vulkan engine, return MeshHandle.

Returns None if the mesh has no vertex data (skipped gracefully).

register_skinned_mesh(mesh: Any) Any | None[source]

Register skinned mesh with Vulkan engine, return MeshHandle.

Returns None if the mesh has no vertex data.

register_material(material: simvx.core.Material | None) int[source]

Convert simvx.core Material to Vulkan material index.

Deduplicates materials by content: two Material objects with identical rendering properties share the same SSBO slot.

upload_materials() None[source]

Upload material array to renderer.

submit_scene(tree: simvx.core.SceneTree) None[source]

Walk scene tree and submit instances to renderer.

Performs a single tree traversal to collect all renderable node types, then passes the pre-collected lists to individual submission methods.

Gracefully handles scenes with no Camera3D (e.g. editor UI-only scenes) by skipping 3D submission while still processing 2D overlays.