This tool was designed and developed by me. As a means to simplify working with GLSL and make debugging and testing shaders easier. The main framework uses the Qt library and GLM to create meta data about the shader classes. Shaders are defined in header files and compiled into a library. First shaders are processed by Qt's moc tool then they're processed by the ShaderBuildTool. Information needed to build the resulting GLSL shader is written to the end of the moc file created by Qt. Then, the moc file is compiled into an object file. Last, the files are linked into a shared library.
Benefits
Compiler errors can be found and fixed at compile time instead of runtime.
Uniforms can be defined once instead of in the shader source and then again in C++ source. Which also fixes the problem of name mismatching when looking up uniforms.
Tests can be developed in C++ to test the shader algorithms.
Lamdbas can be used for function injection.
Inheritance GLSL does support classes or inheritance but because we're writing the shaders in C++ we can take advantage objects and function overriding.
Files can be included which brings the advantage of code reuse. Another feature that is not support by GLSL but is gained by using C++.
Shader Storage Buffer Objects or SSBO's can be hard to work with, because of the data alignment difference C++ and GLSL. But, when the object is defined in C++ we can simply this problem.
Back to Top