• Create a shader from named shader chunks.

    Parameters

    • device: GraphicsDevice

      The graphics device.

    • vsName: string

      The vertex shader chunk name.

    • fsName: string

      The fragment shader chunk name.

    • OptionaluseTransformFeedback: boolean | Record<string, string | boolean | string[]> = false

      Whether to use transform feedback. Defaults to false.

    • OptionalshaderDefinitionOptions: {
          fragmentOutputTypes: string | string[];
          useTransformFeedback: boolean;
      } = {}

      Additional options that will be added to the shader definition.

      • fragmentOutputTypes: string | string[]

        Fragment shader output types, which default to vec4. Passing a string will set the output type for all color attachments. Passing an array will set the output type for each color attachment.

      • useTransformFeedback: boolean

        Whether to use transform feedback. Defaults to false.

    Returns Shader

    The newly created shader.

    ShaderUtils.createDefinition