Computer graphics has become of the fastest growing and dramatically changing aspect of IT in the last two decades. As such, the software developers come up with new technologies day-by-day, let it be Computer-generated imagery (CGI), game development or 3D graphics. Due to the limits of shader programming not every common technique and design pattern used by traditional programming (traditional in sense of writing for a CPU) can be utilized (e.g. dynamic dispatch, polymorphism).
The main barrier is that shader programs have to fully defined when designing a game, so it's hard to create a flexible design. The solution this thesis gives solves this problem by using template shaders at design time and specializing them in runtime with the similar tools to C++ macros and template programming. This makes the shader programs flexible and configurable in runtime.
Using this method, we can create content-sensitive shaders, with a contract defined between the content (models, textures...) and the shader in runtime.