Hierarchy

  • Shader

Constructors

Properties

attributes: {
    [variableName: string]: VertexAttributeDefinition;
} = {}

Type declaration

fragmentSource: string
program: WebGLProgram
uniforms: {
    [variableName: string]: UniformDefinition;
} = {}

Type declaration

vertexSource: string

Accessors

Methods

  • Set a texture in a gpu texture slot

    Parameters

    • slotNumber: number
    • texture: WebGLTexture

    Returns void

  • Set any available uniform type in webgl

    For example setUniform('uniformMatrix2fv', 'u_my2x2_mat`, ...);

    Type Parameters

    Parameters

    • uniformType: TUniformType
    • name: string
    • Rest ...value: RemoveFirstFromTuple<Parameters<WebGLRenderingContext[TUniformType]>>

    Returns void

  • Set a boolean uniform for the current shader

    Important Must call ex.Shader.use() before setting a uniform!

    Parameters

    • name: string
    • value: boolean

    Returns void

  • Set a float uniform for the current shader

    Important Must call ex.Shader.use() before setting a uniform!

    Parameters

    • name: string
    • value: number

    Returns void

  • Set a float array uniform for the current shader

    Important Must call ex.Shader.use() before setting a uniform!

    Parameters

    • name: string
    • value: number[]

    Returns void

  • Set a Vector uniform for the current shader

    Important Must call ex.Shader.use() before setting a uniform!

    Parameters

    Returns void

  • Set an integer uniform for the current shader

    Important Must call ex.Shader.use() before setting a uniform!

    Parameters

    • name: string
    • value: number

    Returns void

  • Set an integer array uniform for the current shader

    Important Must call ex.Shader.use() before setting a uniform!

    Parameters

    • name: string
    • value: number[]

    Returns void

  • Set an Matrix uniform for the current shader

    Important Must call ex.Shader.use() before setting a uniform!

    Parameters

    Returns void