@lakuna/ugl
    Preparing search index...

    Class Program

    A WebGL2 shader program.

    Hierarchy (View Summary)

    Index

    Constructors

    • Create a shader program.

      Parameters

      • context: Context

        The rendering context.

      • Optionalshaders: Shader[]

        The shaders to attach to the shader program. If a valid set of shaders is given, the program will be linked automatically.

      • OptionalattributeLocations: Map<string, number>

        A map of attribute names to their desired locations.

      • OptionalfeedbackVaryings: Iterable<string, any, any>

        The names of the varyings that should be tracked for transform feedback.

      • feedbackMode: MergeOrder = MergeOrder.SEPARATE_ATTRIBS

        The mode to use when capturing transform feedback varyings.

      Returns Program

      ProgramLinkError if there is an issue when linking the shader program.

    Properties

    context: Context

    The rendering context.

    Accessors

    • get activeAttributes(): number

      The number of active attribute variables in this shader program.

      Returns number

    • get activeUniforms(): number

      The number of active uniform variables in this shader program.

      Returns number

    • get attachedShadersCount(): number

      The number of shaders that are attached to this shader program.

      Returns number

    • get deleteStatus(): boolean

      The deletion status of this shader program.

      Returns boolean

    • get linkStatus(): boolean

      The linking status of this shader program.

      Returns boolean

    • get transformFeedbackVaryings(): number

      The number of transform feedback varying variables in this shader program.

      Returns number

    • get validateStatus(): boolean

      The validation status of this shader program.

      Returns boolean

    Methods

    • Bind a generic vertex index to an attribute variable. Doing this after linking this program has no effect.

      Parameters

      • index: number

        The index of the generic vertex to bind.

      • name: string

        The name of the variable to bind to the generic vertex index.

      Returns void

    • Specify the values to record in transform feedback buffers. Doing this after linking this program has no effect.

      Parameters

      • varyings: Iterable<string>

        The names of the varyings to use for transform feedback.

      • bufferMode: MergeOrder

        The mode to use when capturing the varying variables.

      Returns void

    • Create a shader program from the given shader source code.

      Parameters

      • context: Context

        The rendering context.

      • vss: string

        The vertex shader's source code.

      • fss: string

        The fragment shader's source code.

      Returns Program

      The shader program.

      ProgramLinkError if the shaders have different contexts, if either shader is not the correct type, or if there is an issue when linking the shader program.

      UnsupportedOperationError if a shader program cannot be created.

      UnsupportedOperationError if a shader cannot be created.

      ShaderCompileError if a shader fails to compile.