I have been writing a tool over the last few months which will take GLSL shader code and optimize it in a variety of ways.
It can apply a range of changes from simply code reformatting, optimizing maths and function calls, all the way to GOLFing code.
‘Code golf’ is where you make attempts to make the source code as small as possible. Making a tool do this automatically (without breaking the code!) is quite a challenge, but the latest incarnation of my app has got the ‘The Small Step‘ shader code down to a little over 2Kb.
GLSL Shader Shrinker – Feel free to check it out – It’s free!