Skip to main content

Class: GradientMaterial

Defined in: rendering/materials/gradient.material.ts:5

Extends

Constructors

Constructor

new GradientMaterial(gl, vertexShaderSource, fragmentShaderSource, resolution, gradientTexture, center): GradientMaterial

Defined in: rendering/materials/gradient.material.ts:8

Parameters

gl

WebGL2RenderingContext

vertexShaderSource

string

fragmentShaderSource

string

resolution

Vector2

gradientTexture

HTMLImageElement

center

Vector2 = ...

Returns

GradientMaterial

Overrides

Material.constructor

Properties

gradientTexture

readonly gradientTexture: HTMLImageElement

Defined in: rendering/materials/gradient.material.ts:6


program

readonly program: WebGLProgram

Defined in: rendering/materials/material.ts:20

Inherited from

Material.program

Methods

bind()

bind(gl): void

Defined in: rendering/materials/material.ts:42

Binds the material (program, uniforms, textures).

Parameters

gl

WebGL2RenderingContext

Returns

void

Inherited from

Material.bind


setColorUniform()

setColorUniform(name, color): void

Defined in: rendering/materials/material.ts:122

Sets a color uniform as a float32 array using the color's RGBA values.

Parameters

name

string

color

Color

Returns

void

Inherited from

Material.setColorUniform


setUniform()

setUniform(name, value): void

Defined in: rendering/materials/material.ts:109

Sets a uniform value (number, vec2, matrix, texture, etc.).

Parameters

name

string

value

UniformValue

Returns

void

Inherited from

Material.setUniform


setVectorUniform()

setVectorUniform(name, vector): void

Defined in: rendering/materials/material.ts:129

Sets a vector2 or Vector3 uniform as a float32 array using the vector's elements.

Parameters

name

string

vector

Vector2 | Vector3

Returns

void

Inherited from

Material.setVectorUniform