Skip to content

Batch beta ​

Interface of @v12-engine/render

ts
export interface Batch

One geometry with one material at many places

Members ​

animated ​

ts
animated(): void;

Its vertices moved though no copy did (a pose changed, which its shader reads elsewhere than in a copy): the cascades it is in are drawn again and the velocity's layer has it this frame; no copy is culled or sent again

count ​

ts
readonly count: number;

How many copies there are now, the first of matrices (touch changes it)

dispose ​

ts
dispose(): void;

Taken out of every pass, its copies' buffers freed

geometry ​

ts
readonly geometry: Geometry;

What it draws at each copy

glow ​

ts
glow(colour: readonly number[] | undefined): void;

Has the batch glow in a colour (what its material shines with, times how much: the client's colorOf), or no longer (undefined, or black)

limit ​

ts
limit(count: number): void;

A batch with a box draws its first count copies at most from now on: fewer of a chunk far off, in the order its owner laid them

material ​

ts
readonly material: Material;

What it is drawn with now (use)

matrices ​

ts
readonly matrices: Float32Array;

Every copy's matrix, 16 floats each. Written in place by who owns the batch; touch says so

outline ​

ts
outline(copy: number, style: Outline | undefined, thing?: number): void;

Outlines a copy in a style (Renderer.outlines.style) as part of a thing (the copies of one number are outlined as one shape; things that touch each keep an edge), or no longer (undefined). Marked by its place among the batch's copies: who moves a copy into another's place marks it again

previous ​

ts
readonly previous: Float32Array | undefined;

Of a batch with a velocity: every copy's matrix as the frame before had it, kept by the renderer (copied from matrices after each frame it was touched in). Who moves a copy into another's place moves its 16 floats here too

range ​

ts
range(first: number, count: number): void;

Draws a run of its geometry's indices in place of all of them, from now on: a lighter shape made of the same vertices (three levels of a tuft in one geometry)

touch ​

ts
touch(count?: number, from?: number, to?: number): void;

The copies were written (all, or count changed within the capacity): each pass keeps its own again. from and to: only the copies from the one to before the other moved (the rest stand as they did)

touchExtra ​

ts
touchExtra(from?: number, to?: number): void;

What the copies carry beside their matrices was written, from to before to, and nothing else: the copies each pass keeps are sent again as they are, none culled again

use ​

ts
use(material: Material): void;

Drawn with another material from now on: one of the same kind that reads the same of a copy and does not blend (the variant that may leave pixels out, while it must). The copies and their buffers stay; a material's draws are made the first time it is used and kept