Skip to main content

Class: SpriteMaterial

Defined in: rendering/materials/sprite.material.ts:11

Extends

Constructors

Constructor

new SpriteMaterial(gl, shaderStore, albedoTexture, cameraEntity): SpriteMaterial

Defined in: rendering/materials/sprite.material.ts:15

Parameters

gl

WebGL2RenderingContext

shaderStore

ShaderStore

albedoTexture

HTMLImageElement

cameraEntity

Entity

Returns

SpriteMaterial

Overrides

Material.constructor

Properties

albedoTexture

readonly albedoTexture: HTMLImageElement

Defined in: rendering/materials/sprite.material.ts:12


cameraEntity

readonly cameraEntity: Entity

Defined in: rendering/materials/sprite.material.ts:13


program

readonly program: WebGLProgram

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

Inherited from

Material.program

Methods

beforeBind()

protected beforeBind(gl): void

Defined in: rendering/materials/sprite.material.ts:29

Called before binding the material to allow for custom behavior. Override this method in subclasses to implement custom logic.

Parameters

gl

WebGL2RenderingContext

Returns

void

Overrides

Material.beforeBind


bind()

bind(gl): void

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

Binds the material (program, uniforms, textures).

Parameters

gl

WebGL2RenderingContext

Returns

void

Inherited from

Material.bind


convertToFloat32Array()

protected convertToFloat32Array(vector): Float32Array

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

Converts a vector3 to a float32 array.

Parameters

vector

Vector3

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

Color

Returns

void

Inherited from

Material.setColorUniform


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

Material.setUniform


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

Vector2 | Vector3

Returns

void

Inherited from

Material.setVectorUniform