Class ShaderProgram

Shader program, corresponding to the GPU shader program.

Hierarchy

  • ShaderProgram

Constructors

Properties

_activeTextureUint: number = 0

Currently active texture unit.

_engine: Engine
_fragmentShader: WebGLShader
_gl: WebGLRenderingContext
_glProgram: WebGLProgram
_isValid: boolean
_vertexShader: WebGLShader
attributeLocation: Record<string, number> = ...

Attribute variable location in webgl.

cameraUniformBlock: ShaderUniformBlock = ...
id: number

Shader program id.

materialUniformBlock: ShaderUniformBlock = ...
otherUniformBlock: ShaderUniformBlock = ...
rendererUniformBlock: ShaderUniformBlock = ...
sceneUniformBlock: ShaderUniformBlock = ...
_counter: number = 0

Shader program counter.

Accessors

Methods

  • Create a webgl program instance.

    Returns

    WebGL program.

    Parameters

    • vertexSource: string

      Vertex source code.

    • fragmentSource: string

      Fragment source code.

    Returns WebGLProgram

  • Create and compile shader.

    Returns

    WebGLShader | null

    Parameters

    • shaderType: number

      Fragment shader code or vertex shader code.

    • shaderSource: string

      Fragment shader source code or vertex shader source code.

    Returns WebGLShader

  • Get the address of the active attribute variable in the current webgl program.

    Returns

    Array of attribute variable addresses.

    Returns WebGLActiveInfo[]

  • Get the address of the active uniform variable in the current webgl program.

    Returns

    Array of uniform variable addresses.

    Returns WebGLActiveInfo[]

Generated using TypeDoc