The GLSL preprocessor is βequalβ to the standard C preprocessors. Indeed, you can achieve what you want with the following preprocessor definition:
But note, since the concatenation operator ( ##) is only available with GLSL 1.30. In fact, using previous versions of GLSL, this macro will generate a compiler error.
Still wondering why you are not using the function pow...
source
share