• Defines the texture samples/reads per-pass, as GLSL preprocessor macros.

    The macros define the mapping between the values and those they derive from, as step/texture locations in a samples list, and indexes to read values from sampled data in a reads list (once sampled into a data list, as in macroTaps or similar).

    They're set up as function-like macros that may be called from the shader to initialise the mappings arrays with a given name. Caches the result if macros generation is enabled, to help reuse shaders.

    Parameters

    • state: any

      Properties used to generate the macros. See toData.

    • 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

    GLSL preprocessor macros defining the mappings for samples and reads, for each value.