Constructor
new StarFieldProgram(gl)
Parameters:
Name | Type | Description |
---|---|---|
gl |
WebGLRenderingContext | The current WebGL context. |
Throws:
-
If the shaders cannot be compiled, or linking of the compiled shaders into a program fails.
- Type
- ArgumentError
Extends
- GpuProgram
Members
(static, readonly) key :string
A string that uniquely identifies this program.
Type:
- string
(readonly) fragModeLocation :WebGLUniformLocation
The WebGL location for this program's 'textureEnabled' uniform.
Type:
- WebGLUniformLocation
(readonly) magnitudeRangeLocation :WebGLUniformLocation
The WebGL location for this program's 'magnitudeRangeLocation' uniform.
Type:
- WebGLUniformLocation
(readonly) mvpMatrixLocation :WebGLUniformLocation
The WebGL location for this program's 'mvpMatrix' uniform.
Type:
- WebGLUniformLocation
(readonly) numDaysLocation :WebGLUniformLocation
The WebGL location for this program's 'numDays' uniform.
Type:
- WebGLUniformLocation
(readonly) textureUnitLocation :WebGLUniformLocation
The WebGL location for this program's 'textureSampler' uniform.
Type:
- WebGLUniformLocation
(readonly) vertexPointLocation :Number
The WebGL location for this program's 'vertexPoint' attribute.
Type:
- Number
Methods
loadMagnitudeRange(gl, minMag, maxMag)
Loads the specified numbers as the value of this program's 'magnitudeRange' uniform variable.
Parameters:
Name | Type | Description |
---|---|---|
gl |
WebGLRenderingContext | The current WebGL context. |
minMag |
Number | |
maxMag |
Number |
Throws:
-
If the specified numbers are null or undefined.
- Type
- ArgumentError
loadModelviewProjection(gl, matrix)
Loads the specified matrix as the value of this program's 'mvpMatrix' uniform variable.
Parameters:
Name | Type | Description |
---|---|---|
gl |
WebGLRenderingContext | The current WebGL context. |
matrix |
Matrix | The matrix to load. |
Throws:
-
If the specified matrix is null or undefined.
- Type
- ArgumentError
loadNumDays(gl, numDays)
Loads the specified number as the value of this program's 'numDays' uniform variable.
Parameters:
Name | Type | Description |
---|---|---|
gl |
WebGLRenderingContext | The current WebGL context. |
numDays |
Number | The number of days (positive or negative) since Greenwich noon, Terrestrial Time, on 1 January 2000 (J2000.0) |
Throws:
-
If the specified number is null or undefined.
- Type
- ArgumentError
loadTextureUnit(gl, unit)
Loads the specified number as the value of this program's 'textureSampler' uniform variable.
Parameters:
Name | Type | Description |
---|---|---|
gl |
WebGLRenderingContext | The current WebGL context. |
unit |
Number | The texture unit. |