Renderer · const
INSTANCE_FLOATS
Floats one instance occupies in the interleaved vertex buffer: sixteen of matrix, the bottom row of which carries the texture cell, three of tint, and the opacity.
Explained in Hello world.
const INSTANCE_FLOATS = 20import { INSTANCE_FLOATS } from '@driftengine/core';In depth
Twenty so the stride is 80 bytes rather than 76. A vertex buffer's stride must be a multiple of four on both backends, which 76 already is — the twentieth float was padding for the attribute offsets: the tint sits at byte 64 and a three-float attribute ending at 76 leaves the next instance's first column starting there, which is legal but puts every second instance on an offset no driver aligns well. Since 4.8.6 it carries the instance's opacity, read with the tint as one four-float attribute, so the opacity cost no attribute and no byte.