• Minimise resource usage, order values to pack into blocks of channelsMax; interpreted as indexes into the given values.

    Parameters

    • values: array<number>

      Each entry is how many interdependent channels are grouped into one texture in one pass, separate entries may be across one or more textures/passes. See mapGroups.

    • OptionalchannelsMax: number = channelsMaxDef

      The maximum number of channels per texture. See mapGroups.

    • Optionalto: any[] = []

      An array to store the result; a new array if not given.

    Returns array<number>

    to The indexes of the given values, reordered to pack into the fewest buckets of channelsMax size or less; stored in the given to array.

    mapGroups