Class

Program

Program()

A program

Constructor

new Program()

Constructor

View Source Program.js, line 10

Extends

Members

number

UID

Unique identifier
Inherited From:

View Source ContextResource.js, line 19

Methods

getAttributes() → {Array.<ProgramElement>}

Get attributes

View Source Program.js, line 77

An array of attribute
Array.<ProgramElement>

getSources() → {Array.<string>}

Get program's sources

View Source Program.js, line 86

Index 0: Vertex shader, Index 1: Fragment shader
Array.<string>

getUID() → {number}

Get unique ID
Inherited From:

View Source ContextResource.js, line 29

An unsigned integer
number

getUniform(name) → (nullable) {ProgramElement}

Get uniform
Parameters:
Name Type Description
name string Name of the uniform

View Source Program.js, line 96

A program Element or null if uniform doesn't exist

getUniforms() → {Array.<ProgramElement>}

Get uniforms

View Source Program.js, line 105

An array of uniforms
Array.<ProgramElement>

isReady() → {boolean}

Say if program is ready to be use Source array must have two elements: the fragment and the vertex shaders

View Source Program.js, line 115

True if program is ready, otherwise false
boolean

loadFromData(vertexSource, fragmentSource)

Load program from data
Parameters:
Name Type Description
vertexSource string Vertex shader code
fragmentSource string Fragment shader code

View Source Program.js, line 67

async loadFromFiles(vertexFile, fragmentFile)

Load program from shader files
Parameters:
Name Type Description
vertexFile string Path to the vertex shader file
fragmentFile string Path to the fragment shader file

View Source Program.js, line 53