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.shaders.DistanceFieldVectorGL2D class

2D distance field vector OpenGL shader

Enums

class Flags: TEXTURE_TRANSFORMATION = 1 NONE = 0
Flags

Methods

def bind_vector_texture(self, arg0: gl.Texture2D, /) -> None
Bind a vector texture
def draw(self, arg0: gl.Mesh, /) -> None
Draw a mesh
def validate(self, /) -> tuple[bool, str]
Validate program

Special methods

def __init__(self, *, flags: Flags = Flags.NONE) -> None
Constructor

Properties

color: Color4 set
Color
flags: Flags get
Flags
id: int get
OpenGL program ID
outline_color: Color4 set
Outline color
outline_range: tuple[float, float] set
Outline range start and end
smoothness: float set
Smoothness
texture_matrix: Matrix3 set
Texture matrix
transformation_projection_matrix: Matrix3 set
Transformation and projection matrix

Data

POSITION: gl.Attribute
Vertex position
TEXTURE_COORDINATES: gl.Attribute
2D texture coordinates
TransformFeedbackBufferMode
attach_shader
bind_attribute_location
bind_fragment_data_location
bind_fragment_data_location_indexed
dispatch_compute
retrievable_binary
separable
set_uniform
set_uniform_block_binding
uniform_block_index
uniform_location

Property documentation

magnum.shaders.DistanceFieldVectorGL2D.texture_matrix: Matrix3 set

Texture matrix

Exceptions
AttributeError If the shader was not created with Flags.TEXTURE_TRANSFORMATION