Texture Atlases and Merge BufferGeometry

I’ve implemented something similar i supose, it merges the hierarchy of an object with all meshes/subgeometries into one geometry, material and a texture atlas for each map type.

Asides of saving drawcalls the main reason was to get a full automatic merge for instancing. It handles the texture atlas layout of textures of different sizes, matching in a power of 2 layout and optionally scales their sizes down when generating, for example when used as LOD technique.

Since textures can be of different sizes, it seems more efficient to use an atlas per map-type, also since texture size is limited depending on GPU.

Here a little more to it, its part of a project i release soon.