simvx.graphics.renderer.forward¶
Default renderer — Vulkan forward path; implements the RendererBackend ABC.
Module Contents¶
Classes¶
Default Vulkan forward renderer — multi-draw indirect, per-viewport frustum culling. |
Data¶
API¶
- simvx.graphics.renderer.forward.__all__¶
[‘Renderer’]
- simvx.graphics.renderer.forward.log¶
‘getLogger(…)’
- class simvx.graphics.renderer.forward.Renderer(engine: Any, max_objects: int = 10000)[source]¶
Bases:
simvx.graphics.renderer._base.RendererBackendDefault Vulkan forward renderer — multi-draw indirect, per-viewport frustum culling.
Initialization
- set_skybox(cubemap: simvx.graphics.engine.CubemapHandle) None[source]¶
Set a cubemap as the skybox and enable IBL.
Accepts a :class:
~simvx.graphics.engine.CubemapHandlereturned by- Meth:
Engine.load_cubemap. The renderer takes ownership of the underlying Vulkan resources and destroys them at shutdown.
- property post_processing: simvx.graphics.renderer.post_process.PostProcessPass | None[source]¶
Access post-processing pass for configuration.
- property custom_post_processing: simvx.graphics.renderer.custom_post_process.CustomPostProcessPass | None[source]¶
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[source]¶
Access SSAO pass for configuration.
- property fog: simvx.graphics.renderer.fog_pass.FogPass | None[source]¶
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).
- 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_shader_instance(mesh_handle: simvx.graphics._types.MeshHandle, transform: numpy.ndarray, material_id: int, shader_material: Any) None[source]¶
Submit a MeshInstance3D that carries a ShaderMaterial.
The per-material pipeline is lazy-compiled + cached on first use via ShaderMaterialManager. During the forward draw, the renderer splits these submissions into their own bucket, binds the custom pipeline, updates the uniform buffer, and draws one mesh at a time — per- material pipeline switching is the cost of the custom-shader path.
- 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_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.
- resize(width: int, height: int) None[source]¶
Handle framebuffer resize — recreate post-process targets + 3D pipelines.
- register_mesh(vertices: numpy.ndarray, indices: numpy.ndarray) simvx.graphics._types.MeshHandle[source]¶
Register mesh data on GPU via engine’s mesh registry.
- upload_texture_pixels(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__¶
()