ok so quake3 had software shaders through its .shader files, but now that shaders are now implemented in hardware, JC has had to change them to .mtr material files for doom3, but they essentially were the same as .shader files.
Anyway my question is how exactly would i use glSlang to implement a material script system for my engine. My thoughts are to have the same syntax as .mtrfiles, and for each stage in the .mtr file add a line to the .frag shader like:
gl_FragColor += sample2d(...
For each .mtr i would create a new glSlang program, and store it for use later on. Would this work? I am worried that it might be a strain on the system having a hundred different glSlang programs in memory.
In case you dont know, a 'stage' in a .mtr file defines kinda defines a pass to be added when rendering using hte shader. each stage can have its own texture map.