world-of-might-and-magic
world-of-might-and-magic copied to clipboard
Templating for Shaders
Describe the Idea Add basic parsing when loading shaders so we could pick between different code blocks when using different GL versions.
Related Notes #351 added 'precision' commands to top of shaders which are required for GLES builds. These are typically ignored by most GL drivers, however, it only became specification compliant in 4.4. As we are still targeting GL ver 4.1, this may cause issues on some hardware.
What's the industry standard for this? Just using a simple templating engine?
In the old times templates or just bundle multiple versions. And in general it is very rare situation that some game have support for different OpenGL versions, usually thats two different API, not subsets. Nowadays I bet everyone just write shaders in spir-v and compile variations from that in a automatic manner.
Kicking this down the road