Welcome to Python-flavored Magnum! Please note that, while already being rather stable, this functionality is still considered experimental and some APIs might get changed without preserving full backwards compatibility.

magnum.gl.AbstractShaderProgram class

Base for shader program implementations

Enums

class TransformFeedbackBufferMode: INTERLEAVED_ATTRIBUTES = 35980 SEPARATE_ATTRIBUTES = 35981
Buffer mode for transform feedback

Methods

def attach_shader(self, arg0: Shader, /) -> None
Attach a shader
def bind_attribute_location(self, location: int, name: str) -> None
Bind an attribute to given location
def bind_fragment_data_location(self, location: int, name: str) -> None
Bind fragment data to given location and first color input index
def bind_fragment_data_location_indexed(self, location: int, index: int, name: str) -> None
Bind fragment data to given location and first color input index
def dispatch_compute(self, arg0: Vector3ui, /) -> AbstractShaderProgram
Dispatch compute
def draw(self, arg0: Mesh, /) -> None
Draw a mesh
def link(self, /) -> None
Link the shader
def set_uniform(self, arg0: int, arg1: float, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: int, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: int, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Vector2, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Vector3, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Vector4, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Vector2i, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Vector3i, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Vector4i, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Vector2ui, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Vector3ui, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Vector4ui, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Vector2d, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Vector3d, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Vector4d, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix2x2, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix3x3, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix4x4, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix2x3, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix3x2, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix2x4, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix4x2, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix3x4, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix4x3, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix2x3d, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix3x2d, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix2x4d, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix4x2d, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix3x4d, /) -> None
Set uniform value
def set_uniform(self, arg0: int, arg1: Matrix4x3d, /) -> None
Set uniform value
def set_uniform_block_binding(self, arg0: int, arg1: int, /) -> None
Set uniform block binding
def uniform_block_index(self, arg0: str, /) -> int
Get uniform block index
def uniform_location(self, arg0: str, /) -> int
Get uniform location
def validate(self, /) -> tuple[bool, str]
Validate program

Special methods

def __init__(self, /) -> None
Constructor

Properties

id: int get
OpenGL program ID
retrievable_binary: bool set
Allow retrieving program binary
separable: bool set
Allow the program to be bound to individual pipeline stages

Method documentation

def magnum.gl.AbstractShaderProgram.uniform_block_index(self, arg0: str, /) -> int

Get uniform block index

Exceptions
ValueError If there’s no uniform block of that name

def magnum.gl.AbstractShaderProgram.uniform_location(self, arg0: str, /) -> int

Get uniform location

Exceptions
ValueError If there’s no uniform of that name