the topic is quite clear and nothing new I guess
So I'll keep it straight: My first Idea was to code a predefined set of shaders and let the user that was making materials to select them (so no node based approach like unreal material editor or maya hypershader).
I was thinking to avoid in this way not only the explosion that was resulting from the node based approaches but also the fact that shaders generated with node based approaches are more prone in being not optimized at all, or at least, less mantainable in the long run.
The idea is to let the engine programmers to write shaders and optimize them. So, a typical technical artist is allowed only to create materials with a given set of shaders. I think is the crytek material editor approach and naughty dog material editor too: few shaders, optimized and several materials using them.
I'm realizing now that If I write at hand, for example, bump mapping with no specular map (e.g. for a rock material, or in general for a material that doesn't have specular properties) then when I have to write the shader which has specular map I have to duplicate all the code since they differ only for a texture: the specular map. It's a waste of time and I'm wondering if I'll be constrained in making the usual uber shader or if there is a better and faster way to generate shaders considering that most of the code is shared.
At them moment in the engine I'll have to write a set of function and classes for each new shader added ... not fast at all if I want to add a new shader.
What you guys suggest ?
I was thinking of some kind of shader cache that is loaded upfront etc ...
Thanks in advance for any reply













