simvx.graphics.renderer.forward

Forward renderer — implements the Renderer ABC for the engine backend.

Module Contents

Classes

ForwardRenderer

Forward renderer with multi-draw indirect, per-viewport frustum culling.

Data

API

simvx.graphics.renderer.forward.__all__

[‘ForwardRenderer’]

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

‘getLogger(…)’

class simvx.graphics.renderer.forward.ForwardRenderer(engine: Any, max_objects: int = 10000)[source]

Bases: simvx.graphics.renderer._base.Renderer

Forward renderer with multi-draw indirect, per-viewport frustum culling.

Initialization

setup() None[source]

Initialize GPU resources — called once after engine Vulkan init.

set_skybox(cubemap_view: Any, cubemap_sampler: Any) None[source]

Set a cubemap as the skybox and enable IBL.

property post_processing: simvx.graphics.renderer.post_process.PostProcessPass | None

Access post-processing pass for configuration.

property custom_post_processing: simvx.graphics.renderer.custom_post_process.CustomPostProcessPass | None

Access custom user post-process pass for configuration.

set_gizmo_data(data: simvx.graphics.renderer.gizmo_pass.GizmoRenderData | None) None[source]

Set gizmo render data for the current frame (or None to hide).

property ssao: simvx.graphics.renderer.ssao_pass.SSAOPass | None

Access SSAO pass for configuration.

property fog: simvx.graphics.renderer.fog_pass.FogPass | None

Access fog pass for configuration.

set_materials(materials: numpy.ndarray) None[source]

Set material array and upload to GPU (skips if unchanged).

set_lights(lights: numpy.ndarray) None[source]

Set light array and upload to GPU (skips if unchanged).

Prepends uint32 light_count to match GLSL LightBuffer layout: [uint32 count][Light[0]][Light[1]]…

submit_text(text: str, x: float, y: float, font_path: str | None = None, size: float = 24.0, colour: tuple = (1.0, 1.0, 1.0, 1.0)) None[source]

Submit text for 2D overlay rendering.

init(device: Any, swapchain: Any) None[source]

Initialize (called by ABC contract — use setup() instead).

begin_frame() Any[source]

Begin frame — clear submission lists.

submit_instance(mesh_handle: simvx.graphics._types.MeshHandle, transform: numpy.ndarray, material_id: int = 0, viewport_id: int = 0) None[source]

Submit a mesh instance for rendering this frame.

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) None[source]

Bulk-submit many instances of the same mesh — avoids per-instance Python loops.

Args: mesh_handle: Shared mesh for all instances. transforms: (N, 4, 4) float32 array of model matrices. material_id: Material index for all instances (ignored if material_ids given). material_ids: Optional (N,) uint32 array of per-instance material indices. viewport_id: Viewport index.

submit_particles(particle_data: numpy.ndarray) None[source]

Submit particle data for rendering this frame.

submit_gpu_particles(emitter_config: dict) None[source]

Submit a GPU particle emitter config for compute-shader simulation this frame.

submit_light2d(**kwargs) None[source]

Submit a 2D light for this frame (forwarded to Light2DPass).

submit_occluder2d(polygon_vertices: list[tuple[float, float]]) None[source]

Submit a 2D occluder polygon for shadow casting this frame.

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 instance with joint matrices for this frame.

submit_dynamic(vertices: numpy.ndarray, indices: numpy.ndarray, transform: numpy.ndarray, material_id: int = 0, viewport_id: int = 0) None[source]

Submit dynamic geometry (uploaded and drawn this frame only).

pre_render(cmd: Any) None[source]

Record offscreen passes (shadow maps, HDR) before main render pass begins.

render(cmd: Any) None[source]

Record draw commands for all viewports.

resize(width: int, height: int) None[source]

Handle framebuffer resize — recreate pipeline.

cleanup() None[source]

Release all GPU resources.

destroy() None[source]

ABC destroy — delegates to cleanup.

register_mesh(vertices: numpy.ndarray, indices: numpy.ndarray) simvx.graphics._types.MeshHandle[source]

Register mesh data on GPU via engine’s mesh registry.

register_texture(pixels: numpy.ndarray, width: int, height: int) int[source]

Upload RGBA pixel data to GPU, return bindless texture index.

capture_frame() numpy.ndarray[source]

Capture the last rendered frame as (H, W, 4) uint8 RGBA numpy array.

__slots__

()