Options
All
  • Public
  • Public/Protected
  • All
Menu

Material is an object-oriented wrapper around a WebGLProgram.

Hierarchy

Implemented by

Index

Methods

activeTexture

Optional addRef

  • addRef(): number
  • Increments the reference count of an Shareable instance.

    Returns number

    The new reference count. This value is intended to be used only for testing purposes.

attrib

  • attrib(name: string, value: VertexBuffer, size: number, normalized?: boolean, stride?: number, offset?: number): Material
  • Parameters

    • name: string
    • value: VertexBuffer
    • size: number
    • Optional normalized: boolean
    • Optional stride: number
    • Optional offset: number

    Returns Material

Optional contextFree

  • contextFree(): void
  • Called to request the consumer to free any WebGL resources acquired and owned. The consumer may assume that its cached context is still valid in order to properly dispose of any cached resources. In the case of shared objects, this method may be called multiple times for what is logically the same context. In such cases the consumer must be idempotent and respond only to the first request.

    Returns void

Optional contextGain

  • contextGain(): void

Optional contextLost

  • contextLost(): void
  • Called to inform the dependent of a loss of WebGL rendering context. The dependent must assume that any cached context is invalid. The dependent must not try to use and cached context to free resources. The dependent should reset its state to that for which there is no context.

    Returns void

disableAttrib

  • disableAttrib(indexOrName: number | string): void

drawArrays

drawElements

enableAttrib

  • enableAttrib(indexOrName: number | string): void

getAttrib

  • getAttrib(indexOrName: number | string): Attrib

getAttribLocation

  • getAttribLocation(name: string): number

getUniform

  • getUniform(name: string): Uniform

hasUniform

  • hasUniform(name: string): boolean

matrix2fv

  • matrix2fv(name: string, elements: Float32Array, transpose?: boolean): Material

matrix3fv

  • matrix3fv(name: string, elements: Float32Array, transpose?: boolean): Material

matrix4fv

  • matrix4fv(name: string, elements: Float32Array, transpose?: boolean): Material

Optional release

  • release(): number
  • Decrements the reference count of an Shareable instance.

    Returns number

    The new reference count. This value is intended to be used only for testing purposes.

uniform

  • uniform(name: string, value: number | number[]): Material

uniform1f

  • uniform1f(name: string, x: number): void

uniform1fv

  • uniform1fv(name: string, data: Float32Array, srcOffset: number, srcLength: number): void

uniform1i

  • uniform1i(name: string, x: number): void

uniform1iv

  • uniform1iv(name: string, data: Int32Array, srcOffset?: number, srcLength?: number): void

uniform2f

  • uniform2f(name: string, x: number, y: number): void

uniform2fv

  • uniform2fv(name: string, data: Float32Array, srcOffset?: number, srcLength?: number): void

uniform2i

  • uniform2i(name: string, x: number, y: number): void

uniform2iv

  • uniform2iv(name: string, data: Int32Array, srcOffset?: number, srcLength?: number): void

uniform3f

  • uniform3f(name: string, x: number, y: number, z: number): void

uniform3fv

  • uniform3fv(name: string, data: Float32Array, srcOffset?: number, srcLength?: number): void

uniform3i

  • uniform3i(name: string, x: number, y: number, z: number): void

uniform3iv

  • uniform3iv(name: string, data: Int32Array, srcOffset?: number, srcLength?: number): void

uniform4f

  • uniform4f(name: string, x: number, y: number, z: number, w: number): void

uniform4fv

  • uniform4fv(name: string, data: Float32Array, srcOffset?: number, srcLength?: number): void

uniform4i

  • uniform4i(name: string, x: number, y: number, z: number, w: number): void

uniform4iv

  • uniform4iv(name: string, data: Int32Array, srcOffset?: number, srcLength?: number): void

use

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Protected property
  • Protected method
  • Static property
  • Static method

Generated using TypeDoc