simvx.graphics.renderer.text_pass¶
2D text overlay pass using MSDF atlas: renders after 3D geometry.
Module Contents¶
Classes¶
GPU text rendering with MSDF atlas, proper CFFI pipeline. |
Data¶
API¶
- simvx.graphics.renderer.text_pass.__all__¶
[‘TextPass’]
- simvx.graphics.renderer.text_pass.log¶
‘getLogger(…)’
- simvx.graphics.renderer.text_pass.VERTEX_STRIDE¶
32
- simvx.graphics.renderer.text_pass.MAX_CHARS¶
4096
- simvx.graphics.renderer.text_pass.VERTEX_BUF_SIZE¶
None
- simvx.graphics.renderer.text_pass.INDEX_BUF_SIZE¶
None
- class simvx.graphics.renderer.text_pass.TextPass(engine: Any)[source]¶
GPU text rendering with MSDF atlas, proper CFFI pipeline.
Initialization
- pipeline_for(render_pass: Any, extent: tuple[int, int]) Any[source]¶
Return the MSDF pipeline compiled against
render_pass(design §5.3).The default :attr:
pipelinetargets the swapchain (sRGB). Text drawn into an offscreen RTT target (a SubViewport’s R16F colour) needs a pipeline compiled against that pass – a different colour format is render-pass- INCOMPATIBLE, so the swapchain pipeline silently fails to draw there. This lazily builds + caches one pipeline per distinctrender_pass(keyed by id); the layout is shared (same descriptor set / push constants). Returns the default pipeline whenrender_passis the engine’s main pass.
- upload_atlas_if_dirty() None[source]¶
Upload the shared TextRenderer’s atlas if its version changed.
Also checks Draw2D’s atlas (same shared atlas after unification). Must be called outside the render pass (staging transfers).
- upload_atlas(atlas_data: numpy.ndarray, version: int = 1, px_range: float = 4.0) None[source]¶
Upload MSDF atlas (RGBA uint8) to GPU via staging buffer.
Skips upload if the GPU already has this version. On version change, destroys old image/view/memory before creating new ones.
- upload_geometry(vertices: numpy.ndarray, indices: numpy.ndarray) None[source]¶
Upload per-frame text vertex/index data.