picogl.renderer.uvrenderer

Module providing the UvRenderer class for rendering 2D UV meshes using OpenGL.

The module implements a specific renderer for meshes defined with UV coordinates and indices. The UvRenderer class is designed for lightweight UV rendering tasks and operates using OpenGL buffers. It provides methods for binding buffers and rendering the defined UV mesh content.

Classes

UvRenderer

2D UV Renderer that draws a mesh using UV coordinates and indices.

Module Contents

class picogl.renderer.uvrenderer.UvRenderer(parent: object = None, vertex_shader_file: str = 'glsl/utils/uv2d/vertex.glsl', fragment_shader_file: str = 'glsl/utils/uv2d/fragment.glsl')[source]

Bases: picogl.renderer.initializable.Initializable, picogl.renderer.RendererBase

2D UV Renderer that draws a mesh using UV coordinates and indices. Follows the RendererBase interface.

uv_buffer: int | None = None[source]
indices_buffer: int | None = None[source]
index_count: int = 0[source]
shader: picogl.backend.modern.core.shader.program.ShaderProgram[source]
bind(uv_buffer: int, indices_buffer: int, index_count: int) None[source]

Bind the UV and index buffers to the renderer.

Parameters:
  • uv_buffer – OpenGL buffer ID containing UVs

  • indices_buffer – OpenGL buffer ID containing indices

  • index_count – Number of indices to draw

_setup(index_count: int, indices_buffer: int, uv_buffer: int)[source]
_draw_model() None[source]

Draw the UV mesh. Called by RendererBase.render().