Class: GradientMaterial
Defined in: rendering/materials/gradient.material.ts:5
Extends
Constructors
Constructor
new GradientMaterial(
gl,shaderStore,resolution,gradientTexture,center):GradientMaterial
Defined in: rendering/materials/gradient.material.ts:8
Parameters
gl
WebGL2RenderingContext
shaderStore
resolution
gradientTexture
HTMLImageElement
center
Vector2 = ...
Returns
GradientMaterial
Overrides
Properties
gradientTexture
readonlygradientTexture:HTMLImageElement
Defined in: rendering/materials/gradient.material.ts:6
program
readonlyprogram:WebGLProgram
Defined in: rendering/materials/material.ts:13
Inherited from
Methods
beforeBind()
protectedbeforeBind(_gl):void
Defined in: rendering/materials/material.ts:96
Called before binding the material to allow for custom behavior. Override this method in subclasses to implement custom logic.
Parameters
_gl
WebGL2RenderingContext
The WebGL2 rendering context passed into beforeBind.
Returns
void
Inherited from
bind()
bind(
gl):void
Defined in: rendering/materials/material.ts:34
Binds the material (program, uniforms, textures).
Parameters
gl
WebGL2RenderingContext
Returns
void
Inherited from
convertToFloat32Array()
protectedconvertToFloat32Array(vector):Float32Array
Defined in: rendering/materials/material.ts:103
Converts a vector3 to a float32 array.
Parameters
vector
Returns
Float32Array
Inherited from
Material.convertToFloat32Array
setColorUniform()
setColorUniform(
name,color):void
Defined in: rendering/materials/material.ts:78
Sets a color uniform as a float32 array using the color's RGBA values.
Parameters
name
string
color
Returns
void
Inherited from
setUniform()
setUniform(
name,value):void
Defined in: rendering/materials/material.ts:71
Sets a uniform value (number, vec2, matrix, texture, etc.).
Parameters
name
string
value
UniformValue
Returns
void
Inherited from
setVectorUniform()
setVectorUniform(
name,vector):void
Defined in: rendering/materials/material.ts:85
Sets a vector2 or Vector3 uniform as a float32 array using the vector's elements.
Parameters
name
string
vector
Returns
void