Drawing multiple meshes with the same material, attributes / uniforms per mesh

As Roland said, it’s common to use VertexColors, as long as it fits your needs.

If you need to save something which is not compatible with a per-vertex color, still you can have an input in a Shader, and set it per mesh (with the same material for different meshes). Have a look at this topic where I was giving as an example this Playground (instanceColor is a color to be used in the shader, customValue is a float for whatever usage)

Depends on the scene I would say. Merging all geometry in one mesh can be efficient when the mesh is fully present in the Viewport (since, whatever, all would have been rendered anyway). But if some submeshes are not in the Viewport, I means you are somethow loosing performance since if it where a single object, it could have been 100% skipped by the GPU.

1 Like