title: Externally Define Preprocessor Macros in GLSL
body: <p>GLSL has a full C-style preprocessor. The only thing that does not work is #include. One of the great features is that that you can used #ifdef to comment out functions and thus create one shader that can be thinned out if certain features are not used.</p>
  
  <p>My Question is: </p>
  
  <p><strong>Is there a way to define a macro from C code?</strong> </p>
  
  <p>There seems no way to do that with the openGL interface. The quick hack is to prepend a few lines with #define FOO before the code loaded form file. But it seems kind of backwards.</p>