world-of-might-and-magic icon indicating copy to clipboard operation
world-of-might-and-magic copied to clipboard

Templating for Shaders

Open pskelton opened this issue 2 years ago • 3 comments

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.

pskelton avatar Jan 07 '23 11:01 pskelton

What's the industry standard for this? Just using a simple templating engine?

captainurist avatar Jan 07 '23 13:01 captainurist

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.

CkNoSFeRaTU avatar Jan 07 '23 13:01 CkNoSFeRaTU

Kicking this down the road

pskelton avatar Nov 07 '23 22:11 pskelton