Jose Goruka
02-26-2008, 11:12 AM
Hi! I'm new to GLSL and overall to shader development, so I wanted to ask a design question:
First of all, imagine I want to write all the shading of my game project by hand (as in, not use the fixed pipeline). Is there any gain in this? or using the fixed pipeline will be always faster/slower?
Second, how are shader programs organized? I can see you have functions and conditionals, is it better to have only one shader with many functions/conditionals, and depending material/texture properties, do something or something else with a conditional?
Or should I focus on make a small, separate shaders for every specific thing?
Third and last. I'm not sure wether it is possible to feed custom data arrays. Say I want to do skeletal animation with skinning, for example, I'd need to pass weights and matrices to the vertex program for that, is this a good idea?
Thanks
First of all, imagine I want to write all the shading of my game project by hand (as in, not use the fixed pipeline). Is there any gain in this? or using the fixed pipeline will be always faster/slower?
Second, how are shader programs organized? I can see you have functions and conditionals, is it better to have only one shader with many functions/conditionals, and depending material/texture properties, do something or something else with a conditional?
Or should I focus on make a small, separate shaders for every specific thing?
Third and last. I'm not sure wether it is possible to feed custom data arrays. Say I want to do skeletal animation with skinning, for example, I'd need to pass weights and matrices to the vertex program for that, is this a good idea?
Thanks