Glsl ... a lot of shader ... is it a problem?

Hi,
I need to use a lot of shader with a lot of common function on it … Is it a problem to create a lot of shader at start … I know it takes times !!! but Can my program became shoppy and out of ressource … And second is there a simple way to cascad shader in a single pass in glsl or cg ?

regards

You should create a common shader, where all the basic functions are defined. For example, I create a shader with all lighting functions, fog, texturing.

Once compiled, you have just to link this shader with all your programs. Thus, you can “factorize” your code.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.