simvx.graphics.renderer.outline_pass

Selection outline rendering — backface hull expansion technique.

Renders selected objects with front-face culling and slight vertex expansion along normals, producing a colored outline around selected geometry. Operates within the existing render pass (no stencil required).

Module Contents

Classes

OutlinePass

Draws colored outlines around selected objects using backface hull expansion.

Data

API

simvx.graphics.renderer.outline_pass.__all__

[‘OutlinePass’]

simvx.graphics.renderer.outline_pass.log

‘getLogger(…)’

class simvx.graphics.renderer.outline_pass.OutlinePass(engine: Any)

Draws colored outlines around selected objects using backface hull expansion.

Technique: render selected meshes with front-face culling and vertices expanded along their normals. Only the “rim” of the expanded mesh is visible, creating an outline effect. Works without stencil support.

Attributes: outline_color: RGBA outline color (default: orange). outline_width: Controls vertex expansion magnitude (default: 3.0). enabled: Toggle outline rendering on/off.

Initialization

setup() None

Create outline pipeline and GPU resources.

set_outline_color(color: tuple[float, float, float, float]) None

Update outline color. Requires pipeline recreation.

render(cmd: Any, selected_instances: list[tuple[simvx.graphics._types.MeshHandle, numpy.ndarray, int]], view_proj_data: bytes, registry: Any, extent: tuple[int, int]) None

Record outline draw commands for selected objects.

Args: cmd: Active command buffer (inside render pass). selected_instances: List of (mesh_handle, transform_4x4, material_id) for selected objects. view_proj_data: Pre-packed view+proj push constant bytes (128 bytes, column-major). registry: MeshRegistry for vertex/index buffer lookup. extent: Framebuffer (width, height).

cleanup() None

Release all GPU resources.