wolfhece.opengl.cloud_points_shader2d

Shared-resource shader for cloud point rendering.

Draws cloud vertices as GL_POINTS with configurable shape in fragment shader (point, circle, cross, quad), color and fill mode.

Module Contents

wolfhece.opengl.cloud_points_shader2d.SHADER_DIR[source]
wolfhece.opengl.cloud_points_shader2d.SYMBOLS_DIR[source]
class wolfhece.opengl.cloud_points_shader2d.CloudPointsShader2D[source]

Singleton shader for point-cloud rendering.

_instance: CloudPointsShader2D | None = None[source]
_program: int | None = None[source]
_locs: dict | None = None[source]
_vao: int | None = None[source]
_vao_pt: int | None = None[source]
_vbo: int | None = None[source]
_texture_cache: dict[tuple[str, float], int][source]
classmethod get_instance() CloudPointsShader2D[source]
_init_program()[source]
static _compile(shader_type: int, path: pathlib.Path) int[source]
_ensure_vao_vbo()[source]
_upload(pts_xy: numpy.ndarray)[source]
_get_symbol_texture_id(symbol_path: str | None, symbol_raster_size: int = 128) int | None[source]
draw_points(pts_xy: numpy.ndarray, mvp: numpy.ndarray, point_size_px: float, color: tuple[float, float, float, float], style: int, filled: bool, symbol_path: str | None = None, symbol_raster_size: int = 128, symbol_rotation: float = 0.0, symbol_scale: float = 1.0, pts_transform: numpy.ndarray | None = None)[source]

Draw cloud points with the shader pipeline.

Parameters:
  • symbol_rotation – Per-cloud rotation in radians (CCW, Option A). Ignored when pts_transform is provided.

  • symbol_scale – Per-cloud scale factor (Option A). Ignored when pts_transform is provided.

  • pts_transform – Optional (N, 2) float32 array with per-point [rotation_rad, scale] columns (Option B). When provided, overrides symbol_rotation and symbol_scale on a per-point basis and uses the dedicated 4-float VAO layout.

destroy()[source]