picogl.shaders.load

Shader utilities

Attributes

DEFAULT_VERTEX_SHADER_SRC

DEFAULT_FRAGMENT_SHADER_SRC

Classes

ShaderSourceType

Shader Source Types

Functions

load_shader_source_string(→ str)

Loads a shader_manager.current_shader_program source file as a string.

load_fragment_and_vertex_for_shader_type(→ tuple[str, str])

load_fragment_and_vertex_for_shader_type

get_shader_path(→ pathlib.Path)

get shader path

Module Contents

picogl.shaders.load.load_shader_source_string(file_name: str | pathlib.Path, directory: str | None = None) str[source]

Loads a shader_manager.current_shader_program source file as a string.

Parameters:
  • file_name – Shader file name (e.g., “atoms_vertex.glsl”).

  • directory – Optional base shader_directory; defaults to script’s shader_directory.

Returns:

Shader source code.

Raises:

RuntimeError – If file not found or unreadable.

picogl.shaders.load.DEFAULT_VERTEX_SHADER_SRC[source]
picogl.shaders.load.DEFAULT_FRAGMENT_SHADER_SRC[source]
class picogl.shaders.load.ShaderSourceType[source]

Shader Source Types

vertex = 'vertex'[source]
fragment = 'fragment'[source]
picogl.shaders.load.load_fragment_and_vertex_for_shader_type(shader_type_value: str, shader_directory: str) tuple[str, str][source]

load_fragment_and_vertex_for_shader_type

Parameters:
  • shader_directory – str

  • shader_type_value – ShaderType

Returns:

None

picogl.shaders.load.get_shader_path(shader_type_value: str, shader_source_type=ShaderSourceType.vertex) pathlib.Path[source]

get shader path