#author("2024-05-30T07:57:24+00:00","default:J4Y","J4Y")
* Load & draw your mesh [#xfcc3915]
#author("2024-06-07T16:05:17+00:00","default:J4Y","J4Y")

Loading a mesh is like loading a music, texture or any big resources.~
All these resources must be loaded in the ''onEnter'' async method.

 async onEnter() {
  this.mesh = new Gfx3MeshJSM();
  await mesh.loadFromFile('./play/cube.jsm');
  this.mesh.setMaterial(new Gfx3Material({
   texture: await gfx3TextureManager.loadTexture('./play/cube.png')
  }));
 }

 update(ts) {
  this.mesh.update(ts);
 }

 draw() {
  this.mesh.draw();
  gfx3DebugRenderer.drawGrid(UT.MAT4_ROTATE_X(Math.PI * 0.5), 20, 1);
 }

* TOI (Table of indexes) [#xfcc3915]
Each drawable has an "id" property composed of 4 number values.~
This "id" property is mostly used by post-process shader to filter what effect should be applied.

| Usage        | r  | g  | b  | a  |
| ------------ | -- | -- | -- | -- |
| Identifier   | n  |    |    |    |
| Decals group |    | n  |    |    |
| Light group  |    |    | n  |    |
| Pixelation   |    |    |    | 1  |
| Color limit  |    |    |    | 2  |
| Dithering    |    |    |    | 4  |
| Outline      |    |    |    | 8  |
| Shadow vol   |    |    |    | 16 |


Front page   Edit Diff History Attach Copy Rename Reload   New Page list Search Recent changes   Help   RSS of recent changes