A wood of 1,500 pines swaying in the wind, drawn in two draws: one for every trunk and one for every crown. Up and Down show more or fewer trees, and Space plants the wood again.
createMeshInstances takes what createMesh takes, and how many there is room for: one shape and one surface, drawn many times over. set(i, { x, y, z, rotationY, scaleX, tint, data }) places each instance inside the group, with a colour that multiplies in and four numbers of its own, and count is how many are drawn. Only the instances that changed are sent to the card. The group is lit, shadowed, fogged and left out off screen as one model. Its material's corner hook runs after each instance is placed, and reads which instance a corner belongs to: ctx.instance and ctx.origin, or composerInstanceData() and composerInstanceOrigin() in the composer, which is how every tree here sways to its own beat from one shader.