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.SHADER_DIR¶
None
- 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)¶
GPU text rendering with MSDF atlas, proper CFFI pipeline.
Initialization
- setup() None¶
Initialize GPU resources.
- property pipeline: Any¶
- property pipeline_layout: Any¶
- property descriptor_set: Any¶
- property px_range: float¶
- property atlas_version: int¶
- upload_atlas_if_dirty() None¶
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¶
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¶
Upload per-frame text vertex/index data.
- render(cmd: Any, width: int, height: int) None¶
Record text draw commands into the active render pass.
- cleanup() None¶
Release all GPU resources.