Class Program

A vertex shader and a fragment shader which are used together to rasterize primitives.

See

Shaders

Hierarchy

  • Program

Constructors

  • Creates a shader program.

    Parameters

    • vertexShader: Shader

      The vertex shader.

    • fragmentShader: Shader

      The fragment shader.

    • transformFeedbackVaryingNames: string[] = []

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

    • transformFeedbackBufferMode: TransformFeedbackBufferMode = TransformFeedbackBufferMode.SEPARATE_ATTRIBS

      The mode to use when capturing transform feedback varyings.

    Returns Program

Properties

allowDepth: boolean

Whether this program is allowed to draw with depth. Used for optimization only.

allowTransparent: boolean

Whether this program is allowed to draw transparent objects. Used for optimization only.

attributes: ReadonlyMap<string, Attribute>

A map of attribute names to attributes.

context: Context

The rendering context of this shader program.

fragmentShader: Shader

The fragment shader of this shader program.

internal: WebGLProgram

The WebGL API interface of this shader program.

transformFeedbackBufferMode: TransformFeedbackBufferMode

The mode this program uses when capturing transform feedback varyings.

uniforms: ReadonlyMap<string, Uniform>

A map of uniform names to uniforms.

varyings: ReadonlyMap<string, Varying>

A map of varying names to varyings. Only includes varyings that are used for transform feedback.

vertexShader: Shader

The vertex shader of this shader program.

Accessors

  • get deleteStatus(): boolean
  • Whether this program is flagged for deletion.

    Returns boolean

  • get infoLog(): string
  • The information log for this shader program.

    Returns string

  • get linkStatus(): boolean
  • Whether the last link operation was successful.

    Returns boolean

  • get validateStatus(): boolean
  • Whether the last validation operation was successful.

    Returns boolean

Methods

  • Creates a shader program from source code.

    Parameters

    • context: Context

      The rendering context of the shader program.

    • vertexShaderSource: string

      The source code of the vertex shader.

    • fragmentShaderSource: string

      The source code of the fragment shader.

    Returns Program

    A shader program.

Generated using TypeDoc