diff --git a/site/docs/04-graphics/4.2-material.mdx b/site/docs/04-graphics/4.2-material.mdx index 67bcb091a..85db06f51 100644 --- a/site/docs/04-graphics/4.2-material.mdx +++ b/site/docs/04-graphics/4.2-material.mdx @@ -139,6 +139,8 @@ var waterMaterial = game.graphicsContext.createMaterial({ Materials come with a lot of built in uniforms you can use! +* `vec4 u_color` - This is the current color of the material + * `float u_time_ms` - This is `performance.now()` a ms timestamp that starts from initial navigation to the page * `float u_opacity` - Current opacity of your graphic, [[Graphic.opacity]] diff --git a/src/engine/Graphics/Context/material.ts b/src/engine/Graphics/Context/material.ts index ea2547060..45c679d39 100644 --- a/src/engine/Graphics/Context/material.ts +++ b/src/engine/Graphics/Context/material.ts @@ -155,6 +155,14 @@ export class Material { this._initialized = true; } + get color(): Color { + return this._color; + } + + set color(c: Color) { + this._color = c; + } + get name() { return this._name ?? 'anonymous material'; }