Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ShaderProgram

Indexable

[key: string]: any

Index

Constructors

constructor

Properties

ATTRIBUTE

ATTRIBUTE: string = "attribute"

FRAGMENT_SHADER

FRAGMENT_SHADER: string = "fragment"

UNIFORM

UNIFORM: string = "uniform"

VERTEX_SHADER

VERTEX_SHADER: string = "vertex"

Private _fragmentShader

_fragmentShader: WebGLShader | null = null

Private _program

_program: WebGLProgram | null = null

Private _vertexShader

_vertexShader: WebGLShader | null = null

webGL

webGL: WebGLRenderingContext

Accessors

program

  • get program(): WebGLProgram | null

Methods

addShader

  • addShader(type: string, source: string): void
  • Compiling and attaching shader to this program.

    Parameters

    • type: string

      can be ['vertex', 'fragment'].

    • source: string

    Returns void

create

  • create(deleteShaders?: boolean): WebGLProgram

linkAttribute

  • linkAttribute(name: string, customName: string): any
  • Linking attribute variable of program to this object.

    Parameters

    • name: string

      variable name in shader.

    • customName: string

    Returns any

linkUniform

  • linkUniform(name: string, customName: string): any
  • Linking uniform variable of program to this object.

    Parameters

    • name: string

      variable name in shader.

    • customName: string

    Returns any

linkVariable

  • linkVariable(type: string, name: string, customName: string): any
  • Linking variable of program to this object.

    Parameters

    • type: string

      can be ['attribute', 'uniform']

    • name: string

      variable name in shader.

    • customName: string

    Returns any

use

  • use(): void

useIn

  • useIn(webGL: WebGLRenderingContext): void

Generated using TypeDoc