simvx.graphics.renderer.web3d¶
WebGPU 3D renderer — collects submissions and serializes to binary via Scene3DSerializer.
Implements the Renderer ABC without any Vulkan dependency. Resource uploads (meshes + material textures) travel on the separate drain channel to the browser’s Renderer3D, matching the 2D overlay path and the Vulkan backend. Frame binaries carry only per-frame state (viewports, lights, materials, draw groups, post-process).
Module Contents¶
Classes¶
WebGPU 3D renderer — serializes scene state + streams uploads via drain channel. |
Data¶
API¶
- simvx.graphics.renderer.web3d.__all__¶
[‘WebRenderer3D’]
- class simvx.graphics.renderer.web3d.WebRenderer3D(width: int, height: int)[source]¶
Bases:
simvx.graphics.renderer._base.RendererWebGPU 3D renderer — serializes scene state + streams uploads via drain channel.
Initialization
- submit_instance(mesh_handle: simvx.graphics._types.MeshHandle, transform: numpy.ndarray, material_id: int = 0, viewport_id: int = 0) None[source]¶
- submit_multimesh(mesh_handle: simvx.graphics._types.MeshHandle, transforms: numpy.ndarray, material_id: int = 0, material_ids: numpy.ndarray | None = None, viewport_id: int = 0, count: int = 0) None[source]¶
- submit_skinned_instance(mesh_handle: simvx.graphics._types.MeshHandle, transform: numpy.ndarray, material_id: int, joint_matrices: numpy.ndarray) None[source]¶
- submit_text(text: str, x: float, y: float, size: float, colour: tuple[float, float, float, float], **kwargs: Any) None[source]¶
- submit_tilemap_layer(tile_data: numpy.ndarray, tileset_tex_id: int, tile_size: tuple[float, float]) None[source]¶
Queue a tilemap layer for serialization in the current frame.
Mirrors the Vulkan
TileMapPass.submit_layersignature soSceneAdaptercan dispatch to either backend uniformly.
- set_post_process(bloom_enabled: bool = False, bloom_threshold: float = 1.0, bloom_intensity: float = 0.8, bloom_soft_knee: float = 0.5, fog_enabled: bool = False, fog_mode: int = 1, fog_density: float = 0.02, fog_start: float = 10.0, fog_end: float = 100.0, fog_colour: tuple[float, float, float, float] = (0.5, 0.6, 0.7, 1.0), fog_height: float = 0.0, fog_height_density: float = 0.0) None[source]¶
Update post-processing settings (synced from WorldEnvironment).
- register_mesh(vertices: numpy.ndarray, indices: numpy.ndarray) simvx.graphics._types.MeshHandle[source]¶
- upload_texture_pixels(pixels: numpy.ndarray, width: int, height: int) int[source]¶
Mint a texture id and enqueue the pixel payload on the drain channel.
- drain_resources() list[tuple[int, int, bytes]][source]¶
Return and clear pending
(kind, id, payload)resource entries.
- __slots__¶
()