Shader

Shader

Static default shader sources.

Constructor

new Shader()

Source:
Example
const sourceFragment = Shader.sourceFragment;
const sourceVertex = Shader.sourceVertex;

Members

(readonly) attributes :Object.<string, typetypeattribute>

Description:
  • Stores the attributes needed by the shader program.
Source:
Stores the attributes needed by the shader program.
Type:
  • Object.<string, typetypeattribute>

(readonly) sourceFragment :string

Description:
  • Stores the fragment shader source.
Source:
Stores the fragment shader source.
Type:
  • string

(readonly) sourceVertex :string

Description:
  • Stores the vertex shader source.
Source:
Stores the vertex shader source.
Type:
  • string

(readonly) uniforms :Object.<string, typetypeuniform>

Description:
  • Stores the uniforms needed by the shader program.
Source:
Stores the uniforms needed by the shader program.
Type:
  • Object.<string, typetypeuniform>

Type Definitions

typetypeattribute

Description:
  • A type of attribute.
Source:
A type of attribute.
Type:
  • 'vec2' | 'vec3'

typetypeuniform

Description:
  • A type of uniform.
Source:
A type of uniform.
Type:
  • 'bool' | 'bool[]' | 'float' | 'float[]' | 'int' | 'int[]' | 'mat4' | 'mat4[]' | 'sampler2D' | 'vec2' | 'vec2[]' | 'vec3' | 'vec3[]'