Class Program

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

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.

fragmentShader: Shader

The fragment shader of this shader program.

gl: WebGL2RenderingContext

The rendering context of this shader program.

program: WebGLProgram

The WebGL API interface of this shader program.

transformFeedbackBufferMode: TransformFeedbackBufferMode

The mode this program uses when capturing transform feedback varyings.

transformFeedbackVaryings: ReadonlyMap<string, Varying>

A map of transform feedback varying names to varyings.

uniforms: ReadonlyMap<string, Uniform>

A map of uniform names to uniforms.

vertexShader: Shader

The vertex shader of this shader program.

Accessors

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

    Returns boolean

  • 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.

    Returns

    A shader program.

    Parameters

    • gl: WebGL2RenderingContext

      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

Generated using TypeDoc