Options
All
  • Public
  • Public/Protected
  • All
Menu

Module index

Index

References

CameraController

Re-exports CameraController

CubeTexture

Re-exports CubeTexture

Framebuffer

Re-exports Framebuffer

Geometry

Re-exports Geometry

GeometryUtils

Renames and exports geometry-utils

InstancedMesh

Re-exports InstancedMesh

Mesh

Re-exports Mesh

OrthographicCamera

Re-exports OrthographicCamera

PerspectiveCamera

Re-exports PerspectiveCamera

Program

Re-exports Program

SceneObject

Re-exports SceneObject

SwapRenderer

Re-exports SwapRenderer

Texture

Re-exports Texture

Transform

Re-exports Transform

Variables

Const CUBE_SIDE_BACK

CUBE_SIDE_BACK: "back" = 'back'

Const CUBE_SIDE_BOTTOM

CUBE_SIDE_BOTTOM: "bottom" = 'bottom'

Const CUBE_SIDE_FRONT

CUBE_SIDE_FRONT: "front" = 'front'

Const CUBE_SIDE_LEFT

CUBE_SIDE_LEFT: "left" = 'left'

Const CUBE_SIDE_RIGHT

CUBE_SIDE_RIGHT: "right" = 'right'

Const CUBE_SIDE_TOP

CUBE_SIDE_TOP: "top" = 'top'

Const INDEX_ATTRIB_NAME

INDEX_ATTRIB_NAME: "index" = 'index'

Const INSTANCED_OFFSET_MODEL_MATRIX

INSTANCED_OFFSET_MODEL_MATRIX: "instanceModelMatrix" = 'instanceModelMatrix'

Const LINES

LINES: 1 = 0x0001

Const MODEL_MATRIX_UNIFORM_NAME

MODEL_MATRIX_UNIFORM_NAME: "modelMatrix" = 'modelMatrix'

Const POINTS

POINTS: 0 = 0x0000

Const POSITION_ATTRIB_NAME

POSITION_ATTRIB_NAME: "position" = 'position'

Const PROJECTION_MATRIX_UNIFORM_NAME

PROJECTION_MATRIX_UNIFORM_NAME: "projectionMatrix" = 'projectionMatrix'

Const STATIC_DRAW

STATIC_DRAW: 35044 = 0x88e4

Const TEXTURE_FILTER_LINEAR

TEXTURE_FILTER_LINEAR: 9729 = 0x2601

Const TEXTURE_FILTER_NEAREST

TEXTURE_FILTER_NEAREST: 9728 = 0x2600

Const TRIANGLES

TRIANGLES: 4 = 0x0004

Const UNIFORM_TYPE_FLOAT

UNIFORM_TYPE_FLOAT: "float" = 'float'

Const UNIFORM_TYPE_INT

UNIFORM_TYPE_INT: "int" = 'int'

Const UNIFORM_TYPE_MATRIX4X4

UNIFORM_TYPE_MATRIX4X4: "mat4" = 'mat4'

Const UNIFORM_TYPE_VEC2

UNIFORM_TYPE_VEC2: "vec2" = 'vec2'

Const UNIFORM_TYPE_VEC3

UNIFORM_TYPE_VEC3: "vec3" = 'vec3'

Const UNIFORM_TYPE_VEC4

UNIFORM_TYPE_VEC4: "vec4" = 'vec4'

Const VIEW_MATRIX_UNIFORM_NAME

VIEW_MATRIX_UNIFORM_NAME: "viewMatrix" = 'viewMatrix'

Functions

Const clamp

  • clamp(num: number, min: number, max: number): number
  • Clamp number to a given range

    Parameters

    • num: number
    • min: number
    • max: number

    Returns number

compileShader

  • compileShader(gl: WebGLRenderingContext, shaderType: GLenum, shaderSource: string): WebGLShader | null
  • Create and compile WebGLShader

    Parameters

    • gl: WebGLRenderingContext
    • shaderType: GLenum
    • shaderSource: string

    Returns WebGLShader | null

createBuffer

  • createBuffer(gl: WebGLRenderingContext, data: Float32Array | Float64Array, usage?: GLenum): WebGLBuffer | null
  • Create a ARRAY_BUFFER buffer

    Parameters

    • gl: WebGLRenderingContext
    • data: Float32Array | Float64Array

      Typed array types that will be copied into the data store

    • usage: GLenum = ...

    Returns WebGLBuffer | null

createIndexBuffer

  • createIndexBuffer(gl: WebGLRenderingContext, indices: Uint16Array | Uint32Array, usage?: GLenum): WebGLBuffer | null
  • Create a ELEMENT_ARRAY_BUFFER buffer

    Parameters

    • gl: WebGLRenderingContext
    • indices: Uint16Array | Uint32Array
    • usage: GLenum = ...

    Returns WebGLBuffer | null

createProgram

  • createProgram(gl: WebGLRenderingContext, vertexShaderSource: string, fragmentShaderSource: string): WebGLProgram | null
  • Create and link WebGLProgram with provided shader strings

    Parameters

    • gl: WebGLRenderingContext
    • vertexShaderSource: string
    • fragmentShaderSource: string

    Returns WebGLProgram | null

getExtension

  • getExtension(gl: WebGLRenderingContext, extensionName: string, caching?: boolean): any
  • Obtains and returns a WebGL extension if available. Caches it in-memory for future use.

    Parameters

    • gl: WebGLRenderingContext
    • extensionName: string
    • caching: boolean = false

    Returns any

Const isPowerOf2

  • isPowerOf2(value: number): boolean
  • Check if number is power of 2

    Parameters

    • value: number

    Returns boolean

Const mapNumberRange

  • mapNumberRange(val: number, inMin: number, inMax: number, outMin: number, outMax: number): number
  • Parameters

    • val: number
    • inMin: number
    • inMax: number
    • outMin: number
    • outMax: number

    Returns number

Const normalizeNumber

  • normalizeNumber(min: number, max: number, val: number): number
  • Normalizes a number

    Parameters

    • min: number
    • max: number
    • val: number

    Returns number

Const triangleWave

  • triangleWave(t: number): number

Generated using TypeDoc