shader_program
GLSL Shader program compilation and uniform management.
This module manages the ModernGL shader programs used for rendering the world, UI, and post-processing effects. It loads vertex and fragment shaders from disk, compiles them, and provides a central interface for updating dynamic uniforms (like camera matrices, fog density, and time of day) every frame.
- class shader_program.ShaderProgram(app)[source]
Bases:
objectCompiles, links, and manages all GLSL shader programs used by the engine.
Handles sending static and dynamic uniform data (view matrices, lighting, fog) to the GPU to ensure visuals react appropriately to player movement and time.
- Parameters:
app (Any) – The main application context containing the ModernGL instance.
- set_uniforms_on_init()[source]
Initializes static shader uniforms (like texture assignments, texture mapping arrays, and basic projection matrices) that only need to be uploaded once.
- Return type:
None