Skip to content

Commit

Permalink
docs: Add missing u_color documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
eonarheim committed Aug 1, 2024
1 parent 75cc506 commit 743c5ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions site/docs/04-graphics/4.2-material.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
8 changes: 8 additions & 0 deletions src/engine/Graphics/Context/material.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

0 comments on commit 743c5ef

Please sign in to comment.