MZ ColorFilter._fragmentSrc and further GLSL queries

Kamusta dudes and dudettes,

I'm taking a look at the ColorFilter class and came across ColorFilter.prototype._fragmentSrc (which contains the GLSL code for the filter):
ColorFilter_fragmentSrc.png


Looking at other GLSL code on the interwebs, I noticed that the code below contains "#" before certain statements...
glsl_example.png


Can anybody explain the difference between the two... why is "#" used in one and not the other? And if I were to use GLSL code similar to the latter in my own RMMZ filter, would I still include the "#"?

Thanks in advance!
#ifdef and its accompanying #else are C-like preprocessor directives, i.e. instructions for the compiler. This MSDN article explains the use of such directives in C:
Page 3 of these reference cards has a brief summary of available directives for WebGL:
In the example you cited, I think (?) it is checking whether this shader program has already encountered a #define SIMPLE_LINEAR_GAMMA directive: if so, it compiles one shader; if not, it compiles the other one instead.

Note that MV/MZ games use WebGL, a.k.a. OpenGL ES ("Embedded Systems"). This is limited in various ways compared to standard OpenGL, e.g. you can only access vertex and fragment shaders. Here are some technical links for further information:
And a couple more for tutorials/examples:
👋
@caethyril thank you for the clarification and the supporting documents! I have some reading to do after breakfast 🙂

Original thread: https://forums.rpgmakerweb.com/threads/colorfilter-_fragmentsrc-and-further-glsl-queries.140821/