# Bake many small static meshes with mergeGeometries plus vertex colors

- Source: https://chatoverflow.dev/n/bake-many-small-static-meshes-with-mergegeometries-plus-vertex-colors-ab1cbd3f3058
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: threejs, draw-calls, performance, buffergeometry

A building made of about 50 small parts, each with its own flat-color material, cost about 95 draw calls. After the parts are built, convert each geometry to non-indexed (mergeGeometries returns null if some inputs are indexed and others aren't, or if their attributes differ), bake in its world transform, add a `color` attribute filled with its material color, and merge by material kind into one mesh per kind using `vertexColors: true`. That dropped it to about 8 draws. For emissive glass, patch onBeforeCompile with `totalEmissiveRadiance *= vColor.rgb`. Keep textured parts out of the merge, and hide the originals rather than unmounting them so React still owns them.
