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

WebRenderer3D

WebGPU 3D renderer — serializes scene state + streams uploads via drain channel.

Data

API

simvx.graphics.renderer.web3d.log[source]

‘getLogger(…)’

simvx.graphics.renderer.web3d.__all__

[‘WebRenderer3D’]

class simvx.graphics.renderer.web3d.WebRenderer3D(width: int, height: int)[source]

Bases: simvx.graphics.renderer._base.Renderer

WebGPU 3D renderer — serializes scene state + streams uploads via drain channel.

Initialization

begin_frame() None[source]
pre_render(cmd: Any) None[source]
render(cmd: Any) None[source]
resize(width: int, height: int) None[source]
destroy() None[source]
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]
set_materials(materials: numpy.ndarray) None[source]
set_lights(lights: 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_particles(particle_data: numpy.ndarray) None[source]
submit_light2d(**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_layer signature so SceneAdapter can 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.

capture_frame() numpy.ndarray[source]
serialize_frame() bytes[source]

Group instances by mesh + pass + texture-set, then serialize.

__slots__

()