Load & draw your mesh

Loading a mesh is like loading a music, texture or any big resources.
All these asynchronously load must be handle by the onEnter 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)

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.

Usagergba
--------------------
Identifiern
Decals groupn
Light groupn
Pixelation1
Color limit2
Dithering4
Outline8
Shadow vol16

Front page   New Page list Search Recent changes   Help   RSS of recent changes