picogl.backend.gl.api.shader.uniform ==================================== .. py:module:: picogl.backend.gl.api.shader.uniform .. autoapi-nested-parse:: Provides utility functions for managing shader programs and uniform variables in OpenGL. This module includes methods to activate shader programs, update 4x4 matrix uniform variables, and handle uniform updates by their variable names. It serves as a utility layer for efficient OpenGL rendering tasks. Classes ------- .. autoapisummary:: picogl.backend.gl.api.shader.uniform.GLShader Functions --------- .. autoapisummary:: picogl.backend.gl.api.shader.uniform.gl_uniform_matrix_4fv picogl.backend.gl.api.shader.uniform.gl_uniform_name_matrix_4f picogl.backend.gl.api.shader.uniform.gl_set_uniform_matrix Module Contents --------------- .. py:function:: gl_uniform_matrix_4fv(location: int, count: int, transpose: picogl.boolean.GLBoolean, value: Any) -> None Sets a 4x4 matrix for a given uniform variable in the currently active shader program. Parameters: location (int): The location of the uniform variable to be updated. count (int): The number of matrices to be loaded. Typically 1. transpose (GLBoolean): Specifies whether to transpose the matrix values. value (Any): The matrix data to be assigned to the uniform variable. Returns: None .. py:function:: gl_uniform_name_matrix_4f(value: Any, location: int, uniform_name: str) -> None Updates a 4x4 matrix uniform variable in the OpenGL shader program. This function sets the value of a 4x4 matrix uniform variable within a specified OpenGL shader program. It locates the uniform variable by its name and location, then applies the given matrix value. Parameters: value : Any The 4x4 matrix to be used as the uniform value in the shader. location : int The reference to the OpenGL shader program. uniform_name : str The name of the uniform variable within the shader program. Returns: None .. py:class:: GLShader Bases: :py:obj:`enum.IntEnum` GL Shader .. py:attribute:: VERTEX_SHADER .. py:attribute:: FRAGMENT_SHADER .. py:function:: gl_set_uniform_matrix(shader_program: int, shader_uniform_name: str, matrix: numpy.ndarray) gl set uniform matrix