Closed einarf closed 6 years ago
Currently we rely on a single glsl file with preprocessors separating each shader type.
#version 330 #if defined VERTEX_SHADER // Vertex Shader in vec3 in_position; void main() { gl_Position = vec4(in_position, 1.0); } #elif defined FRAGMENT_SHADER // Fragment Shader out vec4 fragColor; void main() { fragColor = vec4(1.0); } #endif
There are very good reasons to support mixing and matching different shaders and this would be fairly easy to achieve.
# Single file shaders.load('test.glsl') # Multiple files shaders.load(vertex_shader='test.vert', fragment_shader='test.frag', .... etc)
We should also make shader loading pluggable. Make some base class and implement the standard loader. Then people can customize if needed.
Fixed
Currently we rely on a single glsl file with preprocessors separating each shader type.
There are very good reasons to support mixing and matching different shaders and this would be fairly easy to achieve.