The Shader Program Handler
ShaderProgram
ShaderProgram encapsulates the handling of shaders by interacting directly with an OpenGL context provided by moderngl.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
opengl_context |
Context
|
The OpenGL context. |
required |
shader_dir |
str
|
The directory containing the vertex and fragment shader source code files. |
required |
Source code in pynecraft/shader_program.py
get_program(shader_dir)
Create a shader program from the vertex and fragment shader source
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shader_dir |
str
|
The directory containing the vertex and fragment shader source code files. |
required |
Source code in pynecraft/shader_program.py
set_uniforms()
Set the uniform variables of the shader program, the values of which remain constant for all vertices processed during a single draw call.