View Full Version : glsl ... a lot of shader ... is it a problem?

08-30-2005, 10:50 AM
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 ?


08-30-2005, 10:30 PM
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.