Renderer · interface

MeshOptions

What a mesh needs to be told at creation that its geometry cannot say.

Explained in Hello world.

interface MeshOptions
import type { MeshOptions } from '@driftengine/core';

Properties

NameTypeDescription
dynamicreadonlyoptionalbooleanWhether this mesh's positions will be rewritten with updateMesh.
More

Costs a DYNAMIC_DRAW hint on WebGL2, and on WebGPU two buffers of its own for the positions and the normals beside the rest of the vertex, bound with it on every draw, and floats for the normals where they might have been sixteen bits. Paid only where a consumer asks.

dynamicColorsreadonlyoptionalbooleanWhether this mesh's colours will be rewritten with updateMeshColors.
More

Costs the colours as floats in a buffer of their own, twelve bytes a vertex where they might have been sixteen bits or, for one colour every vertex shares, nothing at all. Independent of dynamic: a surface shaded again as a camera moves rewrites its colours every frame and its positions never, and should pay for neither the positions' buffers nor their motion.