simvx.graphics.renderer._base¶
Renderer protocol — defines the contract any rendering backend must satisfy.
The ForwardRenderer (Vulkan) is the reference implementation. Future backends (WebGPU, streaming) implement the same protocol so SceneAdapter, App, and testing infrastructure work identically across backends.
Module Contents¶
Classes¶
Base class for rendering pipelines (forward, deferred, webgpu, etc.). |
Data¶
API¶
- simvx.graphics.renderer._base.__all__¶
[‘Renderer’]
- class simvx.graphics.renderer._base.Renderer[source]¶
Bases:
abc.ABCBase class for rendering pipelines (forward, deferred, webgpu, etc.).
Backends implement these methods. SceneAdapter calls the submission methods each frame; Engine calls the lifecycle methods. The numpy dtype boundary (VERTEX_DTYPE, MATERIAL_DTYPE, LIGHT_DTYPE, TRANSFORM_DTYPE) is the contract.
- abstractmethod pre_render(cmd: Any) None[source]¶
Offscreen passes (shadows, SSAO) — after submissions, before main pass.
- abstractmethod render(cmd: Any) None[source]¶
Record draw commands into cmd during the main render pass.
- abstractmethod submit_instance(mesh_handle: simvx.graphics._types.MeshHandle, transform: numpy.ndarray, material_id: int, viewport_id: int = 0) None[source]¶
Submit a single mesh instance for rendering.
- abstractmethod 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 multiple instances of the same mesh.
- abstractmethod submit_skinned_instance(mesh_handle: simvx.graphics._types.MeshHandle, transform: numpy.ndarray, material_id: int, joint_matrices: numpy.ndarray) None[source]¶
Submit a skinned mesh with joint matrices.
- abstractmethod set_materials(materials: numpy.ndarray) None[source]¶
Upload material array (MATERIAL_DTYPE) to GPU.
- abstractmethod set_lights(lights: numpy.ndarray) None[source]¶
Upload light array (LIGHT_DTYPE) to GPU.
- abstractmethod submit_text(text: str, x: float, y: float, size: float, colour: tuple[float, float, float, float], **kwargs: Any) None[source]¶
Submit 2D text for rendering.
- abstractmethod submit_particles(particle_data: numpy.ndarray) None[source]¶
Submit CPU particle data for rendering.
- abstractmethod register_mesh(vertices: numpy.ndarray, indices: numpy.ndarray) simvx.graphics._types.MeshHandle[source]¶
Register mesh data on GPU, return a handle for submissions.
- abstractmethod register_texture(pixels: numpy.ndarray, width: int, height: int) int[source]¶
Upload RGBA pixel data to GPU, return bindless texture index.
- abstractmethod capture_frame() numpy.ndarray[source]¶
Capture the last rendered frame as (H, W, 4) uint8 RGBA numpy array.
- __slots__¶
()