Defines all GLSL preprocessor macro values, texture samples, and outputs for the active pass.

The macros define the mapping between the active values, their textures and channels, bound outputs, and other macros useful for a draw pass. Caches the result if macros generation is enabled, to help reuse shaders.

  • Parameters

    • state: any

      Properties for generating the macros. See toData and mapGroups.

    • Optionalon: string

      Any further macro hooks specifier; if given, both the hook key and this specifier are checked (e.g: key and key_on).

    Returns string

    The GLSL preprocessor macros defining the mappings for values, textures, channels, bound outputs of the active pass, etc. See macroValues, macroOutput, and macroSamples.