DrawCall

A drawcall is just an object holding a mesh, a material and a transform.

Don't change the material after you've added the call to a scene. Right now scenes don't sort draw calls beyond grouping them by pass.

export class DrawCall { constructor(mesh, material = new Material()) { this.mesh = mesh; this.material = material; this.transform = new Transform(); } draw() { if (this.isHidden) return; this.material.apply(); this.transform.apply(); this.mesh.draw(); } }