Class: Material
Defined in: rendering/materials/material.ts:20
Constructors
Constructor
new Material(
vertexShaderSource,fragmentShaderSource,gl):Material
Defined in: rendering/materials/material.ts:32
Constructs a new instance of the Material class.
Parameters
vertexShaderSource
The vertex shader source.
fragmentShaderSource
The fragment shader source.
gl
WebGL2RenderingContext
The WebGL2 rendering context.
Returns
Material
Properties
program
readonlyprogram:WebGLProgram
Defined in: rendering/materials/material.ts:21
Methods
bind()
bind(
gl):void
Defined in: rendering/materials/material.ts:49
Binds the material (program, uniforms, textures).
Parameters
gl
WebGL2RenderingContext
Returns
void
setColorUniform()
setColorUniform(
name,color):void
Defined in: rendering/materials/material.ts:129
Sets a color uniform as a float32 array using the color's RGBA values.
Parameters
name
string
color
Returns
void
setUniform()
setUniform(
name,value):void
Defined in: rendering/materials/material.ts:116
Sets a uniform value (number, vec2, matrix, texture, etc.).
Parameters
name
string
value
Returns
void
setVectorUniform()
setVectorUniform(
name,vector):void
Defined in: rendering/materials/material.ts:136
Sets a vector2 or Vector3 uniform as a float32 array using the vector's elements.
Parameters
name
string
vector
Returns
void