Should Meshes with and without Skeleton use different Shaders?
Background: Right now my shader is constructed to handle meshes with skeletons. Each vertex takes 3 bone IDs, with respective bone weight. This works well for models with skeletons that I wish to animate, but I feel that it is a bit excessive for inanimate meshes to have so much useless data for each passed vertex.
As I see it I can either use separate shaders for animated meshes with bones and inanimate meshes, or I can pass an identity matrix bone as a single bone to the inanimate objects that lack skeleton and bind each vertex to this bone.
Which of these is to be preferred, or is there some better solution?
As you indicate in your question, the primary issues here is that of execution time and memory. There are many ways in which rendering objects with skinning (skeletons) takes more of both:
Because of the above considerations, generally applications choose to have separate vertex shaders for skinned and non-skinned objects. Frequently, applications will create several skinning shaders, which will be created for different 'tiers' of skinning quality. For example, different numbers of possible bones per vertex, or total number of skinning matrices. However, the only way to make these sorts of decisions is profiling your application.
If performance and memory aren't issues for you, then you could render non-skinned objects as skinned ones with your existing shader, although, because this will require some work to setup properly, it's probably just as easy to create a new non-skinned shader.