• Creates a gpgpu update step function, for use with a gpgpu state object.

    Parameters

    • api: {
          buffer: any;
          clear: any;
          command: any;
      }

      An API for GL resources.

      • buffer: any

        Function to set up a GL buffer.

      • clear: any

        Function to clear GL view or framebuffer.

      • command: any

        Function to create a GL render pass, given options, to be called later with options; api if not given.

    • state: {
          maps: {
              passes: number[][];
          };
          merge: undefined | {
              texture: undefined | {
                  subimage: any;
              };
              update: undefined | Function;
          };
          pre: undefined | string;
          vert: undefined | string;
          frag: string;
          uniforms: any;
          positions: any;
          count: undefined | number;
          pipeline: any;
          verts: undefined | string[];
          frags: undefined | string[];
      } = {}

      The gpgpu state to use. See toData and mapGroups.

      • maps: {
            passes: number[][];
        }

        How values are grouped per-texture per-pass per-step. See mapGroups.

        • passes: number[][]
      • merge: undefined | {
            texture: undefined | {
                subimage: any;
            };
            update: undefined | Function;
        }

        Any merged state texture; uses separate state textures if not given.

      • pre: undefined | string

        The namespace prefix; preDef by default.

      • vert: undefined | string

        The step vertex shader GLSL; a simple flat screen shader if not given.

      • frag: string

        The step fragment shader GLSL.

      • uniforms: any

        The step uniforms; modifies any given. See toUniforms.

      • positions: any

        The step position attributes; 3 points of a large flat triangle if not given.

      • count: undefined | number

        The number of elements/attributes to draw.

      • pipeline: any

        Any GL command properties to mix in overriding those ones added here; all passed to api.command.

      • verts: undefined | string[]

        Preprocesses and caches vertex GLSL code per-pass if given, otherwise processes just-in-time before each pass.

      • frags: undefined | string[]

        Preprocesses and caches fragment GLSL code per-pass, otherwise processes just-in-time before each pass.

    • Optionalto: any = state

      The object to set up. Modifies the given state object by default.

    Returns any

    to The given to object; set up with a gpgpu step function and related properties, to use with the gpgpu state.

    Make this fully and consistently extensible; improve pipeline.

    Example.