Class: StarFieldProgram

StarFieldProgram(gl)

StarFieldProgram is a GLSL program that draws points representing stars.

Constructor

new StarFieldProgram(gl)

Parameters:
Name Type Description
gl WebGLRenderingContext The current WebGL context.
Source:
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
Source:

(readonly) fragModeLocation :WebGLUniformLocation

The WebGL location for this program's 'textureEnabled' uniform.
Type:
  • WebGLUniformLocation
Source:

(readonly) magnitudeRangeLocation :WebGLUniformLocation

The WebGL location for this program's 'magnitudeRangeLocation' uniform.
Type:
  • WebGLUniformLocation
Source:

(readonly) mvpMatrixLocation :WebGLUniformLocation

The WebGL location for this program's 'mvpMatrix' uniform.
Type:
  • WebGLUniformLocation
Source:

(readonly) numDaysLocation :WebGLUniformLocation

The WebGL location for this program's 'numDays' uniform.
Type:
  • WebGLUniformLocation
Source:

(readonly) textureUnitLocation :WebGLUniformLocation

The WebGL location for this program's 'textureSampler' uniform.
Type:
  • WebGLUniformLocation
Source:

(readonly) vertexPointLocation :Number

The WebGL location for this program's 'vertexPoint' attribute.
Type:
  • Number
Source:

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
Source:
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.
Source:
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)
Source:
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.
Source: